cpu/decoder - Actually use pushStack16 and popStack16 for POP and PUSH

This commit is contained in:
madmaurice 2023-08-29 16:53:53 +02:00
parent 310fb99ad2
commit c08fd5d68d

View file

@ -67,17 +67,13 @@ void Cpu::executeInstruction()
default: data = state.reg16((op >> 4) & 0x3);
}
state.SP-=2;
bus->write16(state.SP, data);
pushStack16(data);
mcycles = 4;
}
else if((op & 0xCF) == 0xC1) // POP rr
{
u16 data = bus->read16(state.SP);
state.SP+=2;
u16 data = popStack16();
switch((op >> 4) & 0x3)
{