feat: implement ability to boot straigt to cartridge

This commit is contained in:
2020-12-23 19:39:37 -06:00
parent 1502cc3ec2
commit 2a234f4d14
6 changed files with 212 additions and 23 deletions

View File

@@ -3,13 +3,15 @@ use gb::cpu::Cpu as LR35902;
fn main() {
let mut game_boy = LR35902::new();
game_boy.load_cartridge("bin/cpu_instrs.gb");
loop {
let pc = game_boy.register_pair(gb::cpu::RegisterPair::PC);
let opcode = game_boy.fetch();
let instruction = game_boy.decode(opcode);
println!(
"Addr: {:#06x} | Opcode: {:#x} | Instr: {:x?}",
"Addr: {:#06X} | Opcode: {:#04X} | Instr: {:X?}",
pc, opcode, instruction
);