mstan/gbarecomp — reverse-engineered prompt

Reverse engineered prompt

Build me the core of a Game Boy Advance static recompiler in C that takes a real GBA BIOS and ROM, scans the code, and generates native C or C++ from the original ARM and THUMB machine code. I want this to be a reusable platform core, not a custom port for one game, and not a fake high level recreation. The generated code should run against a proper GBA style runtime with memory bus, IO, interrupts, DMA, timers, video, audio, input, save handling, and BIOS behavior modeled in a hardware faithful way.

Please make it build cleanly with CMake, include command line tools to scan a ROM and recompile it, and add a small test suite for decoder and core hardware pieces. I also want basic debugging support like a TCP debug server, ring buffer style logging, and snapshot or save state support. Keep the generated files treated as output only, and put the real logic in the recompiler and runtime. Look up current docs online if you need to.

Want more depth? Deep Reverse