/[RomCheater]/trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs
ViewVC logotype

Diff of /trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs	2013/06/17 03:23:04	665
+++ trunk/RomCheater.RVACalculator/RVACalculatorDockControl.cs	2013/06/17 03:28:46	666
@@ -44,9 +44,9 @@
 
             name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", string.Empty);
             address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", string.Empty);
-            uint physical = Convert.ToUInt32(address) + txtRVA.ToUInt32();
+            uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32();
             ListViewItem li = new ListViewItem(name);
-            li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", Convert.ToUInt32(address))));
+            li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", Convert.ToUInt32(address, 16))));
             li.SubItems.Add(new ListViewItem.ListViewSubItem(li, string.Format("0x{0:x8}", physical)));
             lstCheats.Items.Add(li);
         }
@@ -68,9 +68,9 @@
 
             name = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat name", name);
             address = Microsoft.VisualBasic.Interaction.InputBox("Input Dialog", "Enter the cheat address (in hex : 0xXXXXXXXX)", address);
-            uint physical = Convert.ToUInt32(address) + txtRVA.ToUInt32();
-            li.Text = name; 
-            li.SubItems[1].Text = string.Format("0x{0:x8}", Convert.ToUInt32(address));
+            uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32();
+            li.Text = name;
+            li.SubItems[1].Text = string.Format("0x{0:x8}", Convert.ToUInt32(address, 16));
             li.SubItems[2].Text = string.Format("0x{0:x8}", physical);
             lstCheats.Items[index] = li;            
         }
@@ -98,7 +98,7 @@
             {
                 string name = li.Text;
                 string address = li.SubItems[1].Text;
-                uint physical = Convert.ToUInt32(address) + txtRVA.ToUInt32();
+                uint physical = Convert.ToUInt32(address, 16) + txtRVA.ToUInt32();
                 li.SubItems[2].Text = string.Format("0x{0:x8}", physical);                
                 lstCheats.Items[index] = li;
                 index++;

 

  ViewVC Help
Powered by ViewVC 1.1.22