mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
Netplay commands and possible analog support
This commit is contained in:
parent
85acdc31fc
commit
8cf8e83e4a
@ -46,10 +46,6 @@ struct delta_frame
|
||||
#define UDP_FRAME_PACKETS 16
|
||||
#define MAX_SPECTATORS 16
|
||||
|
||||
#define NETPLAY_CMD_ACK 0
|
||||
#define NETPLAY_CMD_NAK 1
|
||||
#define NETPLAY_CMD_FLIP_PLAYERS 2
|
||||
|
||||
#define PREV_PTR(x) ((x) == 0 ? netplay->buffer_size - 1 : (x) - 1)
|
||||
#define NEXT_PTR(x) ((x + 1) % netplay->buffer_size)
|
||||
|
||||
@ -129,6 +125,7 @@ static void warn_hangup(void)
|
||||
rarch_main_msg_queue_push("Netplay has disconnected. Will continue without connection.", 0, 480, false);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* netplay_should_skip:
|
||||
* @netplay : pointer to netplay object
|
||||
@ -208,7 +205,7 @@ static bool get_self_input_state(netplay_t *netplay)
|
||||
{
|
||||
int16_t tmp = cb(settings->input.netplay_client_swap_input ?
|
||||
0 : !netplay->port,
|
||||
RETRO_DEVICE_JOYPAD, 0, i);
|
||||
RETRO_DEVICE_ANALOG, 0, i);
|
||||
state |= tmp ? 1 << i : 0;
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,15 @@
|
||||
|
||||
typedef struct netplay netplay_t;
|
||||
|
||||
enum netplay_cmd
|
||||
{
|
||||
NETPLAY_CMD_ACK = 0x0000, /**< Acknowlegement response */
|
||||
NETPLAY_CMD_NAK = 0x0001, /**< Failed acknowlegement response */
|
||||
NETPLAY_CMD_FLIP_PLAYERS = 0x0002, /**< Swap inputs between p1 and p2. */
|
||||
NETPLAY_CMD_SPECTATE = 0x0003, /**< Toggle spectate/join mode [PLANNED] */
|
||||
NETPLAY_CMD_LOAD_SAVESTATE = 0x0004 /**< Load a save state between players [PLANNED] */
|
||||
};
|
||||
|
||||
void input_poll_net(void);
|
||||
|
||||
int16_t input_state_net(unsigned port, unsigned device,
|
||||
|
Loading…
Reference in New Issue
Block a user