all repos — mgba @ 5a6ee3aadc2abce53f03416a2da3f5c14bb03d75

mGBA Game Boy Advance Emulator

Python: Fix debugger not properly attaching core
Vicki Pfau vi@endrift.com
Mon, 09 Oct 2017 11:36:55 -0700
commit

5a6ee3aadc2abce53f03416a2da3f5c14bb03d75

parent

f7c935f217370c86078e3c5a7603f65cb87c092c

M src/platform/python/mgba/core.pysrc/platform/python/mgba/core.py

@@ -152,6 +152,9 @@ from .gb import GB

return GB(core) return Core(core) + def _load(self): + self._wasReset = True + def loadFile(self, path): return bool(lib.mCoreLoadFile(self._core, path.encode('UTF-8')))

@@ -193,7 +196,7 @@ self._core.setVideoBuffer(self._core, image.buffer, image.stride)

def reset(self): self._core.reset(self._core) - self._wasReset = True + self._load() @needsReset @protected
M src/platform/python/mgba/debugger.pysrc/platform/python/mgba/debugger.py

@@ -41,7 +41,7 @@ def __init__(self, native):

self._native = native self._cbs = [] self._core = Core._detect(native.core) - self._core._wasReset = True + self._core._load() def pause(self): lib.mDebuggerEnter(self._native, lib.DEBUGGER_ENTER_MANUAL, ffi.NULL)
M src/platform/python/mgba/gb.pysrc/platform/python/mgba/gb.py

@@ -36,8 +36,8 @@ lib.mCacheSetDeinit(cache)

if self._wasReset: self._native.video.renderer.cache = ffi.NULL - def reset(self): - super(GB, self).reset() + def _load(self): + super(GB, self)._load() self.memory = GBMemory(self._core) def attachSIO(self, link):
M src/platform/python/mgba/gba.pysrc/platform/python/mgba/gba.py

@@ -44,8 +44,8 @@ lib.mCacheSetDeinit(cache)

if self._wasReset: self._native.video.renderer.cache = ffi.NULL - def reset(self): - super(GBA, self).reset() + def _load(self): + super(GBA, self)._load() self.memory = GBAMemory(self._core, self._native.memory.romSize) def attachSIO(self, link, mode=lib.SIO_MULTI):