Client-side cheats system added, works on all cores with working PokeByte()
This commit is contained in:
parent
6f379cee76
commit
a1c562259d
|
@ -319,6 +319,7 @@
|
||||||
<Compile Include="tools\Cheats.Designer.cs">
|
<Compile Include="tools\Cheats.Designer.cs">
|
||||||
<DependentUpon>Cheats.cs</DependentUpon>
|
<DependentUpon>Cheats.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="tools\MemoryPulse.cs" />
|
||||||
<Compile Include="tools\VirtualPad.cs">
|
<Compile Include="tools\VirtualPad.cs">
|
||||||
<SubType>Component</SubType>
|
<SubType>Component</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
|
|
@ -12,6 +12,7 @@ using BizHawk.Emulation.Consoles.TurboGrafx;
|
||||||
using BizHawk.Emulation.Consoles.Calculator;
|
using BizHawk.Emulation.Consoles.Calculator;
|
||||||
using BizHawk.Emulation.Consoles.Gameboy;
|
using BizHawk.Emulation.Consoles.Gameboy;
|
||||||
using BizHawk.Emulation.Consoles.Nintendo;
|
using BizHawk.Emulation.Consoles.Nintendo;
|
||||||
|
using BizHawk.MultiClient.tools;
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
|
@ -1486,7 +1487,9 @@ namespace BizHawk.MultiClient
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//=======================================
|
//=======================================
|
||||||
|
MemoryPulse.Pulse();
|
||||||
Global.Emulator.FrameAdvance(!throttle.skipnextframe);
|
Global.Emulator.FrameAdvance(!throttle.skipnextframe);
|
||||||
|
MemoryPulse.Pulse();
|
||||||
//=======================================
|
//=======================================
|
||||||
|
|
||||||
if (CurrAviWriter != null)
|
if (CurrAviWriter != null)
|
||||||
|
@ -1941,6 +1944,7 @@ namespace BizHawk.MultiClient
|
||||||
CloseGame();
|
CloseGame();
|
||||||
Global.Emulator = new NullEmulator();
|
Global.Emulator = new NullEmulator();
|
||||||
Global.Game = new NullGame();
|
Global.Game = new NullGame();
|
||||||
|
MemoryPulse.Clear();
|
||||||
RamSearch1.Restart();
|
RamSearch1.Restart();
|
||||||
RamWatch1.Restart();
|
RamWatch1.Restart();
|
||||||
HexEditor1.Restart();
|
HexEditor1.Restart();
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
using System;
|
using BizHawk.MultiClient.tools;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace BizHawk.MultiClient
|
namespace BizHawk.MultiClient
|
||||||
{
|
{
|
||||||
|
@ -44,13 +41,13 @@ namespace BizHawk.MultiClient
|
||||||
public void Enable()
|
public void Enable()
|
||||||
{
|
{
|
||||||
enabled = true;
|
enabled = true;
|
||||||
//domain.SetFreeze(address, new MemoryDomain.FreezeData(MemoryDomain.FreezeData.Flag.Frozen, value));
|
MemoryPulse.Add(domain, address, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Disable()
|
public void Disable()
|
||||||
{
|
{
|
||||||
enabled = false;
|
enabled = false;
|
||||||
//domain.ClearFreeze(address);
|
MemoryPulse.Remove(domain, address);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEnabled()
|
public bool IsEnabled()
|
||||||
|
|
|
@ -157,10 +157,6 @@ namespace BizHawk.MultiClient
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
case "GB":
|
case "GB":
|
||||||
case "SMS":
|
|
||||||
case "SG":
|
|
||||||
case "GG":
|
|
||||||
case "PCE":
|
|
||||||
AddCheatGroup.Enabled = false;
|
AddCheatGroup.Enabled = false;
|
||||||
CheatListView.Enabled = false;
|
CheatListView.Enabled = false;
|
||||||
MessageLabel.Text = Global.Emulator.SystemId + " not supported.";
|
MessageLabel.Text = Global.Emulator.SystemId + " not supported.";
|
||||||
|
|
|
@ -0,0 +1,53 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace BizHawk.MultiClient.tools
|
||||||
|
{
|
||||||
|
public static class MemoryPulse
|
||||||
|
{
|
||||||
|
public class MemoryPulseEntry
|
||||||
|
{
|
||||||
|
public int address;
|
||||||
|
public byte value;
|
||||||
|
public MemoryDomain domain;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<MemoryPulseEntry> entries = new List<MemoryPulseEntry>();
|
||||||
|
|
||||||
|
public static void Pulse()
|
||||||
|
{
|
||||||
|
foreach (var entry in entries)
|
||||||
|
{
|
||||||
|
entry.domain.PokeByte(entry.address, entry.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Add(MemoryDomain domain, int address, byte value)
|
||||||
|
{
|
||||||
|
entries.RemoveAll(o => o.domain == domain && o.address == address);
|
||||||
|
|
||||||
|
var entry = new MemoryPulseEntry {address = address, value = value, domain = domain};
|
||||||
|
entries.Add(entry);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MemoryPulseEntry Query(MemoryDomain domain, int address)
|
||||||
|
{
|
||||||
|
return entries.Find(o => o.domain == domain && o.address == address);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Remove(MemoryDomain domain, int address)
|
||||||
|
{
|
||||||
|
entries.RemoveAll(o => o.domain == domain && o.address == address);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IList<MemoryPulseEntry> GetEntries()
|
||||||
|
{
|
||||||
|
return entries.AsReadOnly();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Clear()
|
||||||
|
{
|
||||||
|
entries.Clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue