mirror of
https://github.com/libretro/RetroArch
synced 2025-02-15 00:40:06 +00:00
Hook up binds.
This commit is contained in:
parent
d551d93ce4
commit
75408b689d
@ -308,6 +308,7 @@ static const struct snes_keybind snes_keybinds_1[] = {
|
||||
{ SSNES_SCREENSHOT, SK_PRINT, NO_BTN, AXIS_NONE },
|
||||
{ SSNES_DSP_CONFIG, SK_c, NO_BTN, AXIS_NONE },
|
||||
{ SSNES_MUTE, SK_F9, NO_BTN, AXIS_NONE },
|
||||
{ SSNES_NETPLAY_FLIP, SK_i, NO_BTN, AXIS_NONE },
|
||||
{ -1 }
|
||||
};
|
||||
|
||||
|
1
driver.h
1
driver.h
@ -57,6 +57,7 @@ enum
|
||||
SSNES_SCREENSHOT,
|
||||
SSNES_DSP_CONFIG,
|
||||
SSNES_MUTE,
|
||||
SSNES_NETPLAY_FLIP,
|
||||
|
||||
#ifdef SSNES_CONSOLE
|
||||
SSNES_CHEAT_INPUT,
|
||||
|
@ -902,6 +902,9 @@ static bool netplay_get_cmd(netplay_t *handle)
|
||||
handle->flip ^= true;
|
||||
handle->flip_frame = flip_frame;
|
||||
|
||||
SSNES_LOG("Netplay players are flipped!\n");
|
||||
msg_queue_push(g_extern.msg_queue, "Netplay players are flipped!", 1, 180);
|
||||
|
||||
return netplay_cmd_ack(handle);
|
||||
}
|
||||
|
||||
@ -939,6 +942,9 @@ void netplay_flip_players(netplay_t *handle)
|
||||
if (netplay_send_cmd(handle, NETPLAY_CMD_FLIP_PLAYERS, &flip_frame_net, sizeof(flip_frame_net))
|
||||
&& netplay_get_response(handle))
|
||||
{
|
||||
SSNES_LOG("Netplay players are flipped!\n");
|
||||
msg_queue_push(g_extern.msg_queue, "Netplay players are flipped!", 1, 180);
|
||||
|
||||
// Queue up a flip well enough in the future.
|
||||
handle->flip ^= true;
|
||||
handle->flip_frame = flip_frame;
|
||||
|
@ -555,6 +555,7 @@ static const struct bind_map bind_maps[MAX_PLAYERS][MAX_BINDS] = {
|
||||
DECLARE_BIND(screenshot, SSNES_SCREENSHOT),
|
||||
DECLARE_BIND(dsp_config, SSNES_DSP_CONFIG),
|
||||
DECLARE_BIND(audio_mute, SSNES_MUTE),
|
||||
DECLARE_BIND(netplay_flip_players, SSNES_NETPLAY_FLIP),
|
||||
DECLARE_BIND_END(),
|
||||
},
|
||||
|
||||
|
15
ssnes.c
15
ssnes.c
@ -1970,6 +1970,18 @@ static void check_mute(void)
|
||||
old_pressed = pressed;
|
||||
}
|
||||
|
||||
#ifdef HAVE_NETPLAY
|
||||
static void check_netplay_flip(void)
|
||||
{
|
||||
static bool old_pressed = false;
|
||||
bool pressed = driver.input->key_pressed(driver.input_data, SSNES_NETPLAY_FLIP);
|
||||
if (pressed && !old_pressed)
|
||||
netplay_flip_players(g_extern.netplay);
|
||||
|
||||
old_pressed = pressed;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void do_state_checks(void)
|
||||
{
|
||||
check_screenshot();
|
||||
@ -2017,7 +2029,10 @@ static void do_state_checks(void)
|
||||
#ifdef HAVE_NETPLAY
|
||||
}
|
||||
else
|
||||
{
|
||||
check_netplay_flip();
|
||||
check_fullscreen();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_DYLIB
|
||||
|
@ -317,6 +317,9 @@
|
||||
# Take screenshot
|
||||
# input_screenshot = print_screen
|
||||
|
||||
# Netplay flip players.
|
||||
# input_netplay_flip_players = i
|
||||
|
||||
# Directory to dump screenshots to.
|
||||
# screenshot_directory =
|
||||
|
||||
|
@ -103,6 +103,7 @@ static struct bind binds[] = {
|
||||
MISC_BIND("Screenshot", screenshot)
|
||||
MISC_BIND("DSP config", dsp_config)
|
||||
MISC_BIND("Audio mute/unmute", audio_mute)
|
||||
MISC_BIND("Netplay player flip", netplay_flip_players)
|
||||
};
|
||||
|
||||
static void get_binds(config_file_t *conf, int player, int joypad)
|
||||
|
Loading…
x
Reference in New Issue
Block a user