dont pretend to run bootrom if actually running bootrom

This commit is contained in:
Alex Janka 2023-02-06 11:18:18 +11:00
parent 7eba1f9586
commit 4a48bf6a68

View file

@ -274,10 +274,7 @@ fn main() {
let rom: ROM = fs::read(args.rom).expect("Could not load ROM");
let bootrom: ROM = fs::read(args.bootrom).expect("Could not load BootROM");
let mut reg = Registers::default();
if args.run_bootrom {
reg.pc = 0x0;
}
let reg = Registers::default();
let mut cpu = CPU {
memory: Memory::init(bootrom, args.run_bootrom, rom),
@ -287,7 +284,13 @@ fn main() {
window,
gpu: GPU::default(),
};
cpu_ram_init(&mut cpu);
if args.run_bootrom {
cpu.reg.pc = 0x0;
} else {
cpu_ram_init(&mut cpu);
}
let mut cycle_num = 0;
let mut instructions_seen = vec![];
let mut last_state = cpu.reg.clone();