ml 463c85e62f Fix snapshot save/load: route both through CPU trap to sync registers
machine_write_snapshot reads maincpu_regs.pc to record the current
  program counter. When called directly from video_canvas_refresh,
  maincpu_regs is stale — the CPU loop keeps registers as stack-local
  variables and only syncs them to maincpu_regs inside DO_INTERRUPT via
  EXPORT_REGISTERS(). The snapshot therefore recorded the wrong PC.

  On restore (already trap-based), the wrong PC was faithfully written
  back into reg_pc via IMPORT_REGISTERS(), causing the CPU to resume at
  a bad address. The game screen looked correct (memory/VIC/SID state
  all restored) but the CPU never reached the input-polling code, so
  button presses had no effect.

  Fix: route machine_write_snapshot through interrupt_maincpu_trigger_trap
  so DO_INTERRUPT(IK_TRAP) calls EXPORT_REGISTERS() before the trap
  function, capturing the true current PC before the snapshot is written.
2026-06-17 20:50:51 +02:00
S
Description
A port of the classic German C64 text-adventure RPG series **Schwert und Magie** (German Design Group, 1989–1992) to the Pebble Time 2 smartwatch.
MIT 17 MiB
v0.9.9 Latest
2026-07-17 18:45:04 +00:00
Languages
Kotlin 45.5%
C 33.1%
Shell 14.1%
Dockerfile 3.6%
CMake 1.7%
Other 2%