diff --git a/src/cpu.rs b/src/cpu.rs index 439b378326d178198f58df6e9f6fecc9036951ee..ab674168659d9358e83d3d809b33ee341414a33a 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -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"), + (call_u16, 24, "CALL u16"), (nop, 4, "NOP"), (nop, 4, "NOP"), // 0xd opcodes @@ -780,6 +780,12 @@ fn xor_a_a(cpu: &mut Cpu) { 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) { let byte = cpu.read_u8(); cpu.mmu.write(0xff0c + byte as u16, cpu.a);