Core: Refactor code for shutting down internal PS2 components.

This commit is contained in:
Christian Kenny 2022-05-14 22:04:27 -04:00 committed by refractionpcsx2
parent d21c01f8d1
commit 7c9493cbc2
4 changed files with 8 additions and 11 deletions

View File

@ -18,7 +18,6 @@
#include "Hardware.h" #include "Hardware.h"
#include "newVif.h" #include "newVif.h"
#include "IPU/IPUdma.h"
#include "Gif_Unit.h" #include "Gif_Unit.h"
#include "SPU2/spu2.h" #include "SPU2/spu2.h"
@ -76,8 +75,8 @@ void hwReset()
vif0Reset(); vif0Reset();
vif1Reset(); vif1Reset();
gif_fifo.init(); gif_fifo.init();
// needed for legacy DMAC rcntInit();
ipuDmaReset();
} }
__fi uint intcInterrupt() __fi uint intcInterrupt()

View File

@ -75,6 +75,7 @@ void ipuReset()
ipu_fifo.init(); ipu_fifo.init();
ipu_cmd.clear(); ipu_cmd.clear();
ipuDmaReset();
} }
void ReportIPU() void ReportIPU()

View File

@ -101,10 +101,10 @@ void cpuReset()
EEsCycle = 0; EEsCycle = 0;
EEoCycle = cpuRegs.cycle; EEoCycle = cpuRegs.cycle;
pgifInit();
hwReset();
rcntInit();
psxReset(); psxReset();
pgifInit();
hwReset();
extern void Deci2Reset(); // lazy, no good header for it yet. extern void Deci2Reset(); // lazy, no good header for it yet.
Deci2Reset(); Deci2Reset();
@ -130,11 +130,6 @@ void cpuReset()
g_eeloadMain = 0, g_eeloadExec = 0, g_osdsys_str = 0; g_eeloadMain = 0, g_eeloadExec = 0, g_osdsys_str = 0;
} }
void cpuShutdown()
{
hwShutdown();
}
__ri void cpuException(u32 code, u32 bd) __ri void cpuException(u32 code, u32 bd)
{ {
bool errLevel2, checkStatus; bool errLevel2, checkStatus;

View File

@ -473,6 +473,8 @@ void SysMainMemory::DecommitAll()
// to the ring. Let's call it an extra safety valve :) // to the ring. Let's call it an extra safety valve :)
vu1Thread.Reset(); vu1Thread.Reset();
hwShutdown();
m_ee.Decommit(); m_ee.Decommit();
m_iop.Decommit(); m_iop.Decommit();
m_vu.Decommit(); m_vu.Decommit();