Search
lxdream.org :: lxdream/src/sh4/sh4.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4.c
changeset 936:f394309c399a
prev935:45246788ca00
next937:81b0c79d9788
author nkeynes
date Sat Dec 27 02:59:35 2008 +0000 (15 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Replace fpscr_mask/fpscr flags in xlat_cache_block with a single xlat_sh4_mode,
which tracks the field of the same name in sh4r - actually a little faster this way.
Now depends on SR.MD, FPSCR.PR and FPSCR.SZ (although it doesn't benefit from the SR
flag yet).

Also fixed the failure to check the flags in the common case (code address returned
by previous block) which took away the performance benefits, but oh well.
file annotate diff log raw
1.1 --- a/src/sh4/sh4.c Sat Dec 27 02:18:17 2008 +0000
1.2 +++ b/src/sh4/sh4.c Sat Dec 27 02:59:35 2008 +0000
1.3 @@ -233,7 +233,7 @@
1.4 sh4r.in_delay_slot = FALSE;
1.5 }
1.6
1.7 - fwrite( &sh4r, sizeof(sh4r), 1, f );
1.8 + fwrite( &sh4r, offsetof(struct sh4_registers, xlat_sh4_mode), 1, f );
1.9 MMU_save_state( f );
1.10 CCN_save_state( f );
1.11 PMM_save_state( f );
1.12 @@ -247,7 +247,8 @@
1.13 if( sh4_use_translator ) {
1.14 xlat_flush_cache();
1.15 }
1.16 - fread( &sh4r, sizeof(sh4r), 1, f );
1.17 + fread( &sh4r, offsetof(struct sh4_registers, xlat_sh4_mode), 1, f );
1.18 + sh4r.xlat_sh4_mode = (sh4r.sr & SR_MD) | (sh4r.fpscr & (FPSCR_SZ|FPSCR_PR));
1.19 MMU_load_state( f );
1.20 CCN_load_state( f );
1.21 PMM_load_state( f );
1.22 @@ -336,6 +337,7 @@
1.23 sh4r.s = (newval&SR_S) ? 1 : 0;
1.24 sh4r.m = (newval&SR_M) ? 1 : 0;
1.25 sh4r.q = (newval&SR_Q) ? 1 : 0;
1.26 + sh4r.xlat_sh4_mode = (sh4r.sr & SR_MD) | (sh4r.fpscr & (FPSCR_SZ|FPSCR_PR));
1.27 intc_mask_changed();
1.28 }
1.29
1.30 @@ -345,6 +347,7 @@
1.31 sh4_switch_fr_banks();
1.32 }
1.33 sh4r.fpscr = newval & FPSCR_MASK;
1.34 + sh4r.xlat_sh4_mode = (sh4r.sr & SR_MD) | (sh4r.fpscr & (FPSCR_SZ|FPSCR_PR));
1.35 }
1.36
1.37 uint32_t FASTCALL sh4_read_sr( void )
.