Correct/Cleanup the GameShark Tool.

This commit is contained in:
hegyak 2015-11-14 12:10:23 -08:00
parent 1ba166af19
commit 6c9006241d
3 changed files with 12 additions and 20 deletions

View File

@ -3979,8 +3979,6 @@ namespace BizHawk.Client.EmuHawk
private void gameSharkConverterToolStripMenuItem_Click(object sender, EventArgs e)
{
//TODO:
//Wire up the Connection to the Object
GlobalWin.Tools.Load<GameShark>();
}

View File

@ -50,7 +50,7 @@
this.btnClear.Location = new System.Drawing.Point(141, 132);
this.btnClear.Name = "btnClear";
this.btnClear.Size = new System.Drawing.Size(75, 23);
this.btnClear.TabIndex = 16;
this.btnClear.TabIndex = 4;
this.btnClear.Text = "Clear";
this.btnClear.UseVisualStyleBackColor = true;
this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
@ -69,14 +69,14 @@
this.txtCheat.Location = new System.Drawing.Point(128, 106);
this.txtCheat.Name = "txtCheat";
this.txtCheat.Size = new System.Drawing.Size(100, 20);
this.txtCheat.TabIndex = 10;
this.txtCheat.TabIndex = 2;
//
// btnGo
//
this.btnGo.Location = new System.Drawing.Point(35, 131);
this.btnGo.Name = "btnGo";
this.btnGo.Size = new System.Drawing.Size(75, 23);
this.btnGo.TabIndex = 9;
this.btnGo.TabIndex = 3;
this.btnGo.Text = "Convert";
this.btnGo.UseVisualStyleBackColor = true;
this.btnGo.Click += new System.EventHandler(this.btnGo_Click);
@ -95,7 +95,7 @@
this.txtDescription.Location = new System.Drawing.Point(22, 106);
this.txtDescription.Name = "txtDescription";
this.txtDescription.Size = new System.Drawing.Size(100, 20);
this.txtDescription.TabIndex = 18;
this.txtDescription.TabIndex = 1;
//
// GameShark
//

View File

@ -1,8 +1,6 @@
using System;
using System.Windows.Forms;
using BizHawk.Emulation.Common;
//Using the GameBoy Core Directly, is an issue with the limitations for what this tool does.
using BizHawk.Emulation.Cores.Nintendo.Gameboy;
using BizHawk.Client.Common;
using System.Globalization;
@ -10,14 +8,10 @@ namespace BizHawk.Client.EmuHawk
{
public partial class GameShark : Form, IToolForm, IToolFormAutoConfig
{
[ToolAttributes(released: true, supportedSystems: new[] { "GB" })]
//We are using Memory Domains, so we NEED this.
[RequiredService]
private IMemoryDomains MemoryDomains { get; set; }
//Since this is only using GameBoy at the moment, we do this.
//TODO:
//Expand this so that this tool supports ALL cores that are capable of using GameShark/CodeBreaker/Action Replay/Game Genie
[RequiredService]
private Gameboy GB { get; set; }
public GameShark()
{
InitializeComponent();
@ -38,7 +32,7 @@ namespace BizHawk.Client.EmuHawk
public void FastUpdate()
{
throw new NotImplementedException();
}
public void Restart()
@ -77,8 +71,8 @@ namespace BizHawk.Client.EmuHawk
RAMAddress = RAMAddress + parseString.Remove(2, 2);
//We now have our values.
//This part, is annoying...
//try
//{
try
{
//A Watch needs to be generated so we can make a cheat out of that. This is due to how the Cheat engine works.
//System Bus Domain, The Address to Watch, Byte size (Byte), Hex Display, Description. Not Big Endian.
var watch = Watch.GenerateWatch(MemoryDomains["System Bus"], long.Parse(RAMAddress, NumberStyles.HexNumber), Watch.WatchSize.Byte, Watch.DisplayType.Hex, txtDescription.Text, false);
@ -87,11 +81,11 @@ namespace BizHawk.Client.EmuHawk
//Clear old Inputs
txtCheat.Clear();
txtDescription.Clear();
/*}
catch
}
catch (Exception ex)
{
MessageBox.Show("An Error occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
} */
MessageBox.Show("An Error occured:" + ex.GetType().ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnClear_Click(object sender, EventArgs e)