diff options
Diffstat (limited to 'SrcShared/UAE/machdep_m68k.h')
-rw-r--r-- | SrcShared/UAE/machdep_m68k.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/SrcShared/UAE/machdep_m68k.h b/SrcShared/UAE/machdep_m68k.h new file mode 100644 index 0000000..15f740a --- /dev/null +++ b/SrcShared/UAE/machdep_m68k.h @@ -0,0 +1,56 @@ + /* + * UAE - The Un*x Amiga Emulator + * + * MC68000 emulation - machine dependent bits + * + * Copyright 1996 Bernd Schmidt + */ + +#ifdef __cplusplus +extern "C" { +#endif + +struct flag_struct { + unsigned int c; + unsigned int z; + unsigned int n; + unsigned int v; + unsigned int x; +}; + +extern struct flag_struct regflags; + +#define ZFLG (regflags.z) +#define NFLG (regflags.n) +#define CFLG (regflags.c) +#define VFLG (regflags.v) +#define XFLG (regflags.x) + +STATIC_INLINE int cctrue(const int cc) +{ + switch(cc){ + case 0: return 1; /* T */ + case 1: return 0; /* F */ + case 2: return !CFLG && !ZFLG; /* HI */ + case 3: return CFLG || ZFLG; /* LS */ + case 4: return !CFLG; /* CC */ + case 5: return CFLG; /* CS */ + case 6: return !ZFLG; /* NE */ + case 7: return ZFLG; /* EQ */ + case 8: return !VFLG; /* VC */ + case 9: return VFLG; /* VS */ + case 10:return !NFLG; /* PL */ + case 11:return NFLG; /* MI */ + case 12:return NFLG == VFLG; /* GE */ + case 13:return NFLG != VFLG; /* LT */ + case 14:return !ZFLG && (NFLG == VFLG); /* GT */ + case 15:return ZFLG || (NFLG != VFLG); /* LE */ + } + abort(); + return 0; +} + + +#ifdef __cplusplus +} +#endif |