From d3bebefcbce371d38f6bf16e2f9a02d8b3667b18 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Mon, 25 Oct 2021 07:10:04 -0700 Subject: [PATCH] [NDS] Don't try to check for null in an out of range array (#2979) I have no idea wtf I was thinking with this --- src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs index 4f680b09eb..cd3da45639 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/NDS/MelonDS.cs @@ -38,6 +38,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS } bool gbacartpresent = roms.Count > 1; + bool gbasrampresent = roms.Count == 3; _tracecb = MakeTrace; @@ -96,7 +97,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS if (gbacartpresent) { _exe.AddReadonlyFile(roms[1], "gba.rom"); - if (roms[2] != null) + if (gbasrampresent) { _exe.AddReadonlyFile(roms[2], "gba.ram"); } @@ -135,7 +136,7 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.NDS if (gbacartpresent) { _exe.RemoveReadonlyFile("gba.rom"); - if (roms[2] != null) + if (gbasrampresent) { _exe.RemoveReadonlyFile("gba.ram"); }