mirror of https://github.com/mgba-emu/mgba.git
Python: Fix debugger not properly attaching core
This commit is contained in:
parent
f7c935f217
commit
5a6ee3aadc
|
@ -152,6 +152,9 @@ class Core(object):
|
||||||
return GB(core)
|
return GB(core)
|
||||||
return Core(core)
|
return Core(core)
|
||||||
|
|
||||||
|
def _load(self):
|
||||||
|
self._wasReset = True
|
||||||
|
|
||||||
def loadFile(self, path):
|
def loadFile(self, path):
|
||||||
return bool(lib.mCoreLoadFile(self._core, path.encode('UTF-8')))
|
return bool(lib.mCoreLoadFile(self._core, path.encode('UTF-8')))
|
||||||
|
|
||||||
|
@ -193,7 +196,7 @@ class Core(object):
|
||||||
|
|
||||||
def reset(self):
|
def reset(self):
|
||||||
self._core.reset(self._core)
|
self._core.reset(self._core)
|
||||||
self._wasReset = True
|
self._load()
|
||||||
|
|
||||||
@needsReset
|
@needsReset
|
||||||
@protected
|
@protected
|
||||||
|
|
|
@ -41,7 +41,7 @@ class NativeDebugger(IRunner):
|
||||||
self._native = native
|
self._native = native
|
||||||
self._cbs = []
|
self._cbs = []
|
||||||
self._core = Core._detect(native.core)
|
self._core = Core._detect(native.core)
|
||||||
self._core._wasReset = True
|
self._core._load()
|
||||||
|
|
||||||
def pause(self):
|
def pause(self):
|
||||||
lib.mDebuggerEnter(self._native, lib.DEBUGGER_ENTER_MANUAL, ffi.NULL)
|
lib.mDebuggerEnter(self._native, lib.DEBUGGER_ENTER_MANUAL, ffi.NULL)
|
||||||
|
|
|
@ -36,8 +36,8 @@ class GB(Core):
|
||||||
if self._wasReset:
|
if self._wasReset:
|
||||||
self._native.video.renderer.cache = ffi.NULL
|
self._native.video.renderer.cache = ffi.NULL
|
||||||
|
|
||||||
def reset(self):
|
def _load(self):
|
||||||
super(GB, self).reset()
|
super(GB, self)._load()
|
||||||
self.memory = GBMemory(self._core)
|
self.memory = GBMemory(self._core)
|
||||||
|
|
||||||
def attachSIO(self, link):
|
def attachSIO(self, link):
|
||||||
|
|
|
@ -44,8 +44,8 @@ class GBA(Core):
|
||||||
if self._wasReset:
|
if self._wasReset:
|
||||||
self._native.video.renderer.cache = ffi.NULL
|
self._native.video.renderer.cache = ffi.NULL
|
||||||
|
|
||||||
def reset(self):
|
def _load(self):
|
||||||
super(GBA, self).reset()
|
super(GBA, self)._load()
|
||||||
self.memory = GBAMemory(self._core, self._native.memory.romSize)
|
self.memory = GBAMemory(self._core, self._native.memory.romSize)
|
||||||
|
|
||||||
def attachSIO(self, link, mode=lib.SIO_MULTI):
|
def attachSIO(self, link, mode=lib.SIO_MULTI):
|
||||||
|
|
Loading…
Reference in New Issue