Added left panel rom loader.

Left panel has tinyfieldialogs to open a file picker, so you can swap
out roms, required a reset machine function aswell.
This commit is contained in:
2026-06-13 09:29:53 +02:00
parent 2e83baea8e
commit c3367cdf3e
4 changed files with 50 additions and 19 deletions
+1 -1
View File
@@ -333,4 +333,4 @@ op_mem_get :: proc(s: ^System, vx_idx: u16) {
for loop_idx in 0..=vx_idx {
s.v[loop_idx] = s.memory[s.i + loop_idx]
}
}
}
+15
View File
@@ -68,3 +68,18 @@ run_machine :: proc(s: ^System, cycles: int) {
cycle(s)
}
}
new_machine :: proc() -> System {
s: System
s.pc = 0x200
s.current_key = -1
// load fonts into the memory
for v, i in FONT_SET {
s.memory[i] = v
}
return s
}
reset_machine :: proc(s: ^System) {
s^ = new_machine()
}