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();