USB: implement lifecycle callbacks

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-11-02 22:38:36 +01:00 committed by refractionpcsx2
parent e5a7cc4a1c
commit a6c67dde55
2 changed files with 8 additions and 0 deletions

View File

@ -29,6 +29,7 @@
#include "FW.h"
#include "SPU2/spu2.h"
#include "DEV9/DEV9.h"
#include "USB/USB.h"
#include "../DebugTools/MIPSAnalyst.h"
#include "../DebugTools/SymbolMap.h"
@ -96,6 +97,7 @@ void SysCoreThread::Start()
GetCorePlugins().Init();
SPU2init();
DEV9init();
USBinit();
_parent::Start();
}
@ -304,6 +306,7 @@ void SysCoreThread::OnSuspendInThread()
{
GetCorePlugins().Close();
DEV9close();
USBclose();
DoCDVDclose();
FWclose();
SPU2close();
@ -317,6 +320,7 @@ void SysCoreThread::OnResumeInThread(bool isSuspended)
FWopen();
SPU2open((void*)pDsp);
DEV9open((void*)pDsp);
USBopen((void*)pDsp);
}
@ -331,12 +335,14 @@ void SysCoreThread::OnCleanupInThread()
R3000A::ioman::reset();
// FIXME: temporary workaround for deadlock on exit, which actually should be a crash
vu1Thread.WaitVU();
USBclose();
SPU2close();
DEV9close();
DoCDVDclose();
FWclose();
GetCorePlugins().Close();
GetCorePlugins().Shutdown();
USBshutdown();
SPU2shutdown();
DEV9shutdown();

View File

@ -29,6 +29,7 @@
#include "CDVD/CDVD.h"
#include "SPU2/spu2.h"
#include "USB/USB.h"
#include "Elfheader.h"
#include "Patch.h"
#include "R5900Exceptions.h"
@ -171,6 +172,7 @@ void AppCoreThread::Resume()
GetCorePlugins().Init();
SPU2init();
USBinit();
_parent::Resume();
}