Skip to content

m0boy 0.10.34 — save states on every core and every console

Choose a tag to compare

@r043v r043v released this 21 Oct 20:28
· 414 commits to main since this release

Save states on every core and every console: all Sega games (Game Gear, Master System, SG-1000) and PICO-8 cartridges join the Game Boy. Version française : README.fr.md.

  • Sega, META and Pokitto: Game Gear and Master System games whose ROM sits wholly in flash now open the SD card for the state file alone (fully LZSS-packed ROMs too, which never opened it, so their state lines never appeared); a missing card only stops games whose ROM or cartridge RAM live there. The SG-1000 gains sg_state_io (the machine's bytes, its pointers kept, the renderer's caches rebuilt), its .ST8 file, the game-folder lookup and, on the META, the Bootloader USB line; its screen is cleared when the menu closes (the game draws 120 of the 128 rows, the menu's leftovers stayed).
  • ESPboy, Sega: states in the flash after the cartridge RAM's two copies, espboy_flash.cpp now serving every core: 8 slots for a Game Gear game, 5 with cartridge RAM, 10 for an SG-1000 one. The mock-flash test covers save, empty slot, load, the RAM copies left intact and a reboot.
  • ESPboy stack vs heap: the 12 KiB continuation stack gives the heap what it lacks to keep 4 KiB free (never below 6 KiB), decided by compile.sh from the build's RAM report (Ristar 11.5 KiB, The Castle 10 KiB).
  • PICO-8, META and ESPboy: p8_state_io streams the heap and its indexes, drawing state and screen, buttons, random numbers, audio channels and every global the cartridge can change (natives it reassigns included). The heap holds absolute pointers, so a state only loads into the firmware that wrote it, recognised by a hash of its code. The host harness gains --save-state / --load-state (built without PIE): a state saved at frame 300 and loaded by another run ends frame 600 on femto8's recorded picture, also with a collection at every allocation.
  • PICO-8 menu: on the META it drew 160-pixel rows through the picture's 128-column panel window and came out scrambled (since 0.10.28); it now opens the full window while shown and draws one row at a time in the picture's buffers (640 bytes back to a C stack that was down to about 1.2 KiB). On the ESPboy its rows are narrowed instead of cut.
  • compile.sh builds PICO-8 cartridges (.p8, .p8.png; META and ESPboy; SRC_SYSTEM=pico8) with their state file.
  • Checked in gm0 on each console (emulator, not hardware): save, play on, load, the menu says "Etat charge" and the picture is the saved one — Columns, Flicky and The Castle on the META and the Pokitto, Sonic and Flicky on the ESPboy, Celeste on the META and the ESPboy. Not yet tried on the devices.
  • Not covered yet: PICO-8 has no Pokitto target.
  • META runtime 0.10.34, Pokitto 0.10.28, ESPboy 0.3.4: rebuild your games (UPDATE=1 when not interactive).
    The archive m0boy-0.10.34.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.