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:
Dimitris Panokostas 2024-09-02 22:29:28 +02:00
parent e763a6b602
commit a3a0b20eb4
No known key found for this signature in database
GPG Key ID: 330156A68E9E0929
5 changed files with 40 additions and 12 deletions

View File

@ -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;

View File

@ -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);

View File

@ -1071,19 +1071,31 @@ 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 << "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";
whd_bootscript << "WHDLoad SLAVE=\"Games:" << whdload_prefs.sub_path << "/" << whdload_prefs.selected_slave.filename << "\"";
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
whd_bootscript << " PRELOAD NOREQ";
if (amiberry_options.use_jst_instead_of_whd)
whd_bootscript << " PRELOAD ";
else
whd_bootscript << " PRELOAD NOREQ";
if (!whdload_prefs.write_cache)
{
whd_bootscript << " NOWRITECACHE";
if (amiberry_options.use_jst_instead_of_whd)
whd_bootscript << " NOCACHE";
else
whd_bootscript << " NOWRITECACHE";
}
// CUSTOM options
@ -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";
@ -1281,11 +1292,23 @@ 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))
{
// create a symlink to WHDLoad in /tmp/amiberry/
whd_path = whdbooter_path / "WHDLoad";
if (std::filesystem::exists(whd_path) && !std::filesystem::exists("/tmp/amiberry/c/WHDLoad")) {
write_log("WHDBooter - Creating symlink to WHDLoad in /tmp/amiberry/c/ \n");
std::filesystem::create_symlink(whd_path, "/tmp/amiberry/c/WHDLoad");
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";
if (std::filesystem::exists(whd_path) && !std::filesystem::exists("/tmp/amiberry/c/WHDLoad")) {
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/

BIN
whdboot/JST Normal file

Binary file not shown.

Binary file not shown.