Repository navigation
m0boy 0.10.36 — one profile store for every console, storage chosen from the cost of each access
Profiling rebuilt around one store shared by every target console, every ROM and cartridge RAM access traced, and a storage plan chosen from measured access costs. Version française : README.fr.md; details in docs/PROFILING_STOCKAGE_2026-10-22.fr.md.
- One profile store:
profiles/<gb|sg|gg|sms>/<Game>/, shared by the META, the Pokitto and the ESPboy: recorded sessions,profile.json(sessions, map of the ROM's code and data, last build of each console, gm0 cycle profiles),storage.json,rom.plan,rom.rank, andplay.sh, which runs the built firmware in gm0. Every gm0 session is recorded (the buttons the game receives, frame by frame) and replayed in the host harness for the next conversion. - Every access counted: traces (
m0boy.romtrace.v2) hold every ROM read, code and data, in 16-byte granules, repeats included, and every cartridge RAM access. The hook sits in the common read path, and traces come from the generated project's own host build, so the traffic matches the firmware's. tools/profile/m0romsimreplays them through an exact model of the card cache (cartridge RAM and its write-back included) with a cost per access class, and chooses what stays raw or packed in flash. Variants studied on a held-out human session (sub-blocks, small LZSS blocks, zero elision, separate code/data caches, 16/32/128-byte blocks): none beats the unified cache of 64-byte blocks with 512-byte sectors; the hottest sectors are never packed.- Runtime: naked-asm Game Gear stream read, the cache refill split from the miss path, fixed-size unrolled Thumb-1 copies (
m0_copy: 16 to 512 bytes, every source alignment) shared by the Game Boy and Sega cores on all consoles; 16- and 32-byte cache blocks allowed. Costs now measured in gm0: a card sector about 17,250 cycles, an LZSS decode about 11,400 (estimates). Game Boy builds take the simulated plan (--rom-plan) fromcompile.sh. - Measured on a META (Ristar, the same 5,500 frames replayed unpaced, device clock): 133.37 s → 130.82 s (−1.9 %), frames over 25 ms 1,657 → 1,149, over 33 ms 48 → 26, LZSS decodes 2,119 → 21, blocks loaded 2,718 → 580. Repeat run of the old firmware within 0.01 %. The simulated plan does no better than ranking sectors by read count on that run (130.84 s): the gain comes from the access path and the measured costs.
- gm0 finds exactly the console's card reads, decodes and loads; its time is 8.3–8.7 % pessimistic.
- Not measured: the Pokitto on device; other games on device.
- META runtime 0.10.36, Pokitto 0.10.30, ESPboy 0.3.6: rebuild your games (
UPDATE=1when not interactive).
The archive m0boy-0.10.36.zip is the repository tree at this tag (no ROMs, no built firmwares); it was validated by extracting it, building it with BUILD_TESTS=ON and running ctest (58/58, two skipped as usual; the PICO-8 end-to-end test needs FEMTO8_DIR).