chore: don't assume 1cpi when stepping by a frame
This commit is contained in:
parent
e127669549
commit
3046e6243a
|
@ -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 {
|
pub fn runFrame(sched: *Scheduler, cpu: *Arm7tdmi, bus: *Bus) void {
|
||||||
var cycles: u64 = 0;
|
const frame_end = sched.tick + cycles_per_frame;
|
||||||
while (cycles < cycles_per_frame) : (cycles += 1) {
|
|
||||||
|
while (sched.tick < frame_end) {
|
||||||
sched.tick += 1;
|
sched.tick += 1;
|
||||||
_ = cpu.step();
|
_ = cpu.step();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue