Skip to content

Commit

Permalink
EE: Move memSetExtraMemMode call to VMManager
Browse files Browse the repository at this point in the history
  • Loading branch information
DaZombieKiller committed Apr 21, 2024
1 parent 33a812c commit f437aa4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
3 changes: 0 additions & 3 deletions pcsx2/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1134,9 +1134,6 @@ void memReset()
//vtlb_VMap(0x00000000,0x00000000,0x20000000);
//vtlb_VMapUnmap(0x20000000,0x60000000);

// update extra memory mode before memory is mapped
memSetExtraMemMode(EmuConfig.Cpu.ExtraMemory);

memMapPhy();
memMapVUmicro();
memMapKernelMem();
Expand Down
10 changes: 2 additions & 8 deletions pcsx2/VMManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ bool VMManager::Initialize(VMBootParameters boot_params)

s_cpu_implementation_changed = false;
UpdateCPUImplementations();
memSetExtraMemMode(EmuConfig.Cpu.ExtraMemory);
Internal::ClearCPUExecutionCaches();
FPControlRegister::SetCurrent(EmuConfig.Cpu.FPUFPCR);
memBindConditionalHandlers();
Expand Down Expand Up @@ -1616,6 +1617,7 @@ void VMManager::Reset()
if (elf_was_changed)
HandleELFChange(false);

memSetExtraMemMode(EmuConfig.Cpu.ExtraMemory);
Internal::ClearCPUExecutionCaches();
memBindConditionalHandlers();
SysMemory::Reset();
Expand Down Expand Up @@ -2611,14 +2613,6 @@ void VMManager::Internal::ELFLoadingOnCPUThread(std::string elf_path)
Patch::ReloadPatches(s_disc_serial, 0, false, false, false, true);
ApplyCoreSettings();
}

if (CHECK_EXTRAMEM)
{
// If we're using extra memory, we might need to reallocate CPU memory.
// This must be done here to ensure there is enough RAM to load the ELF,
// because it may have segments that will be mapped into high memory.
Cpu->Reset();
}
}

void VMManager::Internal::EntryPointCompilingOnCPUThread()
Expand Down

0 comments on commit f437aa4

Please sign in to comment.