- Python 56.3%
- Zig 43.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Root cause of the blank-tile bug: the contract, the P1XEL exporter and the engine font path used map byte = (CHR + 128) & $FF. Under the engine's signed $8800 LCDC mode the hardware does the opposite, so every exported cell resolved to the empty CHR range 256..383. The correct formula is byte = CHR & $FF (P1XEL-CONTRACT.md "BG tile IDs"). Fixed in the exporter (p1xel-editor), window.rgbinc and the docs; assets re-exported. Engine - abi.rgbinc: single definitions-only engine<->game header (DIR_*, PAD_*, PADF_*, WINDOW_*, BG_BLANK_*); catalogc includes it instead of mirroring. - Popup window moved to the hardware Window layer on the BG map the level does not use: camera-independent, no save/restore strip, dirty-flag VRAM writes. VideoBGMapBase replaces 8 copies of the $9800/$9C00 select. - EngineInit zeroes all of WRAM0 (game state included) - random boot RAM left GAME_POPUP_MODE set and swallowed all input on BGB/hardware. - LevelLoad: bank-correct level addressing (section bank-aligned), field clamping, camera reset to start_x/y, failure -> EngineFatal red screen. - CameraClamp shared by LevelLoad/CameraFollowEntity; fixes <20x18 levels. - Entity slot masking; EntityTryDir trampoline removed; input.rgbinc guard. - catalogc: ident sanitiser matches P1XEL, duplicate names fail the build, meta-tiles emit CATALOG_TILE_<name> + _FIRST/_LAST. - Macros: PADF_* instead of magic masks, PopupPreamble/DpadDir dedupe, OnTileGoto, Despawn, edge-triggered menu nav, dpad repeat throttle. Showcase game (src/game/game.rgbasm, project.p1x via tools/sample) Title (text, flipped frame, palettes, static OAM, menu) -> 32x32 scrolling maze (solid tiles, spawn markers, hunting enemy, camera, pause, exit meta-tile) -> Win; About; Dead/RETRY. Tests: selftest.py now boots with scribbled RAM and asserts VRAM map bytes, CHR contents, window map text, SCX/SCY and OAM, not just WRAM state. Repo: editor binaries removed from the engine repo, junk file and stale tmp/ copies deleted, .gitignore covers *.sav/.pi/__pycache__. |
||
| rom | ||
| src | ||
| tools | ||
| .gitignore | ||
| AGENT.md | ||
| build.zig | ||
| ENGINE.md | ||
| ingame.png | ||
| MACROS.md | ||
| P1XEL-CONTRACT.md | ||
| project.p1x | ||
| README.md | ||
| ref.png | ||
| RULES.md | ||
Nomad Core - Game Boy Color Engine
Produced by Krzysztof Krystian Jankowski
2026 Cyfrowy Nomada
Nomad Core is a deliberately small RGBDS engine for top-down, tile-centric
Game Boy Color games. Game logic is written in rgbasm via the game macro
layer (see MACROS.md), isolated from hardware-facing engine code, and P1XEL
exports four memory-shaped runtime data files.
See:
ENGINE.md- architecture and roadmapMACROS.md- game-layer macro libraryRULES.md- engine/game boundaryP1XEL-CONTRACT.md- runtime asset formatAGENT.md- rules for AI agents writing game code
Build
Requirements: Zig 0.16, RGBDS (in tools/rgbds/ via the P1XEL toolchain
wizard, or on PATH). Optional: Python 3 + pyboy + Pillow for the
self-test, BGB or mGBA for zig build emulate.
zig build # rom/the-game-boy-engine.gbc
zig build emulate # build + run in BGB/mGBA
python tools/test/selftest.py # headless regression test (state + pixels)
The showcase game
src/game/game.rgbasm is a complete small game exercising every engine
feature: a title screen with text, flipped frame tiles, CGB palettes and
static sprites; a two-item menu in the popup window; a 32x32 scrolling maze
with solid walls, spawn markers, a hunting enemy, camera follow, a pause
popup and an exit meta-tile; About, Win and Dead screens.
Its assets come from project.p1x, which is generated by
tools/sample/make_sample.py and exported by P1XEL (or, headless, by
p1xel-editor/tests/export_harness.exe project.p1x src/game/assets). Open
project.p1x in P1XEL to edit the levels, then Export All into
src/game/assets/ and zig build.
Workflow
P1XEL (project.p1x) --Export All--> src/game/assets/{meta.dat, tileset.chr,
levels.tlm, levels.oam, catalog.toml}
catalogc -> src/game/catalog.rgbinc (names -> bytes)
rgbasm/rgblink/rgbfix -> rom/the-game-boy-engine.gbc
Edit only src/game/game.rgbasm for game logic; the engine never needs to
know about your game.