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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user