def configure(self, system): recalSettings = UnixSettings(recalboxFiles.recalboxConf) globalSettings = recalSettings.loadAll('global') system.config['specials'] = recalSettings.load( 'system.emulators.specialkeys', 'default') self.updateConfiguration(system, globalSettings) self.updateConfiguration(system, recalSettings.loadAll(system.name))
def __init__(self, name, rom): self.name = name # read the configuration from the system name self.config = Emulator.get_system_config(self.name, "/recalbox/system/configgen/configgen-defaults.yml", "/recalbox/system/configgen/configgen-defaults-arch.yml") if "emulator" not in self.config or self.config["emulator"] == "": eslog.log("no emulator defined. exiting.") raise Exception("No emulator found") # load configuration from batocera.conf recalSettings = UnixSettings(batoceraFiles.batoceraConf) globalSettings = recalSettings.loadAll('global') systemSettings = recalSettings.loadAll(self.name) gameSettings = recalSettings.loadAll(os.path.basename(rom)) # update config Emulator.updateConfiguration(self.config, globalSettings) Emulator.updateConfiguration(self.config, systemSettings) Emulator.updateConfiguration(self.config, gameSettings) self.updateDrawFPS() # update renderconfig self.renderconfig = {} if "shaderset" in self.config and self.config["shaderset"] != "none": self.renderconfig = Emulator.get_generic_config(self.name, "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults-arch.yml") if "shaderset" not in self.config: # auto self.renderconfig = Emulator.get_generic_config(self.name, "/usr/share/batocera/shaders/configs/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/rendering-defaults-arch.yml") systemSettings = recalSettings.loadAll(self.name + "-renderer") gameSettings = recalSettings.loadAll(os.path.basename(rom) + "-renderer") # es only allow to update systemSettings and gameSettings in fact for the moment Emulator.updateConfiguration(self.renderconfig, systemSettings) Emulator.updateConfiguration(self.renderconfig, gameSettings)
def configure(self, emulator='default', core='default', ratio='auto', netplay=None): recalSettings = UnixSettings(recalboxFiles.recalboxConf) globalSettings = recalSettings.loadAll('global') self.config['specials'] = recalSettings.load('system.emulators.specialkeys', 'default') self.updateConfiguration(globalSettings) self.updateConfiguration(recalSettings.loadAll(self.name)) self.updateForcedConfig(emulator, core, ratio)
def __init__(self, name, rom): self.name = name # read the configuration from the system name self.config = Emulator.get_system_config( self.name, "/usr/share/batocera/configgen/configgen-defaults.yml", "/usr/share/batocera/configgen/configgen-defaults-arch.yml") if "emulator" not in self.config or self.config["emulator"] == "": eslog.log("no emulator defined. exiting.") raise Exception("No emulator found") # load configuration from batocera.conf recalSettings = UnixSettings(batoceraFiles.batoceraConf) globalSettings = recalSettings.loadAll('global') systemSettings = recalSettings.loadAll(self.name) gameSettings = recalSettings.loadAll(self.name + "[\"" + os.path.basename(rom) + "\"]") # update config Emulator.updateConfiguration(self.config, globalSettings) Emulator.updateConfiguration(self.config, systemSettings) Emulator.updateConfiguration(self.config, gameSettings) self.updateFromESSettings() eslog.log("uimode: {}".format(self.config['uimode'])) # update renderconfig self.renderconfig = {} if "shaderset" in self.config and self.config["shaderset"] != "none": self.renderconfig = Emulator.get_generic_config( self.name, "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults-arch.yml") if "shaderset" not in self.config: # auto self.renderconfig = Emulator.get_generic_config( self.name, "/usr/share/batocera/shaders/configs/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/rendering-defaults-arch.yml" ) # for compatibility with earlier Batocera versions, let's keep -renderer # but it should be reviewed when we refactor configgen (to Python3?) # so that we can fetch them from system.shader without -renderer systemSettings = recalSettings.loadAll(self.name + "-renderer") gameSettings = recalSettings.loadAll(self.name + "[\"" + os.path.basename(rom) + "\"]" + "-renderer") # es only allow to update systemSettings and gameSettings in fact for the moment Emulator.updateConfiguration(self.renderconfig, systemSettings) Emulator.updateConfiguration(self.renderconfig, gameSettings)
def __init__(self, name): self.name = name # read the configuration from the system name self.config = Emulator.get_system_config( self.name, "/recalbox/system/configgen/configgen-defaults.yml", "/recalbox/system/configgen/configgen-defaults-arch.yml") if "emulator" not in self.config or self.config["emulator"] == "": eslog.log("no emulator defined. exiting.") raise Exception("No emulator found") # load configuration from batocera.conf recalSettings = UnixSettings(batoceraFiles.batoceraConf) globalSettings = recalSettings.loadAll('global') systemSettings = recalSettings.loadAll(self.name) # update config Emulator.updateConfiguration(self.config, globalSettings) Emulator.updateConfiguration(self.config, systemSettings) self.updateDrawFPS() # update renderconfig self.renderconfig = Emulator.get_generic_config( self.name, "/usr/share/batocera/shaders/configs/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/rendering-defaults-arch.yml") if "shaderset" in self.config and self.config["shaderset"] != "none": eslog.log("shaderset={}".format(self.config["shaderset"])) globalSettings = recalSettings.loadAll('global-renderer-' + self.config["shaderset"]) systemSettings = recalSettings.loadAll(self.name + "-renderer-" + self.config["shaderset"]) self.renderconfig = Emulator.get_generic_config( self.name, "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults-arch.yml") Emulator.updateConfiguration(self.renderconfig, globalSettings) Emulator.updateConfiguration(self.renderconfig, systemSettings) eslog.log("shader file={}".format(self.renderconfig["shader"])) else: eslog.log("no shader")
def configure(self, emulator='default', core='default', ratio='auto', netplay=None, netplay_ip=None, netplay_port=None, hash=None): recalSettings = UnixSettings(rhgamestationFiles.rhgamestationConf) globalSettings = recalSettings.loadAll('global') self.config['specials'] = recalSettings.load( 'system.emulators.specialkeys', 'default') self.config['netplay_nickname'] = recalSettings.load( 'global.netplay.nickname', 'default') self.config['netplaymode'] = netplay self.config['netplay_ip'] = netplay_ip self.config['netplay_port'] = netplay_port self.config['hash'] = hash self.updateConfiguration(globalSettings) self.updateConfiguration(recalSettings.loadAll(self.name)) self.updateForcedConfig(emulator, core, ratio)
def __init__(self, name, rom): self.name = name # read the configuration from the system name self.config = Emulator.get_system_config( self.name, "/usr/share/batocera/configgen/configgen-defaults.yml", "/usr/share/batocera/configgen/configgen-defaults-arch.yml") if "emulator" not in self.config or self.config["emulator"] == "": eslog.error("no emulator defined. exiting.") raise Exception("No emulator found") system_emulator = self.config["emulator"] system_core = self.config["core"] # load configuration from batocera.conf recalSettings = UnixSettings(batoceraFiles.batoceraConf) globalSettings = recalSettings.loadAll('global') systemSettings = recalSettings.loadAll(self.name) folderSettings = recalSettings.loadAll(self.name + ".folder[\"" + os.path.dirname(rom) + "\"]") gameSettings = recalSettings.loadAll(self.name + "[\"" + os.path.basename(rom) + "\"]") # add some other options displaySettings = recalSettings.loadAll('display') for opt in displaySettings: self.config["display." + opt] = displaySettings[opt] # update config Emulator.updateConfiguration(self.config, globalSettings) Emulator.updateConfiguration(self.config, systemSettings) Emulator.updateConfiguration(self.config, folderSettings) Emulator.updateConfiguration(self.config, gameSettings) self.updateFromESSettings() eslog.debug("uimode: {}".format(self.config['uimode'])) # forced emulators ? self.config["emulator-forced"] = False self.config["core-forced"] = False if "emulator" in globalSettings or "emulator" in systemSettings or "emulator" in gameSettings: self.config["emulator-forced"] = True if "core" in globalSettings or "core" in systemSettings or "core" in gameSettings: self.config["core-forced"] = True # update renderconfig self.renderconfig = {} if "shaderset" in self.config: if self.config["shaderset"] != "none": if os.path.exists("/userdata/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults.yml"): self.renderconfig = Emulator.get_generic_config( self.name, "/userdata/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults.yml", "/userdata/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults-arch.yml") else: self.renderconfig = Emulator.get_generic_config( self.name, "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/" + self.config["shaderset"] + "/rendering-defaults-arch.yml") elif self.config["shaderset"] == "none": self.renderconfig = Emulator.get_generic_config( self.name, "/usr/share/batocera/shaders/configs/rendering-defaults.yml", "/usr/share/batocera/shaders/configs/rendering-defaults-arch.yml" ) # for compatibility with earlier Batocera versions, let's keep -renderer # but it should be reviewed when we refactor configgen (to Python3?) # so that we can fetch them from system.shader without -renderer systemSettings = recalSettings.loadAll(self.name + "-renderer") gameSettings = recalSettings.loadAll(self.name + "[\"" + os.path.basename(rom) + "\"]" + "-renderer") # es only allow to update systemSettings and gameSettings in fact for the moment Emulator.updateConfiguration(self.renderconfig, systemSettings) Emulator.updateConfiguration(self.renderconfig, gameSettings)
def configure(self, system): recalSettings = UnixSettings(recalboxFiles.recalboxConf) globalSettings = recalSettings.loadAll('global') system.config['specials'] = recalSettings.load('system.emulators.specialkeys', 'default') self.updateConfiguration(system, globalSettings) self.updateConfiguration(system, recalSettings.loadAll(system.name))