mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 22:43:41 +00:00
demonstration of core association reset
fix .cfg: tweak
This commit is contained in:
parent
a8fc4b204a
commit
4312c11d31
38
command.c
38
command.c
@ -1702,9 +1702,12 @@ void command_playlist_push_write(
|
|||||||
void command_playlist_update_write(
|
void command_playlist_update_write(
|
||||||
void *data,
|
void *data,
|
||||||
size_t idx,
|
size_t idx,
|
||||||
const char *core_display_name,
|
const char *path,
|
||||||
const char *label,
|
const char *label,
|
||||||
const char *path)
|
const char *core_path,
|
||||||
|
const char *core_display_name,
|
||||||
|
const char *crc32,
|
||||||
|
const char *db_name)
|
||||||
{
|
{
|
||||||
playlist_t *plist = (playlist_t*)data;
|
playlist_t *plist = (playlist_t*)data;
|
||||||
playlist_t *playlist = NULL;
|
playlist_t *playlist = NULL;
|
||||||
@ -1721,12 +1724,12 @@ void command_playlist_update_write(
|
|||||||
playlist_update(
|
playlist_update(
|
||||||
playlist,
|
playlist,
|
||||||
idx,
|
idx,
|
||||||
label,
|
|
||||||
NULL,
|
|
||||||
path,
|
path,
|
||||||
|
label,
|
||||||
|
core_path,
|
||||||
core_display_name,
|
core_display_name,
|
||||||
NULL,
|
crc32,
|
||||||
NULL);
|
db_name);
|
||||||
|
|
||||||
playlist_write_file(playlist);
|
playlist_write_file(playlist);
|
||||||
}
|
}
|
||||||
@ -2328,7 +2331,30 @@ TODO: Add a setting for these tweaks */
|
|||||||
);
|
);
|
||||||
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true);
|
runloop_msg_queue_push(msg_hash_to_str(MSG_ADDED_TO_FAVORITES), 1, 180, true);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
case CMD_EVENT_RESET_CORE_ASSOCIATION:
|
||||||
|
{
|
||||||
|
const char *core_name = NULL;
|
||||||
|
const char *core_path = NULL;
|
||||||
|
|
||||||
|
core_name = "DETECT";
|
||||||
|
core_path = "DETECT";
|
||||||
|
|
||||||
|
command_playlist_update_write(
|
||||||
|
NULL,
|
||||||
|
(size_t)data,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
core_path,
|
||||||
|
core_name,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
runloop_msg_queue_push(msg_hash_to_str(MSG_RESET_CORE_ASSOCIATION), 1, 180, true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
case CMD_EVENT_RESTART_RETROARCH:
|
case CMD_EVENT_RESTART_RETROARCH:
|
||||||
if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART))
|
if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART))
|
||||||
return false;
|
return false;
|
||||||
|
@ -138,6 +138,8 @@ enum event_command
|
|||||||
CMD_EVENT_RESUME,
|
CMD_EVENT_RESUME,
|
||||||
/* Add a playlist entry to favorites. */
|
/* Add a playlist entry to favorites. */
|
||||||
CMD_EVENT_ADD_TO_FAVORITES,
|
CMD_EVENT_ADD_TO_FAVORITES,
|
||||||
|
/* Reset playlist entry associated core to DETECT */
|
||||||
|
CMD_EVENT_RESET_CORE_ASSOCIATION,
|
||||||
/* Toggles pause. */
|
/* Toggles pause. */
|
||||||
CMD_EVENT_PAUSE_TOGGLE,
|
CMD_EVENT_PAUSE_TOGGLE,
|
||||||
/* Pauses RetroArch. */
|
/* Pauses RetroArch. */
|
||||||
@ -269,9 +271,12 @@ void command_playlist_push_write(
|
|||||||
void command_playlist_update_write(
|
void command_playlist_update_write(
|
||||||
void *data,
|
void *data,
|
||||||
size_t idx,
|
size_t idx,
|
||||||
const char *core_display_name,
|
const char *path,
|
||||||
const char *label,
|
const char *label,
|
||||||
const char *path);
|
const char *core_path,
|
||||||
|
const char *core_display_name,
|
||||||
|
const char *crc32,
|
||||||
|
const char *db_name);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
|
@ -2009,6 +2009,8 @@ MSG_HASH(MENU_ENUM_SUBLABEL_HELP_LIST,
|
|||||||
"Learn more about how the program works.")
|
"Learn more about how the program works.")
|
||||||
MSG_HASH(MSG_ADDED_TO_FAVORITES,
|
MSG_HASH(MSG_ADDED_TO_FAVORITES,
|
||||||
"Added to favorites")
|
"Added to favorites")
|
||||||
|
MSG_HASH(MSG_RESET_CORE_ASSOCIATION,
|
||||||
|
"Playlist entry core association has been reset.")
|
||||||
MSG_HASH(MSG_APPENDED_DISK,
|
MSG_HASH(MSG_APPENDED_DISK,
|
||||||
"Appended disk")
|
"Appended disk")
|
||||||
MSG_HASH(MSG_APPLICATION_DIR,
|
MSG_HASH(MSG_APPLICATION_DIR,
|
||||||
|
@ -1439,10 +1439,13 @@ static int action_ok_playlist_entry_collection(const char *path,
|
|||||||
|
|
||||||
command_playlist_update_write(tmp_playlist,
|
command_playlist_update_write(tmp_playlist,
|
||||||
selection_ptr,
|
selection_ptr,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
new_core_path,
|
||||||
core_info.inf->display_name,
|
core_info.inf->display_name,
|
||||||
NULL,
|
NULL,
|
||||||
new_core_path);
|
NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
strlcpy(new_core_path, core_path, sizeof(new_core_path));
|
strlcpy(new_core_path, core_path, sizeof(new_core_path));
|
||||||
|
|
||||||
@ -1512,9 +1515,13 @@ static int action_ok_playlist_entry(const char *path,
|
|||||||
|
|
||||||
command_playlist_update_write(NULL,
|
command_playlist_update_write(NULL,
|
||||||
selection_ptr,
|
selection_ptr,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
new_core_path,
|
||||||
core_info.inf->display_name,
|
core_info.inf->display_name,
|
||||||
NULL,
|
NULL,
|
||||||
new_core_path);
|
NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (!string_is_empty(core_path))
|
else if (!string_is_empty(core_path))
|
||||||
strlcpy(new_core_path, core_path, sizeof(new_core_path));
|
strlcpy(new_core_path, core_path, sizeof(new_core_path));
|
||||||
@ -1611,9 +1618,13 @@ static int action_ok_playlist_entry_start_content(const char *path,
|
|||||||
command_playlist_update_write(
|
command_playlist_update_write(
|
||||||
tmp_playlist,
|
tmp_playlist,
|
||||||
selection_ptr,
|
selection_ptr,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
new_core_path,
|
||||||
core_info.inf->display_name,
|
core_info.inf->display_name,
|
||||||
NULL,
|
NULL,
|
||||||
new_core_path);
|
NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
playlist_info.data = playlist;
|
playlist_info.data = playlist;
|
||||||
@ -1758,9 +1769,13 @@ static void menu_input_st_string_cb_rename_entry(void *userdata,
|
|||||||
menu_input_dialog_get_kb_idx(),
|
menu_input_dialog_get_kb_idx(),
|
||||||
NULL,
|
NULL,
|
||||||
label,
|
label,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
menu_input_dialog_end();
|
menu_input_dialog_end();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2157,9 +2172,16 @@ static int action_ok_core_deferred_set(const char *path,
|
|||||||
core_display_name[0] = '\0';
|
core_display_name[0] = '\0';
|
||||||
|
|
||||||
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
core_info_get_name(path, core_display_name, sizeof(core_display_name));
|
||||||
command_playlist_update_write(NULL,
|
command_playlist_update_write(
|
||||||
|
NULL,
|
||||||
rdb_entry_start_game_selection_ptr,
|
rdb_entry_start_game_selection_ptr,
|
||||||
core_display_name, NULL, path);
|
path,
|
||||||
|
label,
|
||||||
|
NULL,
|
||||||
|
core_display_name,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
|
||||||
menu_entries_pop_stack(&selection, 0, 1);
|
menu_entries_pop_stack(&selection, 0, 1);
|
||||||
menu_navigation_set_selection(selection);
|
menu_navigation_set_selection(selection);
|
||||||
@ -2832,6 +2854,26 @@ default_action_ok_cmd_func(action_ok_screenshot, CMD_EVENT_TAKE_SCREENSH
|
|||||||
default_action_ok_cmd_func(action_ok_disk_cycle_tray_status, CMD_EVENT_DISK_EJECT_TOGGLE )
|
default_action_ok_cmd_func(action_ok_disk_cycle_tray_status, CMD_EVENT_DISK_EJECT_TOGGLE )
|
||||||
default_action_ok_cmd_func(action_ok_shader_apply_changes, CMD_EVENT_SHADERS_APPLY_CHANGES )
|
default_action_ok_cmd_func(action_ok_shader_apply_changes, CMD_EVENT_SHADERS_APPLY_CHANGES )
|
||||||
|
|
||||||
|
|
||||||
|
static int action_ok_reset_core_association(const char *path,
|
||||||
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
|
{
|
||||||
|
const char *tmp_path = NULL;
|
||||||
|
playlist_t *tmp_playlist = NULL;
|
||||||
|
|
||||||
|
menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist);
|
||||||
|
|
||||||
|
if (!tmp_playlist)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
playlist_get_index(tmp_playlist,
|
||||||
|
rpl_entry_selection_ptr, &tmp_path, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
if (!command_event(CMD_EVENT_RESET_CORE_ASSOCIATION, (void *)rpl_entry_selection_ptr))
|
||||||
|
return menu_cbs_exit();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int action_ok_add_to_favorites(const char *path,
|
static int action_ok_add_to_favorites(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
@ -2854,13 +2896,14 @@ static int action_ok_add_to_favorites_playlist(const char *path,
|
|||||||
|
|
||||||
playlist_get_index(tmp_playlist,
|
playlist_get_index(tmp_playlist,
|
||||||
rpl_entry_selection_ptr, &tmp_path, NULL, NULL, NULL, NULL, NULL);
|
rpl_entry_selection_ptr, &tmp_path, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
/*
|
||||||
if (!command_event(CMD_EVENT_ADD_TO_FAVORITES, (void*)tmp_path))
|
if (!command_event(CMD_EVENT_ADD_TO_FAVORITES, (void*)tmp_path))
|
||||||
return menu_cbs_exit();
|
return menu_cbs_exit();
|
||||||
return 0;
|
return 0;
|
||||||
|
*/
|
||||||
|
return action_ok_reset_core_association(path, label, type, idx, entry_idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int action_ok_delete_entry(const char *path,
|
static int action_ok_delete_entry(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
|
@ -183,6 +183,8 @@ enum msg_hash_enums
|
|||||||
MSG_NETPLAY_PEER_PAUSED,
|
MSG_NETPLAY_PEER_PAUSED,
|
||||||
MSG_NETPLAY_CHANGED_NICK,
|
MSG_NETPLAY_CHANGED_NICK,
|
||||||
MSG_ADDED_TO_FAVORITES,
|
MSG_ADDED_TO_FAVORITES,
|
||||||
|
MSG_RESET_CORE_ASSOCIATION,
|
||||||
|
MSG_CORE_ASSOCIATION_RESET,
|
||||||
MSG_AUTODETECT,
|
MSG_AUTODETECT,
|
||||||
MSG_AUDIO_VOLUME,
|
MSG_AUDIO_VOLUME,
|
||||||
MSG_AUDIO_MIXER_VOLUME,
|
MSG_AUDIO_MIXER_VOLUME,
|
||||||
|
@ -845,4 +845,4 @@ video_message_bgcolor_opacity = 1.0
|
|||||||
# Enable stdin/network command interface.
|
# Enable stdin/network command interface.
|
||||||
# network_cmd_enable = false
|
# network_cmd_enable = false
|
||||||
# network_cmd_port = 55355
|
# network_cmd_port = 55355
|
||||||
# stdin_cmd_enable = false
|
# stdin_cmd_enable = false
|
Loading…
x
Reference in New Issue
Block a user