From ed5899f9a355ea6d309cc5383ddb2bbe7d92137f Mon Sep 17 00:00:00 2001 From: DiscoStarslayer Date: Mon, 13 Nov 2023 12:42:26 -0500 Subject: [PATCH] Fix ram size issues --- pcsx2/IopMem.cpp | 4 ++-- pcsx2/IopMem.h | 2 +- pcsx2/Memory.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsx2/IopMem.cpp b/pcsx2/IopMem.cpp index 71e2ed36a2876..a848112e113f6 100644 --- a/pcsx2/IopMem.cpp +++ b/pcsx2/IopMem.cpp @@ -66,10 +66,10 @@ void iopMemReset() // at 0x0, 0x8000, and 0xa000: for (int i=0; i<0x0080; i++) { - psxMemWLUT[i + 0x0000] = (uptr)&iopMem->Main[(i & 0x1f) << 16]; + psxMemWLUT[i + 0x0000] = (uptr)&iopMem->Main[(i & 0x7f) << 16]; // RLUTs, accessed through WLUT. - psxMemWLUT[i + 0x8000] = (uptr)&iopMem->Main[(i & 0x1f) << 16]; + psxMemWLUT[i + 0x8000] = (uptr)&iopMem->Main[(i & 0x7f) << 16]; } // A few single-page allocations for things we store in special locations. diff --git a/pcsx2/IopMem.h b/pcsx2/IopMem.h index 43550cd4452b7..ce17fb3079be1 100644 --- a/pcsx2/IopMem.h +++ b/pcsx2/IopMem.h @@ -47,7 +47,7 @@ static __fi const T* iopVirtMemR( u32 mem ) // Obtains a pointer to the IOP's physical mapping (bypasses the TLB) static __fi u8* iopPhysMem( u32 addr ) { - return &iopMem->Main[addr & 0x1fffff]; + return &iopMem->Main[addr & 0x7fffff]; } #define psxSs8(mem) iopMem->Sif[(mem) & 0x00ff] diff --git a/pcsx2/Memory.cpp b/pcsx2/Memory.cpp index 7628242f1ef70..4b1d5f359224e 100644 --- a/pcsx2/Memory.cpp +++ b/pcsx2/Memory.cpp @@ -146,7 +146,7 @@ void memMapPhy() // Main memory vtlb_MapBlock(eeMem->Main, 0x00000000,Ps2MemSize::MainRam);//mirrored on first 256 mb ? // High memory, uninstalled on the configuration we emulate - vtlb_MapBlock(eeMem->ExtraMemory, Ps2MemSize::ExtraRam, Ps2MemSize::ExtraRam); + vtlb_MapBlock(eeMem->ExtraMemory, 0x2000000, Ps2MemSize::ExtraRam); // Various ROMs (all read-only) vtlb_MapBlock(eeMem->ROM, 0x1fc00000, Ps2MemSize::Rom);