get this started: refactor SPI in OOP

This commit is contained in:
Arisotura
2023-11-03 20:17:00 +01:00
parent 70c6750561
commit 440b356674
17 changed files with 855 additions and 846 deletions

View File

@ -180,7 +180,6 @@ void DeInit()
void Reset()
{
using namespace SPI_Firmware;
memset(RAM, 0, 0x2000);
memset(IO, 0, 0x1000);
@ -220,15 +219,17 @@ void Reset()
}
#undef BBREG_FIXED
RFVersion = GetFirmware()->Header().RFChipType;
const Firmware* fw = NDS::SPI->GetFirmware();
RFVersion = fw->GetHeader().RFChipType;
memset(RFRegs, 0, 4*0x40);
FirmwareConsoleType console = GetFirmware()->Header().ConsoleType;
if (console == FirmwareConsoleType::DS)
Firmware::FirmwareConsoleType console = fw->GetHeader().ConsoleType;
if (console == Firmware::FirmwareConsoleType::DS)
IOPORT(0x000) = 0x1440;
else if (console == FirmwareConsoleType::DSLite)
else if (console == Firmware::FirmwareConsoleType::DSLite)
IOPORT(0x000) = 0xC340;
else if (NDS::ConsoleType == 1 && console == FirmwareConsoleType::DSi)
else if (NDS::ConsoleType == 1 && console == Firmware::FirmwareConsoleType::DSi)
IOPORT(0x000) = 0xC340; // DSi has the modern DS-wifi variant
else
{