mirror of https://github.com/mgba-emu/mgba.git
Python: Fix importing .gb or .gba before .core
This commit is contained in:
parent
0f5dab6514
commit
57559610c0
1
CHANGES
1
CHANGES
|
@ -3,6 +3,7 @@ Features:
|
||||||
- ELF support
|
- ELF support
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
- GB Audio: Make audio unsigned with bias (fixes mgba.io/i/749)
|
- GB Audio: Make audio unsigned with bias (fixes mgba.io/i/749)
|
||||||
|
- Python: Fix importing .gb or .gba before .core
|
||||||
Misc:
|
Misc:
|
||||||
- GBA Timer: Use global cycles for timers
|
- GBA Timer: Use global cycles for timers
|
||||||
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
- GBA: Extend oddly-sized ROMs to full address space (fixes mgba.io/i/722)
|
||||||
|
|
|
@ -91,6 +91,12 @@ class CoreCallbacks(object):
|
||||||
cb()
|
cb()
|
||||||
|
|
||||||
class Core(object):
|
class Core(object):
|
||||||
|
if hasattr(lib, 'PLATFORM_GBA'):
|
||||||
|
PLATFORM_GBA = lib.PLATFORM_GBA
|
||||||
|
|
||||||
|
if hasattr(lib, 'PLATFORM_GB'):
|
||||||
|
PLATFORM_GB = lib.PLATFORM_GB
|
||||||
|
|
||||||
def __init__(self, native):
|
def __init__(self, native):
|
||||||
self._core = native
|
self._core = native
|
||||||
self._wasReset = False
|
self._wasReset = False
|
||||||
|
@ -117,8 +123,10 @@ class Core(object):
|
||||||
@classmethod
|
@classmethod
|
||||||
def _detect(cls, core):
|
def _detect(cls, core):
|
||||||
if hasattr(cls, 'PLATFORM_GBA') and core.platform(core) == cls.PLATFORM_GBA:
|
if hasattr(cls, 'PLATFORM_GBA') and core.platform(core) == cls.PLATFORM_GBA:
|
||||||
|
from .gba import GBA
|
||||||
return GBA(core)
|
return GBA(core)
|
||||||
if hasattr(cls, 'PLATFORM_GB') and core.platform(core) == cls.PLATFORM_GB:
|
if hasattr(cls, 'PLATFORM_GB') and core.platform(core) == cls.PLATFORM_GB:
|
||||||
|
from .gb import GB
|
||||||
return GB(core)
|
return GB(core)
|
||||||
return Core(core)
|
return Core(core)
|
||||||
|
|
||||||
|
@ -253,12 +261,3 @@ class IRunner(object):
|
||||||
|
|
||||||
def isPaused(self):
|
def isPaused(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
if hasattr(lib, 'PLATFORM_GBA'):
|
|
||||||
from .gba import GBA
|
|
||||||
Core.PLATFORM_GBA = lib.PLATFORM_GBA
|
|
||||||
|
|
||||||
if hasattr(lib, 'PLATFORM_GB'):
|
|
||||||
from .gb import GB
|
|
||||||
from .lr35902 import LR35902Core
|
|
||||||
Core.PLATFORM_GB = lib.PLATFORM_GB
|
|
||||||
|
|
Loading…
Reference in New Issue