From a76ea9c5207e163869f978e7ced7f4ba5f3e4532 Mon Sep 17 00:00:00 2001 From: beirich Date: Sun, 4 Mar 2012 19:37:00 +0000 Subject: [PATCH] pce: fix a crash when a HuCard accessing invalid addresses would venture into TurboCD ports (namely, Rastan Saga) --- BizHawk.Emulation/Consoles/PC Engine/TurboCD.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BizHawk.Emulation/Consoles/PC Engine/TurboCD.cs b/BizHawk.Emulation/Consoles/PC Engine/TurboCD.cs index 294582ef47..ed65d9e8b9 100644 --- a/BizHawk.Emulation/Consoles/PC Engine/TurboCD.cs +++ b/BizHawk.Emulation/Consoles/PC Engine/TurboCD.cs @@ -43,6 +43,9 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx void WriteCD(int addr, byte value) { + if (!TurboCD && !BramEnabled) + return; // flee if no turboCD hooked up + switch (addr & 0x1FFF) { case 0x1800: // SCSI Drive Control Line @@ -184,6 +187,9 @@ namespace BizHawk.Emulation.Consoles.TurboGrafx public byte ReadCD(int addr) { + if (!TurboCD && !BramEnabled) + return 0xFF; //bail if no TurboCD. + byte returnValue = 0; short sample;