Search
lxdream.org :: lxdream/src/sh4/sh4.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4.c
changeset 930:07e5b11419db
prev929:fd8cb0c82f5f
next931:430048ea8b71
author nkeynes
date Mon Dec 22 09:51:11 2008 +0000 (11 years ago)
branchlxdream-mem
permissions -rw-r--r--
last change Remove pointer cache and add full address-space map. Much better
file annotate diff log raw
1.1 --- a/src/sh4/sh4.c Sat Dec 20 03:01:40 2008 +0000
1.2 +++ b/src/sh4/sh4.c Mon Dec 22 09:51:11 2008 +0000
1.3 @@ -41,7 +41,6 @@
1.4 void sh4_stop( void );
1.5 void sh4_save_state( FILE *f );
1.6 int sh4_load_state( FILE *f );
1.7 -static void sh4_reset_pointer_cache();
1.8
1.9 uint32_t sh4_run_slice( uint32_t );
1.10 uint32_t sh4_xlat_run_slice( uint32_t );
1.11 @@ -109,7 +108,6 @@
1.12
1.13 /* zero everything out, for the sake of having a consistent state. */
1.14 memset( &sh4r, 0, sizeof(sh4r) );
1.15 - sh4_reset_pointer_cache();
1.16
1.17 /* Resume running if we were halted */
1.18 sh4r.sh4_state = SH4_STATE_RUNNING;
1.19 @@ -243,8 +241,7 @@
1.20 sh4r.in_delay_slot = FALSE;
1.21 }
1.22
1.23 - int len = ((char *)&sh4r.pointer_cache) - ((char *)&sh4r);
1.24 - fwrite( &sh4r, len, 1, f );
1.25 + fwrite( &sh4r, sizeof(sh4r), 1, f );
1.26 MMU_save_state( f );
1.27 PMM_save_state( f );
1.28 INTC_save_state( f );
1.29 @@ -257,9 +254,7 @@
1.30 if( sh4_use_translator ) {
1.31 xlat_flush_cache();
1.32 }
1.33 - int len = ((char *)&sh4r.pointer_cache) - ((char *)&sh4r);
1.34 - fread( &sh4r, len, 1, f );
1.35 - sh4_reset_pointer_cache();
1.36 + fread( &sh4r, sizeof(sh4r), 1, f );
1.37 MMU_load_state( f );
1.38 PMM_load_state( f );
1.39 INTC_load_state( f );
1.40 @@ -267,17 +262,6 @@
1.41 return SCIF_load_state( f );
1.42 }
1.43
1.44 -static void sh4_reset_pointer_cache()
1.45 -{
1.46 - int i;
1.47 - for( i=0; i<16; i++ ) {
1.48 - sh4r.pointer_cache[i].page_vma = -1;
1.49 - sh4r.pointer_cache[i].page_mask = 0xFFFFF000;
1.50 - }
1.51 - sh4r.pointer_cache[16].page_vma = -1;
1.52 - sh4r.pointer_cache[16].page_mask = 0xFFFFF000;
1.53 -}
1.54 -
1.55 void sh4_set_breakpoint( uint32_t pc, breakpoint_type_t type )
1.56 {
1.57 sh4_breakpoints[sh4_breakpoint_count].address = pc;
.