diff --git a/src/drivers/win/ram_search.cpp b/src/drivers/win/ram_search.cpp index 1dc16b7a..b7c73a85 100644 --- a/src/drivers/win/ram_search.cpp +++ b/src/drivers/win/ram_search.cpp @@ -412,22 +412,21 @@ void ItemIndexToVirtualRegion(unsigned int itemIndex, MemoryRegion& virtualRegio return; } - MemoryRegion* regionPtr = s_itemIndexToRegionPointer[itemIndex]; - MemoryRegion& region = *regionPtr; + MemoryRegion* region = s_itemIndexToRegionPointer[itemIndex]; - int bytesWithinRegion = (itemIndex - region.itemIndex) * sizeof(stepType); - int startSkipSize = ((unsigned int)(sizeof(stepType) - region.hardwareAddress)) % sizeof(stepType); + int bytesWithinRegion = (itemIndex - region->itemIndex) * sizeof(stepType); + int startSkipSize = ((unsigned int)(sizeof(stepType) - region->hardwareAddress)) % sizeof(stepType); bytesWithinRegion += startSkipSize; virtualRegion.size = sizeof(compareType); - virtualRegion.hardwareAddress = region.hardwareAddress + bytesWithinRegion; - virtualRegion.virtualIndex = region.virtualIndex + bytesWithinRegion; + virtualRegion.hardwareAddress = region->hardwareAddress + bytesWithinRegion; + virtualRegion.virtualIndex = region->virtualIndex + bytesWithinRegion; virtualRegion.itemIndex = itemIndex; - region.cheatAffect = 0; - for (int i = 0; i < numsubcheats; i++) - if (SubCheats[i].addr >= region.hardwareAddress && SubCheats[i].addr < region.hardwareAddress + region.size) - ++region.cheatAffect; + virtualRegion.cheatAffect = 0; + for (int i = 0; i < numsubcheats; ++i) + if (SubCheats[i].addr >= virtualRegion.hardwareAddress && SubCheats[i].addr < virtualRegion.hardwareAddress + virtualRegion.size) + ++virtualRegion.cheatAffect; } template @@ -541,10 +540,10 @@ unsigned int HardwareAddressToItemIndex(HWAddressType hardwareAddress) : sizeTypeID == 'd' \ ? (isSigned \ ? (requiresAligned \ - ? functionName() \ + ? functionName() \ : functionName()) \ : (requiresAligned \ - ? functionName() \ + ? functionName() \ : functionName())) \ : functionName()) @@ -564,10 +563,10 @@ unsigned int HardwareAddressToItemIndex(HWAddressType hardwareAddress) : sizeTypeID == 'd' \ ? (isSigned \ ? (requiresAligned \ - ? functionName(p0) \ + ? functionName(p0) \ : functionName(p0)) \ : (requiresAligned \ - ? functionName(p0) \ + ? functionName(p0) \ : functionName(p0))) \ : functionName(p0)) @@ -587,10 +586,10 @@ unsigned int HardwareAddressToItemIndex(HWAddressType hardwareAddress) : sizeTypeID == 'd' \ ? (isSigned \ ? (requiresAligned \ - ? functionName(p0, p1, p2) \ + ? functionName(p0, p1, p2) \ : functionName(p0, p1, p2)) \ : (requiresAligned \ - ? functionName(p0, p1, p2) \ + ? functionName(p0, p1, p2) \ : functionName(p0, p1, p2))) \ : functionName(p0, p1, p2)) @@ -610,10 +609,10 @@ unsigned int HardwareAddressToItemIndex(HWAddressType hardwareAddress) : sizeTypeID == 'd' \ ? (isSigned \ ? (requiresAligned \ - ? functionName(p0, p1, p2, p3) \ + ? functionName(p0, p1, p2, p3) \ : functionName(p0, p1, p2, p3)) \ : (requiresAligned \ - ? functionName(p0, p1, p2, p3) \ + ? functionName(p0, p1, p2, p3) \ : functionName(p0, p1, p2, p3))) \ : functionName(p0, p1, p2, p3)) @@ -627,7 +626,7 @@ unsigned int HardwareAddressToItemIndex(HWAddressType hardwareAddress) : functionName(p0, p1, p2)) \ : sizeTypeID == 'd' \ ? (requiresAligned \ - ? functionName(p0, p1, p2) \ + ? functionName(p0, p1, p2) \ : functionName(p0, p1, p2)) \ : functionName(p0, p1, p2)) @@ -641,7 +640,7 @@ unsigned int HardwareAddressToItemIndex(HWAddressType hardwareAddress) : functionName(p0, p1, p2, p3)) \ : sizeTypeID == 'd' \ ? (requiresAligned \ - ? functionName(p0, p1, p2, p3) \ + ? functionName(p0, p1, p2, p3) \ : functionName(p0, p1, p2, p3)) \ : functionName(p0, p1, p2, p3))