Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing GB ROM Banks from Lua
#1
I'm writing a script meant to run with arbitrary games that can read data and send it over a socket. It doesn't look like there's a way to directly read ROM data for GB games. Only `memory.cart0`. So if the script is asked to return data in bank 4 or whatever it may not be addressable and the data is unknowable. Any chance I'm missing some obscure way to get at the ROM? I'm much less familiar with GB/GBC than GBA, so let me know if I'm mistaken about something.

I'm coming from the context of BizHawk which uses Gambatte and does allow access to the entire ROM from lua under the domain they label "ROM".
Reply

#2
You can access further banks by indexing past 0x4000 in `memory.cart0`, e.g. bank 4 would start at 0x10000.
Reply

#3
Ahh, I see. And it's `emu:read8` and similar which is reading off the bus. I had been using `emu:readRange` and using the base of the various memory domains as an offset.

Thanks for the response.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 Melroy van den Berg.