dont pretend to run bootrom if actually running bootrom
This commit is contained in:
parent
7eba1f9586
commit
4a48bf6a68
13
src/main.rs
13
src/main.rs
|
@ -274,10 +274,7 @@ fn main() {
|
||||||
|
|
||||||
let rom: ROM = fs::read(args.rom).expect("Could not load ROM");
|
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 bootrom: ROM = fs::read(args.bootrom).expect("Could not load BootROM");
|
||||||
let mut reg = Registers::default();
|
let reg = Registers::default();
|
||||||
if args.run_bootrom {
|
|
||||||
reg.pc = 0x0;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut cpu = CPU {
|
let mut cpu = CPU {
|
||||||
memory: Memory::init(bootrom, args.run_bootrom, rom),
|
memory: Memory::init(bootrom, args.run_bootrom, rom),
|
||||||
|
@ -287,7 +284,13 @@ fn main() {
|
||||||
window,
|
window,
|
||||||
gpu: GPU::default(),
|
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 cycle_num = 0;
|
||||||
let mut instructions_seen = vec![];
|
let mut instructions_seen = vec![];
|
||||||
let mut last_state = cpu.reg.clone();
|
let mut last_state = cpu.reg.clone();
|
||||||
|
|
Loading…
Reference in a new issue