Python: Fix debugger not properly attaching core
Vicki Pfau vi@endrift.com
Mon, 09 Oct 2017 11:36:55 -0700
4 files changed,
9 insertions(+),
6 deletions(-)
M
src/platform/python/mgba/core.py
→
src/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.py
→
src/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.py
→
src/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.py
→
src/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):