mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
commit
19121dbee3
2
core.h
2
core.h
@ -155,6 +155,8 @@ bool core_set_default_callbacks(void *data);
|
|||||||
|
|
||||||
bool core_set_rewind_callbacks(void);
|
bool core_set_rewind_callbacks(void);
|
||||||
|
|
||||||
|
bool core_set_netplay_callbacks(void);
|
||||||
|
|
||||||
bool core_set_poll_type(unsigned *type);
|
bool core_set_poll_type(unsigned *type);
|
||||||
|
|
||||||
/* Runs the core for one frame. */
|
/* Runs the core for one frame. */
|
||||||
|
28
core_impl.c
28
core_impl.c
@ -103,13 +103,7 @@ static bool core_init_libretro_cbs(void *data)
|
|||||||
if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
/* Force normal poll type for netplay. */
|
core_set_netplay_callbacks();
|
||||||
core_poll_type = POLL_TYPE_NORMAL;
|
|
||||||
|
|
||||||
core.retro_set_video_refresh(video_frame_net);
|
|
||||||
core.retro_set_audio_sample(audio_sample_net);
|
|
||||||
core.retro_set_audio_sample_batch(audio_sample_batch_net);
|
|
||||||
core.retro_set_input_state(input_state_net);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -182,6 +176,26 @@ bool core_set_rewind_callbacks(void)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* core_set_netplay_callbacks:
|
||||||
|
*
|
||||||
|
* Set the I/O callbacks to use netplay's interceding callback system. Should
|
||||||
|
* only be called once.
|
||||||
|
**/
|
||||||
|
bool core_set_netplay_callbacks(void)
|
||||||
|
{
|
||||||
|
/* Force normal poll type for netplay. */
|
||||||
|
core_poll_type = POLL_TYPE_NORMAL;
|
||||||
|
|
||||||
|
/* And use netplay's interceding callbacks */
|
||||||
|
core.retro_set_video_refresh(video_frame_net);
|
||||||
|
core.retro_set_audio_sample(audio_sample_net);
|
||||||
|
core.retro_set_audio_sample_batch(audio_sample_batch_net);
|
||||||
|
core.retro_set_input_state(input_state_net);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool core_set_cheat(retro_ctx_cheat_info_t *info)
|
bool core_set_cheat(retro_ctx_cheat_info_t *info)
|
||||||
{
|
{
|
||||||
core.retro_cheat_set(info->index, info->enabled, info->code);
|
core.retro_cheat_set(info->index, info->enabled, info->code);
|
||||||
|
@ -1600,6 +1600,18 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len)
|
|||||||
snprintf(s, len,
|
snprintf(s, len,
|
||||||
"Shows current core inside menu.");
|
"Shows current core inside menu.");
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST:
|
||||||
|
snprintf(s, len,
|
||||||
|
"Enables Netplay in host (server) mode.");
|
||||||
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT:
|
||||||
|
snprintf(s, len,
|
||||||
|
"Enables Netplay in client mode.");
|
||||||
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_DISCONNECT:
|
||||||
|
snprintf(s, len,
|
||||||
|
"Disconnects an active Netplay connection.");
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_DYNAMIC_WALLPAPER:
|
case MENU_ENUM_LABEL_DYNAMIC_WALLPAPER:
|
||||||
snprintf(s, len,
|
snprintf(s, len,
|
||||||
"Dynamically load a new wallpaper \n"
|
"Dynamically load a new wallpaper \n"
|
||||||
@ -2470,6 +2482,12 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
|
|||||||
return "menu_pointer_enable";
|
return "menu_pointer_enable";
|
||||||
case MENU_ENUM_LABEL_CORE_ENABLE:
|
case MENU_ENUM_LABEL_CORE_ENABLE:
|
||||||
return "menu_core_enable";
|
return "menu_core_enable";
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST:
|
||||||
|
return "menu_netplay_enable_host";
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT:
|
||||||
|
return "menu_netplay_enable_client";
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_DISCONNECT:
|
||||||
|
return "menu_netplay_disconnect";
|
||||||
case MENU_ENUM_LABEL_DPI_OVERRIDE_ENABLE:
|
case MENU_ENUM_LABEL_DPI_OVERRIDE_ENABLE:
|
||||||
return "dpi_override_enable";
|
return "dpi_override_enable";
|
||||||
case MENU_ENUM_LABEL_DPI_OVERRIDE_VALUE:
|
case MENU_ENUM_LABEL_DPI_OVERRIDE_VALUE:
|
||||||
@ -2858,6 +2876,8 @@ static const char *menu_hash_to_str_us_label_enum(enum msg_hash_enums msg)
|
|||||||
return "network_information";
|
return "network_information";
|
||||||
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
||||||
return "online_updater";
|
return "online_updater";
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY:
|
||||||
|
return "netplay";
|
||||||
case MENU_ENUM_LABEL_CORE_INFORMATION:
|
case MENU_ENUM_LABEL_CORE_INFORMATION:
|
||||||
return "core_information";
|
return "core_information";
|
||||||
case MENU_ENUM_LABEL_CORE_LIST:
|
case MENU_ENUM_LABEL_CORE_LIST:
|
||||||
@ -3797,6 +3817,12 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
|||||||
return "Touch Support";
|
return "Touch Support";
|
||||||
case MENU_ENUM_LABEL_VALUE_CORE_ENABLE:
|
case MENU_ENUM_LABEL_VALUE_CORE_ENABLE:
|
||||||
return "Display core name";
|
return "Display core name";
|
||||||
|
case MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST:
|
||||||
|
return "Start hosting";
|
||||||
|
case MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT:
|
||||||
|
return "Connect to Netplay host";
|
||||||
|
case MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT:
|
||||||
|
return "Disconnect";
|
||||||
case MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE:
|
case MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE:
|
||||||
return "DPI Override Enable";
|
return "DPI Override Enable";
|
||||||
case MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE:
|
case MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE:
|
||||||
@ -4129,6 +4155,8 @@ const char *msg_hash_to_str_us(enum msg_hash_enums msg)
|
|||||||
return "Achievement List";
|
return "Achievement List";
|
||||||
case MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER:
|
case MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER:
|
||||||
return "Online Updater";
|
return "Online Updater";
|
||||||
|
case MENU_ENUM_LABEL_VALUE_NETPLAY:
|
||||||
|
return "Netplay";
|
||||||
case MENU_ENUM_LABEL_VALUE_CORE_INFORMATION:
|
case MENU_ENUM_LABEL_VALUE_CORE_INFORMATION:
|
||||||
return "Core Information";
|
return "Core Information";
|
||||||
case MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND:
|
case MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND:
|
||||||
|
@ -287,6 +287,11 @@ static int deferred_push_options(menu_displaylist_info_t *info)
|
|||||||
return deferred_push_dlist(info, DISPLAYLIST_OPTIONS);
|
return deferred_push_dlist(info, DISPLAYLIST_OPTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int deferred_push_netplay(menu_displaylist_info_t *info)
|
||||||
|
{
|
||||||
|
return deferred_push_dlist(info, DISPLAYLIST_NETPLAY);
|
||||||
|
}
|
||||||
|
|
||||||
static int deferred_push_content_settings(menu_displaylist_info_t *info)
|
static int deferred_push_content_settings(menu_displaylist_info_t *info)
|
||||||
{
|
{
|
||||||
return deferred_push_dlist(info, DISPLAYLIST_CONTENT_SETTINGS);
|
return deferred_push_dlist(info, DISPLAYLIST_CONTENT_SETTINGS);
|
||||||
@ -905,6 +910,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
|
|||||||
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
||||||
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_options);
|
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_options);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY:
|
||||||
|
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_netplay);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_CONTENT_SETTINGS:
|
case MENU_ENUM_LABEL_CONTENT_SETTINGS:
|
||||||
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_content_settings);
|
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_content_settings);
|
||||||
break;
|
break;
|
||||||
@ -1156,6 +1164,9 @@ static int menu_cbs_init_bind_deferred_push_compare_label(
|
|||||||
case MENU_LABEL_ONLINE_UPDATER:
|
case MENU_LABEL_ONLINE_UPDATER:
|
||||||
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_options);
|
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_options);
|
||||||
break;
|
break;
|
||||||
|
case MENU_LABEL_NETPLAY:
|
||||||
|
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_netplay);
|
||||||
|
break;
|
||||||
case MENU_LABEL_CONTENT_SETTINGS:
|
case MENU_LABEL_CONTENT_SETTINGS:
|
||||||
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_content_settings);
|
BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_content_settings);
|
||||||
break;
|
break;
|
||||||
|
@ -50,6 +50,10 @@
|
|||||||
#include "../../lakka.h"
|
#include "../../lakka.h"
|
||||||
#include "../../wifi/wifi_driver.h"
|
#include "../../wifi/wifi_driver.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_NETPLAY
|
||||||
|
#include "../../network/netplay/netplay.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
enum msg_hash_enums enum_idx;
|
enum msg_hash_enums enum_idx;
|
||||||
@ -3266,6 +3270,126 @@ static int action_ok_video_resolution(const char *path,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int action_ok_netplay_enable_host(const char *path,
|
||||||
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_NETPLAY
|
||||||
|
bool netplay_was_on = false;
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
global->netplay.enable = true;
|
||||||
|
|
||||||
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||||
|
{
|
||||||
|
netplay_was_on = true;
|
||||||
|
|
||||||
|
/* Netplay is already on. Are we in the wrong mode? */
|
||||||
|
if (global->netplay.is_client)
|
||||||
|
{
|
||||||
|
/* Kill it! */
|
||||||
|
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We were already hosting! */
|
||||||
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
global->netplay.is_client = false;
|
||||||
|
global->netplay.server[0] = '\0';
|
||||||
|
|
||||||
|
/* If we haven't yet started, this will load on its own */
|
||||||
|
if (!content_is_inited())
|
||||||
|
{
|
||||||
|
runloop_msg_queue_push(
|
||||||
|
"Netplay will start when content is loaded.",
|
||||||
|
1, 480, true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enable Netplay itself */
|
||||||
|
if (!command_event(CMD_EVENT_NETPLAY_INIT, NULL))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* Then make sure we use Netplay's callbacks */
|
||||||
|
if (!netplay_was_on && !core_set_netplay_callbacks())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||||
|
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int action_ok_netplay_enable_client(const char *path,
|
||||||
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_NETPLAY
|
||||||
|
bool netplay_was_on = false;
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
global->netplay.enable = true;
|
||||||
|
|
||||||
|
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||||
|
{
|
||||||
|
netplay_was_on = true;
|
||||||
|
|
||||||
|
/* Kill it! */
|
||||||
|
command_event(CMD_EVENT_NETPLAY_DEINIT, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
global->netplay.is_client = true;
|
||||||
|
|
||||||
|
/* We can't do anything without a host specified */
|
||||||
|
if (!global->netplay.server[0])
|
||||||
|
{
|
||||||
|
runloop_msg_queue_push(
|
||||||
|
"Please specify the Netplay server's IP address or hostname.",
|
||||||
|
1, 480, true);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If we haven't yet started, this will load on its own */
|
||||||
|
if (!content_is_inited())
|
||||||
|
{
|
||||||
|
runloop_msg_queue_push(
|
||||||
|
"Netplay will start when content is loaded.",
|
||||||
|
1, 480, true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Enable Netplay itself */
|
||||||
|
if (!command_event(CMD_EVENT_NETPLAY_INIT, NULL))
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
/* Then make sure we use Netplay's callbacks */
|
||||||
|
if (!netplay_was_on && !core_set_netplay_callbacks())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||||
|
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static int action_ok_netplay_disconnect(const char *path,
|
||||||
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_NETPLAY
|
||||||
|
netplay_driver_ctl(RARCH_NETPLAY_CTL_DISCONNECT, NULL);
|
||||||
|
return generic_action_ok_command(CMD_EVENT_RESUME);
|
||||||
|
|
||||||
|
#else
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static int is_rdb_entry(enum msg_hash_enums enum_idx)
|
static int is_rdb_entry(enum msg_hash_enums enum_idx)
|
||||||
{
|
{
|
||||||
switch (enum_idx)
|
switch (enum_idx)
|
||||||
@ -3501,6 +3625,7 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_CORE_COUNTERS:
|
case MENU_ENUM_LABEL_CORE_COUNTERS:
|
||||||
case MENU_ENUM_LABEL_MANAGEMENT:
|
case MENU_ENUM_LABEL_MANAGEMENT:
|
||||||
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY:
|
||||||
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
|
case MENU_ENUM_LABEL_LOAD_CONTENT_LIST:
|
||||||
case MENU_ENUM_LABEL_ADD_CONTENT_LIST:
|
case MENU_ENUM_LABEL_ADD_CONTENT_LIST:
|
||||||
case MENU_ENUM_LABEL_HELP_LIST:
|
case MENU_ENUM_LABEL_HELP_LIST:
|
||||||
@ -3641,6 +3766,15 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_UPDATE_AUTOCONFIG_PROFILES:
|
case MENU_ENUM_LABEL_UPDATE_AUTOCONFIG_PROFILES:
|
||||||
BIND_ACTION_OK(cbs, action_ok_update_autoconfig_profiles);
|
BIND_ACTION_OK(cbs, action_ok_update_autoconfig_profiles);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST:
|
||||||
|
BIND_ACTION_OK(cbs, action_ok_netplay_enable_host);
|
||||||
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT:
|
||||||
|
BIND_ACTION_OK(cbs, action_ok_netplay_enable_client);
|
||||||
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY_DISCONNECT:
|
||||||
|
BIND_ACTION_OK(cbs, action_ok_netplay_disconnect);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -86,6 +86,13 @@ static int action_get_online_updater_list(const char *path, const char *label,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int action_get_netplay_list(const char *path, const char *label,
|
||||||
|
unsigned menu_type, char *s, size_t len)
|
||||||
|
{
|
||||||
|
sanitize_to_string(s, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY), len);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int action_get_online_thumbnails_updater_list(const char *path, const char *label,
|
static int action_get_online_thumbnails_updater_list(const char *path, const char *label,
|
||||||
unsigned menu_type, char *s, size_t len)
|
unsigned menu_type, char *s, size_t len)
|
||||||
{
|
{
|
||||||
@ -1171,6 +1178,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
case MENU_ENUM_LABEL_ONLINE_UPDATER:
|
||||||
BIND_ACTION_GET_TITLE(cbs, action_get_online_updater_list);
|
BIND_ACTION_GET_TITLE(cbs, action_get_online_updater_list);
|
||||||
break;
|
break;
|
||||||
|
case MENU_ENUM_LABEL_NETPLAY:
|
||||||
|
BIND_ACTION_GET_TITLE(cbs, action_get_netplay_list);
|
||||||
|
break;
|
||||||
case MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST:
|
case MENU_ENUM_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST:
|
||||||
BIND_ACTION_GET_TITLE(cbs, action_get_online_thumbnails_updater_list);
|
BIND_ACTION_GET_TITLE(cbs, action_get_online_thumbnails_updater_list);
|
||||||
break;
|
break;
|
||||||
@ -1473,6 +1483,9 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs,
|
|||||||
case MENU_LABEL_ONLINE_UPDATER:
|
case MENU_LABEL_ONLINE_UPDATER:
|
||||||
BIND_ACTION_GET_TITLE(cbs, action_get_online_updater_list);
|
BIND_ACTION_GET_TITLE(cbs, action_get_online_updater_list);
|
||||||
break;
|
break;
|
||||||
|
case MENU_LABEL_NETPLAY:
|
||||||
|
BIND_ACTION_GET_TITLE(cbs, action_get_netplay_list);
|
||||||
|
break;
|
||||||
case MENU_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST:
|
case MENU_LABEL_DEFERRED_THUMBNAILS_UPDATER_LIST:
|
||||||
BIND_ACTION_GET_TITLE(cbs, action_get_online_thumbnails_updater_list);
|
BIND_ACTION_GET_TITLE(cbs, action_get_online_thumbnails_updater_list);
|
||||||
break;
|
break;
|
||||||
|
@ -1651,6 +1651,10 @@ static int mui_list_push(void *data, void *userdata,
|
|||||||
#endif
|
#endif
|
||||||
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
|
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
|
||||||
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_NETPLAY)
|
||||||
|
entry.enum_idx = MENU_ENUM_LABEL_NETPLAY;
|
||||||
|
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
||||||
#endif
|
#endif
|
||||||
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
|
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
|
||||||
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
||||||
|
@ -3358,6 +3358,10 @@ static int xmb_list_push(void *data, void *userdata,
|
|||||||
#if defined(HAVE_NETWORKING)
|
#if defined(HAVE_NETWORKING)
|
||||||
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
|
entry.enum_idx = MENU_ENUM_LABEL_ONLINE_UPDATER;
|
||||||
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_NETPLAY)
|
||||||
|
entry.enum_idx = MENU_ENUM_LABEL_NETPLAY;
|
||||||
|
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
||||||
#endif
|
#endif
|
||||||
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
|
entry.enum_idx = MENU_ENUM_LABEL_INFORMATION_LIST;
|
||||||
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
menu_displaylist_ctl(DISPLAYLIST_SETTING_ENUM, &entry);
|
||||||
|
@ -1500,6 +1500,39 @@ static int menu_displaylist_parse_shader_options(menu_displaylist_info_t *info)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int menu_displaylist_parse_netplay(
|
||||||
|
menu_displaylist_info_t *info)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_NETPLAY
|
||||||
|
menu_entries_append_enum(info->list,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST),
|
||||||
|
MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST,
|
||||||
|
MENU_SETTING_ACTION, 0, 0);
|
||||||
|
|
||||||
|
menu_entries_append_enum(info->list,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT),
|
||||||
|
MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT,
|
||||||
|
MENU_SETTING_ACTION, 0, 0);
|
||||||
|
|
||||||
|
menu_entries_append_enum(info->list,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_DISCONNECT),
|
||||||
|
MENU_ENUM_LABEL_NETPLAY_DISCONNECT,
|
||||||
|
MENU_SETTING_ACTION, 0, 0);
|
||||||
|
|
||||||
|
#else
|
||||||
|
menu_entries_append_enum(info->list,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_NO_ITEMS),
|
||||||
|
MENU_ENUM_LABEL_NO_ITEMS,
|
||||||
|
MENU_SETTING_NO_ITEM, 0, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_LIBRETRODB
|
#ifdef HAVE_LIBRETRODB
|
||||||
static int create_string_list_rdb_entry_string(
|
static int create_string_list_rdb_entry_string(
|
||||||
enum msg_hash_enums enum_idx,
|
enum msg_hash_enums enum_idx,
|
||||||
@ -3971,6 +4004,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
case DISPLAYLIST_DATABASE_ENTRY:
|
case DISPLAYLIST_DATABASE_ENTRY:
|
||||||
case DISPLAYLIST_DATABASE_QUERY:
|
case DISPLAYLIST_DATABASE_QUERY:
|
||||||
case DISPLAYLIST_OPTIONS_SHADERS:
|
case DISPLAYLIST_OPTIONS_SHADERS:
|
||||||
|
case DISPLAYLIST_NETPLAY:
|
||||||
case DISPLAYLIST_CORE_CONTENT:
|
case DISPLAYLIST_CORE_CONTENT:
|
||||||
case DISPLAYLIST_CORE_CONTENT_DIRS:
|
case DISPLAYLIST_CORE_CONTENT_DIRS:
|
||||||
case DISPLAYLIST_PLAYLIST_COLLECTION:
|
case DISPLAYLIST_PLAYLIST_COLLECTION:
|
||||||
@ -4241,6 +4275,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
menu_displaylist_parse_settings_enum(menu, info,
|
menu_displaylist_parse_settings_enum(menu, info,
|
||||||
MENU_ENUM_LABEL_ADD_CONTENT_LIST,
|
MENU_ENUM_LABEL_ADD_CONTENT_LIST,
|
||||||
PARSE_ACTION, false);
|
PARSE_ACTION, false);
|
||||||
|
#if defined(HAVE_NETPLAY)
|
||||||
|
menu_displaylist_parse_settings_enum(menu, info,
|
||||||
|
MENU_ENUM_LABEL_NETPLAY,
|
||||||
|
PARSE_ACTION, false);
|
||||||
|
#endif
|
||||||
#if defined(HAVE_NETWORKING)
|
#if defined(HAVE_NETWORKING)
|
||||||
menu_displaylist_parse_settings_enum(menu, info,
|
menu_displaylist_parse_settings_enum(menu, info,
|
||||||
MENU_ENUM_LABEL_ONLINE_UPDATER,
|
MENU_ENUM_LABEL_ONLINE_UPDATER,
|
||||||
@ -5344,6 +5383,11 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
case DISPLAYLIST_OPTIONS_SHADERS:
|
case DISPLAYLIST_OPTIONS_SHADERS:
|
||||||
ret = menu_displaylist_parse_shader_options(info);
|
ret = menu_displaylist_parse_shader_options(info);
|
||||||
|
|
||||||
|
info->need_push = true;
|
||||||
|
break;
|
||||||
|
case DISPLAYLIST_NETPLAY:
|
||||||
|
ret = menu_displaylist_parse_netplay(info);
|
||||||
|
|
||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_CORE_CONTENT:
|
case DISPLAYLIST_CORE_CONTENT:
|
||||||
|
@ -141,6 +141,7 @@ enum menu_displaylist_ctl_state
|
|||||||
DISPLAYLIST_OPTIONS_MANAGEMENT,
|
DISPLAYLIST_OPTIONS_MANAGEMENT,
|
||||||
DISPLAYLIST_OPTIONS_DISK,
|
DISPLAYLIST_OPTIONS_DISK,
|
||||||
DISPLAYLIST_OPTIONS_SHADERS,
|
DISPLAYLIST_OPTIONS_SHADERS,
|
||||||
|
DISPLAYLIST_NETPLAY,
|
||||||
DISPLAYLIST_ADD_CONTENT_LIST,
|
DISPLAYLIST_ADD_CONTENT_LIST,
|
||||||
DISPLAYLIST_SCAN_DIRECTORY_LIST,
|
DISPLAYLIST_SCAN_DIRECTORY_LIST,
|
||||||
DISPLAYLIST_ARCHIVE_ACTION,
|
DISPLAYLIST_ARCHIVE_ACTION,
|
||||||
|
@ -2187,6 +2187,17 @@ static bool setting_append_list(
|
|||||||
parent_group);
|
parent_group);
|
||||||
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_ADD_CONTENT_LIST);
|
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_ADD_CONTENT_LIST);
|
||||||
|
|
||||||
|
#if defined(HAVE_NETPLAY)
|
||||||
|
CONFIG_ACTION(
|
||||||
|
list, list_info,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY),
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY),
|
||||||
|
&group_info,
|
||||||
|
&subgroup_info,
|
||||||
|
parent_group);
|
||||||
|
menu_settings_list_current_add_enum_idx(list, list_info, MENU_ENUM_LABEL_NETPLAY);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_NETWORKING)
|
#if defined(HAVE_NETWORKING)
|
||||||
CONFIG_ACTION(
|
CONFIG_ACTION(
|
||||||
list, list_info,
|
list, list_info,
|
||||||
|
12
msg_hash.h
12
msg_hash.h
@ -959,6 +959,15 @@ enum msg_hash_enums
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Netplay */
|
||||||
|
MENU_ENUM_LABEL_NETPLAY_ENABLE_HOST,
|
||||||
|
MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST,
|
||||||
|
MENU_ENUM_LABEL_NETPLAY_ENABLE_CLIENT,
|
||||||
|
MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_CLIENT,
|
||||||
|
MENU_ENUM_LABEL_NETPLAY_DISCONNECT,
|
||||||
|
MENU_ENUM_LABEL_VALUE_NETPLAY_DISCONNECT,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MENU_ENUM_LABEL_COLLAPSE_SUBGROUPS_ENABLE,
|
MENU_ENUM_LABEL_COLLAPSE_SUBGROUPS_ENABLE,
|
||||||
MENU_ENUM_LABEL_VALUE_COLLAPSE_SUBGROUPS_ENABLE,
|
MENU_ENUM_LABEL_VALUE_COLLAPSE_SUBGROUPS_ENABLE,
|
||||||
@ -1428,6 +1437,8 @@ enum msg_hash_enums
|
|||||||
MENU_ENUM_LABEL_VALUE_MANAGEMENT,
|
MENU_ENUM_LABEL_VALUE_MANAGEMENT,
|
||||||
MENU_ENUM_LABEL_ONLINE_UPDATER,
|
MENU_ENUM_LABEL_ONLINE_UPDATER,
|
||||||
MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER,
|
MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER,
|
||||||
|
MENU_ENUM_LABEL_NETPLAY,
|
||||||
|
MENU_ENUM_LABEL_VALUE_NETPLAY,
|
||||||
MENU_ENUM_LABEL_SETTINGS,
|
MENU_ENUM_LABEL_SETTINGS,
|
||||||
MENU_ENUM_LABEL_FRONTEND_COUNTERS,
|
MENU_ENUM_LABEL_FRONTEND_COUNTERS,
|
||||||
MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS,
|
MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS,
|
||||||
@ -2075,6 +2086,7 @@ enum msg_hash_enums
|
|||||||
#define MENU_LABEL_LOAD_CONTENT_HISTORY 0xfe1d79e5U
|
#define MENU_LABEL_LOAD_CONTENT_HISTORY 0xfe1d79e5U
|
||||||
#define MENU_LABEL_ADD_CONTENT_LIST 0x046f4668U
|
#define MENU_LABEL_ADD_CONTENT_LIST 0x046f4668U
|
||||||
#define MENU_LABEL_ONLINE_UPDATER 0xcac0025eU
|
#define MENU_LABEL_ONLINE_UPDATER 0xcac0025eU
|
||||||
|
#define MENU_LABEL_NETPLAY 0x0b511d22U
|
||||||
#define MENU_LABEL_SETTINGS 0x1304dc16U
|
#define MENU_LABEL_SETTINGS 0x1304dc16U
|
||||||
#define MENU_LABEL_HELP 0x7c97d2eeU
|
#define MENU_LABEL_HELP 0x7c97d2eeU
|
||||||
#define MENU_VALUE_HORIZONTAL_MENU 0x35761704U
|
#define MENU_VALUE_HORIZONTAL_MENU 0x35761704U
|
||||||
|
@ -1272,38 +1272,18 @@ void netplay_load_savestate(netplay_t *netplay, retro_ctx_serialize_info_t *seri
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* netplay_reconnect
|
* netplay_disconnect
|
||||||
* @netplay : pointer to netplay object
|
* @netplay : pointer to netplay object
|
||||||
*
|
*
|
||||||
* Reconnect netplay. Only does anything as a client, and only if netplay isn't
|
* Disconnect netplay.
|
||||||
* currently connected.
|
|
||||||
*
|
*
|
||||||
* Returns: true (1) if successful, false (0) if unsuccessful, false (0) if not
|
* Returns: true (1) if successful. At present, cannot fail.
|
||||||
* client or already connected.
|
|
||||||
**/
|
**/
|
||||||
bool netplay_reconnect(netplay_t *netplay)
|
bool netplay_disconnect(netplay_t *netplay)
|
||||||
{
|
{
|
||||||
/* FIXME: This function has some things remembered in netplay, some things
|
if (!netplay || !netplay->has_connection)
|
||||||
* brought back from global */
|
return true;
|
||||||
global_t *global = global_get_ptr();
|
hangup(netplay);
|
||||||
|
|
||||||
if (!netplay || netplay->has_connection || netplay->is_server)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!init_socket(netplay, global->netplay.server, netplay->tcp_port))
|
|
||||||
{
|
|
||||||
RARCH_WARN("Failed to reconnect Netplay.\n");
|
|
||||||
runloop_msg_queue_push("Failed to reconnect Netplay.", 0, 480, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* FIXME: Connection info is weirdly conflated into info_cb */
|
|
||||||
if (!netplay_info_cb(netplay, netplay->stall_frames))
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1416,8 +1396,8 @@ bool netplay_driver_ctl(enum rarch_netplay_ctl_state state, void *data)
|
|||||||
case RARCH_NETPLAY_CTL_LOAD_SAVESTATE:
|
case RARCH_NETPLAY_CTL_LOAD_SAVESTATE:
|
||||||
netplay_load_savestate((netplay_t*)netplay_data, (retro_ctx_serialize_info_t*)data, true);
|
netplay_load_savestate((netplay_t*)netplay_data, (retro_ctx_serialize_info_t*)data, true);
|
||||||
break;
|
break;
|
||||||
case RARCH_NETPLAY_CTL_RECONNECT:
|
case RARCH_NETPLAY_CTL_DISCONNECT:
|
||||||
return netplay_reconnect((netplay_t*)netplay_data);
|
return netplay_disconnect((netplay_t*)netplay_data);
|
||||||
default:
|
default:
|
||||||
case RARCH_NETPLAY_CTL_NONE:
|
case RARCH_NETPLAY_CTL_NONE:
|
||||||
break;
|
break;
|
||||||
|
@ -39,7 +39,7 @@ enum rarch_netplay_ctl_state
|
|||||||
RARCH_NETPLAY_CTL_PAUSE,
|
RARCH_NETPLAY_CTL_PAUSE,
|
||||||
RARCH_NETPLAY_CTL_UNPAUSE,
|
RARCH_NETPLAY_CTL_UNPAUSE,
|
||||||
RARCH_NETPLAY_CTL_LOAD_SAVESTATE,
|
RARCH_NETPLAY_CTL_LOAD_SAVESTATE,
|
||||||
RARCH_NETPLAY_CTL_RECONNECT
|
RARCH_NETPLAY_CTL_DISCONNECT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum netplay_cmd
|
enum netplay_cmd
|
||||||
@ -196,16 +196,14 @@ void netplay_frontend_paused(netplay_t *netplay, bool paused);
|
|||||||
void netplay_load_savestate(netplay_t *netplay, retro_ctx_serialize_info_t *serial_info, bool save);
|
void netplay_load_savestate(netplay_t *netplay, retro_ctx_serialize_info_t *serial_info, bool save);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* netplay_reconnect
|
* netplay_disconnect
|
||||||
* @netplay : pointer to netplay object
|
* @netplay : pointer to netplay object
|
||||||
*
|
*
|
||||||
* Reconnect netplay. Only does anything as a client, and only if netplay isn't
|
* Disconnect netplay.
|
||||||
* currently connected.
|
|
||||||
*
|
*
|
||||||
* Returns: true (1) if successful, false (0) if unsuccessful, false (0) if not
|
* Returns: true (1) if successful. At present, cannot fail.
|
||||||
* client or already connected.
|
|
||||||
**/
|
**/
|
||||||
bool netplay_reconnect(netplay_t *netplay);
|
bool netplay_disconnect(netplay_t *netplay);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* init_netplay:
|
* init_netplay:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user