fix(bios): set addr_latch even if bios is skipped
This commit is contained in:
parent
822eed1f3a
commit
7b146ad7ca
|
@ -412,6 +412,12 @@ pub const Arm7tdmi = struct {
|
||||||
self.cpsr.mode.write(@enumToInt(next));
|
self.cpsr.mode.write(@enumToInt(next));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Advances state so that the BIOS is skipped
|
||||||
|
///
|
||||||
|
/// Note: This accesses the CPU's bus ptr so it only may be called
|
||||||
|
/// once the Bus has been properly initialized
|
||||||
|
///
|
||||||
|
/// TODO: Make above notice impossible to do in code
|
||||||
pub fn fastBoot(self: *Self) void {
|
pub fn fastBoot(self: *Self) void {
|
||||||
self.r = std.mem.zeroes([16]u32);
|
self.r = std.mem.zeroes([16]u32);
|
||||||
|
|
||||||
|
@ -425,6 +431,8 @@ pub const Arm7tdmi = struct {
|
||||||
|
|
||||||
// self.cpsr.raw = 0x6000001F;
|
// self.cpsr.raw = 0x6000001F;
|
||||||
self.cpsr.raw = 0x0000_001F;
|
self.cpsr.raw = 0x0000_001F;
|
||||||
|
|
||||||
|
self.bus.bios.addr_latch = 0x0000_00DC + 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn step(self: *Self) void {
|
pub fn step(self: *Self) void {
|
||||||
|
|
|
@ -60,11 +60,12 @@ pub fn main() anyerror!void {
|
||||||
|
|
||||||
var bus: Bus = undefined;
|
var bus: Bus = undefined;
|
||||||
var cpu = Arm7tdmi.init(&scheduler, &bus, log_file);
|
var cpu = Arm7tdmi.init(&scheduler, &bus, log_file);
|
||||||
if (paths.bios == null) cpu.fastBoot();
|
|
||||||
|
|
||||||
try bus.init(allocator, &scheduler, &cpu, paths);
|
try bus.init(allocator, &scheduler, &cpu, paths);
|
||||||
defer bus.deinit();
|
defer bus.deinit();
|
||||||
|
|
||||||
|
if (paths.bios == null) cpu.fastBoot();
|
||||||
|
|
||||||
var gui = Gui.init(&bus.pak.title, &bus.apu, width, height);
|
var gui = Gui.init(&bus.pak.title, &bus.apu, width, height);
|
||||||
defer gui.deinit();
|
defer gui.deinit();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue