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 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 @@ class Core(object):
|
|||
|
||||
def reset(self):
|
||||
self._core.reset(self._core)
|
||||
self._wasReset = True
|
||||
self._load()
|
||||
|
||||
@needsReset
|
||||
@protected
|
||||
|
|
|
@ -41,7 +41,7 @@ class NativeDebugger(IRunner):
|
|||
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)
|
||||
|
|
|
@ -36,8 +36,8 @@ class GB(Core):
|
|||
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):
|
||||
|
|
|
@ -44,8 +44,8 @@ class GBA(Core):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue