Correct/Cleanup the GameShark Tool.

Conflicts:
	BizHawk.Client.EmuHawk/tools/GameShark.cs
This commit is contained in:
hegyak 2015-11-14 12:10:23 -08:00 committed by zeromus
parent fae4d27bed
commit 77e6239992
3 changed files with 11 additions and 16 deletions

View File

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

View File

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

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using BizHawk.Emulation.Common; 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 BizHawk.Client.Common;
using System.Globalization; using System.Globalization;
@ -14,7 +12,6 @@ namespace BizHawk.Client.EmuHawk
//We are using Memory Domains, so we NEED this. //We are using Memory Domains, so we NEED this.
[RequiredService] [RequiredService]
private IMemoryDomains MemoryDomains { get; set; } private IMemoryDomains MemoryDomains { get; set; }
public GameShark() public GameShark()
{ {
InitializeComponent(); InitializeComponent();
@ -35,7 +32,7 @@ namespace BizHawk.Client.EmuHawk
public void FastUpdate() public void FastUpdate()
{ {
throw new NotImplementedException();
} }
public void Restart() public void Restart()
@ -74,8 +71,8 @@ namespace BizHawk.Client.EmuHawk
RAMAddress = RAMAddress + parseString.Remove(2, 2); RAMAddress = RAMAddress + parseString.Remove(2, 2);
//We now have our values. //We now have our values.
//This part, is annoying... //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. //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. //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); var watch = Watch.GenerateWatch(MemoryDomains["System Bus"], long.Parse(RAMAddress, NumberStyles.HexNumber), Watch.WatchSize.Byte, Watch.DisplayType.Hex, txtDescription.Text, false);
@ -84,11 +81,11 @@ namespace BizHawk.Client.EmuHawk
//Clear old Inputs //Clear old Inputs
txtCheat.Clear(); txtCheat.Clear();
txtDescription.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) private void btnClear_Click(object sender, EventArgs e)