Skip to content
Snippets Groups Projects
Verified Commit 2d7038a9 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

Merge branch 'joamag/web'

parents e12f58ba f257c45e
No related branches found
No related tags found
No related merge requests found
Pipeline #844 passed
......@@ -74,6 +74,10 @@ impl Cpu {
pub fn clock(&mut self) -> u8 {
let pc = self.pc;
if pc >= 0x8000 && pc < 0x9fff {
panic!("Invalid PC area at 0x{:04x}", pc);
}
// fetches the current instruction and increments
// the PC (program counter) accordingly
let mut opcode = self.mmu.read(self.pc);
......@@ -92,12 +96,12 @@ impl Cpu {
let (instruction_fn, instruction_time, instruction_str) = instruction;
if *instruction_str == "! UNIMP !" {
//if *instruction_str == "! UNIMP !" {
println!(
"{}\t(0x{:02x})\t${:04x} {}",
instruction_str, opcode, pc, is_prefix
);
}
//}
// calls the current instruction and increments the number of
// cycles executed by the instruction time of the instruction
......
......@@ -131,7 +131,7 @@ impl Mmu {
self.ram[(addr & 0x1fff) as usize] = value;
}
0xe00 => {
println!("Writing to PPU OAM");
println!("Writing to PPU OAM at 0x{:04x}", addr);
}
0xf00 => {
if addr >= 0xff80 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment