summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-01-21 14:33:43 -0400
committermrb0nk500 <b0nk@b0nk.xyz>2022-01-21 14:33:43 -0400
commit375c099d1f35f092ca807feffea7dd5c632382f2 (patch)
tree13c9508ce7a6beb0c0bbd5ddf30a4d04739da172
parent99bfc228ef92adc051dbaa709db7bffccf63f35e (diff)
sux.h: Corrected typos in bitmasks that dealt with
conditional branches.
-rw-r--r--sux.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/sux.h b/sux.h
index 4e49f5f..a2a509e 100644
--- a/sux.h
+++ b/sux.h
@@ -1815,7 +1815,7 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(0, 0x00000000, 0x00001200, 0x12000000, 0x00001000, 0x05101110, 0x04000000, 0x00100110, 0x00000000) { reg = &cpu->x; } /* ldx, stx, cpx, inx, dex, txa, txy */ \
t(0, 0x00000000, 0x00000000, 0x00041044, 0x10001200, 0x02000400, 0x00100110, 0x04000000, 0x01001000) { reg = &cpu->y; } /* ldy, sty, cpy, iny, dey, tya, tyx */ \
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { reg = &cpu->sp; } /* tsx */ \
- t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00004200, 0x00000200, 0x02000200, 0x02000201) { reg = &cpu->ps[thread]; } /* php, test/set/clear flags, and interrupts. */ \
+ t(7, 0x00010001, 0x00010001, 0x00010001, 0x00010001, 0x00014200, 0x00000200, 0x02000200, 0x02000201) { reg = &cpu->ps[thread]; } /* php, test/set/clear flags, and interrupts. */ \
t(0, 0x07561370, 0x17561570, 0x14161560, 0x10161160, 0x11161160, 0x51165161, 0x51175161, 0x01171160) { tmp = read_value(cpu, 0, addr, rs, inc_clk, 1); } /* Read data from memory. */ \
t(0, 0x00000006, 0x00000006, 0x00000006, 0x00000006, 0x00000016, 0x00000016, 0x00000016, 0x00000016) { tmp = read_value(cpu, 0, cpu->pc, rs, inc_clk, 0); cpu->pc += rs; } /* Immediate data. */ \
/* Operations that mogrify (overwrite) memory directly. */ \
@@ -1828,17 +1828,17 @@ static /*inline*/ void inst_##op(struct sux *cpu, uint8_t prefix, uint8_t size,
t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x40004200, 0x00000000, 0x00000000, 0x00000000) { rs = 0; } /* php, plp, and interrupts. */ \
t(0, 0x40000000, 0x40000000, 0x40000000, 0x40000000, 0x40000001, 0x00000000, 0x00000000, 0x00000000) { *reg = pull(cpu, rs, thread); } /* Pull value off the stack. */ \
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00000000, 0x00000000) { cpu->pc = pull(cpu, (rs) ? rs : 7, thread); } /* Pull return address off the stack. */ \
-i t(7, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000200, 0x00000001, 0x00010000, 0x00000000) { push(cpu, cpu->pc, (rs) ? rs : 7, thread); } /* Push return address onto the stack. */ \
+ t(7, 0x00000000, 0x10000000, 0x00000000, 0x00000000, 0x00000200, 0x00000001, 0x00010000, 0x00000000) { push(cpu, cpu->pc, (rs) ? rs : 7, thread); } /* Push return address onto the stack. */ \
t(7, 0x00001000, 0x10000000, 0x00000000, 0x00000000, 0x00000200, 0x00000001, 0x00010001, 0x00010000) { cpu->pc = addr; } /* Set program counter to supplied address. */ \
t(7, 0x00004000, 0x00004000, 0x00004000, 0x00004000, 0x00004200, 0x00000000, 0x00000000, 0x00000000) { push(cpu, *reg, rs, thread); } /* Push value onto the stack. */ \
/* Setting/Testing/Clearing flags, and bitwise operations. */ \
- t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000200, 0x02000200, 0x02000200) { tmp = 1; } \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 1; } \
- t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00000200, 0x02000200, 0x00000000) { tmp <<= 2; } \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 4; } \
+ t(7, 0x00010001, 0x00010001, 0x00010001, 0x00010001, 0x00010200, 0x00000200, 0x02000200, 0x02000200) { tmp = 1; } \
+ t(0, 0x00000000, 0x00000001, 0x00010000, 0x00000001, 0x00010000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 1; } \
+ t(7, 0x00000001, 0x00010000, 0x00000000, 0x00000001, 0x00010200, 0x00000200, 0x02000200, 0x00000000) { tmp <<= 2; } \
+ t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00010000, 0x00000000, 0x00000000, 0x00000000) { tmp <<= 4; } \
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000200, 0x00220222, 0x00000200) { tmp = ~tmp; } /* sbc, and clear flag. */ \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00220022, 0x00000000, 0x02000000, 0x02000000) { tmp |= *reg; } /* ora, and set flag. */ \
- t(0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00220222, 0x00000200, 0x00000200) { tmp &= *reg; } /* AND, and clear/test flag. */ \
+ t(7, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00220222, 0x00000000, 0x02000000, 0x02000000) { tmp |= *reg; } /* ora, and set flag. */ \
+ t(0, 0x00000001, 0x00010001, 0x00010001, 0x00010001, 0x00010000, 0x00220222, 0x00000200, 0x00000200) { tmp &= *reg; } /* AND, and clear/test flag. */ \
t(0, 0x00000000, 0x00000000, 0x00000000, 0x00220022, 0x00000000, 0x00000000, 0x00000000, 0x00000000) { tmp ^= *reg; } /* xor. */ \
}