def app_main(): FSGSDirectories.initialize() Settings.instance().verbose = False Settings.instance().load() print("base_dir", FSGSDirectories.get_base_dir()) print("cache_dir", FSGSDirectories.get_cache_dir()) print("cdroms_dir", FSGSDirectories.get_cdroms_dir()) print("configurations_dir", FSGSDirectories.get_configurations_dir()) print("controllers_dir", FSGSDirectories.get_controllers_dir()) print("covers_dir", FSGSDirectories.get_covers_dir()) print("data_dir", FSGSDirectories.get_data_dir()) print("downloads_dir", FSGSDirectories.downloads_dir()) print("floppies_dir", FSGSDirectories.get_floppies_dir()) print("hard_drives_dir", FSGSDirectories.get_hard_drives_dir()) # print("images_dir", FSGSDirectories.get_images_dir()) print("kickstarts_dir", FSGSDirectories.get_kickstarts_dir()) print("launcher_dir", FSGSDirectories.get_launcher_dir()) print("logs_dir", FSGSDirectories.get_logs_dir()) print("plugins_dir", FSGSDirectories.get_plugins_dir()) # print("portable_dir", FSGSDirectories.portable_dir()) print("save_states_dir", FSGSDirectories.get_save_states_dir()) print("screenshots_dir", FSGSDirectories.get_screenshots_dir()) print("screenshots_output_dir =", FSGSDirectories.screenshots_output_dir()) print("themes_dir", FSGSDirectories.get_themes_dir()) print("titles_dir", FSGSDirectories.get_titles_dir())
def decode_path(self, path): if not path or path[0] != "$": return path base_dir = FSGSDirectories.get_base_dir() + "/" if path.startswith("$/"): path = base_dir + path[2:] return path
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()
def encode_path(self, path): # This only works if both path and FSGSDirectories.base_dir (etc) have # been normalized with get_real_case. path = path.replace("\\", "/") base_dir = FSGSDirectories.get_base_dir() if path.startswith(base_dir): path = path[len(base_dir):] if path.startswith("/"): path = path[1:] path = "$/" + path return path
def get_default_directory(media_type): if media_type == "floppy": return FSGSDirectories.get_floppies_dir() elif media_type == "cd": return FSGSDirectories.get_cdroms_dir() elif media_type == "hd": return FSGSDirectories.get_hard_drives_dir() elif media_type == "rom": return FSGSDirectories.get_kickstarts_dir() # FIXME: Return new Media directory instead return FSGSDirectories.get_base_dir()
def plugin_path(cls): # Plugins dir location has changed, add several old and new paths here # to find plugins in both places (FS-UAE and OpenRetro style). result = [] # $BASE/Plugins/ or $BASE/Data/Plugins/ plugins_dir = FSGSDirectories.get_plugins_dir() result.append(plugins_dir) # $BASE/Plugins/ plugins_dir = os.path.join(FSGSDirectories.get_base_dir(), "Plugins") if plugins_dir not in result: result.append(plugins_dir) # $BASE/Data/Plugins/ plugins_dir = os.path.join(FSGSDirectories.get_data_dir(), "Plugins") if plugins_dir not in result: result.append(plugins_dir) # # $BASE/Workspace/Expansion/ # plugins_dir = os.path.join( # FSGSDirectories.get_base_dir(), "Workspace", "Expansion" # ) # if plugins_dir and os.path.isdir(plugins_dir): # result.append(plugins_dir) if not fsboot.development(): if System.macos: escape_exe_dir = "../../../../../.." else: escape_exe_dir = "../../.." # FIXME: Check that this contains something known first? # System/ plugins_dir = os.path.normpath( os.path.join(fsboot.executable_dir(), escape_exe_dir)) result.append(plugins_dir) # FIXME: Check that this contains something known first? # System/Plugins/ plugins_dir = os.path.normpath( os.path.join(fsboot.executable_dir(), escape_exe_dir, "Plugins")) result.append(plugins_dir) return result
def get_settings_path(self): settings_ini = os.path.join(FSGSDirectories.get_data_dir(), "Settings.ini") if not os.path.exists(settings_ini): migrate_list = [ os.path.join(FSGSDirectories.get_data_dir(), "FS-UAE Launcher.ini") ] portable_ini = os.path.join(FSGSDirectories.get_base_dir(), "Portable.ini") # move the highest-priority settings file if present for migrate in migrate_list: if os.path.exists(migrate): shutil.move(migrate, settings_ini) break # remove all old settings files for migrate in migrate_list: if os.path.exists(migrate): os.remove(migrate) return settings_ini
def volume_host_path(volume): if volume == "data:": return FSGSDirectories.get_data_dir() elif volume == "amigaforever:": return os.path.join(FSGSDirectories.get_base_dir(), "AmigaForever") elif volume == "games:": return os.path.join(FSGSDirectories.get_base_dir(), "Games") elif volume == "media:": return os.path.join(FSGSDirectories.get_base_dir(), "Media") elif volume == "ram disk:": # return os.path.join(FSGSDirectories.get_base_dir(), "Cache") return os.path.join(temp_directory()) elif volume == "shared:": # Or ...HardDrives/Shared ? return os.path.join(FSGSDirectories.get_base_dir(), "Shared") elif volume == "software:": return os.path.join(FSGSDirectories.get_base_dir(), "Software") elif volume == "whdload:": return os.path.join(FSGSDirectories.get_base_dir(), "WHDLoad") elif volume == "work:": return os.path.join(FSGSDirectories.get_base_dir(), "Work") else: return None
def get_base_dir(self): # FIXME: dependency loop return FSGSDirectories.get_base_dir()