mGBA Forums

Full Version: How to use mgba for code/data separation???????????
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What I need is the following: log all the states of the program counter and the rombank number, so that I can use the addresses to differ between what are variables/instructions/tilemaps/graphics, etc.
I was going to use some very crazy hack (ptrace in linux) to do such a thing. But if I use the source code of mgba this could be much easier and less time consuming.
Where in the source code I can find the routines that modify/read the pc(program counter) and rombank number?

There is some documentation about the data structures used in the source code?

Just to clarify, my final objective is to create a tool for code/data separation, for reverse engineering gbc roms. A feature similar to code/data separation that exists in Emulicious emulator, this tool will be enhanced for automated data structures extraction and recompilation.
Take a look at the debugger interface. You can use it to trace individual instructions, although I think it might be a bit buggy for GB/C games right now.