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