[Project64] Allow rdram to be at fixed address
This commit is contained in:
parent
7da3180fb6
commit
c6b350720a
|
@ -48,10 +48,10 @@ static bool TranslateToMemProtect(int OsMemProtection, MEM_PROTECTION & memProte
|
|||
}
|
||||
#endif
|
||||
|
||||
void* AllocateAddressSpace(size_t size)
|
||||
void* AllocateAddressSpace(size_t size, void * base_address)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return VirtualAlloc(NULL, size, MEM_RESERVE | MEM_TOP_DOWN, PAGE_NOACCESS);
|
||||
return VirtualAlloc(base_address, size, MEM_RESERVE | MEM_TOP_DOWN, PAGE_NOACCESS);
|
||||
#else
|
||||
void * ptr = mmap((void*)0, size, PROT_NONE, MAP_PRIVATE | MAP_ANON, -1, 0);
|
||||
if (ptr == MAP_FAILED)
|
||||
|
|
|
@ -8,7 +8,7 @@ enum MEM_PROTECTION
|
|||
MEM_EXECUTE_READWRITE,
|
||||
};
|
||||
|
||||
void* AllocateAddressSpace(size_t size);
|
||||
void* AllocateAddressSpace(size_t size, void * base_address = 0);
|
||||
bool FreeAddressSpace(void* addr, size_t size);
|
||||
void* CommitMemory(void* addr, size_t size, MEM_PROTECTION memProtection);
|
||||
bool DecommitMemory(void* addr, size_t size);
|
||||
|
|
|
@ -110,7 +110,7 @@ void CMipsMemoryVM::Reset(bool /*EraseMemory*/)
|
|||
|
||||
void CMipsMemoryVM::ReserveMemory()
|
||||
{
|
||||
m_Reserve1 = (uint8_t *)AllocateAddressSpace(0x20000000);
|
||||
m_Reserve1 = (uint8_t *)AllocateAddressSpace(0x20000000, (void *)g_Settings->LoadDword(Setting_FixedRdramAddress));
|
||||
m_Reserve2 = (uint8_t *)AllocateAddressSpace(0x04002000);
|
||||
}
|
||||
|
||||
|
@ -642,7 +642,7 @@ bool CMipsMemoryVM::LB_NonMemory(uint32_t PAddr, uint32_t* Value, bool /*SignExt
|
|||
// break;
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool CMipsMemoryVM::LH_NonMemory(uint32_t PAddr, uint32_t* Value, bool/* SignExtend*/)
|
||||
{
|
||||
|
@ -711,7 +711,7 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t PAddr, uint32_t* Value)
|
|||
}
|
||||
*Value = m_MemLookupValue.UW[0];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool CMipsMemoryVM::SB_NonMemory(uint32_t PAddr, uint8_t Value)
|
||||
{
|
||||
|
@ -813,7 +813,7 @@ bool CMipsMemoryVM::SW_NonMemory(uint32_t PAddr, uint32_t Value)
|
|||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (PAddr & 0xFFF00000)
|
||||
{
|
||||
|
@ -872,7 +872,7 @@ bool CMipsMemoryVM::SW_NonMemory(uint32_t PAddr, uint32_t Value)
|
|||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
void CMipsMemoryVM::UpdateHalfLine()
|
||||
{
|
||||
|
|
|
@ -48,7 +48,8 @@ enum SettingID
|
|||
Setting_AutoStart,
|
||||
Setting_CheckEmuRunning,
|
||||
Setting_EraseGameDefaults,
|
||||
Setting_ForceInterpreterCPU,
|
||||
Setting_ForceInterpreterCPU,
|
||||
Setting_FixedRdramAddress,
|
||||
|
||||
Setting_AutoZipInstantSave,
|
||||
Setting_RememberCheats,
|
||||
|
|
|
@ -113,7 +113,7 @@ void CSettings::AddHowToHandleSetting(const char * BaseDirectory)
|
|||
AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("", "Erase on default", (uint32_t)true));
|
||||
AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("", "Check Running", (uint32_t)true));
|
||||
AddHandler(Setting_ForceInterpreterCPU, new CSettingTypeApplication("", "Force Interpreter CPU", false));
|
||||
|
||||
AddHandler(Setting_FixedRdramAddress, new CSettingTypeApplication("", "Fixed Rdram Address", (uint32_t)0));
|
||||
|
||||
AddHandler(Setting_RememberCheats, new CSettingTypeApplication("", "Remember Cheats", (uint32_t)false));
|
||||
#ifdef ANDROID
|
||||
|
@ -1279,4 +1279,4 @@ void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFu
|
|||
{
|
||||
g_Notify->BreakPoint(__FILE__, __LINE__);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue