mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-21 18:21:51 +00:00
add stub driver for network gamepad
This commit is contained in:
parent
9fb3fe6216
commit
1296768d47
@ -484,6 +484,10 @@ ifeq ($(HAVE_COMMAND), 1)
|
||||
OBJ += command.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_NETWORK_GAMEPAD), 1)
|
||||
OBJ += remote.o
|
||||
endif
|
||||
|
||||
#Input
|
||||
|
||||
ifeq ($(HAVE_WAYLAND), 1)
|
||||
|
@ -75,6 +75,17 @@ static void event_init_command(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
static void event_init_remote(void)
|
||||
{
|
||||
driver_t *driver = driver_get_ptr();
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (!(driver->remote = rarch_remote_new(55400,1)))
|
||||
RARCH_ERR("Failed to initialize remote gamepad interface.\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* event_free_temporary_content:
|
||||
*
|
||||
@ -1684,6 +1695,20 @@ bool event_command(enum event_command cmd)
|
||||
event_init_command();
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_REMOTE_DEINIT:
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
if (driver->remote)
|
||||
rarch_remote_free(driver->remote);
|
||||
driver->remote = NULL;
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_REMOTE_INIT:
|
||||
event_command(EVENT_CMD_REMOTE_DEINIT);
|
||||
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
event_init_remote();
|
||||
#endif
|
||||
break;
|
||||
case EVENT_CMD_TEMPORARY_CONTENT_DEINIT:
|
||||
if (!global)
|
||||
break;
|
||||
|
@ -175,6 +175,10 @@ enum event_command
|
||||
EVENT_CMD_COMMAND_INIT,
|
||||
/* Deinitialize command interface. */
|
||||
EVENT_CMD_COMMAND_DEINIT,
|
||||
/* Initializes remote gamepad interface. */
|
||||
EVENT_CMD_REMOTE_INIT,
|
||||
/* Deinitializes remote gamepad interface. */
|
||||
EVENT_CMD_REMOTE_DEINIT,
|
||||
/* Deinitializes drivers. */
|
||||
EVENT_CMD_DRIVERS_DEINIT,
|
||||
/* Initializes drivers. */
|
||||
|
7
driver.h
7
driver.h
@ -49,6 +49,10 @@
|
||||
#include "command.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
#include "remote.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -258,6 +262,9 @@ typedef struct driver
|
||||
|
||||
#ifdef HAVE_COMMAND
|
||||
rarch_cmd_t *command;
|
||||
#endif
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
rarch_remote_t *remote;
|
||||
#endif
|
||||
bool block_hotkey;
|
||||
bool block_libretro_input;
|
||||
|
@ -856,6 +856,10 @@ MENU
|
||||
#include "../command.c"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORK_GAMEPAD
|
||||
#include "../remote.c"
|
||||
#endif
|
||||
|
||||
#include "../command_event.c"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -588,6 +588,13 @@ static int menu_displaylist_parse_system_info(menu_displaylist_info_t *info)
|
||||
_network_command_supp ? menu_hash_to_str(MENU_LABEL_VALUE_YES) : menu_hash_to_str(MENU_LABEL_VALUE_NO));
|
||||
menu_entries_push(info->list, feat_str, "",
|
||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||
|
||||
snprintf(feat_str, sizeof(feat_str),
|
||||
"%s : %s",
|
||||
menu_hash_to_str(MENU_LABEL_VALUE_SYSTEM_INFO_NETWORK_COMMAND_IFACE_SUPPORT),
|
||||
_network_gamepad_supp ? menu_hash_to_str(MENU_LABEL_VALUE_YES) : menu_hash_to_str(MENU_LABEL_VALUE_NO));
|
||||
menu_entries_push(info->list, feat_str, "",
|
||||
MENU_SETTINGS_CORE_INFO_NONE, 0, 0);
|
||||
|
||||
snprintf(feat_str, sizeof(feat_str),
|
||||
"%s: %s",
|
||||
|
@ -1213,6 +1213,7 @@ int rarch_main_init(int argc, char *argv[])
|
||||
|
||||
event_command(EVENT_CMD_DRIVERS_INIT);
|
||||
event_command(EVENT_CMD_COMMAND_INIT);
|
||||
event_command(EVENT_CMD_REMOTE_INIT);
|
||||
event_command(EVENT_CMD_REWIND_INIT);
|
||||
event_command(EVENT_CMD_CONTROLLERS_INIT);
|
||||
event_command(EVENT_CMD_RECORD_INIT);
|
||||
@ -1457,6 +1458,7 @@ void rarch_main_deinit(void)
|
||||
|
||||
event_command(EVENT_CMD_NETPLAY_DEINIT);
|
||||
event_command(EVENT_CMD_COMMAND_DEINIT);
|
||||
event_command(EVENT_CMD_REMOTE_DEINIT);
|
||||
|
||||
if (global->sram.use)
|
||||
event_command(EVENT_CMD_AUTOSAVE_DEINIT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user