Skip to content

Commit

Permalink
force real bios file usage if an encrypted DS rom is used
Browse files Browse the repository at this point in the history
  • Loading branch information
CasualPokePlayer committed Oct 18, 2024
1 parent 64d5540 commit 593e7c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ public NDS(CoreLoadParameters<NDSSettings, NDSSyncSettings> lp)

_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)
{
Expand Down

0 comments on commit 593e7c1

Please sign in to comment.