Added adjustable speed for simulator.

Added struct fields, calcs for the correct cycles per frame by hz value.
Updated control bar to wire it all up and make sure it updates in real
time.
This commit is contained in:
2026-06-24 10:21:52 +02:00
parent 7403efa6cf
commit 6a43058033
3 changed files with 44 additions and 9 deletions
+2 -1
View File
@@ -70,9 +70,10 @@ run_gui :: proc(sim: ^Simulator) {
rl.BeginDrawing()
rl.ClearBackground(rl.Color{0x18, 0x18, 0x18, 0xFF})
cycles := int(sim.cpu_hz / SIM_FPS)
if (!sim.paused) {
// Cycle the machine to update memory etc
emu.run_machine(sim.machine, 12)
emu.run_machine(sim.machine, cycles)
tick_timers(sim, beep)
}