Behavior-preserving architecture work: split the large C game and test files into smaller, focused pieces without adding gameplay or changing artwork.
Reduce source/main.c from 1,627 to 260 lines; extract video, scenery, world/movement, actors, battle, story/save, and HUD modules with a shared game.h.
Split the 1,235-line test file into maps, story, battle, rendering, movement, and shared support files, preserving assertion bodies and runner order. Largest source/test file is now 403 lines.
Update the Makefile to compile real translation units and add make check-host for C behavior tests without an ARM compiler or ROM. make check retains ROM build/header/Python verification.
Update README file descriptions and first-edit instructions.
Verification
Baseline and refactored C host checks passed with -Wall -Wextra -Werror.
All 22 freshly generated scene previews are byte-for-byte identical to the baseline; all four behavior/performance diagnostic lines match.
Mechanical comparison found 68 production function bodies, 19 test function bodies, 413 assertion sites, 22 initialized arrays, and test invocation order unchanged.
After installing the documented ARM compiler/binutils via Homebrew, full make check passed: ARM compilation/linking, valid 32,768-byte ROM header, all 7 Python tests, and C behavior/rendering/movement/save checks. SRAM_V113 confirmed present in built ROM; final exit status 0.
git diff --check clean. make play successfully dispatched the ROM to installed mGBA 0.10.5.
Manual verification remaining
Opening mGBA is not a gameplay verification. Please smoke-test team/ball inventory (with an existing save if available), doors, conversations, a wild encounter, and battling/running away. No manual playthrough claimed.
The large gross diff is moved code, not new gameplay. Existing small palette/scenery duplications are deliberately unchanged.
## Summary
Behavior-preserving architecture work: split the large C game and test files into smaller, focused pieces without adding gameplay or changing artwork.
- Reduce `source/main.c` from 1,627 to 260 lines; extract video, scenery, world/movement, actors, battle, story/save, and HUD modules with a shared `game.h`.
- Split the 1,235-line test file into maps, story, battle, rendering, movement, and shared support files, preserving assertion bodies and runner order. Largest source/test file is now 403 lines.
- Update the Makefile to compile real translation units and add `make check-host` for C behavior tests without an ARM compiler or ROM. `make check` retains ROM build/header/Python verification.
- Update README file descriptions and first-edit instructions.
## Verification
- Baseline and refactored C host checks passed with `-Wall -Wextra -Werror`.
- All 22 freshly generated scene previews are byte-for-byte identical to the baseline; all four behavior/performance diagnostic lines match.
- Mechanical comparison found 68 production function bodies, 19 test function bodies, 413 assertion sites, 22 initialized arrays, and test invocation order unchanged.
- After installing the documented ARM compiler/binutils via Homebrew, full `make check` passed: ARM compilation/linking, valid 32,768-byte ROM header, all 7 Python tests, and C behavior/rendering/movement/save checks. `SRAM_V113` confirmed present in built ROM; final exit status 0.
- `git diff --check` clean. `make play` successfully dispatched the ROM to installed mGBA 0.10.5.
## Manual verification remaining
Opening mGBA is not a gameplay verification. Please smoke-test team/ball inventory (with an existing save if available), doors, conversations, a wild encounter, and battling/running away. No manual playthrough claimed.
The large gross diff is moved code, not new gameplay. Existing small palette/scenery duplications are deliberately unchanged.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Behavior-preserving architecture work: split the large C game and test files into smaller, focused pieces without adding gameplay or changing artwork.
source/main.cfrom 1,627 to 260 lines; extract video, scenery, world/movement, actors, battle, story/save, and HUD modules with a sharedgame.h.make check-hostfor C behavior tests without an ARM compiler or ROM.make checkretains ROM build/header/Python verification.Verification
-Wall -Wextra -Werror.make checkpassed: ARM compilation/linking, valid 32,768-byte ROM header, all 7 Python tests, and C behavior/rendering/movement/save checks.SRAM_V113confirmed present in built ROM; final exit status 0.git diff --checkclean.make playsuccessfully dispatched the ROM to installed mGBA 0.10.5.Manual verification remaining
Opening mGBA is not a gameplay verification. Please smoke-test team/ball inventory (with an existing save if available), doors, conversations, a wild encounter, and battling/running away. No manual playthrough claimed.
The large gross diff is moved code, not new gameplay. Existing small palette/scenery duplications are deliberately unchanged.