mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
move CartHomebrew init to reset, so it doesn't shit the bed if you change the config
This commit is contained in:
@ -1212,8 +1212,30 @@ u8 CartRetailBT::SPIWrite(u8 val, u32 pos, bool last)
|
|||||||
|
|
||||||
CartHomebrew::CartHomebrew(u8* rom, u32 len, u32 chipid) : CartCommon(rom, len, chipid)
|
CartHomebrew::CartHomebrew(u8* rom, u32 len, u32 chipid) : CartCommon(rom, len, chipid)
|
||||||
{
|
{
|
||||||
|
SD = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
CartHomebrew::~CartHomebrew()
|
||||||
|
{
|
||||||
|
if (SD)
|
||||||
|
{
|
||||||
|
SD->Close();
|
||||||
|
delete SD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CartHomebrew::Reset()
|
||||||
|
{
|
||||||
|
CartCommon::Reset();
|
||||||
|
|
||||||
ReadOnly = Platform::GetConfigBool(Platform::DLDI_ReadOnly);
|
ReadOnly = Platform::GetConfigBool(Platform::DLDI_ReadOnly);
|
||||||
|
|
||||||
|
if (SD)
|
||||||
|
{
|
||||||
|
SD->Close();
|
||||||
|
delete SD;
|
||||||
|
}
|
||||||
|
|
||||||
if (Platform::GetConfigBool(Platform::DLDI_Enable))
|
if (Platform::GetConfigBool(Platform::DLDI_Enable))
|
||||||
{
|
{
|
||||||
std::string folderpath;
|
std::string folderpath;
|
||||||
@ -1233,20 +1255,6 @@ CartHomebrew::CartHomebrew(u8* rom, u32 len, u32 chipid) : CartCommon(rom, len,
|
|||||||
SD = nullptr;
|
SD = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
CartHomebrew::~CartHomebrew()
|
|
||||||
{
|
|
||||||
if (SD)
|
|
||||||
{
|
|
||||||
SD->Close();
|
|
||||||
delete SD;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CartHomebrew::Reset()
|
|
||||||
{
|
|
||||||
CartCommon::Reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CartHomebrew::SetupDirectBoot(std::string romname)
|
void CartHomebrew::SetupDirectBoot(std::string romname)
|
||||||
{
|
{
|
||||||
CartCommon::SetupDirectBoot(romname);
|
CartCommon::SetupDirectBoot(romname);
|
||||||
|
Reference in New Issue
Block a user