various code cleanup
This commit is contained in:
parent
ea92bdcc66
commit
dc94825891
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.Components.LR35902;
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
using BizHawk.Common.NumberExtensions;
|
||||
using BizHawk.Emulation.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Nintendo.GBHawk;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
using System;
|
||||
|
||||
using BizHawk.Common.BufferExtensions;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Common.Components.LR35902;
|
||||
|
||||
using BizHawk.Emulation.Cores.Consoles.Nintendo.Gameboy;
|
||||
using BizHawk.Emulation.Cores.Nintendo.GBHawk;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.GBHawkLink
|
||||
{
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Components.Z80A;
|
||||
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
|
||||
{
|
||||
|
@ -68,28 +67,20 @@ namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
|
|||
Data = 0x04
|
||||
};
|
||||
|
||||
private struct CDLog_MapResults
|
||||
{
|
||||
public CDLog_AddrType Type;
|
||||
public int Address;
|
||||
}
|
||||
|
||||
private delegate CDLog_MapResults MapMemoryDelegate(ushort addr, bool write);
|
||||
private MapMemoryDelegate MapMemory;
|
||||
private ICodeDataLog CDL;
|
||||
|
||||
private void RunCDL(ushort address, CDLog_Flags flags)
|
||||
{
|
||||
if (MapMemory != null)
|
||||
if (L.MapMemory != null)
|
||||
{
|
||||
CDLog_MapResults results = MapMemory(address, false);
|
||||
SMS.CDLog_MapResults results = L.MapMemory(address, false);
|
||||
switch (results.Type)
|
||||
{
|
||||
case CDLog_AddrType.None: break;
|
||||
case CDLog_AddrType.ROM: CDL["ROM"][results.Address] |= (byte)flags; break;
|
||||
case CDLog_AddrType.MainRAM: CDL["Main RAM"][results.Address] |= (byte)flags; break;
|
||||
case CDLog_AddrType.SaveRAM: CDL["Save RAM"][results.Address] |= (byte)flags; break;
|
||||
case CDLog_AddrType.CartRAM: CDL["Cart (Volatile) RAM"][results.Address] |= (byte)flags; break;
|
||||
case SMS.CDLog_AddrType.None: break;
|
||||
case SMS.CDLog_AddrType.ROM: CDL["ROM"][results.Address] |= (byte)flags; break;
|
||||
case SMS.CDLog_AddrType.MainRAM: CDL["Main RAM"][results.Address] |= (byte)flags; break;
|
||||
case SMS.CDLog_AddrType.SaveRAM: CDL["Save RAM"][results.Address] |= (byte)flags; break;
|
||||
case SMS.CDLog_AddrType.CartRAM: CDL["Cart (Volatile) RAM"][results.Address] |= (byte)flags; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
using BizHawk.Common.NumberExtensions;
|
||||
using BizHawk.Emulation.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
|
||||
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
|
||||
{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
using System.Collections.Generic;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
|
||||
|
|
|
@ -3,7 +3,6 @@ using Newtonsoft.Json;
|
|||
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Sega.MasterSystem;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.GGHawkLink
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
|
||||
}
|
||||
|
||||
private enum CDLog_AddrType
|
||||
public enum CDLog_AddrType
|
||||
{
|
||||
None,
|
||||
ROM,
|
||||
|
@ -58,24 +58,24 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
}
|
||||
|
||||
[Flags]
|
||||
private enum CDLog_Flags
|
||||
public enum CDLog_Flags
|
||||
{
|
||||
ExecFirst = 0x01,
|
||||
ExecOperand = 0x02,
|
||||
Data = 0x04
|
||||
};
|
||||
|
||||
private struct CDLog_MapResults
|
||||
public struct CDLog_MapResults
|
||||
{
|
||||
public CDLog_AddrType Type;
|
||||
public int Address;
|
||||
}
|
||||
|
||||
private delegate CDLog_MapResults MapMemoryDelegate(ushort addr, bool write);
|
||||
private MapMemoryDelegate MapMemory;
|
||||
private ICodeDataLog CDL;
|
||||
public delegate CDLog_MapResults MapMemoryDelegate(ushort addr, bool write);
|
||||
public MapMemoryDelegate MapMemory;
|
||||
public ICodeDataLog CDL;
|
||||
|
||||
private void RunCDL(ushort address, CDLog_Flags flags)
|
||||
public void RunCDL(ushort address, CDLog_Flags flags)
|
||||
{
|
||||
if (MapMemory != null)
|
||||
{
|
||||
|
@ -94,7 +94,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
/// <summary>
|
||||
/// A wrapper for FetchMemory which inserts CDL logic
|
||||
/// </summary>
|
||||
private byte FetchMemory_CDL(ushort address)
|
||||
public byte FetchMemory_CDL(ushort address)
|
||||
{
|
||||
RunCDL(address, CDLog_Flags.ExecFirst);
|
||||
return ReadMemory(address);
|
||||
|
@ -103,7 +103,7 @@ namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
|||
/// <summary>
|
||||
/// A wrapper for ReadMemory which inserts CDL logic
|
||||
/// </summary>
|
||||
private byte ReadMemory_CDL(ushort address)
|
||||
public byte ReadMemory_CDL(ushort address)
|
||||
{
|
||||
RunCDL(address, CDLog_Flags.Data);
|
||||
return ReadMemory(address);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using BizHawk.Common.NumberExtensions;
|
||||
using BizHawk.Emulation.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
||||
|
|
|
@ -5,7 +5,6 @@ using BizHawk.Emulation.Common;
|
|||
using BizHawk.Emulation.Common.Components;
|
||||
using BizHawk.Emulation.Cores.Components;
|
||||
using BizHawk.Emulation.Cores.Components.Z80A;
|
||||
using BizHawk.Common.BufferExtensions;
|
||||
|
||||
/*****************************************************
|
||||
TODO:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// Contains rendering functions for legacy TMS9918 modes.
|
||||
|
||||
using System;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
using System;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
|
||||
using BizHawk.Common;
|
||||
using BizHawk.Emulation.Common;
|
||||
using BizHawk.Emulation.Cores.Components.Z80A;
|
||||
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Sega.MasterSystem
|
||||
{
|
||||
public enum VdpMode { SMS, GameGear }
|
||||
|
|
Loading…
Reference in New Issue