def play(self): """Runs the game""" rom = self.game_config.get('main_file') or '' machine = self.game_config.get('machine') if self.runner_config.get("fs"): fullscreen = "1" else: fullscreen = "0" resolution = get_current_resolution() (resolutionx, resolutiony) = resolution.split("x") xres = str(resolutionx) yres = str(resolutiony) options = [ "-fs", fullscreen, "-" + machine + ".xres", xres, "-" + machine + ".yres", yres, "-" + machine + ".stretch", "1", "-" + machine + ".special", "hq4x", "-" + machine + ".videoip", "1" ] joy_ids = self.find_joysticks() if len(joy_ids) > 0: controls = self.set_joystick_controls(joy_ids) for control in controls: options.append(control) else: logger.debug("No Joystick found") if not os.path.exists(rom): return {'error': 'FILE_NOT_FOUND', 'file': rom} command = [self.get_executable()] for option in options: command.append(option) command.append(rom) return {'command': command}
def play(self): arguments = [self.get_executable()] if self.runner_config.get("fullscreen"): arguments.append("-fullscreen") else: arguments.append("-windowed") resolution = self.runner_config.get("resolution") if resolution: if resolution == 'desktop': resolution = display.get_current_resolution() width, height = resolution.split('x') arguments += [ "-fs-width", "%s" % width, "-fs-height", "%s" % height ] if self.runner_config.get("machine"): arguments.append("-%s" % self.runner_config["machine"]) bios_path = self.runner_config.get("bios_path") if not system.path_exists(bios_path): return {'error': 'NO_BIOS'} good_bios = self.find_good_bioses(bios_path) for bios in good_bios.keys(): arguments.append("-%s" % bios) arguments.append(os.path.join(bios_path, good_bios[bios])) rom = self.game_config.get('main_file') or '' if not system.path_exists(rom): return {'error': 'FILE_NOT_FOUND', 'file': rom} arguments.append(rom) return {"command": arguments}
def play(self): arguments = [self.get_executable()] if self.runner_config.get("fullscreen"): arguments.append("-fullscreen") else: arguments.append("-windowed") resolution = self.runner_config.get("resolution") if resolution: if resolution == 'desktop': resolution = display.get_current_resolution() width, height = resolution.split('x') arguments += ["-fs-width", "%s" % width, "-fs-height", "%s" % height] if self.runner_config.get("machine"): arguments.append("-%s" % self.runner_config["machine"]) bios_path = self.runner_config.get("bios_path") if not os.path.exists(bios_path): return {'error': 'NO_BIOS'} good_bios = self.find_good_bioses(bios_path) for bios in good_bios.keys(): arguments.append("-%s" % bios) arguments.append(os.path.join(bios_path, good_bios[bios])) rom = self.game_config.get('main_file') or '' if not os.path.exists(rom): return {'error': 'FILE_NOT_FOUND', 'file': rom} arguments.append(rom) return {"command": arguments}
def play(self): arguments = [self.get_executable()] if self.runner_config.get("fullscreen"): arguments.append("-fullscreen") else: arguments.append("-windowed") resolution = self.runner_config.get("resolution") if resolution: if resolution == "desktop": resolution = display.get_current_resolution() width, height = resolution.split("x") arguments += ["-fs-width", "%s" % width, "-fs-height", "%s" % height] if self.runner_config.get("machine"): arguments.append("-%s" % self.runner_config["machine"]) bios_path = self.runner_config.get("bios_path") if not system.path_exists(bios_path): return {"error": "NO_BIOS"} good_bios = self.find_good_bioses(bios_path) for bios, filename in good_bios.items(): arguments.append("-%s" % bios) arguments.append(os.path.join(bios_path, filename)) rom = self.game_config.get("main_file") or "" if not system.path_exists(rom): return {"error": "FILE_NOT_FOUND", "file": rom} arguments.append(rom) return {"command": arguments}
def play(self): """Runs the game""" rom = self.game_config.get('main_file') or '' machine = self.game_config.get('machine') if self.runner_config.get("fs"): fullscreen = "1" else: fullscreen = "0" resolution = get_current_resolution() (resolutionx, resolutiony) = resolution.split("x") xres = str(resolutionx) yres = str(resolutiony) options = ["-fs", fullscreen, "-" + machine + ".xres", xres, "-" + machine + ".yres", yres, "-" + machine + ".stretch", "1", "-" + machine + ".special", "hq4x", "-" + machine + ".videoip", "1"] joy_ids = self.find_joysticks() if len(joy_ids) > 0: controls = self.set_joystick_controls(joy_ids) for control in controls: options.append(control) else: logger.debug("No Joystick found") if not os.path.exists(rom): return {'error': 'FILE_NOT_FOUND', 'file': rom} command = [self.get_executable()] for option in options: command.append(option) command.append(rom) return {'command': command}
def play(self): command = [self.get_executable()] resolution = self.runner_config.get("resolution") if resolution: if resolution == 'desktop': resolution = display.get_current_resolution() width, height = resolution.split('x') command.append("-width") command.append(width) command.append("-height") command.append(height) # Append any boolean options. bool_options = ['2', '4', 'nostartup'] for option in bool_options: if self.runner_config.get(option): command.append("-%s" % option) # Append the skill level. skill = self.runner_config.get('skill') if skill: command.append("-skill") command.append(skill) # Append the warp arguments. warp = self.game_config.get('warp') if warp: command.append("-warp") for warparg in warp.split(' '): command.append(warparg) # Append the wad file to load, if provided. wad = self.game_config.get('main_file') if wad: command.append("-iwad") command.append(wad) # Append the pwad files to load, if provided. files = self.game_config.get('files') or [] pwads = [ f for f in files if f.lower().endswith('.wad') or f.lower().endswith('.pk3') ] deh = [f for f in files if f.lower().endswith('.deh')] bex = [f for f in files if f.lower().endswith('.bex')] if deh: command.append('-deh') command.append(deh[0]) if bex: command.append('-bex') command.append(bex[0]) if pwads: command.append("-file") for pwad in pwads: command.append(pwad) return {'command': command}
def play(self): command = [self.get_executable()] resolution = self.runner_config.get("resolution") if resolution: if resolution == 'desktop': resolution = display.get_current_resolution() width, height = resolution.split('x') command.append("-width") command.append(width) command.append("-height") command.append(height) # Append any boolean options. bool_options = ['2', '4', 'nostartup'] for option in bool_options: if self.runner_config.get(option): command.append("-%s" % option) # Append the skill level. skill = self.runner_config.get('skill') if skill: command.append("-skill") command.append(skill) # Append the warp arguments. warp = self.game_config.get('warp') if warp: command.append("-warp") for warparg in warp.split(' '): command.append(warparg) # Append the wad file to load, if provided. wad = self.game_config.get('main_file') if wad: command.append("-iwad") command.append(wad) # Append the pwad files to load, if provided. files = self.game_config.get('files') or [] pwads = [f for f in files if f.lower().endswith('.wad') or f.lower().endswith('.pk3')] deh = [f for f in files if f.lower().endswith('.deh')] bex = [f for f in files if f.lower().endswith('.bex')] if deh: command.append('-deh') command.append(deh[0]) if bex: command.append('-bex') command.append(bex[0]) if pwads: command.append("-file") for pwad in pwads: command.append(pwad) return {'command': command}
def play(self): """Runs the game""" rom = self.game_config.get("main_file") or "" machine = self.game_config.get("machine") or "" fullscreen = self.runner_config.get("fs") or "0" if fullscreen is True: fullscreen = "1" elif fullscreen is False: fullscreen = "0" stretch = self.runner_config.get("stretch") or "0" scaler = self.runner_config.get("scaler") or "hq4x" resolution = get_current_resolution() (resolutionx, resolutiony) = resolution.split("x") xres = str(resolutionx) yres = str(resolutiony) options = [ "-fs", fullscreen, "-" + machine + ".xres", xres, "-" + machine + ".yres", yres, "-" + machine + ".stretch", stretch, "-" + machine + ".special", scaler, "-" + machine + ".videoip", "1", ] joy_ids = self.find_joysticks() dont_map_controllers = self.runner_config.get("dont_map_controllers") if joy_ids and not dont_map_controllers: controls = self.set_joystick_controls(joy_ids, machine) for control in controls: options.append(control) if not system.path_exists(rom): return {"error": "FILE_NOT_FOUND", "file": rom} command = [self.get_executable()] for option in options: command.append(option) command.append(rom) return {"command": command}
def get_params(self): runner = self.__class__.__name__ params = [] runner_config = self.settings[runner] or {} machine = runner_config.get('machine') kickstart_file = runner_config.get('kickstart_file') if kickstart_file: params.append("--kickstart_file=\"%s\"" % kickstart_file) if machine: params.append('--amiga_model=%s' % machine) if runner_config.get("gfx_fullscreen_amiga", False): width = int(get_current_resolution().split('x')[0]) params.append("--fullscreen") #params.append("--fullscreen_mode=fullscreen-window") params.append("--fullscreen_mode=fullscreen") params.append("--fullscreen_width=%d" % width) return params
def get_params(self): params = [] model = self.runner_config.get('model') kickstart_file = self.runner_config.get('kickstart_file') if kickstart_file: params.append("--kickstart_file=\"%s\"" % kickstart_file) if model: params.append('--amiga_model=%s' % model) if self.runner_config.get("gfx_fullscreen_amiga", False): width = int(get_current_resolution().split('x')[0]) params.append("--fullscreen") # params.append("--fullscreen_mode=fullscreen-window") params.append("--fullscreen_mode=fullscreen") params.append("--fullscreen_width=%d" % width) if self.runner_config.get('scanlines'): params.append("--scanlines=1") return params
def play(self): """Runs the game""" rom = self.settings["game"]["main_file"] machine = self.settings["game"]["machine"] # Defaults fullscreen = "1" if "mednafen" in self.settings.config: if "fs" in self.settings.config["mednafen"]: if not self.settings.config["mednafen"]["fs"]: fullscreen = "0" resolution = get_current_resolution() (resolutionx, resolutiony) = resolution.split("x") xres = str(resolutionx) yres = str(resolutiony) options = [ "-fs", fullscreen, "-" + machine + ".xres", xres, "-" + machine + ".yres", yres, "-" + machine + ".stretch", "1", "-" + machine + ".special", "hq4x", "-" + machine + ".videoip", "1", ] joy_ids = self.find_joysticks() if len(joy_ids) > 0: controls = self.set_joystick_controls(joy_ids) for control in controls: options.append(control) else: logger.debug("No Joystick found") if not os.path.exists(rom): return {"error": "FILE_NOT_FOUND", "file": rom} command = [self.executable] for option in options: command.append(option) command.append('"%s"' % rom) return {"command": command}
def get_params(self): runner = self.__class__.__name__ params = [] runner_config = self.settings[runner] or {} model = runner_config.get("model") kickstart_file = runner_config.get("kickstart_file") if kickstart_file: params.append('--kickstart_file="%s"' % kickstart_file) if model: params.append("--amiga_model=%s" % model) if runner_config.get("gfx_fullscreen_amiga", False): width = int(get_current_resolution().split("x")[0]) params.append("--fullscreen") # params.append("--fullscreen_mode=fullscreen-window") params.append("--fullscreen_mode=fullscreen") params.append("--fullscreen_width=%d" % width) if runner_config.get("scanlines"): params.append("--scanlines=1") return params
def play(self): """Runs the game""" rom = self.game_config.get('main_file') or '' machine = self.game_config.get('machine') or '' fullscreen = self.runner_config.get("fs") or "0" if fullscreen is True: fullscreen = "1" elif fullscreen is False: fullscreen = "0" stretch = self.runner_config.get('stretch') or "0" scaler = self.runner_config.get('scaler') or "hq4x" resolution = get_current_resolution() (resolutionx, resolutiony) = resolution.split("x") xres = str(resolutionx) yres = str(resolutiony) options = ["-fs", fullscreen, "-" + machine + ".xres", xres, "-" + machine + ".yres", yres, "-" + machine + ".stretch", stretch, "-" + machine + ".special", scaler, "-" + machine + ".videoip", "1"] joy_ids = self.find_joysticks() use_dflt_cntrllr = self.runner_config.get('dflt_cntrllr') if (len(joy_ids) > 0) and not use_dflt_cntrllr: controls = self.set_joystick_controls(joy_ids, machine) for control in controls: options.append(control) else: logger.debug("No joystick specification") if not os.path.exists(rom): return {'error': 'FILE_NOT_FOUND', 'file': rom} command = [self.get_executable()] for option in options: command.append(option) command.append(rom) return {'command': command}
def get_params(self): params = [] model = self.runner_config.get("model") fmemory = self.runner_config.get("fmemory") fdvolume = self.runner_config.get("fdvolume") fdspeed = self.runner_config.get("fdspeed") grafixcard = self.runner_config.get("grafixcard") grafixmemory = self.runner_config.get("grafixmemory") kickstart_file = self.runner_config.get("kickstart_file") if kickstart_file: params.append("--kickstart_file=%s" % kickstart_file) kickstart_ext_file = self.runner_config.get("kickstart_ext_file") if kickstart_ext_file: params.append("--kickstart_ext_file=%s" % kickstart_ext_file) if model: params.append("--amiga_model=%s" % model) if fmemory: params.append("--fast_memory=%s" % fmemory) if fdvolume: params.append("--floppy_drive_volume_empty=%s" % fdvolume) if fdspeed: params.append("--floppy_drive_volume_empty=%s" % fdspeed) if grafixcard: params.append("--graphics_card=%s" % grafixcard) if grafixmemory: params.append("--graphics_card=%s" % grafixmemory) if self.runner_config.get("gfx_fullscreen_amiga"): width = int(get_current_resolution().split("x")[0]) params.append("--fullscreen") # params.append("--fullscreen_mode=fullscreen-window") params.append("--fullscreen_mode=fullscreen") params.append("--fullscreen_width=%d" % width) if self.runner_config.get("jitcompiler"): params.append("--jit_compiler=1") if self.runner_config.get("jitcompiler"): params.append("--bsdsocket_library=1") if self.runner_config.get("scanlines"): params.append("--scanlines=1") return params
def get_params(self): params = [] model = self.runner_config.get('model') fmemory = self.runner_config.get("fmemory") kickstart_file = self.runner_config.get('kickstart_file') if kickstart_file: params.append("--kickstart_file=%s" % kickstart_file) kickstart_ext_file = self.runner_config.get('kickstart_ext_file') if kickstart_ext_file: params.append('--kickstart_ext_file=%s' % kickstart_ext_file) if model: params.append('--amiga_model=%s' % model) if fmemory: params.append("--fast_memory=%s" % fmemory) if self.runner_config.get('gfx_fullscreen_amiga'): width = int(get_current_resolution().split('x')[0]) params.append("--fullscreen") # params.append("--fullscreen_mode=fullscreen-window") params.append("--fullscreen_mode=fullscreen") params.append("--fullscreen_width=%d" % width) if self.runner_config.get('scanlines'): params.append("--scanlines=1") return params
def play(self): command = [self.get_executable()] resolution = self.runner_config.get("resolution") if resolution: if resolution == "desktop": resolution = display.get_current_resolution() width, height = resolution.split("x") command.append("-width") command.append(width) command.append("-height") command.append(height) # Append any boolean options. bool_options = ["2", "4", "nostartup"] for option in bool_options: if self.runner_config.get(option): command.append("-%s" % option) # Append the skill level. skill = self.runner_config.get("skill") if skill: command.append("-skill") command.append(skill) # Append directory for configuration file, if provided. config = self.runner_config.get("config") if config: command.append("-config") command.append(config) # Append the warp arguments. warp = self.game_config.get("warp") if warp: command.append("-warp") for warparg in warp.split(" "): command.append(warparg) # Append directory for save games, if provided. savedir = self.game_config.get("savedir") if savedir: command.append("-savedir") command.append(savedir) # Append the wad file to load, if provided. wad = self.game_config.get("main_file") if wad: command.append("-iwad") command.append(wad) # Append the pwad files to load, if provided. files = self.game_config.get("files") or [] pwads = [ f for f in files if f.lower().endswith(".wad") or f.lower().endswith(".pk3") ] deh = [f for f in files if f.lower().endswith(".deh")] bex = [f for f in files if f.lower().endswith(".bex")] if deh: command.append("-deh") command.append(deh[0]) if bex: command.append("-bex") command.append(bex[0]) if pwads: command.append("-file") for pwad in pwads: command.append(pwad) # Append additional arguments, if provided. args = self.game_config.get("args") or "" for arg in shlex.split(args): command.append(arg) return {"command": command}