From 046e3244ce97ae892af8b6c5beb0752e87eb923e Mon Sep 17 00:00:00 2001 From: saxxonpike Date: Sun, 2 Dec 2012 15:10:37 +0000 Subject: [PATCH] commodore64: fix 6510 IO port input pin values --- BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs index 2cde96481a..9b01166682 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs @@ -43,7 +43,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS // configure data port defaults portDir = 0x00; - SetPortData(0x1F); + SetPortData(0x17); // todo: verify this value (I only know that unconnected bits fade after a number of cycles) unusedPinTTLCycles = 40; @@ -200,9 +200,9 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS pinCassetteButton = ((val & 0x10) != 0); pinCassetteMotor = ((val & 0x20) != 0); - pinLoram = ((val & 0x01) != 0); - pinHiram = ((val & 0x02) != 0); - pinCharen = ((val & 0x04) != 0); + pinLoram = ((val & 0x01) != 0) || ((portDir & 0x01) == 0); + pinHiram = ((val & 0x02) != 0) || ((portDir & 0x02) == 0); + pinCharen = ((val & 0x04) != 0) || ((portDir & 0x04) == 0); unusedPin0 = ((val & 0x40) != 0); unusedPin1 = ((val & 0x80) != 0); @@ -213,7 +213,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS private void SetPortDir(byte val) { portDir = val; - //SetPortData((byte)(PortData | ((byte)~val & 0x1F))); + SetPortData(PortData); } // ------------------------------------