filename | src/sh4/sh4core.c |
changeset | 569:a1c49e1e8776 |
prev | 561:533f6b478071 |
next | 570:d2893980fbf5 |
author | nkeynes |
date | Fri Jan 04 11:54:17 2008 +0000 (16 years ago) |
branch | lxdream-mmu |
permissions | -rw-r--r-- |
last change | Bring icache partially into line with the mmu, a little less slow with AT off now. |
file | annotate | diff | log | raw |
1.1 --- a/src/sh4/sh4core.c Tue Jan 01 05:08:38 2008 +00001.2 +++ b/src/sh4/sh4core.c Fri Jan 04 11:54:17 2008 +00001.3 @@ -38,9 +38,6 @@1.5 /********************** SH4 Module Definition ****************************/1.7 -uint16_t *sh4_icache = NULL;1.8 -uint32_t sh4_icache_addr = 0;1.9 -1.10 uint32_t sh4_run_slice( uint32_t nanosecs )1.11 {1.12 int i;1.13 @@ -238,20 +235,13 @@1.15 /* Read instruction */1.16 uint32_t pageaddr = pc >> 12;1.17 - if( sh4_icache != NULL && pageaddr == sh4_icache_addr ) {1.18 - ir = sh4_icache[(pc&0xFFF)>>1];1.19 + if( !IS_IN_ICACHE(pc) ) {1.20 + mmu_update_icache(pc);1.21 + }1.22 + if( IS_IN_ICACHE(pc) ) {1.23 + ir = *(uint16_t *)GET_ICACHE_PTR(pc);1.24 } else {1.25 - sh4_icache = (uint16_t *)mem_get_page(pc);1.26 - if( ((uintptr_t)sh4_icache) < MAX_IO_REGIONS ) {1.27 - /* If someone's actually been so daft as to try to execute out of an IO1.28 - * region, fallback on the full-blown memory read1.29 - */1.30 - sh4_icache = NULL;1.31 - MEM_READ_WORD(pc, ir);1.32 - } else {1.33 - sh4_icache_addr = pageaddr;1.34 - ir = sh4_icache[(pc&0xFFF)>>1];1.35 - }1.36 + ir = sh4_read_word(pc);1.37 }1.38 switch( (ir&0xF000) >> 12 ) {1.39 case 0x0:
.