Search
lxdream.org :: lxdream/src/sh4/sh4core.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4core.h
changeset 359:c588dce7ebde
prev312:2c34bdc36cbd
next367:9c52dcbad3fb
author nkeynes
date Thu Aug 23 12:33:27 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Commit decoder generator
Translator work in progress
Fix mac.l, mac.w in emu core
file annotate diff log raw
1.1 --- a/src/sh4/sh4core.h Tue Jan 23 08:17:06 2007 +0000
1.2 +++ b/src/sh4/sh4core.h Thu Aug 23 12:33:27 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: sh4core.h,v 1.18 2007-01-23 08:17:06 nkeynes Exp $
1.6 + * $Id: sh4core.h,v 1.19 2007-08-23 12:33:27 nkeynes Exp $
1.7 *
1.8 * This file defines the internal functions exported/used by the SH4 core,
1.9 * except for disassembly functions defined in sh4dasm.h
1.10 @@ -59,11 +59,11 @@
1.11 struct sh4_registers {
1.12 uint32_t r[16];
1.13 uint32_t r_bank[8]; /* hidden banked registers */
1.14 - uint32_t sr, gbr, ssr, spc, sgr, dbr, vbr;
1.15 - uint32_t pr, pc, fpscr;
1.16 + uint32_t sr, pr, pc, fpscr, t;
1.17 int32_t fpul;
1.18 + uint32_t gbr, ssr, spc, sgr, dbr, vbr;
1.19 uint64_t mac;
1.20 - uint32_t m, q, s, t; /* really boolean - 0 or 1 */
1.21 + uint32_t m, q, s; /* really boolean - 0 or 1 */
1.22 float fr[2][16];
1.23
1.24 int32_t store_queue[16]; /* technically 2 banks of 32 bytes */
1.25 @@ -171,10 +171,14 @@
1.26 #define IS_FPU_ENABLED() ((sh4r.sr&SR_FD)==0)
1.27
1.28 #define FR(x) sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21][(x)^1]
1.29 -#define DR(x) ((double *)(sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21]))[x]
1.30 +#define DRF(x) ((double *)(sh4r.fr[(sh4r.fpscr&FPSCR_FR)>>21]))[x]
1.31 #define XF(x) sh4r.fr[((~sh4r.fpscr)&FPSCR_FR)>>21][(x)^1]
1.32 #define XDR(x) ((double *)(sh4r.fr[((~sh4r.fpscr)&FPSCR_FR)>>21]))[x]
1.33 #define DRb(x,b) ((double *)(sh4r.fr[((b ? (~sh4r.fpscr) : sh4r.fpscr)&FPSCR_FR)>>21]))[x]
1.34 +#define DR(x) DRb((x>>1), (x&1))
1.35 +#define FPULf *((float *)&sh4r.fpul)
1.36 +#define FPULi (sh4r.fpul)
1.37 +
1.38 /* Exceptions (for use with sh4_raise_exception) */
1.39
1.40 #define EX_ILLEGAL_INSTRUCTION 0x180, 0x100
1.41 @@ -198,3 +202,4 @@
1.42 }
1.43 #endif
1.44 #endif
1.45 +
.