Giter Club home page Giter Club logo

Comments (8)

evanbowman avatar evanbowman commented on August 19, 2024

Great idea! The gba lua code allows you to write to two specific address ranges already, see here:

https://github.com/evanbowman/BPCore-Engine?tab=readme-ov-file#ram-readwrite

The _IWRAM variable is currently not a fixed address, it is placed by the linker, but you can print its contents to see what the address is.

from bpcore-engine.

evanbowman avatar evanbowman commented on August 19, 2024

All the required components should exist in the api, I can try it out sometime this week.

A really cool idea would be to use an emulator's lua api to put source code strings into gba memory, then read and eval() them on the gba, and write the result back to gba memory for the emulator's lua api to read. Then you'd have interactive development!

from bpcore-engine.

Mte90 avatar Mte90 commented on August 19, 2024

So I have this snippet for mgba and the Metal Slug Advance (https://drive.google.com/file/d/1FNTohgCTjEHrxzeDly0l3awPoti8W0nU/view):

function detectGame()
console:log(emu:getGameTitle())
end
count = 0
function updateBuffer()
count = count + 1
-- Wait around 2 seconds
if count == 120 then
console:log('Updating ammo')
-- Unlimited arms point
emu:write16(0x02000072, 0xFF)
count = 0
end
end
callbacks:add("start", detectGame)
callbacks:add("frame", updateBuffer)
if emu then
detectGame()
end

Mgba doc: https://mgba.io/docs/scripting.html
mgba-emu/mgba#2550
Various examples scripts: https://github.com/mgba-emu/mgba/tree/c541a79e9564310d7a81d9668f41317acf30dda1/res/scripts

I think that what are you looking to do is possible as the scripting UI has a textbox where you should be able to run lua commands.

from bpcore-engine.

evanbowman avatar evanbowman commented on August 19, 2024

Resolved in previous release

from bpcore-engine.

Mte90 avatar Mte90 commented on August 19, 2024

It isn't clear how to use the log function right now.
Reading the code I think that is not using the solution that I proposed.

from bpcore-engine.

evanbowman avatar evanbowman commented on August 19, 2024

Can you please describe what you're looking for in more detail? It sounded like you wanted to write text to the emulator log window, I must have misunderstood.

from bpcore-engine.

Mte90 avatar Mte90 commented on August 19, 2024

So that function write in the screen the content and not in the log window, like explained in this ticket?

from bpcore-engine.

evanbowman avatar evanbowman commented on August 19, 2024

Ah! Sorry, I was looking at the wrong issue ticket!

from bpcore-engine.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.