summaryrefslogtreecommitdiff
path: root/opcode.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcode.c')
-rw-r--r--opcode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/opcode.c b/opcode.c
index ea3f726..32f4e9d 100644
--- a/opcode.c
+++ b/opcode.c
@@ -1,4 +1,5 @@
#include "opcode.h"
+
void setps(struct sux *cpu, uint8_t thread) {
(cpu->c[thread]) ? (cpu->ps |= (C << 8*thread)) : (cpu->ps &= ~(C << 8*thread));
(cpu->z[thread]) ? (cpu->ps |= (Z << 8*thread)) : (cpu->ps &= ~(Z << 8*thread));
@@ -57,7 +58,7 @@ void mul(struct sux *cpu, uint64_t adr, uint8_t thread) {
cpu->z[thread] = (sum == 0);
cpu->n[thread] = (sum >> 63);
cpu->v[thread] = !((cpu->a[thread]^value) & 0x8000000000000000) && ((cpu->a[thread]^sum) & 0x8000000000000000);
- cpu->c[thread] = (!((cpu->a[thread]^sum) && (cpu->a[thread]^value)) || (cpu->a[thread] >= ((uint64_t)1 << 32) && value >= ((uint64_t)1 << 32)));
+ cpu->c[thread] = (!((cpu->a[thread]^sum) && (cpu->a[thread]^value)) && (cpu->a[thread] >= ((uint64_t)1 << 32) && value >= ((uint64_t)1 << 32)));
cpu->a[thread] = sum;
setps(cpu, thread);
}