diff --git a/netplay.c b/netplay.c index e2299877cd..431a9c8921 100644 --- a/netplay.c +++ b/netplay.c @@ -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; } } diff --git a/netplay.h b/netplay.h index 1f24e07452..ac8be4cf0e 100644 --- a/netplay.h +++ b/netplay.h @@ -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,