Compare commits

..

1 Commits

2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@ const Bus = @import("Bus.zig");
const Scheduler = @import("scheduler.zig").Scheduler; const Scheduler = @import("scheduler.zig").Scheduler;
const Arm7tdmi = @import("cpu.zig").Arm7tdmi; const Arm7tdmi = @import("cpu.zig").Arm7tdmi;
const cycles_per_frame: u64 = 160 * (308 * 4); const cycles_per_frame: u64 = 100; // TODO: How many cycles actually?
pub fn runFrame(sched: *Scheduler, cpu: *Arm7tdmi, bus: *Bus) void { pub fn runFrame(sched: *Scheduler, cpu: *Arm7tdmi, bus: *Bus) void {
var cycles: u64 = 0; var cycles: u64 = 0;

View File

@ -53,7 +53,7 @@ pub const Scheduler = struct {
} else { } else {
// Transitioning to a Vblank // Transitioning to a Vblank
bus.io.dispstat.vblank.set(); bus.io.dispstat.vblank.set();
self.push(.{ .kind = .VBlank, .tick = self.tick + (308 * 4) }); self.push(.{ .kind = .VBlank, .tick = self.tick + 68 * (308 * 4) });
} }
}, },
.Draw => { .Draw => {
@ -72,7 +72,7 @@ pub const Scheduler = struct {
if (new_scanline < 228) { if (new_scanline < 228) {
// Transition to another Vblank // Transition to another Vblank
self.push(.{ .kind = .VBlank, .tick = self.tick + (308 * 4) }); self.push(.{ .kind = .VBlank, .tick = self.tick + 68 * (308 * 4) });
} else { } else {
// Transition to another Draw // Transition to another Draw
bus.io.vcount.scanline.write(0); // Reset Scanline bus.io.vcount.scanline.write(0); // Reset Scanline