lonestar

0x10c-inspired space game based on the DCPU-16
git clone git://squid-tech.com/lonestar.git
Log | Files | Refs | README

commit 2455154cc927f14a608befce6226322f6d91f96a
parent 51860e6b58bef5e2c6c662e030e83449aca3ec4d
Author: Josh Moore <jxm5210@rit.edu>
Date:   Tue, 19 Nov 2019 01:49:58 -0500

Fix stack

Diffstat:
Msrc/LoneStar/Assets/Scripts/DCPU16Controller.cs | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/LoneStar/Assets/Scripts/DCPU16Controller.cs b/src/LoneStar/Assets/Scripts/DCPU16Controller.cs @@ -436,7 +436,7 @@ public class DCPU16Controller : NetworkBehaviour { case 0x18: // PUSH - MEM[--REG_SP] = val; + MEM[REG_SP--] = val; break; case 0x19: // PEEK @@ -492,7 +492,8 @@ public class DCPU16Controller : NetworkBehaviour { case 0x18: // POP - return MEM[REG_SP++]; + return MEM[++REG_SP]; + MEM[REG_SP] = 0x0000; break; case 0x19: // PEEK