force real bios file usage if an encrypted DS rom is used

This commit is contained in:
CasualPokePlayer 2024-10-18 13:46:25 -07:00
parent 64d55404ba
commit 593e7c125b
1 changed files with 11 additions and 0 deletions
src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS

View File

@ -190,6 +190,17 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS
_activeSyncSettings.UseRealBIOS |= IsDSi;
if (!_activeSyncSettings.UseRealBIOS)
{
// check if the user is using an encrypted rom
// if they are, they need to be using real bios files
Span<byte> decryptedBytePattern = stackalloc byte[] { 0xFF, 0xDE, 0xFF, 0xE7, 0xFF, 0xDE, 0xFF, 0xE7 };
if (!roms[0].AsSpan(0x4000, 8).SequenceEqual(decryptedBytePattern))
{
_activeSyncSettings.UseRealBIOS = true;
}
}
byte[] bios9 = null, bios7 = null, firmware = null;
if (_activeSyncSettings.UseRealBIOS)
{