explicitly eject the cart before a load with reset, preventing a spurious cart-eject IRQ on startup
also fix possible KEY1 issues when using internal BIOS
This commit is contained in:
parent
e665e25bd3
commit
80564ba947
|
@ -137,13 +137,21 @@ void Key1_LoadKeyBuf(bool dsi)
|
||||||
// it is possible that this gets called before the BIOSes are loaded
|
// it is possible that this gets called before the BIOSes are loaded
|
||||||
// so we will read from the BIOS files directly
|
// so we will read from the BIOS files directly
|
||||||
|
|
||||||
std::string path = Platform::GetConfigString(dsi ? Platform::DSi_BIOS7Path : Platform::BIOS7Path);
|
if (Platform::GetConfigBool(Platform::ExternalBIOSEnable))
|
||||||
FILE* f = Platform::OpenLocalFile(path, "rb");
|
|
||||||
if (f)
|
|
||||||
{
|
{
|
||||||
fseek(f, dsi ? 0xC6D0 : 0x0030, SEEK_SET);
|
std::string path = Platform::GetConfigString(dsi ? Platform::DSi_BIOS7Path : Platform::BIOS7Path);
|
||||||
fread(Key1_KeyBuf, 0x1048, 1, f);
|
FILE* f = Platform::OpenLocalFile(path, "rb");
|
||||||
fclose(f);
|
if (f)
|
||||||
|
{
|
||||||
|
fseek(f, dsi ? 0xC6D0 : 0x0030, SEEK_SET);
|
||||||
|
fread(Key1_KeyBuf, 0x1048, 1, f);
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// well
|
||||||
|
memset(Key1_KeyBuf, 0, 0x1048);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -535,6 +535,7 @@ bool LoadROM(QStringList filepath, bool reset)
|
||||||
if (reset)
|
if (reset)
|
||||||
{
|
{
|
||||||
NDS::SetConsoleType(Config::ConsoleType);
|
NDS::SetConsoleType(Config::ConsoleType);
|
||||||
|
NDS::EjectCart();
|
||||||
NDS::Reset();
|
NDS::Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue