Exemplo n.º 1
0
def app_main():
    from launcher.launcherapp import LauncherApp

    launcherapp = LauncherApp()

    gscontext = FSGameSystemContext()
    print("\n\n\n")
    # print(gscontext.config.items())
    config = gscontext.config
    config.set("amiga_model", "A4000")

    amigaforeverdir = os.path.join(
        FSGSDirectories.get_base_dir(), "AmigaForever"
    )
    amigafilesdir = os.path.join(amigaforeverdir, "Amiga Files")
    shareddir = os.path.join(amigafilesdir, "Shared")
    romdir = os.path.join(shareddir, "rom")
    systemdir = os.path.join(shareddir, "dir", "System")
    workdir = os.path.join(shareddir, "dir", "Work")
    config.set(
        "kickstart_file", os.path.join(romdir, "amiga-os-310-a4000.rom")
    )
    # FIXME: Shouldn't be necessary...
    config.set(
        "x_kickstart_file", os.path.join(romdir, "amiga-os-310-a4000.rom")
    )
    config.set("hard_drive_0", systemdir)
    config.set("hard_drive_1", workdir)

    # config.set("hard_drive_2", os.path.join(FSGSDirectories.get_base_dir(), "Work"))

    # config.set("zorro_iii_memory", "65536")
    config.set("graphics_card", "uaegfx")

    config.set("window_width", "800")
    config.set("window_height", "600")
    config.set("legacy", "1")

    print(gscontext.config.items())
    # sys.exit(1)
    # gscontext.config.set()

    platform_handler = PlatformHandler.create("amiga")
    driver = platform_handler.get_runner(gscontext)

    device_helper = EnumerateHelper()
    device_helper.default_port_selection(driver.ports, driver.options)

    driver.prepare()
    driver.install()
    # set_progress("__run__")
    driver.run()
    driver.wait()
    driver.finish()
Exemplo n.º 2
0
    def start(self):
        assert self.thread is None

        platform_handler = PlatformHandler.create(self.fsgs.game.platform.id)
        self.runner = platform_handler.get_runner(self.fsgs)

        device_helper = EnumerateHelper()
        device_helper.default_port_selection(self.runner.ports)

        self.thread = threading.Thread(target=self._thread)
        self.thread.start()
Exemplo n.º 3
0
    def run(self):
        device_helper = EnumerateHelper()
        device_helper.default_port_selection(self.driver.ports,
                                             self.driver.options)

        self.driver.prepare()
        self.driver.install()
        self.set_progress("__run__")
        self.driver.run()
        self.driver.wait()
        self.driver.finish()
    def run_game(self):
        from fsgamesys.platforms.platform import PlatformHandler

        platform_handler = PlatformHandler.create(self.game.platform.id)
        runner = platform_handler.get_runner(self)

        from fsgamesys.input.enumeratehelper import EnumerateHelper

        device_helper = EnumerateHelper()
        device_helper.default_port_selection(runner.ports, runner.options)

        runner.prepare()
        process = runner.run()
        process.wait()
        runner.finish()
Exemplo n.º 5
0
 def __init__(self, port, mapping):
     InputMapper.__init__(self, port, mapping)
     helper = EnumerateHelper()
     helper.init()
     seen_ids = set()
     self.id_map = {}
     for device in helper.devices:
         uid = self.calculate_unique_id(device)
         while uid in seen_ids:
             uid += 1
         seen_ids.add(uid)
         self.id_map[device.id] = uid
     print("MednafenInputMapper device map")
     for id, uid in self.id_map.items():
         print(uid, id)
Exemplo n.º 6
0
def app_main():
    args = []
    for arg in sys.argv[1:]:
        if not arg.startswith("--"):
            args.append(arg)
    if len(args) == 0:
        print("Usage: fsgc [options] <game_uuid | variant_uuid>")
        return

    game_or_variant_uuid = args[-1]
    print(game_or_variant_uuid)

    fsgc = default_context()
    fsgc.load_game_by_uuid(game_or_variant_uuid)
    fsgc.config.add_from_argv()

    print("settings:fullscreen", Settings.instance()["fullscreen"])
    print("config:fullscreen", fsgc.config.get("fullscreen"))

    # sys.exit(1)
    # fsgc.run_game()

    from fsgamesys.platforms.platform import Platform

    platform = Platform.create(fsgc.game.platform.id)
    driver = platform.driver(fsgc)

    from fsgamesys.input.enumeratehelper import EnumerateHelper

    device_helper = EnumerateHelper()
    device_helper.default_port_selection(driver.ports, driver.options)

    print("")
    for port in driver.ports:
        print("Port", port.index)
        print(" ", port.type, [x["type"] for x in port.types])
        print(" ", port.device)
    print("")

    # sys.exit(1)

    driver.prepare()
    process = driver.run()
    process.wait()
    driver.finish()
Exemplo n.º 7
0
    def run_config_in_background(config):
        print(config)

        gscontext = FSGameSystemContext()
        gscontext.config.set(config.items())

        platform_handler = PlatformHandler.create("amiga")
        driver = platform_handler.get_runner(gscontext)

        device_helper = EnumerateHelper()
        device_helper.default_port_selection(driver.ports, driver.options)

        driver.prepare()
        driver.install()

        # import sys
        # sys.exit(1)

        # set_progress("__run__")
        driver.run()

        Thread(None, runhelper_cleanup_thread, args=(driver,)).start()