Skip to content

Commit

Permalink
Configure memory like PSX
Browse files Browse the repository at this point in the history
  • Loading branch information
DiscoStarslayer committed Nov 13, 2023
1 parent 78dbeba commit f09ce69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pcsx2/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_MapHandler(null_handler, Ps2MemSize::MainRam, 0x10000000 - Ps2MemSize::MainRam);
vtlb_MapBlock(eeMem->ExtraMemory, Ps2MemSize::ExtraRam, Ps2MemSize::ExtraRam);

// Various ROMs (all read-only)
vtlb_MapBlock(eeMem->ROM, 0x1fc00000, Ps2MemSize::Rom);
Expand Down
8 changes: 4 additions & 4 deletions pcsx2/MemoryTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

namespace Ps2MemSize
{
static constexpr u32 MainRam = _64mb; // 32 MB main memory.
static constexpr u32 ExtraRam = _1mb * 96; // 32+96 MB devkit memory.
static constexpr u32 MainRam = _32mb; // 32 MB main memory.
static constexpr u32 ExtraRam = _32mb; // 32+32 MB psx memory.
static constexpr u32 Rom = _1mb * 4; // 4 MB main rom
static constexpr u32 Rom1 = _1mb * 4; // DVD player
static constexpr u32 Rom2 = 0x00080000; // Chinese rom extension
static constexpr u32 Hardware = _64kb;
static constexpr u32 Scratch = _16kb;

static constexpr u32 IopRam = _1mb * 8; // 8MB main ram on the IOP.
static constexpr u32 IopRam = _1mb * 8; // 8MB main ram on the PSX IOP.
static constexpr u32 IopHardware = _64kb;

static const uint GSregs = 0x00002000; // 8k for the GS registers and stuff.
Expand Down Expand Up @@ -58,7 +58,7 @@ struct EEVM_MemoryAllocMess

struct IopVM_MemoryAllocMess
{
u8 Main[Ps2MemSize::IopRam]; // Main memory (hard-wired to 2MB)
u8 Main[Ps2MemSize::IopRam]; // Main memory (hard-wired to 8MB)
u8 P[_64kb]; // I really have no idea what this is... --air
u8 Sif[0x100]; // a few special SIF/SBUS registers (likely not needed)
};
Expand Down
8 changes: 4 additions & 4 deletions pcsx2/System.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ namespace HostMemoryMap
// Main
//////////////////////////////////////////////////////////////////////////

// PS2 main memory, SPR, and ROMs (approximately 138.5MB, but we round up to 139MB for simplicity).
// PS2 main memory, SPR, and ROMs (approximately 74.5MB, but we round up to 75MB for simplicity).
static constexpr u32 EEmemOffset = 0x00000000;
static constexpr u32 EEmemSize = 0x8B00000;
static constexpr u32 EEmemSize = 0x4B00000;

// IOP main memory (2MB + 64K + 256b, rounded up to 3MB for simplicity).
// IOP main memory (8MB + 64K + 256b, rounded up to 9MB for simplicity).
static constexpr u32 IOPmemOffset = EEmemOffset + EEmemSize;
static constexpr u32 IOPmemSize = 0x300000;
static constexpr u32 IOPmemSize = 0x900000;

// VU0 and VU1 memory (40KB, rounded up to 1MB for simplicity).
static constexpr u32 VUmemOffset = IOPmemOffset + IOPmemSize;
Expand Down

0 comments on commit f09ce69

Please sign in to comment.