Search
lxdream.org :: lxdream/src/sh4/sh4core.in :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/sh4/sh4core.in
changeset 569:a1c49e1e8776
prev561:533f6b478071
next570:d2893980fbf5
author nkeynes
date Fri Jan 04 11:54:17 2008 +0000 (12 years ago)
branchlxdream-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.in Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/sh4/sh4core.in Fri Jan 04 11:54:17 2008 +0000
1.3 @@ -38,9 +38,6 @@
1.4
1.5 /********************** SH4 Module Definition ****************************/
1.6
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.14
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 IO
1.28 - * region, fallback on the full-blown memory read
1.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 %%
1.39 AND Rm, Rn {: sh4r.r[Rn] &= sh4r.r[Rm]; :}
.