Previous 15994 Revisions Next

r10130 Saturday 22nd January, 2011 at 13:18:47 UTC by Tim Schuerewegen
[GBA] Fixed an ARM7 carry flag bug. This fixes the palette corruption in "Banjo-Kazooie".
[docs]messnew.txt
[src/emu/cpu/arm7]arm7core.c

src/emu/cpu/arm7/arm7core.c
r10129r10130
243243//  - HandleALUAddFlags = HandleThumbALUAddFlags except for PC incr
244244//  - HandleALUSubFlags = HandleThumbALUSubFlags except for PC incr
245245
246#define IsNeg(i) ((i) >> 31)
247#define IsPos(i) ((~(i)) >> 31)
248
246249/* Set NZCV flags for ADDS / SUBS */
247250#define HandleALUAddFlags(rd, rn, op2)                                                \
248251  if (insn & INSN_S)                                                                  \
249252    SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK))                       \
250253              | (((!SIGN_BITS_DIFFER(rn, op2)) && SIGN_BITS_DIFFER(rn, rd)) << V_BIT) \
251              | (((~(rn)) < (op2)) << C_BIT)                                 \
254              | (((IsNeg(rn) & IsNeg(op2)) | (IsNeg(rn) & IsPos(rd)) | (IsNeg(op2) & IsPos(rd))) ? C_MASK : 0) \
252255              | HandleALUNZFlags(rd)));                                               \
253256  R15 += 4;
254257
r10129r10130
259262              | HandleALUNZFlags(rd)));                                                           \
260263  R15 += 2;
261264
262#define IsNeg(i) ((i) >> 31)
263#define IsPos(i) ((~(i)) >> 31)
264
265265#define HandleALUSubFlags(rd, rn, op2)                                                                         \
266266  if (insn & INSN_S)                                                                                           \
267267    SET_CPSR(((GET_CPSR & ~(N_MASK | Z_MASK | V_MASK | C_MASK))                                                \
docs/messnew.txt
r10129r10130
2626- [GBA] Fixed EEPROM detection for "Banjo-Kazooie" and "Custom Robo GX".
2727  [Tim Schuerewegen]
2828
29- [GBA] Fixed an ARM7 carry flag bug. This fixes the palette corruption
30  in "Banjo-Kazooie". [Tim Schuerewegen]
31
2932- [PIPPIN] Added pre release rom
3033
3134- [PV1000] 4 new cartridge dumps for the software list.  [anondumper]

Previous 15994 Revisions Next


© 1998-2018 The MESS Team