mirror of
https://github.com/LIV2/amiberry.git
synced 2025-12-06 06:32:45 +00:00
enhancement: Added option to use JST instead of WHDLoad binary
In case someone needs this, there is now an option to use JST instead of WHDLoad for the Booter. use_jst_instead_of_whd (boolean) The option is saved in the global configuration of amiberry.conf and when enabled, will switch out the startup-sequence references from WHDLoad to JST, including any differences in options. The old AMOS-based booter is not changed with this.
This commit is contained in:
parent
e763a6b602
commit
a3a0b20eb4
@ -1351,6 +1351,7 @@ struct amiberry_options
|
||||
int default_whd_configdelay = 0;
|
||||
bool default_whd_writecache = false;
|
||||
bool default_whd_quit_on_exit = false;
|
||||
bool use_jst_instead_of_whd = false;
|
||||
bool disable_shutdown_button = false;
|
||||
bool allow_display_settings_from_xml = true;
|
||||
int default_soundcard = 0;
|
||||
|
||||
@ -3506,6 +3506,9 @@ void save_amiberry_settings(void)
|
||||
// WHDLoad Quit emulator after game exits
|
||||
write_bool_option("default_whd_quit_on_exit", amiberry_options.default_whd_quit_on_exit);
|
||||
|
||||
// Use JST instead of WHDLoad
|
||||
write_bool_option("use_jst_instead_of_whd", amiberry_options.use_jst_instead_of_whd);
|
||||
|
||||
// Disable Shutdown button in GUI
|
||||
write_bool_option("disable_shutdown_button", amiberry_options.disable_shutdown_button);
|
||||
|
||||
@ -3782,6 +3785,7 @@ static int parse_amiberry_settings_line(const char *path, char *linea)
|
||||
ret |= cfgfile_intval(option, value, "default_whd_configdelay", &amiberry_options.default_whd_configdelay, 1);
|
||||
ret |= cfgfile_yesno(option, value, "default_whd_writecache", &amiberry_options.default_whd_writecache);
|
||||
ret |= cfgfile_yesno(option, value, "default_whd_quit_on_exit", &amiberry_options.default_whd_quit_on_exit);
|
||||
ret |= cfgfile_yesno(option, value, "use_jst_instead_of_whd", &amiberry_options.use_jst_instead_of_whd);
|
||||
ret |= cfgfile_yesno(option, value, "disable_shutdown_button", &amiberry_options.disable_shutdown_button);
|
||||
ret |= cfgfile_yesno(option, value, "allow_display_settings_from_xml", &amiberry_options.allow_display_settings_from_xml);
|
||||
ret |= cfgfile_intval(option, value, "default_soundcard", &amiberry_options.default_soundcard, 1);
|
||||
|
||||
@ -1071,18 +1071,30 @@ void create_startup_sequence()
|
||||
{
|
||||
whd_bootscript << "DH3:C/Assign LIBS: DH3:LIBS/ ADD\n";
|
||||
}
|
||||
|
||||
if (amiberry_options.use_jst_instead_of_whd)
|
||||
whd_bootscript << "IF NOT EXISTS JST\n";
|
||||
else
|
||||
whd_bootscript << "IF NOT EXISTS WHDLoad\n";
|
||||
|
||||
whd_bootscript << "DH3:C/Assign C: DH3:C/ ADD\n";
|
||||
whd_bootscript << "ENDIF\n";
|
||||
|
||||
whd_bootscript << "CD \"Games:" << whdload_prefs.sub_path << "\"\n";
|
||||
if (amiberry_options.use_jst_instead_of_whd)
|
||||
whd_bootscript << "JST SLAVE=\"Games:" << whdload_prefs.sub_path << "/" << whdload_prefs.selected_slave.filename << "\"";
|
||||
else
|
||||
whd_bootscript << "WHDLoad SLAVE=\"Games:" << whdload_prefs.sub_path << "/" << whdload_prefs.selected_slave.filename << "\"";
|
||||
|
||||
// Write Cache
|
||||
if (amiberry_options.use_jst_instead_of_whd)
|
||||
whd_bootscript << " PRELOAD ";
|
||||
else
|
||||
whd_bootscript << " PRELOAD NOREQ";
|
||||
if (!whdload_prefs.write_cache)
|
||||
{
|
||||
if (amiberry_options.use_jst_instead_of_whd)
|
||||
whd_bootscript << " NOCACHE";
|
||||
else
|
||||
whd_bootscript << " NOWRITECACHE";
|
||||
}
|
||||
|
||||
@ -1209,6 +1221,8 @@ void set_booter_drives(uae_prefs* prefs, const char* filepath)
|
||||
void whdload_auto_prefs(uae_prefs* prefs, const char* filepath)
|
||||
{
|
||||
write_log("WHDBooter Launched\n");
|
||||
if (amiberry_options.use_jst_instead_of_whd)
|
||||
write_log("WHDBooter - Using JST instead of WHDLoad\n");
|
||||
|
||||
if (lstAvailableROMs.empty())
|
||||
RescanROMs();
|
||||
@ -1242,9 +1256,6 @@ void whdload_auto_prefs(uae_prefs* prefs, const char* filepath)
|
||||
whd_startup = "/tmp/amiberry/s/startup-sequence";
|
||||
std::filesystem::remove(whd_startup);
|
||||
|
||||
// LOAD HOST OPTIONS
|
||||
whd_path = whdbooter_path / "WHDLoad";
|
||||
|
||||
// are we using save-data/ ?
|
||||
kickstart_path = std::filesystem::path(get_savedatapath(true)) / "Kickstarts";
|
||||
|
||||
@ -1280,6 +1291,17 @@ void whdload_auto_prefs(uae_prefs* prefs, const char* filepath)
|
||||
|
||||
// now we should have a startup-sequence file (if we don't, we are going to use the original booter)
|
||||
if (std::filesystem::exists(whd_startup))
|
||||
{
|
||||
if (amiberry_options.use_jst_instead_of_whd)
|
||||
{
|
||||
// create a symlink to JST in /tmp/amiberry/
|
||||
whd_path = whdbooter_path / "JST";
|
||||
if (std::filesystem::exists(whd_path) && !std::filesystem::exists("/tmp/amiberry/c/JST")) {
|
||||
write_log("WHDBooter - Creating symlink to JST in /tmp/amiberry/c/ \n");
|
||||
std::filesystem::create_symlink(whd_path, "/tmp/amiberry/c/JST");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// create a symlink to WHDLoad in /tmp/amiberry/
|
||||
whd_path = whdbooter_path / "WHDLoad";
|
||||
@ -1287,6 +1309,7 @@ void whdload_auto_prefs(uae_prefs* prefs, const char* filepath)
|
||||
write_log("WHDBooter - Creating symlink to WHDLoad in /tmp/amiberry/c/ \n");
|
||||
std::filesystem::create_symlink(whd_path, "/tmp/amiberry/c/WHDLoad");
|
||||
}
|
||||
}
|
||||
|
||||
// Create a symlink to AmiQuit in /tmp/amiberry/
|
||||
whd_path = whdbooter_path / "AmiQuit";
|
||||
|
||||
BIN
whdboot/JST
Normal file
BIN
whdboot/JST
Normal file
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user