From 1fc081b3c5e24ac1d75bf54d3048f719ce7dcc14 Mon Sep 17 00:00:00 2001 From: MadMaurice Date: Tue, 29 Aug 2023 12:10:10 +0200 Subject: [PATCH] cpu - Fix push operations --- cpu/cpu.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp index 989283c..310a077 100644 --- a/cpu/cpu.cpp +++ b/cpu/cpu.cpp @@ -65,8 +65,8 @@ u16 Cpu::readPC16() void Cpu::pushStack8(u8 data) { - bus->write8(state.SP, data); state.SP--; + bus->write8(state.SP, data); } u8 Cpu::popStack8() @@ -78,8 +78,8 @@ u8 Cpu::popStack8() void Cpu::pushStack16(u16 data) { - bus->write16(state.SP,data); state.SP-=2; + bus->write16(state.SP,data); } u16 Cpu::popStack16()