Cleanups
This commit is contained in:
parent
f0fa3c5861
commit
d024ff553f
|
@ -200,7 +200,6 @@ enum event_command
|
||||||
CMD_EVENT_AUDIO_REINIT,
|
CMD_EVENT_AUDIO_REINIT,
|
||||||
/* Resizes windowed scale. Will reinitialize video driver. */
|
/* Resizes windowed scale. Will reinitialize video driver. */
|
||||||
CMD_EVENT_RESIZE_WINDOWED_SCALE,
|
CMD_EVENT_RESIZE_WINDOWED_SCALE,
|
||||||
CMD_EVENT_LOG_FILE_DEINIT,
|
|
||||||
/* Toggles disk eject. */
|
/* Toggles disk eject. */
|
||||||
CMD_EVENT_DISK_EJECT_TOGGLE,
|
CMD_EVENT_DISK_EJECT_TOGGLE,
|
||||||
/* Cycle to next disk. */
|
/* Cycle to next disk. */
|
||||||
|
|
|
@ -221,9 +221,8 @@ static void frontend_orbis_deinit(void *data)
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
verbosity_disable();
|
verbosity_disable();
|
||||||
#ifdef HAVE_FILE_LOGGER
|
#ifdef HAVE_FILE_LOGGER
|
||||||
command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL);
|
retro_main_log_file_deinit();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
ps4LinkFinish();
|
ps4LinkFinish();
|
||||||
}
|
}
|
||||||
|
|
75
retroarch.c
75
retroarch.c
|
@ -1994,7 +1994,7 @@ static int generic_menu_iterate(
|
||||||
#ifdef HAVE_ACCESSIBILITY
|
#ifdef HAVE_ACCESSIBILITY
|
||||||
if ( (iterate_type != last_iterate_type) &&
|
if ( (iterate_type != last_iterate_type) &&
|
||||||
is_accessibility_enabled(
|
is_accessibility_enabled(
|
||||||
settings->bools.accessibility_enable,
|
accessibility_enable,
|
||||||
p_rarch->accessibility_enabled))
|
p_rarch->accessibility_enabled))
|
||||||
{
|
{
|
||||||
if (string_is_equal(menu->menu_state_msg,
|
if (string_is_equal(menu->menu_state_msg,
|
||||||
|
@ -2166,7 +2166,7 @@ static int generic_menu_iterate(
|
||||||
|| last_iterate_type == ITERATE_TYPE_INFO)
|
|| last_iterate_type == ITERATE_TYPE_INFO)
|
||||||
&& last_iterate_type != iterate_type
|
&& last_iterate_type != iterate_type
|
||||||
&& is_accessibility_enabled(
|
&& is_accessibility_enabled(
|
||||||
settings->bools.accessibility_enable,
|
accessibility_enable,
|
||||||
p_rarch->accessibility_enabled))
|
p_rarch->accessibility_enabled))
|
||||||
accessibility_speak_priority(p_rarch,
|
accessibility_speak_priority(p_rarch,
|
||||||
accessibility_enable,
|
accessibility_enable,
|
||||||
|
@ -10778,15 +10778,6 @@ static bool is_ai_service_speech_running(void)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool ai_service_speech_stop(void)
|
|
||||||
{
|
|
||||||
#ifdef HAVE_AUDIOMIXER
|
|
||||||
audio_driver_mixer_stop_stream(10);
|
|
||||||
audio_driver_mixer_remove_stream(10);
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void task_auto_translate_handler(retro_task_t *task)
|
static void task_auto_translate_handler(retro_task_t *task)
|
||||||
{
|
{
|
||||||
int *mode_ptr = (int*)task->user_data;
|
int *mode_ptr = (int*)task->user_data;
|
||||||
|
@ -11927,14 +11918,11 @@ finish:
|
||||||
**/
|
**/
|
||||||
static bool command_event_disk_control_append_image(
|
static bool command_event_disk_control_append_image(
|
||||||
struct rarch_state *p_rarch,
|
struct rarch_state *p_rarch,
|
||||||
|
rarch_system_info_t *sys_info,
|
||||||
const char *path)
|
const char *path)
|
||||||
{
|
{
|
||||||
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
if ( !sys_info ||
|
||||||
|
!disk_control_append_image(&sys_info->disk_control, path))
|
||||||
if (!sys_info)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!disk_control_append_image(&sys_info->disk_control, path))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
|
@ -14512,9 +14500,6 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
video_driver_cached_frame();
|
video_driver_cached_frame();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CMD_EVENT_LOG_FILE_DEINIT:
|
|
||||||
retro_main_log_file_deinit();
|
|
||||||
break;
|
|
||||||
case CMD_EVENT_DISK_APPEND_IMAGE:
|
case CMD_EVENT_DISK_APPEND_IMAGE:
|
||||||
{
|
{
|
||||||
const char *path = (const char*)data;
|
const char *path = (const char*)data;
|
||||||
|
@ -14525,14 +14510,15 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
|
|
||||||
if (disk_control_enabled(&sys_info->disk_control))
|
if (disk_control_enabled(&sys_info->disk_control))
|
||||||
{
|
{
|
||||||
bool success = false;
|
|
||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
/* Get initial disk eject state */
|
/* Get initial disk eject state */
|
||||||
bool initial_disk_ejected = disk_control_get_eject_state(&sys_info->disk_control);
|
bool initial_disk_ejected = disk_control_get_eject_state(&sys_info->disk_control);
|
||||||
#endif
|
#endif
|
||||||
|
rarch_system_info_t *
|
||||||
|
sys_info = &p_rarch->runloop_system;
|
||||||
/* Append disk image */
|
/* Append disk image */
|
||||||
success = command_event_disk_control_append_image(p_rarch, path);
|
bool success = command_event_disk_control_append_image(p_rarch, sys_info, path);
|
||||||
|
|
||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
/* Appending a disk image may or may not affect
|
/* Appending a disk image may or may not affect
|
||||||
|
@ -14556,13 +14542,13 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
case CMD_EVENT_DISK_EJECT_TOGGLE:
|
case CMD_EVENT_DISK_EJECT_TOGGLE:
|
||||||
{
|
{
|
||||||
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
||||||
bool *show_msg = (bool*)data;
|
|
||||||
|
|
||||||
if (!sys_info)
|
if (!sys_info)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (disk_control_enabled(&sys_info->disk_control))
|
if (disk_control_enabled(&sys_info->disk_control))
|
||||||
{
|
{
|
||||||
|
bool *show_msg = (bool*)data;
|
||||||
bool eject = !disk_control_get_eject_state(&sys_info->disk_control);
|
bool eject = !disk_control_get_eject_state(&sys_info->disk_control);
|
||||||
bool verbose = true;
|
bool verbose = true;
|
||||||
bool refresh = false;
|
bool refresh = false;
|
||||||
|
@ -14570,7 +14556,8 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
if (show_msg)
|
if (show_msg)
|
||||||
verbose = *show_msg;
|
verbose = *show_msg;
|
||||||
|
|
||||||
disk_control_set_eject_state(&sys_info->disk_control, eject, verbose);
|
disk_control_set_eject_state(
|
||||||
|
&sys_info->disk_control, eject, verbose);
|
||||||
|
|
||||||
#if defined(HAVE_MENU)
|
#if defined(HAVE_MENU)
|
||||||
/* It is necessary to refresh the disk options
|
/* It is necessary to refresh the disk options
|
||||||
|
@ -14589,13 +14576,13 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
case CMD_EVENT_DISK_NEXT:
|
case CMD_EVENT_DISK_NEXT:
|
||||||
{
|
{
|
||||||
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
||||||
bool *show_msg = (bool*)data;
|
|
||||||
|
|
||||||
if (!sys_info)
|
if (!sys_info)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (disk_control_enabled(&sys_info->disk_control))
|
if (disk_control_enabled(&sys_info->disk_control))
|
||||||
{
|
{
|
||||||
|
bool *show_msg = (bool*)data;
|
||||||
bool verbose = true;
|
bool verbose = true;
|
||||||
|
|
||||||
if (show_msg)
|
if (show_msg)
|
||||||
|
@ -14613,13 +14600,13 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
case CMD_EVENT_DISK_PREV:
|
case CMD_EVENT_DISK_PREV:
|
||||||
{
|
{
|
||||||
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
rarch_system_info_t *sys_info = &p_rarch->runloop_system;
|
||||||
bool *show_msg = (bool*)data;
|
|
||||||
|
|
||||||
if (!sys_info)
|
if (!sys_info)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (disk_control_enabled(&sys_info->disk_control))
|
if (disk_control_enabled(&sys_info->disk_control))
|
||||||
{
|
{
|
||||||
|
bool *show_msg = (bool*)data;
|
||||||
bool verbose = true;
|
bool verbose = true;
|
||||||
|
|
||||||
if (show_msg)
|
if (show_msg)
|
||||||
|
@ -14666,9 +14653,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
case CMD_EVENT_GRAB_MOUSE_TOGGLE:
|
case CMD_EVENT_GRAB_MOUSE_TOGGLE:
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
bool grab_mouse_state = p_rarch->input_driver_grab_mouse_state;
|
bool grab_mouse_state = !p_rarch->input_driver_grab_mouse_state;
|
||||||
|
|
||||||
grab_mouse_state = !grab_mouse_state;
|
|
||||||
|
|
||||||
if (grab_mouse_state)
|
if (grab_mouse_state)
|
||||||
ret = input_driver_grab_mouse(p_rarch);
|
ret = input_driver_grab_mouse(p_rarch);
|
||||||
|
@ -14769,8 +14754,10 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
video_driver_show_mouse();
|
video_driver_show_mouse();
|
||||||
}
|
}
|
||||||
|
|
||||||
p_rarch->input_driver_block_hotkey = p_rarch->game_focus_state.enabled;
|
p_rarch->input_driver_block_hotkey =
|
||||||
p_rarch->keyboard_mapping_blocked = p_rarch->game_focus_state.enabled;
|
p_rarch->game_focus_state.enabled;
|
||||||
|
p_rarch->keyboard_mapping_blocked =
|
||||||
|
p_rarch->game_focus_state.enabled;
|
||||||
|
|
||||||
if (show_message)
|
if (show_message)
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
|
@ -14778,7 +14765,8 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
msg_hash_to_str(MSG_GAME_FOCUS_ON) :
|
msg_hash_to_str(MSG_GAME_FOCUS_ON) :
|
||||||
msg_hash_to_str(MSG_GAME_FOCUS_OFF),
|
msg_hash_to_str(MSG_GAME_FOCUS_OFF),
|
||||||
1, 60, true,
|
1, 60, true,
|
||||||
NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);
|
NULL, MESSAGE_QUEUE_ICON_DEFAULT,
|
||||||
|
MESSAGE_QUEUE_CATEGORY_INFO);
|
||||||
|
|
||||||
RARCH_LOG("[Input]: %s => %s\n",
|
RARCH_LOG("[Input]: %s => %s\n",
|
||||||
"Game Focus",
|
"Game Focus",
|
||||||
|
@ -14857,7 +14845,10 @@ bool command_event(enum event_command cmd, void *data)
|
||||||
unsigned ai_service_mode = settings->uints.ai_service_mode;
|
unsigned ai_service_mode = settings->uints.ai_service_mode;
|
||||||
if (ai_service_mode == 1 && is_ai_service_speech_running())
|
if (ai_service_mode == 1 && is_ai_service_speech_running())
|
||||||
{
|
{
|
||||||
ai_service_speech_stop();
|
#ifdef HAVE_AUDIOMIXER
|
||||||
|
audio_driver_mixer_stop_stream(10);
|
||||||
|
audio_driver_mixer_remove_stream(10);
|
||||||
|
#endif
|
||||||
#ifdef HAVE_ACCESSIBILITY
|
#ifdef HAVE_ACCESSIBILITY
|
||||||
if (is_accessibility_enabled(
|
if (is_accessibility_enabled(
|
||||||
accessibility_enable,
|
accessibility_enable,
|
||||||
|
@ -15085,15 +15076,16 @@ static void global_free(struct rarch_state *p_rarch)
|
||||||
|
|
||||||
path_deinit_subsystem(p_rarch);
|
path_deinit_subsystem(p_rarch);
|
||||||
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
command_event(CMD_EVENT_RECORD_DEINIT, NULL);
|
||||||
command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL);
|
|
||||||
|
retro_main_log_file_deinit();
|
||||||
|
|
||||||
p_rarch->rarch_is_sram_load_disabled = false;
|
p_rarch->rarch_is_sram_load_disabled = false;
|
||||||
p_rarch->rarch_is_sram_save_disabled = false;
|
p_rarch->rarch_is_sram_save_disabled = false;
|
||||||
p_rarch->rarch_use_sram = false;
|
p_rarch->rarch_use_sram = false;
|
||||||
#ifdef HAVE_PATCH
|
#ifdef HAVE_PATCH
|
||||||
rarch_ctl(RARCH_CTL_UNSET_BPS_PREF, NULL);
|
p_rarch->rarch_bps_pref = false;
|
||||||
rarch_ctl(RARCH_CTL_UNSET_IPS_PREF, NULL);
|
p_rarch->rarch_ips_pref = false;
|
||||||
rarch_ctl(RARCH_CTL_UNSET_UPS_PREF, NULL);
|
p_rarch->rarch_ups_pref = false;
|
||||||
p_rarch->rarch_patch_blocked = false;
|
p_rarch->rarch_patch_blocked = false;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_CONFIGFILE
|
#ifdef HAVE_CONFIGFILE
|
||||||
|
@ -15193,7 +15185,8 @@ void main_exit(void *args)
|
||||||
|
|
||||||
retroarch_msg_queue_deinit(p_rarch);
|
retroarch_msg_queue_deinit(p_rarch);
|
||||||
driver_uninit(p_rarch, DRIVERS_CMD_ALL);
|
driver_uninit(p_rarch, DRIVERS_CMD_ALL);
|
||||||
command_event(CMD_EVENT_LOG_FILE_DEINIT, NULL);
|
|
||||||
|
retro_main_log_file_deinit();
|
||||||
|
|
||||||
rarch_ctl(RARCH_CTL_STATE_FREE, NULL);
|
rarch_ctl(RARCH_CTL_STATE_FREE, NULL);
|
||||||
global_free(p_rarch);
|
global_free(p_rarch);
|
||||||
|
@ -34294,9 +34287,9 @@ static bool retroarch_parse_input_and_config(
|
||||||
|
|
||||||
p_rarch->has_set_username = false;
|
p_rarch->has_set_username = false;
|
||||||
#ifdef HAVE_PATCH
|
#ifdef HAVE_PATCH
|
||||||
rarch_ctl(RARCH_CTL_UNSET_UPS_PREF, NULL);
|
p_rarch->rarch_ups_pref = false;
|
||||||
rarch_ctl(RARCH_CTL_UNSET_IPS_PREF, NULL);
|
p_rarch->rarch_ips_pref = false;
|
||||||
rarch_ctl(RARCH_CTL_UNSET_BPS_PREF, NULL);
|
p_rarch->rarch_bps_pref = false;
|
||||||
*global->name.ups = '\0';
|
*global->name.ups = '\0';
|
||||||
*global->name.bps = '\0';
|
*global->name.bps = '\0';
|
||||||
*global->name.ips = '\0';
|
*global->name.ips = '\0';
|
||||||
|
|
Loading…
Reference in New Issue