Moved hostprefs functionality in amiberry.conf
This commit is contained in:
parent
4155877546
commit
890ad9bfd0
6 changed files with 154 additions and 268 deletions
|
@ -1107,8 +1107,10 @@ struct amiberry_options
|
|||
int default_line_mode = 0;
|
||||
int input_default_mouse_speed = 100;
|
||||
bool input_keyboard_as_joystick_stop_keypresses = false;
|
||||
char default_open_gui_key[128]{};
|
||||
char default_open_gui_key[128] = "F12";
|
||||
char default_quit_key[128]{};
|
||||
char default_ar_key[128] = "Pause";
|
||||
char default_fullscreen_toggle_key[128]{};
|
||||
int rotation_angle = 0;
|
||||
bool default_horizontal_centering = false;
|
||||
bool default_vertical_centering = false;
|
||||
|
@ -1116,6 +1118,19 @@ struct amiberry_options
|
|||
bool default_frameskip = false;
|
||||
bool default_correct_aspect_ratio = true;
|
||||
bool default_auto_height = false;
|
||||
int default_width = 640;
|
||||
int default_height = 270;
|
||||
int default_stereo_separation = 7;
|
||||
int default_joystick_deadzone = 33;
|
||||
bool default_retroarch_quit = true;
|
||||
bool default_retroarch_menu = true;
|
||||
bool default_retroarch_reset = false;
|
||||
char default_controller1[128] = "joy1";
|
||||
char default_controller2[128] = "joy2";
|
||||
char default_controller3[128]{};
|
||||
char default_controller4[128]{};
|
||||
char default_mouse1[128] = "mouse";
|
||||
char default_mouse2[128] = "joy0";
|
||||
};
|
||||
|
||||
extern struct amiberry_options amiberry_options;
|
||||
|
|
|
@ -52,7 +52,7 @@ int enter_gui_key = 0;
|
|||
// We don't set a default value for Quitting
|
||||
int quit_key = 0;
|
||||
// The default value for Action Replay is Pause/Break
|
||||
int action_replay_button = SDLK_PAUSE;
|
||||
int action_replay_button = 0;
|
||||
// No default value for Full Screen toggle
|
||||
int fullscreen_key = 0;
|
||||
|
||||
|
@ -67,38 +67,31 @@ std::string get_version_string()
|
|||
void set_key_configs(struct uae_prefs* p)
|
||||
{
|
||||
if (strncmp(p->open_gui, "", 1) != 0)
|
||||
{
|
||||
// If we have a value in the config, we use that instead
|
||||
enter_gui_key = SDL_GetKeyFromName(p->open_gui);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise we go for the default found in amiberry.conf
|
||||
enter_gui_key = SDL_GetKeyFromName(amiberry_options.default_open_gui_key);
|
||||
}
|
||||
// if nothing was found in amiberry.conf either, let's default back to F12
|
||||
// if nothing was found in amiberry.conf either, we default back to F12
|
||||
if (enter_gui_key == 0)
|
||||
enter_gui_key = SDLK_F12;
|
||||
|
||||
if (strncmp(p->quit_amiberry, "", 1) != 0)
|
||||
{
|
||||
// If we have a value in the config, we use that instead
|
||||
quit_key = SDL_GetKeyFromName(p->quit_amiberry);
|
||||
}
|
||||
else
|
||||
{
|
||||
quit_key = SDL_GetKeyFromName(amiberry_options.default_quit_key);
|
||||
}
|
||||
|
||||
if (strncmp(p->action_replay, "", 1) != 0)
|
||||
{
|
||||
action_replay_button = SDL_GetKeyFromName(p->action_replay);
|
||||
}
|
||||
else
|
||||
action_replay_button = SDL_GetKeyFromName(amiberry_options.default_ar_key);
|
||||
if (action_replay_button == 0)
|
||||
action_replay_button = SDLK_PAUSE;
|
||||
|
||||
if (strncmp(p->fullscreen_toggle, "", 1) != 0)
|
||||
{
|
||||
fullscreen_key = SDL_GetKeyFromName(p->fullscreen_toggle);
|
||||
}
|
||||
else
|
||||
fullscreen_key = SDL_GetKeyFromName(amiberry_options.default_fullscreen_toggle_key);
|
||||
}
|
||||
|
||||
int pissoff_value = 15000 * CYCLE_UNIT;
|
||||
|
@ -363,6 +356,9 @@ void target_default_options(struct uae_prefs* p, int type)
|
|||
p->kbd_led_num = -1; // No status on numlock
|
||||
p->kbd_led_scr = -1; // No status on scrollock
|
||||
|
||||
p->gfx_monitor.gfx_size.width = amiberry_options.default_width;
|
||||
p->gfx_monitor.gfx_size.height = amiberry_options.default_height;
|
||||
|
||||
p->gfx_auto_height = amiberry_options.default_auto_height;
|
||||
p->gfx_correct_aspect = amiberry_options.default_correct_aspect_ratio;
|
||||
|
||||
|
@ -407,17 +403,28 @@ void target_default_options(struct uae_prefs* p, int type)
|
|||
#else
|
||||
amiberry_options.use_sdl2_render_thread = false;
|
||||
#endif
|
||||
|
||||
if (amiberry_options.default_stereo_separation >= 0 && amiberry_options.default_stereo_separation <= 10)
|
||||
p->sound_stereo_separation = amiberry_options.default_stereo_separation;
|
||||
|
||||
if (amiberry_options.default_joystick_deadzone >= 0
|
||||
&& amiberry_options.default_joystick_deadzone <= 100
|
||||
&& amiberry_options.default_joystick_deadzone != 33)
|
||||
{
|
||||
p->input_joymouse_deadzone = amiberry_options.default_joystick_deadzone;
|
||||
p->input_joystick_deadzone = amiberry_options.default_joystick_deadzone;
|
||||
}
|
||||
|
||||
_tcscpy(p->open_gui, amiberry_options.default_open_gui_key);
|
||||
_tcscpy(p->quit_amiberry, amiberry_options.default_quit_key);
|
||||
_tcscpy(p->action_replay, "Pause");
|
||||
_tcscpy(p->fullscreen_toggle, "");
|
||||
_tcscpy(p->action_replay, amiberry_options.default_ar_key);
|
||||
_tcscpy(p->fullscreen_toggle, amiberry_options.default_fullscreen_toggle_key);
|
||||
|
||||
p->input_analog_remap = false;
|
||||
|
||||
p->use_retroarch_quit = true;
|
||||
p->use_retroarch_menu = true;
|
||||
p->use_retroarch_reset = false;
|
||||
p->use_retroarch_quit = amiberry_options.default_retroarch_quit;
|
||||
p->use_retroarch_menu = amiberry_options.default_retroarch_menu;
|
||||
p->use_retroarch_reset = amiberry_options.default_retroarch_reset;
|
||||
|
||||
#ifdef ANDROID
|
||||
p->onScreen = 1;
|
||||
|
@ -911,6 +918,14 @@ void save_amiberry_settings(void)
|
|||
snprintf(buffer, MAX_DPATH, "default_quit_key=%s\n", amiberry_options.default_quit_key);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Default key for opening Action Replay
|
||||
snprintf(buffer, MAX_DPATH, "default_ar_key=%s\n", amiberry_options.default_ar_key);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Default key for Fullscreen Toggle
|
||||
snprintf(buffer, MAX_DPATH, "default_fullscreen_toggle_key=%s\n", amiberry_options.default_fullscreen_toggle_key);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Rotation angle of the output display (useful for screens with portrait orientation, like the Go Advance)
|
||||
snprintf(buffer, MAX_DPATH, "rotation_angle=%d\n", amiberry_options.rotation_angle);
|
||||
fputs(buffer, f);
|
||||
|
@ -940,6 +955,58 @@ void save_amiberry_settings(void)
|
|||
snprintf(buffer, MAX_DPATH, "default_auto_height=%s\n", amiberry_options.default_auto_height ? "yes" : "no");
|
||||
fputs(buffer, f);
|
||||
|
||||
// Default Screen Width
|
||||
snprintf(buffer, MAX_DPATH, "default_width=%d\n", amiberry_options.default_width);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Default Screen Height
|
||||
snprintf(buffer, MAX_DPATH, "default_height=%d\n", amiberry_options.default_height);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Default Stereo Separation
|
||||
snprintf(buffer, MAX_DPATH, "default_stereo_separation=%d\n", amiberry_options.default_stereo_separation);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Default Joystick Deadzone
|
||||
snprintf(buffer, MAX_DPATH, "default_joystick_deadzone=%d\n", amiberry_options.default_joystick_deadzone);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Enable RetroArch Quit by default?
|
||||
snprintf(buffer, MAX_DPATH, "default_retroarch_quit=%s\n", amiberry_options.default_retroarch_quit ? "yes" : "no");
|
||||
fputs(buffer, f);
|
||||
|
||||
// Enable RetroArch Menu by default?
|
||||
snprintf(buffer, MAX_DPATH, "default_retroarch_menu=%s\n", amiberry_options.default_retroarch_menu ? "yes" : "no");
|
||||
fputs(buffer, f);
|
||||
|
||||
// Enable RetroArch Reset by default?
|
||||
snprintf(buffer, MAX_DPATH, "default_retroarch_reset=%s\n", amiberry_options.default_retroarch_reset ? "yes" : "no");
|
||||
fputs(buffer, f);
|
||||
|
||||
// Controller1
|
||||
snprintf(buffer, MAX_DPATH, "default_controller1=%s\n", amiberry_options.default_controller1);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Controller2
|
||||
snprintf(buffer, MAX_DPATH, "default_controller2=%s\n", amiberry_options.default_controller2);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Controller3
|
||||
snprintf(buffer, MAX_DPATH, "default_controller3=%s\n", amiberry_options.default_controller3);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Controller4
|
||||
snprintf(buffer, MAX_DPATH, "default_controller4=%s\n", amiberry_options.default_controller4);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Mouse1
|
||||
snprintf(buffer, MAX_DPATH, "default_mouse1=%s\n", amiberry_options.default_mouse1);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Mouse2
|
||||
snprintf(buffer, MAX_DPATH, "default_mouse2=%s\n", amiberry_options.default_mouse2);
|
||||
fputs(buffer, f);
|
||||
|
||||
// Paths
|
||||
snprintf(buffer, MAX_DPATH, "path=%s\n", currentDir);
|
||||
fputs(buffer, f);
|
||||
|
@ -1134,6 +1201,8 @@ void load_amiberry_settings(void)
|
|||
cfgfile_yesno(option, value, "input_keyboard_as_joystick_stop_keypresses", &amiberry_options.input_keyboard_as_joystick_stop_keypresses);
|
||||
cfgfile_string(option, value, "default_open_gui_key", amiberry_options.default_open_gui_key, sizeof amiberry_options.default_open_gui_key);
|
||||
cfgfile_string(option, value, "default_quit_key", amiberry_options.default_quit_key, sizeof amiberry_options.default_quit_key);
|
||||
cfgfile_string(option, value, "default_ar_key", amiberry_options.default_ar_key, sizeof amiberry_options.default_ar_key);
|
||||
cfgfile_string(option, value, "default_fullscreen_toggle_key", amiberry_options.default_fullscreen_toggle_key, sizeof amiberry_options.default_fullscreen_toggle_key);
|
||||
cfgfile_intval(option, value, "rotation_angle", &amiberry_options.rotation_angle, 1);
|
||||
cfgfile_yesno(option, value, "default_horizontal_centering", &amiberry_options.default_horizontal_centering);
|
||||
cfgfile_yesno(option, value, "default_vertical_centering", &amiberry_options.default_vertical_centering);
|
||||
|
@ -1141,6 +1210,19 @@ void load_amiberry_settings(void)
|
|||
cfgfile_yesno(option, value, "default_frameskip", &amiberry_options.default_frameskip);
|
||||
cfgfile_yesno(option, value, "default_correct_aspect_ratio", &amiberry_options.default_correct_aspect_ratio);
|
||||
cfgfile_yesno(option, value, "default_auto_height", &amiberry_options.default_auto_height);
|
||||
cfgfile_intval(option, value, "default_width", &amiberry_options.default_width, 1);
|
||||
cfgfile_intval(option, value, "default_height", &amiberry_options.default_height, 1);
|
||||
cfgfile_intval(option, value, "default_stereo_separation", &amiberry_options.default_stereo_separation, 1);
|
||||
cfgfile_intval(option, value, "default_joystick_deadzone", &amiberry_options.default_joystick_deadzone, 1);
|
||||
cfgfile_yesno(option, value, "default_retroarch_quit", &amiberry_options.default_retroarch_quit);
|
||||
cfgfile_yesno(option, value, "default_retroarch_menu", &amiberry_options.default_retroarch_menu);
|
||||
cfgfile_yesno(option, value, "default_retroarch_reset", &amiberry_options.default_retroarch_reset);
|
||||
cfgfile_string(option, value, "default_controller1", amiberry_options.default_controller1, sizeof amiberry_options.default_controller1);
|
||||
cfgfile_string(option, value, "default_controller2", amiberry_options.default_controller2, sizeof amiberry_options.default_controller2);
|
||||
cfgfile_string(option, value, "default_controller3", amiberry_options.default_controller3, sizeof amiberry_options.default_controller3);
|
||||
cfgfile_string(option, value, "default_controller4", amiberry_options.default_controller4, sizeof amiberry_options.default_controller4);
|
||||
cfgfile_string(option, value, "default_mouse1", amiberry_options.default_mouse1, sizeof amiberry_options.default_mouse1);
|
||||
cfgfile_string(option, value, "default_mouse2", amiberry_options.default_mouse2, sizeof amiberry_options.default_mouse2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,27 +53,6 @@ struct game_options
|
|||
TCHAR z3[256] = "nul\0";
|
||||
};
|
||||
|
||||
struct host_options
|
||||
{
|
||||
TCHAR controller1[256] = "nul\0";
|
||||
TCHAR controller2[256] = "nul\0";
|
||||
TCHAR controller3[256] = "nul\0";
|
||||
TCHAR controller4[256] = "nul\0";
|
||||
TCHAR mouse1[256] = "nul\0";
|
||||
TCHAR mouse2[256] = "nul\0";
|
||||
TCHAR ra_quit[256] = "nul\0";
|
||||
TCHAR ra_menu[256] = "nul\0";
|
||||
TCHAR ra_reset[256] = "nul\0";
|
||||
TCHAR deadzone[256] = "nul\0";
|
||||
TCHAR stereo_split[256] = "nul\0";
|
||||
TCHAR sound_on[256] = "nul\0";
|
||||
TCHAR sound_mode[256] = "nul\0";
|
||||
TCHAR fixed_height[256] = "nul\0";
|
||||
TCHAR fixed_width[256] = "nul\0";
|
||||
TCHAR fixed_cd32_height[256] = "nul\0";
|
||||
TCHAR fixed_cd32_width[256] = "nul\0";
|
||||
};
|
||||
|
||||
static xmlNode* get_node(xmlNode* node, const char* name)
|
||||
{
|
||||
for (auto* curr_node = node; curr_node; curr_node = curr_node->next)
|
||||
|
@ -236,30 +215,6 @@ struct game_options get_game_settings(char* HW)
|
|||
return output_detail;
|
||||
}
|
||||
|
||||
struct host_options get_host_settings(char* HW)
|
||||
{
|
||||
struct host_options output_detail;
|
||||
strcpy(output_detail.controller1, find_whdload_game_option("CONTROLLER_1", HW).c_str());
|
||||
strcpy(output_detail.controller2, find_whdload_game_option("CONTROLLER_2", HW).c_str());
|
||||
strcpy(output_detail.controller3, find_whdload_game_option("CONTROLLER_3", HW).c_str());
|
||||
strcpy(output_detail.controller4, find_whdload_game_option("CONTROLLER_4", HW).c_str());
|
||||
strcpy(output_detail.mouse1, find_whdload_game_option("CONTROLLER_MOUSE_1", HW).c_str());
|
||||
strcpy(output_detail.mouse2, find_whdload_game_option("CONTROLLER_MOUSE_2", HW).c_str());
|
||||
strcpy(output_detail.ra_quit, find_whdload_game_option("RETROARCH_QUIT", HW).c_str());
|
||||
strcpy(output_detail.ra_menu, find_whdload_game_option("RETROARCH_MENU", HW).c_str());
|
||||
strcpy(output_detail.ra_reset, find_whdload_game_option("RETROARCH_RESET", HW).c_str());
|
||||
strcpy(output_detail.deadzone, find_whdload_game_option("DEADZONE", HW).c_str());
|
||||
strcpy(output_detail.stereo_split, find_whdload_game_option("STEREO_SPLIT", HW).c_str());
|
||||
strcpy(output_detail.sound_on, find_whdload_game_option("SOUND_ON", HW).c_str());
|
||||
strcpy(output_detail.sound_mode, find_whdload_game_option("SOUND_MODE", HW).c_str());
|
||||
strcpy(output_detail.fixed_height, find_whdload_game_option("FIXED_HEIGHT", HW).c_str());
|
||||
strcpy(output_detail.fixed_width, find_whdload_game_option("FIXED_WIDTH", HW).c_str());
|
||||
strcpy(output_detail.fixed_cd32_height, find_whdload_game_option("FIXED_CD32_HEIGHT", HW).c_str());
|
||||
strcpy(output_detail.fixed_cd32_width, find_whdload_game_option("FIXED_CD32_WIDTH", HW).c_str());
|
||||
|
||||
return output_detail;
|
||||
}
|
||||
|
||||
void make_rom_symlink(const char* kick_short, char* kick_path, int kick_numb, struct uae_prefs* p)
|
||||
{
|
||||
char kick_long[MAX_DPATH];
|
||||
|
@ -314,19 +269,6 @@ void symlink_roms(struct uae_prefs* prefs)
|
|||
make_rom_symlink("kick40068.A1200", kick_path, 15, prefs);
|
||||
make_rom_symlink("kick40068.A4000", kick_path, 16, prefs);
|
||||
|
||||
// these ones could not be located in 'rommgr.cpp' although all but one are BETA(?) anyway
|
||||
// make_rom_symlink("kick36143.A3000", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick39046.A500.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick39106.A500.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick39110.A500.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick39115.A3000.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick40003.A600.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick40003.A3000.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick40009.A600.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick40009.A4000.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick40038.A600.BETA", kick_path, ? ,prefs);
|
||||
// make_rom_symlink("kick40038.A4000.BETA", kick_path, ? ,prefs);
|
||||
|
||||
// Symlink rom.key also
|
||||
// source file
|
||||
get_rom_path(tmp2, MAX_DPATH);
|
||||
|
@ -373,49 +315,19 @@ void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
char whd_path[MAX_DPATH];
|
||||
snprintf(whd_path, MAX_DPATH, "%s/whdboot/", start_path_data);
|
||||
|
||||
// this should be made into it's own routine!! 1 (see repeat, below)
|
||||
|
||||
struct host_options host_detail;
|
||||
strcpy(whd_config, whd_path);
|
||||
strcat(whd_config, "hostprefs.conf");
|
||||
|
||||
if (zfile_exists(whd_config)) // use direct .whd file
|
||||
{
|
||||
ifstream read_file(whd_config);
|
||||
std::ifstream in(whd_config);
|
||||
std::string contents((std::istreambuf_iterator<char>(in)),
|
||||
std::istreambuf_iterator<char>());
|
||||
|
||||
_stprintf(hardware_settings, "%s", contents.c_str());
|
||||
host_detail = get_host_settings(hardware_settings);
|
||||
}
|
||||
|
||||
write_log("AutoBooter - Host: Controller 1 : %s \n", host_detail.controller1);
|
||||
write_log("AutoBooter - Host: Controller 2 : %s \n", host_detail.controller2);
|
||||
write_log("AutoBooter - Host: Controller 3 : %s \n", host_detail.controller3);
|
||||
write_log("AutoBooter - Host: Controller 4 : %s \n", host_detail.controller4);
|
||||
write_log("AutoBooter - Host: Mouse 1 : %s \n", host_detail.mouse1);
|
||||
write_log("AutoBooter - Host: Mouse 2 : %s \n", host_detail.mouse2);
|
||||
write_log("AutoBooter - Host: Fixed CD32 Height: %s \n", host_detail.fixed_cd32_height);
|
||||
write_log("AutoBooter - Host: Fixed CD32 Width : %s \n", host_detail.fixed_cd32_width);
|
||||
|
||||
//
|
||||
// *** EMULATED HARDWARE ***
|
||||
//
|
||||
|
||||
prefs->start_gui = false;
|
||||
|
||||
const int is_cdtv = strstr(filepath, "CDTV") != nullptr || strstr(filepath, "cdtv") != nullptr;
|
||||
const int is_cd32 = strstr(filepath, "CD32") != nullptr || strstr(filepath, "cd32") != nullptr;
|
||||
const auto is_cdtv = strstr(filepath, "CDTV") != nullptr || strstr(filepath, "cdtv") != nullptr;
|
||||
const auto is_cd32 = strstr(filepath, "CD32") != nullptr || strstr(filepath, "cd32") != nullptr;
|
||||
|
||||
// CD32
|
||||
if (static_cast<bool>(is_cd32))
|
||||
if (is_cd32)
|
||||
{
|
||||
_tcscpy(prefs->description, _T("AutoBoot Configuration [CD32]"));
|
||||
// SET THE BASE AMIGA (CD32)
|
||||
built_in_prefs(prefs, 8, 0, 0, 0);
|
||||
}
|
||||
else if (static_cast<bool>(is_cdtv))
|
||||
else if (is_cdtv)
|
||||
{
|
||||
_tcscpy(prefs->description, _T("AutoBoot Configuration [CDTV]"));
|
||||
// SET THE BASE AMIGA (CDTV)
|
||||
|
@ -440,7 +352,7 @@ void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
|
||||
//APPLY THE SETTINGS FOR MOUSE/JOYSTICK ETC
|
||||
// CD32
|
||||
if (static_cast<bool>(is_cd32))
|
||||
if (is_cd32)
|
||||
{
|
||||
prefs->jports[0].mode = 7;
|
||||
prefs->jports[1].mode = 7;
|
||||
|
@ -464,14 +376,14 @@ void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
|
||||
// WHAT IS THE MAIN CONTROL?
|
||||
// PORT 0 - MOUSE
|
||||
if (static_cast<bool>(is_cd32) && !(strcmpi(host_detail.controller2, "nul") == 0))
|
||||
if (is_cd32 && strcmpi(amiberry_options.default_controller2, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(host_detail.controller2));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(amiberry_options.default_controller2));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
else if (!(strcmpi(host_detail.mouse1, "nul") == 0))
|
||||
else if (strcmpi(amiberry_options.default_mouse1, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(host_detail.mouse1));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(amiberry_options.default_mouse1));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
else
|
||||
|
@ -481,9 +393,9 @@ void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
}
|
||||
|
||||
// PORT 1 - JOYSTICK
|
||||
if (!(strcmpi(host_detail.controller1, "nul") == 0))
|
||||
if (strcmpi(amiberry_options.default_controller1, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(host_detail.controller1));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(amiberry_options.default_controller1));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
else
|
||||
|
@ -491,26 +403,6 @@ void cd_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
_stprintf(txt2, "%s=joy1", _T("joyport1"));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
if (strcmpi(host_detail.fixed_cd32_height, "nul") != 0)
|
||||
{
|
||||
_stprintf(txt2, "gfx_height=%s", host_detail.fixed_cd32_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_height_windowed=%s", host_detail.fixed_cd32_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_height_fullscreen=%s", host_detail.fixed_cd32_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
if (strcmpi(host_detail.fixed_cd32_width, "nul") != 0)
|
||||
{
|
||||
_stprintf(txt2, "gfx_width=%s", host_detail.fixed_cd32_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_width_windowed=%s", host_detail.fixed_cd32_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_width_fullscreen=%s", host_detail.fixed_cd32_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
||||
|
@ -599,22 +491,6 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
// this should be made into it's own routine!! 1 (see repeat, above)
|
||||
snprintf(whd_path, MAX_DPATH, "%s/whdboot/", start_path_data);
|
||||
|
||||
struct host_options host_detail;
|
||||
strcpy(whd_config, whd_path);
|
||||
strcat(whd_config, "hostprefs.conf");
|
||||
|
||||
if (zfile_exists(whd_config)) // use hostprefs
|
||||
{
|
||||
ifstream read_file(whd_config);
|
||||
std::ifstream in(whd_config);
|
||||
std::string contents((std::istreambuf_iterator<char>(in)),
|
||||
std::istreambuf_iterator<char>());
|
||||
|
||||
_stprintf(hardware_settings, "%s", contents.c_str());
|
||||
write_log("WHDBooter - Loading hostprefs.conf.\n");
|
||||
host_detail = get_host_settings(hardware_settings);
|
||||
}
|
||||
|
||||
// LOAD GAME SPECIFICS - USE SHA1 IF AVAILABLE
|
||||
snprintf(whd_path, MAX_DPATH, "%s/whdboot/game-data/", start_path_data);
|
||||
struct game_options game_detail;
|
||||
|
@ -820,27 +696,12 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
write_log("WHDBooter - Game: Z3 Ram : %s \n", game_detail.z3);
|
||||
|
||||
// debugging code!
|
||||
write_log("WHDBooter - Host: Controller 1 : %s \n", host_detail.controller1);
|
||||
write_log("WHDBooter - Host: Controller 2 : %s \n", host_detail.controller2);
|
||||
write_log("WHDBooter - Host: Controller 3 : %s \n", host_detail.controller3);
|
||||
write_log("WHDBooter - Host: Controller 4 : %s \n", host_detail.controller4);
|
||||
write_log("WHDBooter - Host: Mouse 1 : %s \n", host_detail.mouse1);
|
||||
write_log("WHDBooter - Host: Mouse 2 : %s \n", host_detail.mouse2);
|
||||
//printf("ra_qui: %s \n", host_detail.ra_quit);
|
||||
//printf("ra_men: %s \n", host_detail.ra_menu);
|
||||
//printf("ra_rst: %s \n", host_detail.ra_reset);
|
||||
//printf("ky_qut: %s \n", host_detail.key_quit);
|
||||
//printf("ky_gui: %s \n", host_detail.key_gui);
|
||||
//printf("deadzn: %s \n", host_detail.stereo_split);
|
||||
write_log("WHDBooter - Host: Sound On : %s \n", host_detail.sound_on);
|
||||
write_log("WHDBooter - Host: Sound Mode : %s \n", host_detail.sound_mode);
|
||||
write_log("WHDBooter - Host: Stereo Split : %s \n", host_detail.stereo_split);
|
||||
//printf("aspect: %s \n", host_detail.aspect_ratio);
|
||||
//printf("frames: %s \n", host_detail.frameskip);
|
||||
write_log("WHDBooter - Host: Fixed Height : %s \n", host_detail.fixed_height);
|
||||
write_log("WHDBooter - Host: Fixed Width : %s \n", host_detail.fixed_width);
|
||||
write_log("WHDBooter - Host: Fixed CD32 Height: %s \n", host_detail.fixed_cd32_height);
|
||||
write_log("WHDBooter - Host: Fixed CD32 Width : %s \n", host_detail.fixed_cd32_width);
|
||||
write_log("WHDBooter - Host: Controller 1 : %s \n", amiberry_options.default_controller1);
|
||||
write_log("WHDBooter - Host: Controller 2 : %s \n", amiberry_options.default_controller2);
|
||||
write_log("WHDBooter - Host: Controller 3 : %s \n", amiberry_options.default_controller3);
|
||||
write_log("WHDBooter - Host: Controller 4 : %s \n", amiberry_options.default_controller4);
|
||||
write_log("WHDBooter - Host: Mouse 1 : %s \n", amiberry_options.default_mouse1);
|
||||
write_log("WHDBooter - Host: Mouse 2 : %s \n", amiberry_options.default_mouse2);
|
||||
#endif
|
||||
|
||||
// so remember, we already loaded a .uae config, so we dont need to do the below manual setup for hardware
|
||||
|
@ -980,17 +841,17 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
|
||||
// WHAT IS THE MAIN CONTROL?
|
||||
// PORT 0 - MOUSE GAMES
|
||||
if (strcmpi(game_detail.control, "mouse") == 0 && !(strcmpi(host_detail.mouse1, "nul") == 0))
|
||||
if (strcmpi(game_detail.control, "mouse") == 0 && strcmpi(amiberry_options.default_mouse1, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(host_detail.mouse1));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(amiberry_options.default_mouse1));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
write_log("WHDBooter Option (Mouse Control): %s\n", txt2);
|
||||
}
|
||||
|
||||
// PORT 0 - JOYSTICK GAMES
|
||||
else if (!(strcmpi(host_detail.controller2, "nul") == 0))
|
||||
// PORT 0 - JOYSTICK GAMES
|
||||
else if (strcmpi(amiberry_options.default_controller2, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(host_detail.controller2));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport0"), _T(amiberry_options.default_controller2));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
write_log("WHDBooter Option (Joystick Control): %s\n", txt2);
|
||||
}
|
||||
|
@ -1002,16 +863,16 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
}
|
||||
|
||||
// PORT 1 - MOUSE GAMES
|
||||
if (strcmpi(game_detail.control, "mouse") == 0 && !(strcmpi(host_detail.mouse2, "nul") == 0))
|
||||
if (strcmpi(game_detail.control, "mouse") == 0 && strcmpi(amiberry_options.default_mouse2, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(host_detail.mouse2));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(amiberry_options.default_mouse2));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
write_log("WHDBooter Option (Mouse Control): %s\n", txt2);
|
||||
}
|
||||
// PORT 1 - JOYSTICK GAMES
|
||||
else if (!(strcmpi(host_detail.controller1, "nul") == 0))
|
||||
// PORT 1 - JOYSTICK GAMES
|
||||
else if (strcmpi(amiberry_options.default_controller1, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(host_detail.controller1));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport1"), _T(amiberry_options.default_controller1));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
write_log("WHDBooter Option (Joystick Control): %s\n", txt2);
|
||||
}
|
||||
|
@ -1023,14 +884,14 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
}
|
||||
|
||||
// PARALLEL PORT GAMES
|
||||
if (strcmpi(host_detail.controller3, "nul") != 0)
|
||||
if (strcmpi(amiberry_options.default_controller3, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport2"), _T(host_detail.controller3));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport2"), _T(amiberry_options.default_controller3));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
if (strcmpi(host_detail.controller4, "nul") != 0)
|
||||
if (strcmpi(amiberry_options.default_controller4, "") != 0)
|
||||
{
|
||||
_stprintf(txt2, "%s=%s", _T("joyport3"), _T(host_detail.controller4));
|
||||
_stprintf(txt2, "%s=%s", _T("joyport3"), _T(amiberry_options.default_controller4));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
|
@ -1038,44 +899,6 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
if (strlen(custom_settings) > 0)
|
||||
parse_custom_settings(prefs, custom_settings);
|
||||
|
||||
if (!(strcmpi(host_detail.deadzone, "nul") == 0))
|
||||
{
|
||||
_stprintf(txt2, "input.joymouse_deadzone=%s", _T(host_detail.deadzone));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "input.joystick_deadzone=%s", _T(host_detail.deadzone));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
// RETROARCH CONTROLS
|
||||
if (!(strcmpi(host_detail.ra_quit, "nul") == 0))
|
||||
{
|
||||
_stprintf(txt2, "amiberry.use_retroarch_quit=%s", _T(host_detail.ra_quit));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
if (!(strcmpi(host_detail.ra_menu, "nul") == 0))
|
||||
{
|
||||
_stprintf(txt2, "amiberry.use_retroarch_menu=%s", _T(host_detail.ra_menu));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
if (!(strcmpi(host_detail.ra_reset, "nul") == 0))
|
||||
{
|
||||
_stprintf(txt2, "amiberry.use_retroarch_reset=%s", _T(host_detail.ra_reset));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
// SOUND OPTIONS
|
||||
if (strcmpi(host_detail.sound_on, "false") == 0 || strcmpi(host_detail.sound_on, "off") == 0 || strcmpi(
|
||||
host_detail.sound_on, "none") == 0)
|
||||
{
|
||||
_stprintf(txt2, "sound_output=none");
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
if (!(strcmpi(host_detail.stereo_split, "nul") == 0))
|
||||
{
|
||||
_stprintf(txt2, "sound_stereo_separation=%s", _T(host_detail.stereo_split));
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
// *** GAME-SPECIFICS ***
|
||||
// SET THE GAME COMPATIBILITY SETTINGS
|
||||
//
|
||||
|
@ -1232,16 +1055,7 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
if (strcmpi(host_detail.fixed_height, "nul") != 0)
|
||||
{
|
||||
_stprintf(txt2, "gfx_height=%s", host_detail.fixed_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_height_windowed=%s", host_detail.fixed_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_height_fullscreen=%s", host_detail.fixed_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
else if (strcmpi(game_detail.scr_height, "nul") != 0)
|
||||
if (strcmpi(game_detail.scr_height, "nul") != 0)
|
||||
{
|
||||
_stprintf(txt2, "gfx_height=%s", game_detail.scr_height);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
|
@ -1251,16 +1065,7 @@ void whdload_auto_prefs(struct uae_prefs* prefs, char* filepath)
|
|||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
|
||||
if (strcmpi(host_detail.fixed_width, "nul") != 0)
|
||||
{
|
||||
_stprintf(txt2, "gfx_width=%s", host_detail.fixed_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_width_windowed=%s", host_detail.fixed_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
_stprintf(txt2, "gfx_width_fullscreen=%s", host_detail.fixed_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
}
|
||||
else if (strcmpi(game_detail.scr_width, "nul") != 0)
|
||||
if (strcmpi(game_detail.scr_width, "nul") != 0)
|
||||
{
|
||||
_stprintf(txt2, "gfx_width=%s", game_detail.scr_width);
|
||||
cfgfile_parse_line(prefs, txt2, 0);
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
|
||||
std::string getElementAt(const int i) override
|
||||
{
|
||||
if (i < 0 || i >= freq.size())
|
||||
if (i < 0 || i >= static_cast<int>(freq.size()))
|
||||
return "---";
|
||||
return freq[i];
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
#define GETBDM(x) (((x) - (((x) / 10000) * 10000)) / 100)
|
||||
#define GETBDD(x) ((x) % 100)
|
||||
|
||||
#define AMIBERRYVERSION _T("Amiberry v3.2 beta (2020-06-08)")
|
||||
#define AMIBERRYDATE MAKEBD(2020, 6, 8)
|
||||
#define AMIBERRYVERSION _T("Amiberry v3.2 beta (2020-06-09)")
|
||||
#define AMIBERRYDATE MAKEBD(2020, 6, 9)
|
||||
|
||||
extern std::string get_version_string();
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
CONTROLLER_1=joy1
|
||||
CONTROLLER_2=joy2
|
||||
CONTROLLER_3=joy0
|
||||
;CONTROLLER_4=
|
||||
CONTROLLER_MOUSE_1=joy1
|
||||
CONTROLLER_MOUSE_2=joy2
|
||||
;RETROARCH_QUIT=TRUE
|
||||
;RETROARCH_MENU=TRUE
|
||||
;RETROARCH_RESET=TRUE
|
||||
;KEY_FOR_QUIT=F12
|
||||
;KEY_FOR_MENU=F11
|
||||
;DEADZONE=
|
||||
STEREO_SPLIT=1
|
||||
;SOUND_ON=FALSE
|
||||
;ASPECT_RATIO_FIX=TRUE
|
||||
;FRAMESKIP=TRUE
|
Loading…
Add table
Add a link
Reference in a new issue