def command(self) -> LaunchCommand:
     args = ['-f']
     if main_config.scummvm_config_path != Path(
             '~/.config/scummvm/scummvm.ini').expanduser():
         args.append(f'--config={str(main_config.scummvm_config_path)}')
     args.append(self.game.game_id)
     return LaunchCommand(self.runner.config.exe_path, args)
Exemple #2
0
def mame_driver(game: 'ROMGame',
                emulator_config: 'EmulatorConfig',
                driver: str,
                slot=None,
                slot_options: Optional[Mapping[str, str]] = None,
                has_keyboard=False,
                autoboot_script=None) -> LaunchCommand:
    #Hmm I might need to refactor this and mame_system when I figure out what I'm doing
    compat_threshold = cast(
        int, emulator_config.options.get('software_compatibility_threshold',
                                         1))
    software = game.metadata.specific_info.get('MAME Software')
    if software and compat_threshold > -1:
        #We assume something without software Just Works, well unless skip_unknown_stuff is enabled down below
        game_compatibility = software.emulation_status
        if game_compatibility and game_compatibility < compat_threshold:
            raise EmulationNotSupportedException(
                f'{software.name} is {game_compatibility.name}')

    skip_unknown = emulator_config.options.get('skip_unknown_stuff', False)
    if skip_unknown and not software:
        raise EmulationNotSupportedException(
            'Does not match anything in software list')

    args = mame_base(driver, slot, slot_options, has_keyboard, autoboot_script)
    return LaunchCommand(emulator_config.exe_path, args)
Exemple #3
0
    def make_launcher(self):
        #if main_config.skip_mame_non_working_software:
        #	if self.metadata.specific_info.get('MAME Emulation Status', EmulationStatus.Unknown) == EmulationStatus.Broken:
        #		raise EmulationNotSupportedException('Not supported')
        #TODO Have option to skip if not working

        launch_params = LaunchCommand('mame',
                                      self.platform.get_launch_params(self))

        make_launcher(launch_params, self.software.description, self.metadata,
                      'MAME software', self.id)
Exemple #4
0
 def get_dosbox_launch_params(self, task: GOGTask) -> LaunchCommand:
     args = tuple(
         self.fix_subfolder_relative_folder(arg, 'dosbox')
         for arg in task.args)
     dosbox_path = main_config.dosbox_path
     dosbox_folder = _find_subpath_case_insensitive(
         self.folder, 'dosbox'
     )  #Game's config files are expecting to be launched from here
     return LaunchCommand(dosbox_path,
                          args,
                          working_directory=str(dosbox_folder))
Exemple #5
0
 def command(self) -> LaunchCommand:
     #TODO: Ideally EmulatorLauncher would do something useful with self.runner and then we call super() but that also needs refactoring
     command = super().command
     if isinstance(self.game.rom, CompressedROM):
         if not self.runner.supports_compressed_extension(
                 self.game.rom.outer_extension):
             temp_extraction_folder = PurePath(
                 tempfile.gettempdir(),
                 'meow-launcher-' + self._make_very_safe_temp_filename())
             extracted_path = temp_extraction_folder.joinpath(
                 self.game.rom.inner_filename)
             command = command.replace_path_argument(extracted_path)
             command = command.prepend_command(
                 LaunchCommand('7z', [
                     'x', '-o' + os.fspath(temp_extraction_folder),
                     os.fspath(self.game.rom.path)
                 ]))
             command = command.append_command(
                 LaunchCommand(
                     'rm', ['-rf', os.fspath(temp_extraction_folder)]))
     else:
         command = command.replace_path_argument(self.game.rom.path)
     return command
Exemple #6
0
def get_launch_params(
    flavour: str, exe_path: Path, windows_info: Optional[Mapping]
) -> Optional[tuple[LaunchCommand, Optional[str]]]:
    if flavour in {'linux', 'script'}:
        #ez pez
        return LaunchCommand(str(exe_path), []), None
    if flavour == 'html':
        #hmm I guess this will do
        return LaunchCommand('xdg-open', [str(exe_path)]), None
    if flavour in {'windows', 'windows-script'}:
        if windows_info and windows_info.get('dotNet', False):
            #Mono does not really count as an emulator but whateves (I mean neither does Wine by the name but for metadata purposes I will)
            return LaunchCommand('mono', [str(exe_path)]), 'Mono'
        #gui might also be useful if it is false
        return launch_with_wine(main_config.wine_path, main_config.wineprefix,
                                str(exe_path), []), 'Wine'
    if flavour == 'jar':
        #Guess we can just assume it's installed who cares
        return LaunchCommand('java', ['-jar', str(exe_path)]), None
    if flavour == 'love':
        #Guess we can also just assume this is installed who cares
        return LaunchCommand('love', [str(exe_path)]), 'LOVE'

    return None
Exemple #7
0
 def make_launcher(self) -> None:
     params = LaunchCommand('steam',
                            ['steam://rungameid/{0}'.format(self.appid)])
     make_launcher(params, self.name, self.metadata, 'Steam',
                   str(self.appid))
Exemple #8
0
 def command(self) -> LaunchCommand:
     return LaunchCommand(str(self.game.start_script), [],
                          working_directory=str(self.game.folder))
Exemple #9
0
 def make_launcher(self) -> None:
     params = LaunchCommand(str(self.start_script), [],
                            working_directory=str(self.folder))
     make_launcher(params, self.name, self.metadata, 'GOG',
                   str(self.folder))
Exemple #10
0
def mednafen_module(module: str, exe_path: str = 'mednafen') -> LaunchCommand:
    return LaunchCommand(
        exe_path,
        ['-video.fs', '1', '-force_module', module, rom_path_argument])
Exemple #11
0
 def inner(game: 'ROMGame', _, emulator_config: 'EmulatorConfig'):
     mapper = game.metadata.specific_info.get('Mapper')
     if mapper and mapper in unsupported_mappers:
         raise EmulationNotSupportedException(mapper + ' not supported')
     return LaunchCommand(emulator_config.exe_path, args)
Exemple #12
0
 def inner(game: 'ROMGame', _, emulator_config: 'EmulatorConfig'):
     _verify_supported_gb_mappers(game, mappers, autodetected_mappers)
     return LaunchCommand(emulator_config.exe_path, args)
Exemple #13
0
 def inner(_, __, emulator_config: 'EmulatorConfig'):
     return LaunchCommand(emulator_config.exe_path,
                          args if args else [rom_path_argument])
Exemple #14
0
 def command(self) -> LaunchCommand:
     return LaunchCommand(
         self.runner.config.exe_path,
         mame_base(self.game.machine_name, bios=self.game.bios_name))