Wire up the Genesis Game Genie Encoder/Decoder to the GPGX core, but disable it since it doesn't seem to work right now

This commit is contained in:
adelikat 2013-12-22 20:25:43 +00:00
parent 5fc78efe85
commit 2448ad0dda
4 changed files with 80 additions and 93 deletions

View File

@ -709,10 +709,12 @@ namespace BizHawk.Client.EmuHawk
{ {
GlobalWin.Tools.Load<GBGameGenie>(); GlobalWin.Tools.Load<GBGameGenie>();
} }
else if (Global.Emulator is Genesis) /* adelikat: Genesis decoding doesn't seem to work yet
else if (Global.Emulator.SystemId == "GEN")
{ {
GlobalWin.Tools.Load<GenGameGenie>(); GlobalWin.Tools.Load<GenGameGenie>();
} }
*/
} }
public void LoadTraceLogger() public void LoadTraceLogger()

View File

@ -71,7 +71,7 @@ namespace BizHawk.Client.EmuHawk
public void UpdateValues() public void UpdateValues()
{ {
//Do nothing; // Do nothing;
} }
public void Restart() public void Restart()
@ -191,7 +191,7 @@ namespace BizHawk.Client.EmuHawk
LoadConfigSettings(); LoadConfigSettings();
ToggleGameGenieButton(); ToggleGameGenieButton();
CheatEditor.SetAddEvent(AddCheat); CheatEditor.SetAddEvent(AddCheat);
CheatEditor.SetEditEvent(AddCheat); //CheatList.Add is already an upsert, so there is nothing different to handle here CheatEditor.SetEditEvent(AddCheat); // CheatList.Add is already an upsert, so there is nothing different to handle here
UpdateDialog(); UpdateDialog();
} }
@ -200,7 +200,7 @@ namespace BizHawk.Client.EmuHawk
GameGenieToolbarSeparator.Visible = GameGenieToolbarSeparator.Visible =
LoadGameGenieToolbarItem.Visible = LoadGameGenieToolbarItem.Visible =
((Global.Emulator is NES) ((Global.Emulator is NES)
|| (Global.Emulator is Genesis) /*|| (Global.Emulator.SystemId == "GEN")*/
|| (Global.Emulator.SystemId == "GB") || (Global.Emulator.SystemId == "GB")
|| (Global.Game.System == "GG") || (Global.Game.System == "GG")
|| (Global.Emulator is LibsnesCore)); || (Global.Emulator is LibsnesCore));
@ -224,8 +224,8 @@ namespace BizHawk.Client.EmuHawk
private void LoadConfigSettings() private void LoadConfigSettings()
{ {
//Size and Positioning // Size and Positioning
_defaultWidth = Size.Width; //Save these first so that the user can restore to its original size _defaultWidth = Size.Width;
_defaultHeight = Size.Height; _defaultHeight = Size.Height;
if (Global.Config.CheatsSaveWindowPosition && Global.Config.CheatsWndx >= 0 && Global.Config.CheatsWndy >= 0) if (Global.Config.CheatsSaveWindowPosition && Global.Config.CheatsWndx >= 0 && Global.Config.CheatsWndy >= 0)

View File

@ -6,7 +6,7 @@ using System.Globalization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using BizHawk.Client.Common; using BizHawk.Client.Common;
using BizHawk.Emulation.Cores.Sega.Genesis; //using BizHawk.Emulation.Cores.Sega.Genesis;
#pragma warning disable 675 //TOOD: fix the potential problem this is masking #pragma warning disable 675 //TOOD: fix the potential problem this is masking
@ -21,14 +21,14 @@ namespace BizHawk.Client.EmuHawk
public bool UpdateBefore { get { return false; } } public bool UpdateBefore { get { return false; } }
public void Restart() public void Restart()
{ {
if (!(Global.Emulator is Genesis)) if (!(Global.Emulator.SystemId == "GEN"))
{ {
Close(); Close();
} }
} }
public void UpdateValues() public void UpdateValues()
{ {
if (!(Global.Emulator is Genesis)) if (!(Global.Emulator.SystemId == "GEN"))
{ {
Close(); Close();
} }
@ -73,7 +73,6 @@ namespace BizHawk.Client.EmuHawk
GameGenieTable.Add('9', 31); GameGenieTable.Add('9', 31);
} }
// code is code to be converted, val is pointer to value, add is pointer to address // code is code to be converted, val is pointer to value, add is pointer to address
private void GenGGDecode(string code, ref int val, ref int add) private void GenGGDecode(string code, ref int val, ref int add)
{ {
@ -241,59 +240,45 @@ namespace BizHawk.Client.EmuHawk
private void addcheatbt_Click(object sender, EventArgs e) private void addcheatbt_Click(object sender, EventArgs e)
{ {
if (Global.Emulator is Genesis) string NAME;
int ADDRESS = 0;
int VALUE = 0;
if (!String.IsNullOrWhiteSpace(cheatname.Text))
{ {
string NAME; NAME = cheatname.Text;
int ADDRESS = 0; }
int VALUE = 0; else
int romDataDomainIndex = 0; {
_processing = true;
GGCodeMaskBox.TextMaskFormat = MaskFormat.IncludeLiterals;
if (!String.IsNullOrWhiteSpace(cheatname.Text)) NAME = GGCodeMaskBox.Text;
{ GGCodeMaskBox.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
NAME = cheatname.Text; _processing = false;
}
else
{
_processing = true;
GGCodeMaskBox.TextMaskFormat = MaskFormat.IncludeLiterals;
NAME = GGCodeMaskBox.Text;
GGCodeMaskBox.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
_processing = false;
}
if (!String.IsNullOrWhiteSpace(AddressBox.Text))
{
ADDRESS = int.Parse(AddressBox.Text, NumberStyles.HexNumber);
}
if (!String.IsNullOrWhiteSpace(ValueBox.Text))
{
VALUE = ValueBox.ToRawInt().Value;
}
for (int i = 0; i < Global.Emulator.MemoryDomains.Count; i++)
{
if (Global.Emulator.MemoryDomains[i].ToString() == "Rom Data")
{
romDataDomainIndex = i;
}
}
Watch watch = Watch.GenerateWatch(
Global.Emulator.MemoryDomains[romDataDomainIndex],
ADDRESS,
Watch.WatchSize.Word,
Watch.DisplayType.Hex,
NAME, true
);
Global.CheatList.Add(new Cheat(
watch,
VALUE
));
} }
if (!String.IsNullOrWhiteSpace(AddressBox.Text))
{
ADDRESS = int.Parse(AddressBox.Text, NumberStyles.HexNumber);
}
if (!String.IsNullOrWhiteSpace(ValueBox.Text))
{
VALUE = ValueBox.ToRawInt().Value;
}
Watch watch = Watch.GenerateWatch(
Global.Emulator.MemoryDomains["MD CART"],
ADDRESS,
Watch.WatchSize.Word,
Watch.DisplayType.Hex,
NAME, true
);
Global.CheatList.Add(new Cheat(
watch,
VALUE
));
} }
private void autoloadToolStripMenuItem_Click(object sender, EventArgs e) private void autoloadToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -460,7 +460,7 @@ namespace BizHawk.Emulation.Cores.Sega.Genesis
addr => VDP.VRAM[addr & 0xFFFF], addr => VDP.VRAM[addr & 0xFFFF],
(addr, value) => VDP.VRAM[addr & 0xFFFF] = value); (addr, value) => VDP.VRAM[addr & 0xFFFF] = value);
var RomDomain = new MemoryDomain("Rom Data", RomData.Length, MemoryDomain.Endian.Big, var RomDomain = new MemoryDomain("MD CART", RomData.Length, MemoryDomain.Endian.Big,
addr => RomData[addr], //adelikat: For speed considerations, I didn't mask this, every tool that uses memory domains is smart enough not to overflow, if I'm wrong let me know! addr => RomData[addr], //adelikat: For speed considerations, I didn't mask this, every tool that uses memory domains is smart enough not to overflow, if I'm wrong let me know!
(addr, value) => RomData[addr & (RomData.Length - 1)] = value); (addr, value) => RomData[addr & (RomData.Length - 1)] = value);