all repos — mgba @ e820e4dcbb71bd3e7486e9a828a0226075103bc3

mGBA Game Boy Advance Emulator

Python: Fix memory search
Vicki Pfau vi@endrift.com
Sat, 14 Oct 2017 19:07:17 -0700
commit

e820e4dcbb71bd3e7486e9a828a0226075103bc3

parent

db69256ce9f247969ee3194a35b70f7bda52ab52

1 files changed, 6 insertions(+), 9 deletions(-)

jump to
M src/platform/python/mgba/memory.pysrc/platform/python/mgba/memory.py

@@ -100,11 +100,11 @@ self._memory[self.address] = v // self.guessDivisor

class Memory(object): - SEARCH_32 = lib.mCORE_MEMORY_SEARCH_32 - SEARCH_16 = lib.mCORE_MEMORY_SEARCH_16 - SEARCH_8 = lib.mCORE_MEMORY_SEARCH_8 + SEARCH_INT = lib.mCORE_MEMORY_SEARCH_INT SEARCH_STRING = lib.mCORE_MEMORY_SEARCH_STRING SEARCH_GUESS = lib.mCORE_MEMORY_SEARCH_GUESS + + SEARCH_EQUAL = lib.mCORE_MEMORY_SEARCH_EQUAL READ = lib.mCORE_MEMORY_READ WRITE = lib.mCORE_MEMORY_READ

@@ -131,12 +131,9 @@ lib.mCoreMemorySearchResultsInit(results, len(old_results))

params = ffi.new("struct mCoreMemorySearchParams*") params.memoryFlags = flags params.type = type - if type == self.SEARCH_8: - params.value8 = int(value) - elif type == self.SEARCH_16: - params.value16 = int(value) - elif type == self.SEARCH_32: - params.value32 = int(value) + params.op = self.SEARCH_EQUAL + if type == self.SEARCH_INT: + params.valueInt = int(value) else: params.valueStr = ffi.new("char[]", str(value).encode("ascii"))