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

feat: added LD A, [DE]

parent 60ef3157
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,7 @@ fn main() { ...@@ -6,7 +6,7 @@ fn main() {
for _ in 0..40000 { for _ in 0..40000 {
game_boy.clock(); game_boy.clock();
if game_boy.cpu().pc() >= 0x0023 { if game_boy.cpu().pc() >= 0x0032 {
break; break;
} }
} }
......
...@@ -31,7 +31,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ ...@@ -31,7 +31,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [
(nop, 4, "NOP"), (nop, 4, "NOP"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
(nop, 4, "NOP"), (ld_a_mde, 8, "LD A, [DE]"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
...@@ -736,6 +736,11 @@ fn ld_de_u16(cpu: &mut Cpu) { ...@@ -736,6 +736,11 @@ fn ld_de_u16(cpu: &mut Cpu) {
cpu.set_de(word); cpu.set_de(word);
} }
fn ld_a_mde(cpu: &mut Cpu) {
let byte = cpu.mmu.read(cpu.de());
cpu.a = byte;
}
fn jr_nz_i8(cpu: &mut Cpu) { fn jr_nz_i8(cpu: &mut Cpu) {
let byte = cpu.read_u8() as i8; let byte = cpu.read_u8() as i8;
......
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