Skip to content

Commit

Permalink
SAGE: Fix flag setting with 33bit mask
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Veit authored and markpizz committed Mar 28, 2017
1 parent d985645 commit 3e54264
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SAGE/m68k_cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#define BIT15 0x8000
#define BIT16 0x10000
#define BIT31 0x80000000
#define BIT32 0x100000000L
#define BIT32 0x100000000LL

#define MASK_0(x) ((x) & 1)
#define MASK_8U(x) ((x) & 0xffffff00)
Expand All @@ -78,7 +78,7 @@
#define MASK_32U(x) (0)
#define MASK_32L(x) ((x) & 0xffffffff)
#define MASK_32SGN(x) ((x) & BIT31)
#define MASK_33(x) ((x) & BIT32)
#define MASK_33(x64) ((x64) & BIT32)

#define COMBINE8(tgt,src) (MASK_8U(tgt) | MASK_8L(src))
#define COMBINE16(tgt,src) (MASK_16U(tgt) | MASK_16L(src))
Expand Down Expand Up @@ -3052,7 +3052,7 @@ do_roxr32: reg = DR+IR_REGY;
if (CCR_X) resx |= BIT32;
resx = (resx>>cnt) | (resx<<(33-cnt));
*reg = MASK_32L(resx);
SETF(MASK_33(res),FLAG_X|FLAG_C);
SETF(MASK_33(resx),FLAG_X|FLAG_C);
} else SETF(CCR_X,FLAG_C);
SETNZ32(resx);
CLRF(FLAG_V);
Expand Down

0 comments on commit 3e54264

Please sign in to comment.