aboutsummaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authornotaz2011-10-24 02:37:35 +0300
committernotaz2011-10-30 23:48:08 +0200
commitd25604ca7b315121ec12f00d042ee87e4a0f3ecb (patch)
tree2aab1623a1cf5dbb2a8795c095e5ff46e2db858c /libpcsxcore
parent59fb0bb456b51f5385a2e0b8b4cd8c043595b15d (diff)
downloadpcsx_rearmed-d25604ca7b315121ec12f00d042ee87e4a0f3ecb.tar.gz
pcsx_rearmed-d25604ca7b315121ec12f00d042ee87e4a0f3ecb.tar.bz2
pcsx_rearmed-d25604ca7b315121ec12f00d042ee87e4a0f3ecb.zip
drc: always use physical block addresses
there is no reason to use virtual addressing, things can't be remapped on PSX as there is no MMU anyway. Fixes somewhat related invalidation bug along the way.
Diffstat (limited to 'libpcsxcore')
-rw-r--r--libpcsxcore/new_dynarec/new_dynarec.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c
index 4b70f33..05c83c0 100644
--- a/libpcsxcore/new_dynarec/new_dynarec.c
+++ b/libpcsxcore/new_dynarec/new_dynarec.c
@@ -343,6 +343,7 @@ static u_int get_page(u_int vaddr)
return page;
}
+#ifndef PCSX
static u_int get_vpage(u_int vaddr)
{
u_int vpage=(vaddr^0x80000000)>>12;
@@ -352,6 +353,13 @@ static u_int get_vpage(u_int vaddr)
if(vpage>2048) vpage=2048+(vpage&2047);
return vpage;
}
+#else
+// no virtual mem in PCSX
+static u_int get_vpage(u_int vaddr)
+{
+ return get_page(vaddr);
+}
+#endif
// Get address from virtual address
// This is called from the recompiled JR/JALR instructions
@@ -1226,7 +1234,7 @@ void invalidate_addr(u_int addr)
//static int rhits;
// this check is done by the caller
//if (inv_code_start<=addr&&addr<=inv_code_end) { rhits++; return; }
- u_int page=get_page(addr);
+ u_int page=get_vpage(addr);
if(page<2048) { // RAM
struct ll_entry *head;
u_int addr_min=~0, addr_max=0;
@@ -1265,11 +1273,9 @@ void invalidate_addr(u_int addr)
return;
}
else {
- inv_debug("INV ADDR: %08x miss, inv %08x-%08x, sk %d\n", addr, inv_code_start, inv_code_end, 0);//rhits);
- }
- //rhits=0;
- if(page!=0) // FIXME: don't know what's up with page 0 (Klonoa)
+ inv_debug("INV ADDR: %08x miss, inv %08x-%08x, sk %d\n", addr, inv_code_start, inv_code_end, 0);
return;
+ }
}
#endif
invalidate_block(addr>>12);