NES: disconnect some bitrotted code for an alternate 6502 core

This commit is contained in:
goyuken 2014-07-30 16:33:48 +00:00
parent 8bad959f84
commit 9609bf1601
3 changed files with 10 additions and 21 deletions

View File

@ -7,7 +7,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
{
public sealed partial class MOS6502X
{
public MOS6502X(Action<System.Runtime.InteropServices.GCHandle> DisposeBuilder = null)
public MOS6502X()
{
InitOpcodeHandlers();
Reset();
@ -188,8 +188,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
Func<ushort, byte> ReadMemory,
Func<ushort, byte> DummyReadMemory,
Func<ushort, byte> PeekMemory,
Action<ushort, byte> WriteMemory,
Action<System.Runtime.InteropServices.GCHandle> DisposeBuilder
Action<ushort, byte> WriteMemory
)
{
this.ReadMemory = ReadMemory;

View File

@ -10,12 +10,13 @@ namespace BizHawk.Emulation.Cores.Components.M6502
/// maintains a managed 6502X and an unmanaged 6502X, running them alongside and ensuring consistency
/// by taking savestates every cycle (!). slow.
/// </summary>
/*
public class MOS6502XDouble
{
readonly MOS6502X m;
readonly MOS6502X_CPP n;
public MOS6502XDouble(Action<System.Runtime.InteropServices.GCHandle> DisposeBuilder)
public MOS6502XDouble()
{
m = new MOS6502X(DisposeBuilder);
n = new MOS6502X_CPP(DisposeBuilder);
@ -43,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Components.M6502
{
writes.Enqueue(value);
WriteMemory(addr, value);
}, DisposeBuilder);
});
n.SetCallbacks(
delegate(ushort addr)
{
@ -237,4 +238,5 @@ namespace BizHawk.Emulation.Cores.Components.M6502
public string Disassemble(ushort pc, out int bytesToAdvance) { bytesToAdvance = 1; return "FOOBAR"; }
}
*/
}

View File

@ -13,12 +13,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public partial class NES : IEmulator
{
//hardware/state
// any of the 3 cpus are drop in replacements
public MOS6502X cpu;
//public MOS6502X_CPP cpu;
//public MOS6502XDouble cpu;
// dispose list as the native core can't keep track of its own stuff
List<System.Runtime.InteropServices.GCHandle> DisposeList = new List<System.Runtime.InteropServices.GCHandle>();
int cpu_accumulate; //cpu timekeeper
public PPU ppu;
public APU apu;
@ -75,14 +70,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public void Dispose()
{
if (magicSoundProvider != null) magicSoundProvider.Dispose();
if (magicSoundProvider != null)
magicSoundProvider.Dispose();
magicSoundProvider = null;
if (DisposeList != null)
{
foreach (var h in DisposeList)
h.Free();
DisposeList = null;
}
}
class MagicSoundProvider : ISoundProvider, ISyncSoundProvider, IDisposable
@ -169,10 +159,8 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public void HardReset()
{
cpu = new MOS6502X((h) => DisposeList.Add(h));
//cpu = new MOS6502X_CPP((h) => DisposeList.Add(h));
//cpu = new MOS6502XDouble((h) => DisposeList.Add(h));
cpu.SetCallbacks(ReadMemory, ReadMemory, PeekMemory, WriteMemory, (h) => DisposeList.Add(h));
cpu = new MOS6502X();
cpu.SetCallbacks(ReadMemory, ReadMemory, PeekMemory, WriteMemory);
cpu.BCD_Enabled = false;
cpu.OnExecFetch = ExecFetch;