def attach_plugins(self, plugins): """Attaches plugins to the emulator core.""" self.plugins = plugins for plugin_type in PLUGIN_ORDER: plugin = self.plugins[plugin_type] if not plugin: plugin_map = list(self.plugin_map[plugin_type].values())[0] else: try: plugin_map = self.plugin_map[plugin_type][plugin] except KeyError: continue (plugin_handle, plugin_path, plugin_name, plugin_desc, plugin_version) = plugin_map rval = self.m64p.CoreAttachPlugin( C.c_int(plugin_type), C.c_void_p(plugin_handle._handle)) if rval != M64ERR_SUCCESS: log.debug("attach_plugins()") log.warn(self.error_message(rval)) log.warn("core failed to attach %s plugin." % ( plugin_name)) else: log.info("using %s plugin: '%s' v%s" % ( plugin_name.decode(), plugin_desc, version_split(plugin_version)))
def attach_plugins(self, plugins): """Attaches plugins to the emulator core.""" self.plugins = plugins for plugin_type in PLUGIN_ORDER: plugin = self.plugins[plugin_type] if not plugin: plugin_maps = list(self.plugin_map[plugin_type].values()) if not plugin_maps: continue plugin_map = plugin_maps[0] else: plugin_map = self.plugin_map[plugin_type][plugin] (plugin_handle, plugin_path, plugin_name, plugin_desc, plugin_version) = plugin_map rval = self.m64p.CoreAttachPlugin( C.c_int(plugin_type), C.c_void_p(plugin_handle._handle)) if rval != M64ERR_SUCCESS: log.debug("attach_plugins()") log.warn(self.error_message(rval)) log.warn("core failed to attach %s plugin." % (plugin_name)) else: log.info("using %s plugin: '%s' v%s" % (plugin_name.decode(), plugin_desc, version_split(plugin_version)))
def __init__(self, parent): QDialog.__init__(self, parent) self.setupUi(self) if parent.worker.core.core_version != "Unknown": version = version_split(parent.worker.core.core_version) else: version = "Unknown" text = self.labelAbout.text() text = text.replace("FRONTEND_VERSION", FRONTEND_VERSION) text = text.replace("CORE_VERSION", version) self.labelAbout.setText(text) self.show()
def check_version(self): """Checks core API version.""" version = self.plugin_get_version(self.m64p, self.core_path) if version: plugin_type, plugin_version, plugin_api, plugin_name, plugin_cap = version if plugin_type != M64PLUGIN_CORE: raise Exception("library '%s' is invalid, " "this is not the emulator core." % (os.path.basename(self.core_path))) elif plugin_version < MINIMUM_CORE_VERSION: raise Exception( "library '%s' is incompatible, " "core version %s is below minimum supported %s." % (os.path.basename( self.core_path), version_split(plugin_version), version_split(MINIMUM_CORE_VERSION))) elif plugin_api & 0xffff0000 != CORE_API_VERSION & 0xffff0000: raise Exception( "library '%s' is incompatible, " "core API major version %s doesn't match application (%s)." % (os.path.basename( self.core_path), version_split(plugin_version), version_split(CORE_API_VERSION))) else: config_ver, debug_ver, vidext_ver = self.get_api_versions() if config_ver & 0xffff0000 != CONFIG_API_VERSION & 0xffff0000: raise Exception( "emulator core '%s' is incompatible, " "config API major version %s doesn't match application: (%s)" % (os.path.basename( self.core_path), version_split(config_ver), version_split(CONFIG_API_VERSION))) self.core_name = plugin_name self.core_version = plugin_version if LDD_CMD: proc = subprocess.Popen( LDD_CMD % self.core_path, shell=True, preexec_fn=lambda: signal.signal( signal.SIGPIPE, signal.SIG_DFL)) proc.communicate() if proc.returncode == 0: self.core_sdl2 = True log.info("attached to library '%s' version %s" % (self.core_name, version_split(self.core_version))) if plugin_cap & M64CAPS_DYNAREC: log.info("includes support for Dynamic Recompiler.") if plugin_cap & M64CAPS_DEBUGGER: log.info("includes support for MIPS r4300 Debugger.") if plugin_cap & M64CAPS_CORE_COMPARE: log.info("includes support for r4300 Core Comparison.")
def check_version(self): """Checks core API version.""" version = self.plugin_get_version(self.m64p, self.core_path) if version: plugin_type, plugin_version, plugin_api, plugin_name, plugin_cap = version if plugin_type != M64PLUGIN_CORE: raise Exception( "library '%s' is invalid, " "this is not the emulator core." % ( os.path.basename(self.core_path))) elif plugin_version < MINIMUM_CORE_VERSION: raise Exception( "library '%s' is incompatible, " "core version %s is below minimum supported %s." % ( os.path.basename(self.core_path), version_split(plugin_version), version_split(MINIMUM_CORE_VERSION))) elif plugin_api & 0xffff0000 != CORE_API_VERSION & 0xffff0000: raise Exception( "library '%s' is incompatible, " "core API major version %s doesn't match application (%s)." % ( os.path.basename(self.core_path), version_split(plugin_version), version_split(CORE_API_VERSION))) else: config_ver, debug_ver, vidext_ver = self.get_api_versions() if config_ver & 0xffff0000 != CONFIG_API_VERSION & 0xffff0000: raise Exception( "emulator core '%s' is incompatible, " "config API major version %s doesn't match application: (%s)" % ( os.path.basename(self.core_path), version_split(config_ver), version_split(CONFIG_API_VERSION))) self.core_name = plugin_name self.core_version = plugin_version if LDD_CMD: proc = subprocess.Popen( LDD_CMD % self.core_path, shell=True, preexec_fn=lambda: signal.signal(signal.SIGPIPE, signal.SIG_DFL)) proc.communicate() if proc.returncode == 0: self.core_sdl2 = True log.info("attached to library '%s' version %s" % (self.core_name, version_split(self.core_version))) if plugin_cap & M64CAPS_DYNAREC: log.info("includes support for Dynamic Recompiler.") if plugin_cap & M64CAPS_DEBUGGER: log.info("includes support for MIPS r4300 Debugger.") if plugin_cap & M64CAPS_CORE_COMPARE: log.info("includes support for r4300 Core Comparison.")