Пример #1
0
from meowlauncher.config.main_config import main_config
from meowlauncher.data.emulated_platforms import all_mame_drivers
from meowlauncher.util.name_utils import normalize_name
from meowlauncher.util.utils import (find_filename_tags_at_end, load_dict,
                                     remove_capital_article,
                                     remove_filename_tags)

from .mame_support_files import (MachineCategory, OrganizedCatlist,
                                 get_category, get_machine_cat,
                                 organize_catlist)
from .mame_utils import consistentify_manufacturer, untangle_manufacturer

if TYPE_CHECKING:
	from .mame_executable import MAMEExecutable

_subtitles = load_dict(None, 'subtitles')

mame_statuses: dict[Optional[str], EmulationStatus] = {
	#It is optional[str] so that we can .get None and have it return whatever default
	'good': EmulationStatus.Good,
	'imperfect': EmulationStatus.Imperfect,
	'preliminary': EmulationStatus.Broken,
}

class MediaSlot():
	def __init__(self, xml: ElementTree.Element):
		self.type = xml.attrib.get('type')
		self.tag = xml.attrib.get('tag')
		self.fixed_image = xml.attrib.get('fixed_image')
		self.mandatory = xml.attrib.get('mandatory', '0') == '1'
		self.interface = xml.attrib.get('interface')
Пример #2
0
from meowlauncher.games.mame_common.mame_executable import \
    MAMENotInstalledException
from meowlauncher.games.mame_common.mame_helpers import default_mame_executable
from meowlauncher.games.roms.rom import FileROM
from meowlauncher.metadata import Date, Metadata
from meowlauncher.platform_types import MegadriveRegionCodes
from meowlauncher.util import cd_read
from meowlauncher.util.utils import load_dict

from .common.atari_controllers import megadrive_pad as standard_gamepad

if TYPE_CHECKING:
    from meowlauncher.games.mame_common.software_list import Software
    from meowlauncher.games.roms.rom_game import ROMGame

_licensee_codes = load_dict(None, 'sega_licensee_codes')

_copyright_regex = re.compile(r'\(C\)(\S{4}.)(\d{4})\.(.{3})')
_t_with_zero = re.compile(r'^T-0')
_t_not_followed_by_dash = re.compile(r'^T(?!-)')


def _parse_peripherals(metadata: Metadata, peripherals: Collection[str]):
    for peripheral_char in peripherals:
        if peripheral_char == 'M':
            #3 buttons if I'm not mistaken
            mouse = input_metadata.Mouse()
            mouse.buttons = 3
            metadata.input_info.add_option(mouse)
        elif peripheral_char == 'V':
            #Is this just the SMS paddle?
Пример #3
0
from meowlauncher.games.mame_common.mame_executable import \
    MAMENotInstalledException
from meowlauncher.games.mame_common.mame_helpers import default_mame_executable
from meowlauncher.platform_types import SNESExpansionChip
from meowlauncher.util.region_info import regions_by_name
from meowlauncher.util.utils import (NotAlphanumericException,
                                     convert_alphanumeric, load_dict)

from .common import snes_controllers as controllers

if TYPE_CHECKING:
    from meowlauncher.games.mame_common.software_list import Software
    from meowlauncher.games.roms.rom import FileROM
    from meowlauncher.metadata import Metadata

_nintendo_licensee_codes = load_dict(None, 'nintendo_licensee_codes')


class BadSNESHeaderException(Exception):
    pass


_ram_rom_sizes = {i: (1 << i) * 1024 for i in range(0, 256)}

_rom_layouts = {
    0x20: "LoROM",
    0x21: "HiROM",
    0x22: "LoROM + S-DD1",
    0x23: "LoROM + SA-1",
    0x30: "LoROM + FastROM",
    0x31: "HiROM + FastROM",
Пример #4
0
    add_metadata_for_raw_exe, check_for_interesting_things_in_folder)
from meowlauncher.games.steam.steam_utils import (normalize_developer,
                                                  translate_language_list)
from meowlauncher.metadata import Date
from meowlauncher.util.desktop_files import has_been_done
from meowlauncher.util.name_utils import normalize_name_case
from meowlauncher.util.utils import load_dict, remove_capital_article

if have_steamfiles or TYPE_CHECKING:
	from meowlauncher.games.steam.steam_game import LauncherInfo, SteamGame
	from meowlauncher.games.steam.steam_installation import (IconError,
	                                                         IconNotFoundError,
	                                                         SteamInstallation)


store_categories = load_dict(None, 'steam_store_categories')
genre_ids = load_dict(None, 'steam_genre_ids')

class SteamState():
	class __SteamState():
		#If you have Steam installed twice in different locations somehow then that is your own problem, but I don't think that's really a thing that people do
		def __init__(self) -> None:
			self.steam_installation = None
			#Most likely the former will be present as a symlink to the latter, I don't know if weird distros install it any differently
			possible_locations = ('~/.steam/steam', '~/.local/share/steam', '~/.local/share/Steam')
			steam_path = None
			for location in possible_locations:
				location = os.path.expanduser(location)

				if os.path.isdir(location):
					steam_path = location