/[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 04:33:03	564
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2013/06/06 05:08:26	565
@@ -58,8 +58,13 @@
         const int MIN_NUMBER_OF_RESULTS_BEFORE_DISPLAY = 0x03e8; // 1,000 results
 #endif
 
-        const uint MEM_1MB = 0x00100000;
-        const uint MEM_CHUNK_SIZE = 16; /* MEM_1MB * MB_SIZE = MB_SIZE in megabytes */
+        const uint MEM_1KB = 0x400;
+        const uint MEM_1MB = MEM_1KB * MEM_1KB; // 1024 * 1024 = 1MB
+        const uint MEM_CHUNK_SIZE_MB = MEM_1MB * 16; /* MEM_1MB * N = N in megabytes (in bytes) */
+        const uint MEM_CHUNK_SIZE_KB = MEM_1KB * 64; /* MEM_1KB * N = N in kilobytes (in bytes) */
+
+        const uint MEM_CHUNK_SIZE = MEM_CHUNK_SIZE_KB;
+
 
         const bool USE_OLD_SEARCH_RESULTS_COMPRATOR_CODE = false;
         const bool USE_NONRANGE_SEARCH_RESULT_READER = false;
@@ -1111,10 +1116,10 @@
                         uint size = 0;
                         switch (sdt)
                         {
-                            case SearchDataTypes._8bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                            case SearchDataTypes._16bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                            case SearchDataTypes._32bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                            case SearchDataTypes._64bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._8bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._16bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._32bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                            case SearchDataTypes._64bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
                         }
                         //uint size = STEP_SIZE * 4096;
                         for (uint i = MemoryRangeStart; i < MemoryRangeSize; i += size)
@@ -1554,10 +1559,10 @@
                             uint size = 0;                           
                             switch (sdt)
                             {
-                                case SearchDataTypes._8bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                                case SearchDataTypes._16bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                                case SearchDataTypes._32bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
-                                case SearchDataTypes._64bits: size = STEP_SIZE * MEM_1MB * (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._8bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._16bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._32bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
+                                case SearchDataTypes._64bits: size = (MEM_CHUNK_SIZE / BitTools.SizeOf<uint>(sdt)); break;
                             }
                             //size = STEP_SIZE * 4096;
                             for (uint i = MemoryRangeStart; i < MemoryRangeSize; i += size)

 

  ViewVC Help
Powered by ViewVC 1.1.22