Open elvishfiend opened 7 years ago
Yeah I noticed this too. According to a manual for the gameboy, it just loads a 16-bit address to the stack pointer.
It actually writes the value of the stack pointer to a memory address and the location that follows, with the first memory address being passed as an imm16.
For more information, see Game Boy Opcode Periodic Table The Pan Docs
I'll include the pseudocode for my implementation here, for anyone who's reading this issue and is stumped on how to implement it, like I was.
pseudocode (C++):
void STR_IMM16_SP()
{
unsigned short value = mmu.rw(pc);
mmu.ww(value, sp);
pc += 2;
m = 5;
}
LDmmSP appears in _map but doesn't appear to be implemented anywhere.