gb/src/main.rs

21 lines
480 B
Rust
Raw Normal View History

use gb::cpu::Cpu as LR35902;
fn main() {
2021-01-03 08:05:46 +00:00
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!(
2021-01-18 03:13:59 +00:00
"\nAddr: {:#06X} | Opcode: {:#04X} | Instr: {:X?}",
pc, opcode, instruction
);
game_boy.execute(instruction);
}
}