Bios: add support for Rom2 up to 4Mb

This commit is contained in:
AKuHAK 2024-07-17 14:28:15 +03:00 committed by Ty
parent dfb857b68f
commit a2a711b1b3
3 changed files with 16 additions and 16 deletions

View File

@ -39,18 +39,18 @@ void iopMemRelease()
// which is performed by MemInit and PsxMemInit()
void iopMemReset()
{
pxAssert( iopMem );
pxAssert(iopMem);
DbgCon.WriteLn("IOP resetting main memory...");
memset(psxMemWLUT, 0, 0x2000 * sizeof(uptr) * 2); // clears both allocations, RLUT and WLUT
memset(psxMemWLUT, 0, 0x2000 * sizeof(uptr) * 2); // clears both allocations, RLUT and WLUT
// Trick! We're accessing RLUT here through WLUT, since it's the non-const pointer.
// So the ones with a 0x2000 prefixed are RLUT tables.
// Map IOP main memory, which is Read/Write, and mirrored three times
// at 0x0, 0x8000, and 0xa000:
for (int i=0; i<0x0080; i++)
for (int i = 0; i < 0x0080; i++)
{
psxMemWLUT[i + 0x0000] = (uptr)&iopMem->Main[(i & 0x1f) << 16];
@ -78,7 +78,7 @@ void iopMemReset()
psxMemWLUT[i + 0x2000 + 0x1e00] = (uptr)&eeMem->ROM1[i << 16];
}
for (int i = 0; i < 0x0008; i++)
for (int i = 0; i < 0x0040; i++)
{
psxMemWLUT[i + 0x2000 + 0x1e40] = (uptr)&eeMem->ROM2[i << 16];
}
@ -318,7 +318,7 @@ void iopMemWrite16(u32 mem, u16 value)
default:
psxHu16(mem) = value;
break;
break;
}
} else
{
@ -443,7 +443,7 @@ void iopMemWrite32(u32 mem, u32 value)
case 0x60:
psHu32(SBUS_F260) = 0;
return;
return;
}
#if PSX_EXTRALOGS
@ -529,11 +529,11 @@ bool iopMemSafeWriteBytes(u32 mem, const void* src, u32 size)
std::string iopMemReadString(u32 mem, int maxlen)
{
std::string ret;
char c;
std::string ret;
char c;
while ((c = iopMemRead8(mem++)) && maxlen--)
ret.push_back(c);
while ((c = iopMemRead8(mem++)) && maxlen--)
ret.push_back(c);
return ret;
return ret;
}

View File

@ -11,7 +11,7 @@ namespace Ps2MemSize
static constexpr u32 TotalRam = _1mb * 128;// 128 MB total 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 Rom2 = _1mb * 4; // Chinese rom extension
static constexpr u32 Hardware = _64kb;
static constexpr u32 Scratch = _16kb;

View File

@ -548,7 +548,7 @@ static void recReserveRAM()
recLUT_SetPage(recLUT, hwLUT, recROM1, 0xa000, i, i - 0x1e00);
}
for (int i = 0x1e40; i < 0x1e48; i++)
for (int i = 0x1e40; i < 0x1e80; i++)
{
recLUT_SetPage(recLUT, hwLUT, recROM2, 0x0000, i, i - 0x1e40);
recLUT_SetPage(recLUT, hwLUT, recROM2, 0x8000, i, i - 0x1e40);
@ -691,7 +691,7 @@ static void recExecute()
if (!fastjmp_set(&m_SetJmp_StateCheck))
{
eeCpuExecuting = true;
((void(*)())EnterRecompiledCode)();
((void (*)())EnterRecompiledCode)();
// Generally unreachable code here ...
}
@ -1544,7 +1544,7 @@ void dynarecMemcheck(size_t i)
auto mc = CBreakPoints::GetMemChecks(BREAKPOINT_EE)[i];
if(mc.hasCond)
if (mc.hasCond)
{
if (!mc.cond.Evaluate())
return;