From eeb7fdd1ff7ab2cb2b1ca247f6fd40d83dff0a89 Mon Sep 17 00:00:00 2001 From: Mathieu Comandon Date: Mon, 1 Sep 2014 00:18:17 +0200 Subject: [PATCH] Set rom directory for vice --- lutris/runners/vice.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lutris/runners/vice.py b/lutris/runners/vice.py index 34f73f9c3..ab1bea8ca 100644 --- a/lutris/runners/vice.py +++ b/lutris/runners/vice.py @@ -34,12 +34,12 @@ class vice(Runner): "type": "choice", "label": "Machine", "choices": ( - ("c64", "C64"), - ("c128", "C128"), - ("vic20", "VIC20"), - ("pet", "PET"), - ("plus4", "Plus/4"), - ("cmbii", "CBM-II") + ("C64", "c64"), + ("C128", "c128"), + ("vic20", "vic20"), + ("PET", "pet"), + ("Plus/4", "plus4"), + ("CMB-II", "cbmii") ), "default": "c64" } @@ -59,7 +59,6 @@ class vice(Runner): "pet": "xpet", "plus4": "xplus4", "cmbii": "xcbm2" - } try: executable = executables[machine] @@ -67,9 +66,24 @@ class vice(Runner): raise ValueError("Invalid machine '%s'" % machine) return os.path.join(settings.RUNNER_DIR, "vice/bin/%s" % executable) + def get_roms_path(self, machine=None): + if not machine: + machine = "C64" + paths = { + "c64": "C64", + "c128": "C128", + "vic20": "VIC20", + "pet": "PET", + "plus4": "PLUS4", + "cmbii": "CBM-II" + } + root_dir = os.path.dirname(os.path.dirname(self.get_executable())) + return os.path.join(root_dir, 'lib/vice', paths[machine]) + def play(self): machine = self.runner_config.get("machine") - params = [self.get_executable(machine)] + params = [self.get_executable(machine), + "-chdir", self.get_roms_path(machine)] if self.runner_config.get("fullscreen"): params.append("-fullscreen") if self.runner_config.get("double"):