Frame model: per-port coroutines, first frame-waiting ports (#37) #65
Loading…
Reference in a new issue
No description provided.
Delete branch "frame-model"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Frame model for ported code (#37):
tm_wait_frame(core/platform/timing.h) is the single yield point; a port flaggedPORT_WAITS_FRAMESruns its bridge in a libco coroutine (core/port/port_frame.c). At a wait the machine idles in WAI at the routine's address, runs its interrupt handlers, and the C resumes once the NMI handler has returned there. Mode on: the real machine, resumed from the instruction hook. Shadow: the clone follows the original cycle by cycle with its pad state; the call is compared when the original returns (same state, same number of vblank interrupts). A savestate is refused while a port in mode on waits.First ports: field/WaitVblank and btlgfx/WaitVblank.
Found on the way: #64 (LakeSnes keeps the old FastROM access table after snes_loadState), worked around in core/hw.
Validation:
Closes #37.
🤖 Generated with Claude Code
🤖 Generated with Claude Code