summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\notaz_cp <SND\notaz_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-03-11 03:27:15 +0000
committerSND\notaz_cp <SND\notaz_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2013-03-11 03:27:15 +0000
commit71ed5539908c942efb0ce10d11290012fa11b62f (patch)
treeb44c51713b99d7297dd202402c3908e7b6106215 /libpcsxcore
parentd0c76b09e921ab68b61ac1c1de6feb071fe19637 (diff)
downloadpcsxr-71ed5539908c942efb0ce10d11290012fa11b62f.tar.gz
psxmem: handle io mirrors
tested on real hardware (ignoring missing fault emulation) fixes Star Wars - Episode I git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83441 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rwxr-xr-xlibpcsxcore/psxmem.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c
index 73f5bc76..194fd06d 100755
--- a/libpcsxcore/psxmem.c
+++ b/libpcsxcore/psxmem.c
@@ -148,8 +148,8 @@ u8 psxMemRead8(u32 mem) {
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
return psxHu8(mem);
else
return psxHwRead8(mem);
@@ -177,8 +177,8 @@ u16 psxMemRead16(u32 mem) {
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
return psxHu16(mem);
else
return psxHwRead16(mem);
@@ -206,8 +206,8 @@ u32 psxMemRead32(u32 mem) {
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
return psxHu32(mem);
else
return psxHwRead32(mem);
@@ -235,8 +235,8 @@ void psxMemWrite8(u32 mem, u8 value) {
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
psxHu8(mem) = value;
else
psxHwWrite8(mem, value);
@@ -266,8 +266,8 @@ void psxMemWrite16(u32 mem, u16 value) {
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
psxHu16ref(mem) = SWAPu16(value);
else
psxHwWrite16(mem, value);
@@ -298,8 +298,8 @@ void psxMemWrite32(u32 mem, u32 value) {
// if ((mem&0x1fffff) == 0x71E18 || value == 0x48088800) SysPrintf("t2fix!!\n");
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
psxHu32ref(mem) = SWAPu32(value);
else
psxHwWrite32(mem, value);
@@ -359,8 +359,8 @@ void *psxMemPointer(u32 mem) {
u32 t;
t = mem >> 16;
- if (t == 0x1f80) {
- if (mem < 0x1f801000)
+ if (t == 0x1f80 || t == 0x9f80 || t == 0xbf80) {
+ if ((mem & 0xffff) < 0x400)
return (void *)&psxH[mem];
else
return NULL;