/[RomCheater]/trunk/RomCheater/Docking/FloatingMemorySearcher.cs
ViewVC logotype

Diff of /trunk/RomCheater/Docking/FloatingMemorySearcher.cs

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

--- trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/06 06:44:39	569
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/06 06:48:54	570
@@ -1578,6 +1578,16 @@
                                     return;
                                 }
                                 var address = reader_addresses[i];
+
+                                string message = string.Format(" -> Parsing Address 0x{0:x8} ({1} of {2})", address, i.ToString(), reader_addresses.Length.ToString());
+                                double double_percent_done = 100.0 * (double)((double)i / (double)reader_addresses.Length);
+                                int int_percent_done = (int)double_percent_done;
+                                if ((int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
+                                {
+                                    UpdateProgress((int)double_percent_done, message);
+                                    Last_Whole_Percent_Done = int_percent_done;
+                                }
+
                                 provider.OpenProvider();
 
                                 int bytesRead =0;
@@ -1618,14 +1628,46 @@
                                                 }
                                                 if (comparer.Compare(Convert.ToByte(Value), value))
                                                 {
-                                                    writer.WriteResult<ushort>(comparer.Address, comparer.Value);
+                                                    writer.WriteResult<byte>(comparer.Address, comparer.Value);
                                                 }
                                             }
                                             #endregion
                                         }
                                         else
                                         {
-                                            sbyte value = Convert.ToSByte(data[0]);
+                                            #region 8bits - signed
+                                            sbyte Value = Convert.ToSByte(data[0]);
+                                            using (_8bit_signed_comparer_ comparer = new _8bit_signed_comparer_(SearchArgs, address))
+                                            {
+                                                sbyte value = 0;
+                                                if (SearchArgs.CompareValueType == CompareValueTypes.OldValue)
+                                                {
+                                                    using (GenericMemoryProvider gmp = new GenericMemoryProvider((IAcceptsProcessAndConfig)this))
+                                                    {
+                                                        try
+                                                        {
+                                                            gmp.OpenProvider();
+                                                            gmp.ReadMemory(address, out value);
+                                                            gmp.CloseProvider();
+                                                        }
+                                                        catch (Exception ex)
+                                                        {
+                                                            logger.VerboseError.WriteLine(ex.ToString());
+                                                        }
+                                                    }
+                                                    comparer.Value = value;
+                                                }
+                                                else
+                                                {
+                                                    value = Convert.ToSByte(SearchArgs.CompareStartValue);
+                                                    comparer.Value = value;
+                                                }
+                                                if (comparer.Compare(Convert.ToSByte(Value), value))
+                                                {
+                                                    writer.WriteResult<sbyte>(comparer.Address, comparer.Value);
+                                                }
+                                            }
+                                            #endregion
                                         }
                                         break;
                                     case SearchDataTypes._16bits:

 

  ViewVC Help
Powered by ViewVC 1.1.22