Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacMarovitz committed Nov 30, 2023
1 parent 5f2e047 commit bf20bb9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ impl CPU {
0x32 => { let a = self.reg.get_hl();
self.mem.write(a, self.reg.a);
self.reg.set_hl(a - 1); 2 },
0x33 => { let sp = self.reg.get_sp();
self.reg.set_sp(sp.wrapping_add(1)); 2 },
0x33 => { let sp = self.reg.sp;
self.reg.sp = sp.wrapping_add(1); 2 },
0x36 => { let a = self.reg.get_hl();
let b = self.read_byte();
self.mem.write(a, b); 3 },
Expand All @@ -84,8 +84,8 @@ impl CPU {
0x3A => { let a = self.reg.get_hl();
self.reg.a = self.mem.read(a);
self.reg.set_hl(a - 1); 2 },
0x3B => { let sp = self.reg.get_sp();
self.reg.set_sp(sp.wrapping_sub(1)); 2 },
0x3B => { let sp = self.reg.sp;
self.reg.sp = sp.wrapping_sub(1); 2 },
0x3E => { self.reg.a = self.read_byte(); 2 },
0x40 => { self.reg.b = self.reg.b; 1 },
0x41 => { self.reg.b = self.reg.c; 1 },
Expand Down Expand Up @@ -233,7 +233,7 @@ impl CPU {
0xFE => { let b = self.read_byte();
self.alu_cp(b); 2 },
// Should be a panic!, keep it as a println! for now
code => { println!("Instruction {:} is unknown!", code); 0 },
code => { println!("Instruction {:#04x} is unknown!", code); 0 },
}
}

Expand Down Expand Up @@ -313,7 +313,7 @@ impl CPU {
self.alu_bit(self.mem.read(a), 7); 4 },
0x7F => { self.alu_bit(self.reg.a, 7); 2 },
// Should be a panic!, keep it as a println! for now
code => { println!("CB Instruction {:2X} is unknown!", code); 0 },
code => { println!("CB Instruction {:#04x} is unknown!", code); 0 },
}
}

Expand Down

0 comments on commit bf20bb9

Please sign in to comment.