/[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 23:12:01	546
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/05 23:19:19	547
@@ -1106,7 +1106,16 @@
                         int count = (int)((MemoryRangeSize - MemoryRangeStart) / STEP_SIZE);
                         SearchResultWriter writer = new SearchResultWriter((int)(count), SearchGuid);                                             
                         int Last_Whole_Percent_Done = 0;
-                        uint size = STEP_SIZE * 4096;
+                        uint size = 0;
+                        const uint MB_SIZE = 16; /* MEM_1MB * MB_SIZE = MB_SIZE in megabytes */
+                        switch (sdt)
+                        {
+                            case SearchDataTypes._8bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._16bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._32bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._64bits: size = STEP_SIZE * MEM_1MB * (MB_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                        }
+                        //uint size = STEP_SIZE * 4096;
                         for (uint i = MemoryRangeStart; i < MemoryRangeSize; i+=size)
                         {
                            
@@ -1116,7 +1125,7 @@
                             string message = string.Format(" -> Reading Address: 0x{0:x8}", (i + MemoryRangeStart));
                             double double_percent_done = 100.0 * (double)((double)i / (double)MemoryRangeSize);
                             int int_percent_done = (int)double_percent_done;
-                            if ( (int_percent_done != Last_Whole_Percent_Done) && (i % 10000) == 0)
+                            if ( (int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
                             {
                                 UpdateProgress((int)double_percent_done, message);
                                 Last_Whole_Percent_Done = int_percent_done;
@@ -1525,7 +1534,7 @@
                                     string message = string.Format(" -> Reading Address: 0x{0:x8}", (i + MemoryRangeStart));
                                     double double_percent_done = 100.0 * (double)((double)i / (double)MemoryRangeSize);
                                     int int_percent_done = (int)double_percent_done;
-                                    if ((int_percent_done != Last_Whole_Percent_Done) && (i % 10000) == 0)
+                                    if ((int_percent_done != Last_Whole_Percent_Done))// && (i % 10000) == 0)
                                     {
                                         UpdateProgress((int)double_percent_done, message);
                                         Last_Whole_Percent_Done = int_percent_done;

 

  ViewVC Help
Powered by ViewVC 1.1.22