diff options
Diffstat (limited to 'src/cpu/6502.c')
-rw-r--r-- | src/cpu/6502.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/cpu/6502.c b/src/cpu/6502.c index 17796cf..ab8248e 100644 --- a/src/cpu/6502.c +++ b/src/cpu/6502.c @@ -33,10 +33,11 @@ void flagClear(byte flag){ // Functions which perform reusable routines for finding if a specific flag should be set. void SetFlagN(byte x){ - if ((x & flag_N) == flag_N) + /*if ((x & flag_N) == flag_N) SetFlag(flag_N, 1); else - SetFlag(flag_N, 0); + SetFlag(flag_N, 0);*/ + P = (x & flag_N) | (P & ~flag_N); } //Perform prior to any changes @@ -84,9 +85,11 @@ void SetMemory(address x, byte y){ byte GetStack() { + S--; return GetMemory(0x01FF - S); } -void SetStack(byte z) { - SetMemory(0x01FF - S, z); +void SetStack(byte x) { + SetMemory(0x01FF - S, x); + S++; } |