From 8695ce07a4c54da5065708add897252fb3fdf9e9 Mon Sep 17 00:00:00 2001 From: saxxonpike Date: Fri, 9 Aug 2013 04:15:33 +0000 Subject: [PATCH] Commodore64: Disable disk emulation (for now.) --- .../Computers/Commodore64/C64.Core.cs | 2 +- BizHawk.Emulation/Computers/Commodore64/C64.cs | 2 +- .../Computers/Commodore64/MOS/MOS6510.cs | 15 +++++++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs b/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs index 83d9639687..0531c7b8f2 100644 --- a/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs +++ b/BizHawk.Emulation/Computers/Commodore64/C64.Core.cs @@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Computers.Commodore64 byte[] diskRom = File.ReadAllBytes(diskPath); disk = new VIC1541(initRegion, diskRom); - disk.Connect(board.serPort); + //disk.Connect(board.serPort); } private void InitMedia() diff --git a/BizHawk.Emulation/Computers/Commodore64/C64.cs b/BizHawk.Emulation/Computers/Commodore64/C64.cs index 54d0f2be2d..05e1b622dd 100644 --- a/BizHawk.Emulation/Computers/Commodore64/C64.cs +++ b/BizHawk.Emulation/Computers/Commodore64/C64.cs @@ -111,7 +111,7 @@ namespace BizHawk.Emulation.Computers.Commodore64 board.PollInput(); for (uint count = cyclesPerFrame; count > 0; count--) { - disk.Execute(); + //disk.Execute(); board.Execute(); } _islag = !board.inputRead; diff --git a/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs b/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs index 3b95c6872a..0882b0c60c 100644 --- a/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs +++ b/BizHawk.Emulation/Computers/Commodore64/MOS/MOS6510.cs @@ -1,5 +1,7 @@ using BizHawk.Emulation.CPUs.M6502; using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; namespace BizHawk.Emulation.Computers.Commodore64.MOS { @@ -9,7 +11,8 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS { // ------------------------------------ - private MOS6502X cpu; + private MOS6502X cpu; + private List disposeList = new List(); private bool freezeCpu; private bool pinCassetteButton; // note: these are only private bool pinCassetteMotor; // latches! @@ -41,7 +44,7 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS public MOS6510() { - cpu = new MOS6502X(); + cpu = new MOS6502X(); // configure cpu r/w cpu.DummyReadMemory = Read; @@ -61,6 +64,14 @@ namespace BizHawk.Emulation.Computers.Commodore64.MOS pinNMILast = true; } + ~MOS6510() + { + foreach (GCHandle handle in disposeList) + { + handle.Free(); + } + } + public void HardReset() { cpu.Reset();