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); default: data = state.reg16((op >> 4) & 0x3);
} }
state.SP-=2; pushStack16(data);
bus->write16(state.SP, data);
mcycles = 4; mcycles = 4;
} }
else if((op & 0xCF) == 0xC1) // POP rr else if((op & 0xCF) == 0xC1) // POP rr
{ {
u16 data = bus->read16(state.SP); u16 data = popStack16();
state.SP+=2;
switch((op >> 4) & 0x3) switch((op >> 4) & 0x3)
{ {