From bcbc588e05ea80e716092513acb4705c3f72034a Mon Sep 17 00:00:00 2001 From: scrimpeh Date: Mon, 6 Jul 2015 22:09:18 +0200 Subject: [PATCH] Apple II - Fix Memory and Input Callbacks interacting with savestates --- .../Computers/AppleII/AppleII.ISettable.cs | 3 +++ .../Computers/AppleII/AppleII.cs | 16 ++++++++++------ ExternalCoreProjects/Virtu/Machine.cs | 12 ++++++------ References/Virtu.dll | Bin 173056 -> 173056 bytes 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISettable.cs b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISettable.cs index 91b1e5d31f..a1bd7be8e4 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISettable.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.ISettable.cs @@ -37,6 +37,9 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII { _settings = o; _machine.Video.IsMonochrome = _settings.Monochrome; + + setCallbacks(); + return false; } diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs index 21b57a5d99..cad6c19f38 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs @@ -54,12 +54,7 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII ser.Register(Tracer); - //Set up Memory Callbacks - _machine.Memory.ReadCallback = MemoryCallbacks.CallReads; - _machine.Memory.WriteCallback = MemoryCallbacks.CallWrites; - _machine.Memory.ExecuteCallback = MemoryCallbacks.CallExecutes; - - _machine.Memory.InputCallback = InputCallbacks.Call; + setCallbacks(); InitSaveStates(); SetupMemoryDomains(); @@ -180,5 +175,14 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII Frame++; } + + private void setCallbacks() + { + _machine.Memory.ReadCallback = MemoryCallbacks.CallReads; + _machine.Memory.WriteCallback = MemoryCallbacks.CallWrites; + _machine.Memory.ExecuteCallback = MemoryCallbacks.CallExecutes; + _machine.Memory.InputCallback = InputCallbacks.Call; + } + } } diff --git a/ExternalCoreProjects/Virtu/Machine.cs b/ExternalCoreProjects/Virtu/Machine.cs index 24c5b64b0f..c8ed15e4ca 100644 --- a/ExternalCoreProjects/Virtu/Machine.cs +++ b/ExternalCoreProjects/Virtu/Machine.cs @@ -83,7 +83,6 @@ namespace Jellyfish.Virtu } } - public void BizInitialize() { Initialize(); @@ -139,11 +138,12 @@ namespace Jellyfish.Virtu }; ser.Converters.Add(new TypeTypeConverter(new[] - { - // all expected Types to convert are either in this assembly or mscorlib - typeof(Machine).Assembly, - typeof(object).Assembly - })); + { + // all expected Types to convert are either in this assembly or mscorlib + typeof(Machine).Assembly, + typeof(object).Assembly + })); + ser.Converters.Add(new DelegateConverter()); ser.Converters.Add(new ArrayConverter()); diff --git a/References/Virtu.dll b/References/Virtu.dll index bcea43dda8bab8f1e135109d3704691ea9e1ec26..77c0260f55840be4702205a15502dd6ffa335abc 100644 GIT binary patch delta 109 zcmZoT!PRhrYeEOpllzTbtzC>;yO_?WtD2fSIlDMHo9Y@G8(Qd^m^qs0T38qu>YBN@ znY)@fnFFC&?eu_RCh6@nGnmdR2pqk=CtN~!iCYI_?)PWgw{P2C(aH2g5NPQ1xYvfAQ1301d`}8_)W7~Ns+N(qv^MJi2~#i0#MVJ PUYi0c0UfuAn*w(T4j(4A