/[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 04:40:00	519
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 04:50:44	520
@@ -1434,28 +1434,7 @@
                 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;
-
-                    double align_base = 5000;
-                    double align_power = 1;
-                    double align = align_base * align_power;
-                    //if ((int_percent_done != Last_Whole_Percent_Done) && (CurrentIndex % alignment) == 0)
-                    if ((CurrentIndex % align) == 0)
-                    {
-                        if (int_percent_done <= 100)
-                        {
-                            string message = string.Format(" -> Reading Address: 0x{0:x8} of 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))
@@ -1464,6 +1443,28 @@
                         {
                             try
                             {
+                                if (e.ReportProgress)
+                                {
+                                    double double_percent_done = 100.0 * (double)((double)CurrentIndex / (double)e.TotalCount);
+                                    int int_percent_done = (int)double_percent_done;
+                                    
+                                    double align_base = 100000;
+                                    double align_power = 1;
+                                    double align = align_base * align_power;
+                                    if ((int_percent_done != Last_Whole_Percent_Done) && (CurrentIndex % align) == 0)
+                                    //if ((CurrentIndex % align) == 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; }
+                                    }
+                                }
+
                                 switch (sdt)
                                 {
                                     case SearchDataTypes._8bits:
@@ -1762,6 +1763,7 @@
                                 if (SearchWorkerThread.CancellationPending) { e.Canceled = true; return; }
                             }
                             catch (EndOfStreamException) { }
+                         
                             uint size = 0;
                             BitTools.SizeOf(sdt, out size);
                             CurrentIndex += size;                          

 

  ViewVC Help
Powered by ViewVC 1.1.22