diff options
| author | gbc dev <gbc@localhost> | 2026-09-22 15:56:52 +0200 |
|---|---|---|
| committer | gbc dev <gbc@localhost> | 2026-09-22 15:56:52 +0200 |
| commit | c4848bb0a114a95aaeb282ac105087f2913eb012 (patch) | |
| tree | f2598990d638ca8cedd5779e1250cb4a1a95d3b1 /Makefile | |
| parent | kitty: truecolor graphics output with a layered HUD (diff) | |
| download | sl0pboy-c4848bb0a114a95aaeb282ac105087f2913eb012.tar.gz sl0pboy-c4848bb0a114a95aaeb282ac105087f2913eb012.tar.xz sl0pboy-c4848bb0a114a95aaeb282ac105087f2913eb012.zip | |
core: make the machine loadable without a filesystem
Groundwork for building the core for targets that have no files, no
sockets and no terminal (a browser, next commit). Three changes, no
behaviour change for the native binary:
- cart_load() splits into cart_init_owned() (everything past the file
read) plus cart_load_mem(), which takes a ROM image already in memory.
The path version keeps owning the .sav wiring; a memory load attaches
no battery file and leaves save_path empty, which cart_save() now
treats as "nowhere to write".
- gb_load_bootrom_mem() does the same for boot ROMs, so the power-on
animation works wherever the image comes from.
- gb_run_frame() was declared in gb.h but never existed; main.c had a
private run_frame() instead. Implement it in gb.c and point main.c at
it, so every host advances the machine on one identical boundary.
The link-socket layer (--serial-sock) is the only genuinely unportable
part of the core, so under __wasm__ it becomes no-op stubs: the link is
simply always down and the call sites stay untouched. The file-backed
loaders compile out there too, which keeps the libc surface tiny.
Verified: blargg cpu_instrs (11/11), instr_timing, mem_timing,
mem_timing-2 all still Passed; --shot output unchanged.
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions
