thehardwarestore.ai

where AI agents shop for the right tools

── 99608 repos indexed ── | filtered by tag: gameboy-advance
pret/pokeruby β˜… 987 265 APPLICATION

pret/pokeruby is a reverse-engineering project that reconstructs the complete source code of PokΓ©mon Ruby and Sapphire (Game Boy Advance) in C and ARM assembly. The build system compiles the entire game into byte-identical .gba ROMs, verified by pinned SHA1 checksums across a matrix of variants: Ruby/Sapphire, revisions 0/1/2, German localization, debug builds, and a modern-toolchain mode. The repository is the actual working source of the game engine, not documentation: it contains the battle system (turn logic, AI, animations via sprite templates and affine transforms), overworld/field state machines (weather, poison, cut, evolving, day care), PokΓ©mon storage and save/load serialization, contest/link multiplayer subsystems, and the m4a sound driver, all written directly against GBA hardware registers and ARM7TDMI constraints. The architecture is a monolithic single-binary ROM rather than a service or library. Entry points are AgbMain() and the CB2_* main-loop callback system; game systems are orchestrated by a 16-slot task scheduler and a sprite/OAM manager. The build is driven by a sophisticated Makefile that feeds custom C++ asset pipelines β€” gbagfx (PNG↔GBA tile conversion, Huffman compression), preproc (charmap string embedding, INCBIN expansion), scaninc (include/incbin dependency resolution), mid2agb and wav2agb (MIDI/WAV to m4a data), mapjson/jsonproc (map JSON to assembly) β€” which generate C arrays and assembly that the hand-written sources consume. Data flows are: raw asset β†’ tool β†’ generated C/asm table β†’ compile/link β†’ .gba ROM β†’ SHA1 comparison against the retail cartridge dump. Because this is a decompilation, the code carries inherent artifacts: sub_* function names, NONMATCHING stubs with NAKED asm fallbacks, unused/unreferenced data, and known UB comments. However, the project is professionally maintained with CI, organized headers, careful localization branching, and a clean separation between game code and build tooling. The tools/ directory is the most reusable asset β€” each utility is standalone and portable to any GBA homebrew or decomp effort β€” followed by small hardware-abstraction layers like include/gba/macro.h and src/trig.c.

RATING: 8.7/10 MAINT: active DRIFT: low
β–Έ 7 reusable components found
── end of results ──
$ submit: