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

feat: call prototype

parent 8eb5ab77
No related branches found
No related tags found
No related merge requests found
...@@ -221,7 +221,7 @@ pub const INSTRUCTIONS: [(fn(&mut Cpu), u8, &'static str); 256] = [ ...@@ -221,7 +221,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"), (call_u16, 24, "CALL u16"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
(nop, 4, "NOP"), (nop, 4, "NOP"),
// 0xd opcodes // 0xd opcodes
...@@ -780,6 +780,12 @@ fn xor_a_a(cpu: &mut Cpu) { ...@@ -780,6 +780,12 @@ fn xor_a_a(cpu: &mut Cpu) {
cpu.set_carry(false); cpu.set_carry(false);
} }
fn call_u16(cpu: &mut Cpu) {
// @todo push stack and set the current PC
// to be able to jump
cpu.sp += 1;
}
fn ld_mff00u8_a(cpu: &mut Cpu) { fn ld_mff00u8_a(cpu: &mut Cpu) {
let byte = cpu.read_u8(); let byte = cpu.read_u8();
cpu.mmu.write(0xff0c + byte as u16, cpu.a); cpu.mmu.write(0xff0c + byte as u16, cpu.a);
......
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