static TUI_MENU_CALLBACK(restore_default_settings_callback) { if (been_activated) { resources_set_defaults(); tui_message("Default settings restored."); ui_update_menus(); } return NULL; }
static TUI_MENU_CALLBACK(set_romset_callback) { if (been_activated) { if (machine_romset_file_load((char *)param) < 0) { tui_error("Could not load ROM set '%s'", param); } else { tui_message("ROM set loaded successfully."); } } return NULL; }
static TUI_MENU_CALLBACK(save_settings_callback) { if (been_activated) { if (resources_save(NULL) < 0) { tui_error("Cannot save settings."); } else { tui_message("Settings saved successfully."); } } return NULL; }
static TUI_MENU_CALLBACK(load_settings_callback) { if (been_activated) { if (resources_load(NULL) < 0) { tui_error("Cannot load settings."); } else { tui_message("Settings loaded successfully."); ui_update_menus(); } } return NULL; }
static char *screenshot_save_file(char *screenshot_type, char *screenshot_save_failed, char *screenshot_save_success) { if (file_name == NULL || *file_name == 0) { tui_error("Specify a file name first."); return NULL; } if (!util_file_exists(file_name) || tui_ask_confirmation("The specified file already exists. Replace? (Y/N)")) { if (screenshot_save(screenshot_type, file_name, last_canvas) < 0) { tui_error(screenshot_save_failed); } else { tui_message(screenshot_save_success); } } return NULL; }
static TUI_MENU_CALLBACK(ui_sound_set_drive_volume_callback) { if (been_activated) { int current_volume, value; char buf[10]; resources_get_int("DriveSoundEmulationVolume", ¤t_volume); sprintf(buf, "%d", current_volume); if (tui_input_string("DriveSoundEmulationVolume", "Enter drive sound volume to use (0-4000):", buf, 10) == 0) { value = atoi(buf); if (value > 4000) { value = 4000; } else if (value < 0) { value = 0; } resources_set_int("DriveSoundEmulationVolume", value); tui_message("Drive sound volume set to : %d", value); } else { return NULL; } } return NULL; }