convert SPU to OOP

This commit is contained in:
Arisotura
2023-11-04 14:20:58 +01:00
parent ac38faef14
commit 76976fef30
8 changed files with 216 additions and 202 deletions

View File

@ -533,7 +533,11 @@ SPIHost::SPIHost()
Devices[SPIDevice_FirmwareMem] = new FirmwareMem(this);
Devices[SPIDevice_PowerMan] = new PowerMan(this);
Devices[SPIDevice_TSC] = nullptr;
if (NDS::ConsoleType == 1)
Devices[SPIDevice_TSC] = new DSi_TSC(this);
else
Devices[SPIDevice_TSC] = new TSC(this);
}
SPIHost::~SPIHost()
@ -553,14 +557,6 @@ void SPIHost::Reset()
{
Cnt = 0;
if (Devices[SPIDevice_TSC])
delete Devices[SPIDevice_TSC];
if (NDS::ConsoleType == 1)
Devices[SPIDevice_TSC] = new DSi_TSC(this);
else
Devices[SPIDevice_TSC] = new TSC(this);
for (int i = 0; i < SPIDevice_MAX; i++)
{
Devices[i]->Reset();