Properly init/deinit the GBA slot

This commit is contained in:
Raphaël Zumer 2019-12-08 15:30:56 -05:00
parent d86ee1d5bf
commit 968768042e
2 changed files with 18 additions and 0 deletions

View File

@ -170,6 +170,7 @@ bool Init()
IPCFIFO7 = new FIFO<u32>(16);
if (!NDSCart::Init()) return false;
if (!GBACart::Init()) return false;
if (!GPU::Init()) return false;
if (!SPU::Init()) return false;
if (!SPI::Init()) return false;
@ -191,6 +192,7 @@ void DeInit()
delete IPCFIFO7;
NDSCart::DeInit();
GBACart::DeInit();
GPU::DeInit();
SPU::DeInit();
SPI::DeInit();
@ -492,6 +494,7 @@ void Reset()
RCnt = 0;
NDSCart::Reset();
GBACart::Reset();
GPU::Reset();
SPU::Reset();
SPI::Reset();
@ -693,6 +696,7 @@ bool DoSavestate(Savestate* file)
ARM7->DoSavestate(file);
NDSCart::DoSavestate(file);
GBACart::DoSavestate(file);
GPU::DoSavestate(file);
SPU::DoSavestate(file);
SPI::DoSavestate(file);
@ -721,6 +725,19 @@ bool LoadROM(const char* path, const char* sram, bool direct)
}
}
bool LoadGBAROM(const char* path, const char* sram)
{
if (GBACart::LoadROM(path, sram))
{
return true;
}
else
{
printf("Failed to load ROM %s\n", path);
return false;
}
}
void LoadBIOS()
{
Reset();

View File

@ -135,6 +135,7 @@ void SetARM9RegionTimings(u32 addrstart, u32 addrend, int buswidth, int nonseq,
void SetARM7RegionTimings(u32 addrstart, u32 addrend, int buswidth, int nonseq, int seq);
bool LoadROM(const char* path, const char* sram, bool direct);
bool LoadGBAROM(const char* path, const char* sram);
void LoadBIOS();
void SetupDirectBoot();
void RelocateSave(const char* path, bool write);