diff options
Diffstat (limited to 'opcode.c')
-rw-r--r-- | opcode.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); } |