diff --git a/Core/System.cpp b/Core/System.cpp index 6a005498d6..4af24e2ce3 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -116,6 +116,8 @@ void CPU_WaitStatus(bool (*pred)()) { cpuThreadLock.unlock(); } +void CPU_Shutdown(); + void CPU_Init() { currentCPU = &mipsr4k; numCPUs = 1; @@ -157,12 +159,7 @@ void CPU_Init() { // Why did we check for CORE_POWERDOWN here? if (!LoadFile(filename, &coreParameter.errorString)) { - pspFileSystem.Shutdown(); - CoreTiming::Shutdown(); - __KernelShutdown(); - HLEShutdown(); - host->ShutdownSound(); - Memory::Shutdown(); + CPU_Shutdown(); coreParameter.fileToStart = ""; CPU_SetState(CPU_THREAD_NOT_RUNNING); return; @@ -176,20 +173,18 @@ void CPU_Init() { } void CPU_Shutdown() { - pspFileSystem.Shutdown(); - - CoreTiming::Shutdown(); - if (g_Config.bAutoSaveSymbolMap) { host->SaveSymbolMap(); } + CoreTiming::Shutdown(); + __KernelShutdown(); + HLEShutdown(); if (coreParameter.enableSound) { host->ShutdownSound(); mixer = 0; // deleted in ShutdownSound } - __KernelShutdown(); - HLEShutdown(); + pspFileSystem.Shutdown(); Memory::Shutdown(); currentCPU = 0; }