summaryrefslogtreecommitdiff
path: root/src/cpu/6502.c
diff options
context:
space:
mode:
authoralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 00:47:05 +1100
committeralekseiplusplus <alekseijeaves@protonmail.com>2023-12-01 00:47:05 +1100
commit580a7040ba53367c15ca682d4ea90c31fdcca45f (patch)
tree58ccb3ddb419884f6f9da790b0173a62eb4dd22f /src/cpu/6502.c
parent40447eccd6db43d636ccc518ae7792b7b43834b5 (diff)
large progress approaching functionality
Diffstat (limited to 'src/cpu/6502.c')
-rw-r--r--src/cpu/6502.c11
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++;
}