Compare commits
1 Commits
7d96019c01
...
ead6d1ce49
Author | SHA1 | Date |
---|---|---|
Rekai Nyangadzayi Musuka | ead6d1ce49 |
|
@ -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 = 100; // TODO: How many cycles actually?
|
const cycles_per_frame: u64 = 160 * (308 * 4);
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -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 + 68 * (308 * 4) });
|
self.push(.{ .kind = .VBlank, .tick = self.tick + (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 + 68 * (308 * 4) });
|
self.push(.{ .kind = .VBlank, .tick = self.tick + (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
|
||||||
|
|
Loading…
Reference in New Issue