summaryrefslogtreecommitdiff
path: root/sux.h
diff options
context:
space:
mode:
Diffstat (limited to 'sux.h')
-rw-r--r--sux.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/sux.h b/sux.h
index aa0355e..b36c4b1 100644
--- a/sux.h
+++ b/sux.h
@@ -22,8 +22,8 @@ uint8_t subdbg;
WINDOW *scr;
-#define setflag(flag, bit) ((flag)) ? (cpu->ps |= (bit << (thread << 3))) : (cpu->ps &= ~(bit << (thread << 3)))
-#define getflag(bit) (cpu->ps & (bit << (thread << 3)))
+#define setflag(flag, bit) ((flag)) ? (cpu->ps.u8[thread] |= bit) : (cpu->ps.u8[thread] &= ~bit)
+#define getflag(bit) (cpu->ps.u8[thread] & bit)
extern pthread_mutex_t mutex;
extern pthread_mutex_t main_mutex;
@@ -231,7 +231,7 @@ inline void push(struct sux *cpu, uint64_t value, uint8_t opcode, uint8_t thread
case PHB: r.reg = cpu->b[thread]; break;
case PHX: r.reg = cpu->x[thread]; break;
case PHY: r.reg = cpu->y[thread]; break;
- case PHP: r.reg = cpu->ps; break;
+ case PHP: r.reg = cpu->ps.u64; break;
}
/* Unroll Loop by implementing Duff's Device. */
switch (tmp) {
@@ -271,7 +271,7 @@ inline void pull(struct sux *cpu, uint64_t value, uint8_t opcode, uint8_t thread
case PLB: cpu->b[thread] = r.reg; break;
case PLX: cpu->x[thread] = r.reg; break;
case PLY: cpu->y[thread] = r.reg; break;
- case PLP: cpu->ps = r.reg; break;
+ case PLP: cpu->ps.u64 = r.reg; break;
}
}