X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=libpcsxcore%2Fpsxmem.c;h=46cee0cab0d9ef710bc1b7d49353dbf5a315cf95;hb=cdc2da64d4c55a97c4507b6c9389bf4dca04695b;hp=61b14c6550b651eeda5d8000e7456a1dbfe8fa44;hpb=fa18abb20fe2316f078023ddec6068bafef86014;p=pcsx_rearmed.git diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 61b14c65..46cee0ca 100644 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -27,7 +27,8 @@ #include "psxmem_map.h" #include "r3000a.h" #include "psxhw.h" -#include "debug.h" +//#include "debug.h" +#define DebugCheckBP(...) #include "memmap.h" @@ -136,10 +137,8 @@ int psxMemInit() { memset(psxMemWLUT, 0, 0x10000 * sizeof(void *)); psxM = psxMap(0x80000000, 0x00210000, 1, MAP_TAG_RAM); -#ifndef RAM_FIXED if (psxM == NULL) psxM = psxMap(0x77000000, 0x00210000, 0, MAP_TAG_RAM); -#endif if (psxM == NULL) { SysMessage(_("mapping main RAM failed")); return -1; @@ -240,7 +239,7 @@ u8 psxMemRead8(u32 mem) { #ifdef PSXMEM_LOG PSXMEM_LOG("err lb %8.8lx\n", mem); #endif - return 0; + return 0xFF; } } } @@ -265,7 +264,7 @@ u16 psxMemRead16(u32 mem) { #ifdef PSXMEM_LOG PSXMEM_LOG("err lh %8.8lx\n", mem); #endif - return 0; + return 0xFFFF; } } } @@ -290,7 +289,7 @@ u32 psxMemRead32(u32 mem) { #ifdef PSXMEM_LOG if (writeok) { PSXMEM_LOG("err lw %8.8lx\n", mem); } #endif - return 0; + return 0xFFFFFFFF; } } } @@ -389,6 +388,8 @@ void psxMemWrite32(u32 mem, u32 value) { memset(psxMemWLUT + 0x0000, 0, 0x80 * sizeof(void *)); memset(psxMemWLUT + 0x8000, 0, 0x80 * sizeof(void *)); memset(psxMemWLUT + 0xa000, 0, 0x80 * sizeof(void *)); + /* Required for icache interpreter otherwise Armored Core won't boot on icache interpreter */ + psxCpu->Notify(R3000ACPU_NOTIFY_CACHE_ISOLATED, NULL); break; case 0x00: case 0x1e988: if (writeok == 1) break; @@ -396,6 +397,8 @@ void psxMemWrite32(u32 mem, u32 value) { for (i = 0; i < 0x80; i++) psxMemWLUT[i + 0x0000] = (void *)&psxM[(i & 0x1f) << 16]; memcpy(psxMemWLUT + 0x8000, psxMemWLUT, 0x80 * sizeof(void *)); memcpy(psxMemWLUT + 0xa000, psxMemWLUT, 0x80 * sizeof(void *)); + /* Dynarecs might take this opportunity to flush their code cache */ + psxCpu->Notify(R3000ACPU_NOTIFY_CACHE_UNISOLATED, NULL); break; default: #ifdef PSXMEM_LOG