feat: implement fetch, decode, execute loop
This commit is contained in:
17
src/main.rs
17
src/main.rs
@@ -1,3 +1,18 @@
|
||||
use gb::cpu::Cpu as LR35902;
|
||||
|
||||
fn main() {
|
||||
println!("Hello World!");
|
||||
let mut game_boy = LR35902::new();
|
||||
|
||||
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?}",
|
||||
pc, opcode, instruction
|
||||
);
|
||||
|
||||
game_boy.execute(instruction);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user