/[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 00:47:13	514
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 02:02:08	515
@@ -1432,6 +1432,27 @@
                 if (writer == null)
                     throw new InvalidOperationException("writer cannot be null");
 
+                if (e.ReportProgress)
+                {
+                    double double_percent_done = 100.0 * (double)((double)CurrentIndex / (double)e.TotalCount);
+                    int int_percent_done = (int)double_percent_done;
+
+                    //int align_base = 1000;
+                    //int align_magnitude = 1000;
+                    //int alignment = align_base * align_magnitude;
+                    //if (int_percent_done != Last_Whole_Percent_Done && (CurrentIndex % alignment) == 0)
+                    if (int_percent_done != Last_Whole_Percent_Done)// && (CurrentIndex % alignment) == 0)
+                    {
+                        if (int_percent_done <= 100)
+                        {
+                            string message = string.Format(" -> Reading Address: 0x{0:x8} - 0x{1:x8}", (CurrentIndex + MemoryRangeStart), (CurrentIndex + MemoryRangeStart) + e.Data.Length);
+                            //UpdateProgress(int_percent_done, message);
+                            new Action<int, string>(UpdateProgress).Invoke(int_percent_done, message);
+                            Last_Whole_Percent_Done = int_percent_done;
+                        }
+                        if (SearchWorkerThread.CancellationPending) { e.Canceled = true; return; }
+                    }
+                }
                 using (MemoryStream ms = new MemoryStream(e.Data))
                 {
                     using (BinaryReader br = new BinaryReader(ms))
@@ -1738,28 +1759,6 @@
                                 if (SearchWorkerThread.CancellationPending) { e.Canceled = true; return; }
                             }
                             catch (EndOfStreamException) { }
-
-                            if (e.ReportProgress)
-                            {
-                                double double_percent_done = 100.0 * (double)((double)CurrentIndex / (double)e.TotalCount);
-                                int int_percent_done = (int)double_percent_done;
-
-                                int align_base = 1000;
-                                int align_magnitude = 1000;
-                                int alignment = align_base * align_magnitude;
-                                if (int_percent_done != Last_Whole_Percent_Done && (CurrentIndex % alignment) == 0)
-                                {
-                                    if (int_percent_done <= 100)
-                                    {
-                                        string message = string.Format(" -> Reading Address: 0x{0:x8}", (CurrentIndex + MemoryRangeStart));
-                                        //UpdateProgress(int_percent_done, message);
-                                        new Action<int, string>(UpdateProgress).Invoke(int_percent_done, message);
-                                        Last_Whole_Percent_Done = int_percent_done;
-                                    }
-                                    if (SearchWorkerThread.CancellationPending) { e.Canceled = true; return; }
-                                }
-                            }
-
                             uint size = 0;
                             BitTools.SizeOf(sdt, out size);
                             CurrentIndex += size;                          

 

  ViewVC Help
Powered by ViewVC 1.1.22