mirror of https://github.com/mgba-emu/mgba.git
Python: Add subscripting to root memory object
This commit is contained in:
parent
5a6ee3aadc
commit
6b0847c472
|
@ -153,3 +153,9 @@ class Memory(object):
|
|||
new_results = [MemorySearchResult(self, lib.mCoreMemorySearchResultsGetPointer(results, i)) for i in range(lib.mCoreMemorySearchResultsSize(results))]
|
||||
lib.mCoreMemorySearchResultsDeinit(results)
|
||||
return new_results
|
||||
|
||||
def __getitem__(self, address):
|
||||
if isinstance(address, slice):
|
||||
return bytearray(self.u8[address])
|
||||
else:
|
||||
return self.u8[address]
|
||||
|
|
Loading…
Reference in New Issue