/[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	2012/06/19 10:15:53	384
+++ trunk/RomCheater/Docking/FloatingMemorySearcher.cs	2012/06/19 11:06:47	385
@@ -1090,9 +1090,11 @@
                     {
                         //r_ms.BaseStream.Seek(SearchArgs.Results[i].Address, SeekOrigin.Begin);
                         uint address = SearchArgs.Results[i].Address;
+                        if (MemoryRangeStart > 0 && !SearchArgs.IsFirstSearch) { address = address - MemoryRangeStart; }
                         switch (SearchArgs.DataType)
                         {
                             #region Comparer Support
+                            #region case SearchDataTypes._8bits:
                             case SearchDataTypes._8bits:
                                 if (SearchArgs.IsUnsignedDataType)
                                 {
@@ -1145,6 +1147,8 @@
                                     comparer = null; // free memory
                                 }
                                 break;
+                            #endregion
+                            #region case SearchDataTypes._16bits:
                             case SearchDataTypes._16bits:
                                 if (SearchArgs.IsUnsignedDataType)
                                 {
@@ -1197,6 +1201,8 @@
                                     comparer = null; // free memory
                                 }
                                 break;
+                            #endregion
+                            #region case SearchDataTypes._32bits:
                             case SearchDataTypes._32bits:
                                 if (SearchArgs.IsUnsignedDataType)
                                 {
@@ -1249,6 +1255,8 @@
                                     comparer = null; // free memory
                                 }
                                 break;
+                            #endregion
+                            #region case SearchDataTypes._64bits:
                             case SearchDataTypes._64bits:
                                 if (SearchArgs.IsUnsignedDataType)
                                 {
@@ -1302,6 +1310,7 @@
                                 }
                                 break;
                             #endregion
+                            #endregion
                         }
 
                         double double_percent_done = 100.0 * (double)((double)i / (double)SearchArgs.Results.Count);
@@ -1328,10 +1337,11 @@
                     for (int i = 0; i < SearchArgs.Results.Count; i += 1)
                     {
                         uint address = SearchArgs.Results[i].Address;
+                        if (MemoryRangeStart > 0 && !SearchArgs.IsFirstSearch) { address = address - MemoryRangeStart; }
                         //r_ms.BaseStream.Seek(SearchArgs.Results[i].Address, SeekOrigin.Begin);
                         if (SearchArgs.CompareType == SearchCompareTypes.Between)
                         {
-                            InRangeComparer comparer = new InRangeComparer(SearchArgs.Results[i].Address, 0);
+                            InRangeComparer comparer = new InRangeComparer(address, 0);
                             if (comparer.Compare(start, end, SearchArgs.DataType, SearchArgs.IsUnsignedDataType, buffered_mem))
                             {
                                 SearchArgs.Results[i].Value = comparer.Value;
@@ -1341,7 +1351,7 @@
                         }
                         else if (SearchArgs.CompareType == SearchCompareTypes.NotBetween)
                         {
-                            NotInRangeComparer comparer = new NotInRangeComparer(SearchArgs.Results[i].Address, 0);
+                            NotInRangeComparer comparer = new NotInRangeComparer(address, 0);
                             if (comparer.Compare(start, end, SearchArgs.DataType, SearchArgs.IsUnsignedDataType, buffered_mem))
                             {
                                 SearchArgs.Results[i].Value = comparer.Value;
@@ -1373,6 +1383,8 @@
             if (NeedToCompare)
             {
                 SearchArgs.Results = second_tmp_Results.GetRange(0, second_tmp_Results.Count);
+                // fix addresses when memory start is not zero
+                if (MemoryRangeStart > 0 && SearchArgs.IsFirstSearch) { for (int i = 0; i < SearchArgs.Results.Count; i++) { SearchArgs.Results[i].Address = SearchArgs.Results[i].Address + MemoryRangeStart; } }
                 second_tmp_Results = null; // free memory
             }
 

 

  ViewVC Help
Powered by ViewVC 1.1.22