chore: don't assume 1cpi when stepping by a frame
This commit is contained in:
parent
147f6ac9ec
commit
b76481b34c
|
@ -43,8 +43,9 @@ pub fn run(kind: RunKind, quit: *Atomic(bool), fps: *FpsAverage, sched: *Schedul
|
|||
}
|
||||
|
||||
pub fn runFrame(sched: *Scheduler, cpu: *Arm7tdmi, bus: *Bus) void {
|
||||
var cycles: u64 = 0;
|
||||
while (cycles < cycles_per_frame) : (cycles += 1) {
|
||||
const frame_end = sched.tick + cycles_per_frame;
|
||||
|
||||
while (sched.tick < frame_end) {
|
||||
sched.tick += 1;
|
||||
_ = cpu.step();
|
||||
|
||||
|
|
Loading…
Reference in New Issue