/[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/05 09:09:08	533
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 09:36:14	534
@@ -73,6 +73,7 @@
             if (pm == null) { return; }
             resultsprogress.Value = pm.Progress;
             resultsprogress.Message = pm.Message;
+            //Application.DoEvents();
         }
 
         private bool ShouldCancelAnySearchOperation() { return SearchWorkerThread.CancellationPending; }
@@ -1830,7 +1831,7 @@
                                     if (unsigned)
                                     {
                                         #region 8bits - unsigned
-                                        var t_data = BitTools.ConvertByteArray<byte>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                        var t_data = data;
                                         foreach (var Value in t_data)
                                         {
                                             if (SearchWorkerThread.CancellationPending) { break; }
@@ -1871,7 +1872,7 @@
                                     else
                                     {
                                         #region 8bits - signed
-                                        var t_data = BitTools.ConvertByteArray<sbyte>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                        var t_data = data;
                                         foreach (var Value in t_data)
                                         {
                                             if (SearchWorkerThread.CancellationPending) { break; }
@@ -2292,13 +2293,21 @@
                                     byte[] data = new byte[STEP_SIZE];
                                     provider.ReadProcessMemory(k.Address, STEP_SIZE, out bytesRead, out data);
                                     provider.CloseProvider();
-
+                                    if (SearchWorkerThread.CancellationPending)
+                                    {
+                                        provider_st.Stop();
+                                        st.Stop();
+                                        writer.CancelRequest();
+                                        writer.Dispose();
+                                        e.Result = true;
+                                        return;
+                                    }
                                     uint address_index = k.Address;
 
                                     string message = string.Format(" -> Reading Address 0x{0:x8} from index 0x{1}", k.Address, index.ToString("X"));
                                     double double_percent_done = 100.0 * (double)((double)index / (double)reader.ResultCount);
                                     int int_percent_done = (int)double_percent_done;
-                                    if ((int_percent_done != Last_Whole_Percent_Done) && (index % 1000000) == 0)
+                                    if ((int_percent_done != Last_Whole_Percent_Done) && ((double)index % 0.005) == 0.0)
                                     {
                                         UpdateProgress((int)double_percent_done, message);
                                         Last_Whole_Percent_Done = int_percent_done;
@@ -2311,7 +2320,7 @@
                                             if (unsigned)
                                             {
                                                 #region 8bits - unsigned
-                                                var t_data = BitTools.ConvertByteArray<byte>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                                var t_data = data;
                                                 foreach (var Value in t_data)
                                                 {
                                                     if (SearchWorkerThread.CancellationPending) { break; }
@@ -2352,7 +2361,7 @@
                                             else
                                             {
                                                 #region 8bits - signed
-                                                var t_data = BitTools.ConvertByteArray<sbyte>(data, new Func<bool>(ShouldCancelAnySearchOperation));
+                                                var t_data = data;
                                                 foreach (var Value in t_data)
                                                 {
                                                     if (SearchWorkerThread.CancellationPending) { break; }

 

  ViewVC Help
Powered by ViewVC 1.1.22