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

feat: more instructions

parent ddc63f98
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ fn main() {
let mut game_boy = GameBoy::new();
game_boy.load_boot_default();
for i in 0..24612 {
for i in 0..24650 {
game_boy.clock();
if game_boy.cpu().pc() >= 0x3032 {
println!("{}", i);
......
......@@ -619,7 +619,7 @@ impl Cpu {
#[inline(always)]
fn push_byte(&mut self, byte: u8) {
self.sp -= 1;
self.sp = self.sp.wrapping_sub(1);
self.mmu.write(self.sp, byte);
}
......@@ -632,7 +632,7 @@ impl Cpu {
#[inline(always)]
fn pop_byte(&mut self) -> u8 {
let byte = self.mmu.read(self.sp);
self.sp += 1;
self.sp = self.sp.wrapping_add(1);
byte
}
......
......@@ -81,7 +81,7 @@ impl Mmu {
}
0xf00 => {
if addr >= 0xff80 {
self.ram[(addr & 0x7f) as usize]
self.hram[(addr & 0x7f) as usize]
} else {
println!("WRITING TO IO control");
0x00
......@@ -137,7 +137,6 @@ impl Mmu {
}
0xf00 => {
if addr >= 0xff80 {
println!("WRITING TO Zero page");
self.hram[(addr & 0x7f) as usize] = value;
} else {
println!("WRITING TO IO control");
......
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