Get rid of a lot of RARCH_INPUT_STATE_BIT_ macros - replace them

with BIT128_ equivalents instead
This commit is contained in:
twinaphex 2017-12-05 09:22:33 +01:00
parent 0691c9e0d3
commit e94300a581
32 changed files with 250 additions and 276 deletions

View File

@ -62,11 +62,12 @@ static void hidpad_nesusb_deinit(void *data)
static void hidpad_nesusb_get_buttons(void *data, retro_bits_t* state) static void hidpad_nesusb_get_buttons(void *data, retro_bits_t* state)
{ {
struct hidpad_nesusb_data *device = (struct hidpad_nesusb_data*)data; struct hidpad_nesusb_data *device = (struct hidpad_nesusb_data*)data;
if (device) { if (device)
{
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t hidpad_nesusb_get_axis(void *data, unsigned axis) static int16_t hidpad_nesusb_get_axis(void *data, unsigned axis)

View File

@ -62,11 +62,12 @@ static void hidpad_ps2adapter_deinit(void *data)
static void hidpad_ps2adapter_get_buttons(void *data, retro_bits_t *state) static void hidpad_ps2adapter_get_buttons(void *data, retro_bits_t *state)
{ {
struct hidpad_ps2adapter_data *device = (struct hidpad_ps2adapter_data*)data; struct hidpad_ps2adapter_data *device = (struct hidpad_ps2adapter_data*)data;
if ( device ) { if (device)
{
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t hidpad_ps2adapter_get_axis(void *data, unsigned axis) static int16_t hidpad_ps2adapter_get_axis(void *data, unsigned axis)

View File

@ -114,14 +114,11 @@ static void hidpad_ps3_get_buttons(void *data, retro_bits_t *state)
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
/*PS button?*/ /*PS button?*/
if ( device->buttons & 0x10000 ) { if (device->buttons & 0x10000)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RARCH_MENU_TOGGLE ); BIT128_SET_PTR(state, RARCH_MENU_TOGGLE);
}
} }
else else
{ BIT128_CLEAR_ALL_PTR(state);
RARCH_INPUT_STATE_CLEAR_PTR( state );
}
} }
static int16_t hidpad_ps3_get_axis(void *data, unsigned axis) static int16_t hidpad_ps3_get_axis(void *data, unsigned axis)

View File

@ -20,6 +20,7 @@
#include <boolean.h> #include <boolean.h>
#include <retro_environment.h> #include <retro_environment.h>
#include <retro_miscellaneous.h>
#include "joypad_connection.h" #include "joypad_connection.h"
#include "../input_defines.h" #include "../input_defines.h"
@ -187,64 +188,48 @@ static bool hidpad_ps4_check_dpad(struct ps4 *rpt, unsigned id)
static void hidpad_ps4_get_buttons(void *data, retro_bits_t* state) static void hidpad_ps4_get_buttons(void *data, retro_bits_t* state)
{ {
struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data; struct hidpad_ps4_data *device = (struct hidpad_ps4_data*)data;
struct ps4 *rpt = device ? (struct ps4*)&device->data : NULL; struct ps4 *rpt = device ?
(struct ps4*)&device->data : NULL;
if (!device || !rpt) if (!device || !rpt)
return; return;
RARCH_INPUT_STATE_CLEAR_PTR( state ); BIT128_CLEAR_ALL_PTR( state );
if ( rpt->btn.r3 ) { if (rpt->btn.r3)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R3 ); BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R3 );
} if (rpt->btn.l3)
if ( rpt->btn.l3 ) { BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L3 );
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L3 ); if (rpt->btn.options)
} BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_START );
if ( rpt->btn.options ) { if ( rpt->btn.share)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_START ); BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_SELECT );
} if ( rpt->btn.r2)
if ( rpt->btn.share ) { BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R2 );
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_SELECT ); if (rpt->btn.l2)
} BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L2 );
if ( rpt->btn.r2 ) { if (rpt->btn.r1)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R2 ); BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R );
} if (rpt->btn.l1)
if ( rpt->btn.l2 ) { BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L );
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L2 ); if (rpt->btn.triangle)
} BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_X );
if ( rpt->btn.r1 ) { if (rpt->btn.circle)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R ); BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_A );
} if (rpt->btn.cross)
if ( rpt->btn.l1 ) { BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_B );
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L ); if (rpt->btn.square)
} BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_Y );
if ( rpt->btn.triangle ) { if ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_LEFT)))
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_X ); BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_LEFT );
} if ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_DOWN)))
if ( rpt->btn.circle ) { BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_DOWN );
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_A ); if ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_RIGHT)))
} BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_RIGHT );
if ( rpt->btn.cross ) { if ((hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_UP)))
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_B ); BIT128_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_UP );
} if (rpt->btn.ps)
if ( rpt->btn.square ) { BIT128_SET_PTR( state, RARCH_MENU_TOGGLE );
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_Y );
}
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_LEFT)) ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_LEFT );
}
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_DOWN)) ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_DOWN );
}
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_RIGHT)) ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_RIGHT );
}
if ( (hidpad_ps4_check_dpad(rpt, RETRO_DEVICE_ID_JOYPAD_UP)) ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_UP );
}
if ( rpt->btn.ps ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RARCH_MENU_TOGGLE );
}
} }
static int16_t hidpad_ps4_get_axis(void *data, unsigned axis) static int16_t hidpad_ps4_get_axis(void *data, unsigned axis)

View File

@ -62,11 +62,12 @@ static void hidpad_psxadapter_deinit(void *data)
static void hidpad_psxadapter_get_buttons(void *data, retro_bits_t *state) static void hidpad_psxadapter_get_buttons(void *data, retro_bits_t *state)
{ {
struct hidpad_psxadapter_data *device = (struct hidpad_psxadapter_data*)data; struct hidpad_psxadapter_data *device = (struct hidpad_psxadapter_data*)data;
if ( device ) { if (device)
{
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t hidpad_psxadapter_get_axis(void *data, unsigned axis) static int16_t hidpad_psxadapter_get_axis(void *data, unsigned axis)

View File

@ -63,11 +63,12 @@ static void hidpad_snesusb_deinit(void *data)
static void hidpad_snesusb_get_buttons(void *data, retro_bits_t *state) static void hidpad_snesusb_get_buttons(void *data, retro_bits_t *state)
{ {
struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data; struct hidpad_snesusb_data *device = (struct hidpad_snesusb_data*)data;
if ( device ) { if (device)
{
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t hidpad_snesusb_get_axis(void *data, unsigned axis) static int16_t hidpad_snesusb_get_axis(void *data, unsigned axis)

View File

@ -66,11 +66,12 @@ static void hidpad_wiiugca_deinit(void *data)
static void hidpad_wiiugca_get_buttons(void *data, retro_bits_t *state) static void hidpad_wiiugca_get_buttons(void *data, retro_bits_t *state)
{ {
struct hidpad_wiiugca_data *device = (struct hidpad_wiiugca_data*)data; struct hidpad_wiiugca_data *device = (struct hidpad_wiiugca_data*)data;
if ( device ) { if (device)
{
RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, device->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t hidpad_wiiugca_get_axis(void *data, unsigned axis) static int16_t hidpad_wiiugca_get_axis(void *data, unsigned axis)

View File

@ -121,64 +121,48 @@ static void hidpad_wiiupro_deinit(void *data)
static void hidpad_wiiupro_get_buttons(void *data, retro_bits_t *state) static void hidpad_wiiupro_get_buttons(void *data, retro_bits_t *state)
{ {
struct hidpad_wiiupro_data *device = (struct hidpad_wiiupro_data*)data; struct hidpad_wiiupro_data *device = (struct hidpad_wiiupro_data*)data;
struct wiiupro *rpt = device ? (struct wiiupro*)&device->data : NULL; struct wiiupro *rpt = device ?
(struct wiiupro*)&device->data : NULL;
if (!device || !rpt) if (!device || !rpt)
return; return;
RARCH_INPUT_STATE_CLEAR_PTR( state ); BIT128_CLEAR_ALL_PTR(state);
if ( rpt->btn.r3 ) { if (rpt->btn.r3)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R3 ); BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_R3);
} if (rpt->btn.l3)
if ( rpt->btn.l3 ) { BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_L3);
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L3 ); if (rpt->btn.plus)
} BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_START);
if ( rpt->btn.plus ) { if ( rpt->btn.minus)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_START ); BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_SELECT);
} if ( rpt->btn.zr)
if ( rpt->btn.minus ) { BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_R2);
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_SELECT ); if ( rpt->btn.zl)
} BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_L2);
if ( rpt->btn.zr ) { if ( rpt->btn.r)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R2 ); BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_R);
} if ( rpt->btn.l)
if ( rpt->btn.zl ) { BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_L);
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L2 ); if ( rpt->btn.x)
} BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_X);
if ( rpt->btn.r ) { if ( rpt->btn.a)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_R ); BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_A);
} if ( rpt->btn.b)
if ( rpt->btn.l ) { BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_B);
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_L ); if ( rpt->btn.y)
} BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_Y);
if ( rpt->btn.x ) { if ( rpt->btn.left)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_X ); BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_LEFT);
} if ( rpt->btn.down)
if ( rpt->btn.a ) { BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_DOWN);
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_A ); if ( rpt->btn.right)
} BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_RIGHT);
if ( rpt->btn.b ) { if ( rpt->btn.up)
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_B ); BIT128_SET_PTR(state, RETRO_DEVICE_ID_JOYPAD_UP);
} if ( rpt->btn.home)
if ( rpt->btn.y ) { BIT128_SET_PTR(state, RARCH_MENU_TOGGLE);
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_Y );
}
if ( rpt->btn.left ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_LEFT );
}
if ( rpt->btn.down ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_DOWN );
}
if ( rpt->btn.right ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_RIGHT );
}
if ( rpt->btn.up ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RETRO_DEVICE_ID_JOYPAD_UP );
}
if ( rpt->btn.home ) {
RARCH_INPUT_STATE_BIT_SET_PTR( state, RARCH_MENU_TOGGLE );
}
} }
static int16_t hidpad_wiiupro_get_axis(void *data, unsigned axis) static int16_t hidpad_wiiupro_get_axis(void *data, unsigned axis)

View File

@ -175,11 +175,12 @@ void pad_connection_packet(joypad_connection_t *joyconn, uint32_t pad,
void pad_connection_get_buttons(joypad_connection_t *joyconn, unsigned pad, retro_bits_t* state) void pad_connection_get_buttons(joypad_connection_t *joyconn, unsigned pad, retro_bits_t* state)
{ {
if (joyconn->iface) { if (joyconn->iface)
{
joyconn->iface->get_buttons(joyconn->data, state); joyconn->iface->get_buttons(joyconn->data, state);
} else {
RARCH_INPUT_STATE_CLEAR_PTR( state );
} }
else
BIT128_CLEAR_ALL_PTR( state );
} }
int16_t pad_connection_get_axis(joypad_connection_t *joyconn, int16_t pad_connection_get_axis(joypad_connection_t *joyconn,

View File

@ -17,14 +17,17 @@
#include <stdint.h> #include <stdint.h>
#include <unistd.h> #include <unistd.h>
#include <retro_miscellaneous.h>
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../../config.h" #include "../../config.h"
#endif #endif
#include "../input_driver.h" #include "../input_driver.h"
#include "../input_keymaps.h" #include "../input_keymaps.h"
#include "cocoa_input.h" #include "cocoa_input.h"
#include "../../gfx/video_driver.h" #include "../../gfx/video_driver.h"
#include "../../driver.h" #include "../../driver.h"
@ -56,7 +59,7 @@ static int cocoa_input_find_any_button_ret(cocoa_input_data_t *apple,
if (state) if (state)
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
if (RARCH_INPUT_STATE_BIT_GET_PTR(state,i)) if (BIT128_GET_PTR(state,i))
return i; return i;
return -1; return -1;
} }

View File

@ -107,8 +107,8 @@ static int16_t wiiu_pointer_device_state(wiiu_input_t* wiiu, unsigned id)
case RETRO_DEVICE_ID_POINTER_PRESSED: case RETRO_DEVICE_ID_POINTER_PRESSED:
{ {
retro_bits_t state; retro_bits_t state;
wiiu->joypad->get_buttons(0,&state); wiiu->joypad->get_buttons(0, &state);
return RARCH_INPUT_STATE_BIT_GET(state, VPAD_BUTTON_TOUCH) ? 1 : 0; return BIT128_GET(state, VPAD_BUTTON_TOUCH) ? 1 : 0;
} }
case RETRO_DEVICE_ID_POINTER_X: case RETRO_DEVICE_ID_POINTER_X:
return wiiu->joypad->axis(0, 0xFFFF0004UL); return wiiu->joypad->axis(0, 0xFFFF0004UL);

View File

@ -27,6 +27,7 @@
#endif #endif
#include <boolean.h> #include <boolean.h>
#include <retro_miscellaneous.h>
#include <rthreads/rthreads.h> #include <rthreads/rthreads.h>
#ifdef HAVE_DYNAMIC #ifdef HAVE_DYNAMIC
#include <dynamic/dylib.h> #include <dynamic/dylib.h>
@ -1369,7 +1370,7 @@ static void btstack_hid_joypad_get_buttons(void *data, unsigned port, retro_bits
if (hid) if (hid)
pad_connection_get_buttons(&hid->slots[port], port, state); pad_connection_get_buttons(&hid->slots[port], port, state);
else else
RARCH_INPUT_STATE_CLEAR_PTR(state); BIT128_CLEAR_ALL_PTR(state);
} }
static bool btstack_hid_joypad_button(void *data, unsigned port, uint16_t joykey) static bool btstack_hid_joypad_button(void *data, unsigned port, uint16_t joykey)
@ -1383,7 +1384,7 @@ static bool btstack_hid_joypad_button(void *data, unsigned port, uint16_t joykey
/* Check the button. */ /* Check the button. */
if ((port < MAX_USERS) && (joykey < 32)) if ((port < MAX_USERS) && (joykey < 32))
return (RARCH_INPUT_STATE_BIT_GET(buttons, joykey) != 0); return (BIT128_GET(buttons, joykey) != 0);
return false; return false;
} }

View File

@ -114,7 +114,7 @@ static void iohidmanager_hid_joypad_get_buttons(void *data, unsigned port, retro
if (hid) if (hid)
return pad_connection_get_buttons(&hid->slots[port], port, state); return pad_connection_get_buttons(&hid->slots[port], port, state);
else else
RARCH_INPUT_STATE_CLEAR_PTR(state); BIT128_CLEAR_ALL_PTR(state);
} }
static bool iohidmanager_hid_joypad_button(void *data, static bool iohidmanager_hid_joypad_button(void *data,
@ -150,7 +150,7 @@ static bool iohidmanager_hid_joypad_button(void *data,
/* Check the button. */ /* Check the button. */
if ((port < MAX_USERS) && (joykey < 32)) if ((port < MAX_USERS) && (joykey < 32))
return (RARCH_INPUT_STATE_BIT_GET(buttons, joykey) != 0) return (BIT128_GET(buttons, joykey) != 0)
|| ((hid->buttons[port] & (1 << joykey)) != 0); || ((hid->buttons[port] & (1 << joykey)) != 0);
return false; return false;

View File

@ -449,7 +449,7 @@ static void libusb_hid_joypad_get_buttons(void *data, unsigned port, retro_bits_
if (hid) if (hid)
return pad_connection_get_buttons(&hid->slots[port], port, state); return pad_connection_get_buttons(&hid->slots[port], port, state);
else else
RARCH_INPUT_STATE_CLEAR_PTR(state); BIT128_CLEAR_ALL_PTR(state);
} }
static bool libusb_hid_joypad_button(void *data, static bool libusb_hid_joypad_button(void *data,
@ -464,7 +464,7 @@ static bool libusb_hid_joypad_button(void *data,
/* Check the button. */ /* Check the button. */
if ((port < MAX_USERS) && (joykey < 32)) if ((port < MAX_USERS) && (joykey < 32))
return (RARCH_INPUT_STATE_BIT_GET(buttons, joykey) != 0); return (BIT128_GET(buttons, joykey) != 0);
return false; return false;
} }

View File

@ -43,7 +43,7 @@ static void null_hid_joypad_get_buttons(void *data, unsigned port, retro_bits_t
(void)data; (void)data;
(void)port; (void)port;
RARCH_INPUT_STATE_CLEAR_PTR(state); BIT128_CLEAR_ALL_PTR(state);
} }
static bool null_hid_joypad_button(void *data, unsigned port, uint16_t joykey) static bool null_hid_joypad_button(void *data, unsigned port, uint16_t joykey)

View File

@ -484,7 +484,7 @@ static void wiiusb_hid_joypad_get_buttons(void *data, unsigned port, retro_bits_
if (hid) if (hid)
return pad_connection_get_buttons(&hid->connections[port], port, state); return pad_connection_get_buttons(&hid->connections[port], port, state);
else else
RARCH_INPUT_STATE_CLEAR_PTR(state); BIT128_CLEAR_ALL_PTR(state);
} }
static bool wiiusb_hid_joypad_button(void *data, unsigned port, uint16_t joykey) static bool wiiusb_hid_joypad_button(void *data, unsigned port, uint16_t joykey)
@ -499,7 +499,7 @@ static bool wiiusb_hid_joypad_button(void *data, unsigned port, uint16_t joykey)
/* Check the button. */ /* Check the button. */
if ((port < MAX_USERS) && (joykey < 32)) if ((port < MAX_USERS) && (joykey < 32))
return (RARCH_INPUT_STATE_BIT_GET(buttons, joykey) != 0); return (BIT128_GET(buttons, joykey) != 0);
return false; return false;
} }

View File

@ -72,11 +72,12 @@ static bool ctr_joypad_button(unsigned port_num, uint16_t key)
static void ctr_joypad_get_buttons(unsigned port_num, retro_bits_t *state) static void ctr_joypad_get_buttons(unsigned port_num, retro_bits_t *state)
{ {
if ( port_num < MAX_PADS ) { if ( port_num < MAX_PADS )
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad_state ); RARCH_INPUT_STATE_COPY16_PTR( state, pad_state );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t ctr_joypad_axis(unsigned port_num, uint32_t joyaxis) static int16_t ctr_joypad_axis(unsigned port_num, uint32_t joyaxis)

View File

@ -164,11 +164,12 @@ static bool gx_joypad_button(unsigned port, uint16_t key)
static void gx_joypad_get_buttons(unsigned port, retro_bits_t *state) static void gx_joypad_get_buttons(unsigned port, retro_bits_t *state)
{ {
if ( port < MAX_PADS ) { if (port < MAX_PADS)
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port] ); RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port] );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t gx_joypad_axis(unsigned port, uint32_t joyaxis) static int16_t gx_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -57,11 +57,10 @@ static bool hid_joypad_button(unsigned port, uint16_t joykey)
static void hid_joypad_get_buttons(unsigned port, retro_bits_t *state) static void hid_joypad_get_buttons(unsigned port, retro_bits_t *state)
{ {
if (generic_hid && generic_hid->get_buttons) { if (generic_hid && generic_hid->get_buttons)
generic_hid->get_buttons((void*)hid_driver_get_data(), port, state); generic_hid->get_buttons((void*)hid_driver_get_data(), port, state);
} else { else
RARCH_INPUT_STATE_CLEAR_PTR( state ); BIT128_CLEAR_ALL_PTR(state);
}
} }
static int16_t hid_joypad_axis(unsigned port, uint32_t joyaxis) static int16_t hid_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -329,11 +329,12 @@ static bool linuxraw_joypad_button(unsigned port, uint16_t joykey)
static void linuxraw_joypad_get_buttons(unsigned port, retro_bits_t *state) static void linuxraw_joypad_get_buttons(unsigned port, retro_bits_t *state)
{ {
const struct linuxraw_joypad *pad = (const struct linuxraw_joypad*)&linuxraw_pads[port]; const struct linuxraw_joypad *pad = (const struct linuxraw_joypad*)&linuxraw_pads[port];
if ( pad ) { if (pad)
{
RARCH_INPUT_STATE_COPY16_PTR(state, pad->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, pad->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t linuxraw_joypad_axis(unsigned port, uint32_t joyaxis) static int16_t linuxraw_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -39,7 +39,7 @@ static bool null_joypad_button(unsigned port_num, uint16_t joykey)
static void null_joypad_get_buttons(unsigned port_num, retro_bits_t *state) static void null_joypad_get_buttons(unsigned port_num, retro_bits_t *state)
{ {
RARCH_INPUT_STATE_CLEAR_PTR( state ); BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t null_joypad_axis(unsigned port_num, uint32_t joyaxis) static int16_t null_joypad_axis(unsigned port_num, uint32_t joyaxis)

View File

@ -343,11 +343,12 @@ static bool parport_joypad_button(unsigned port, uint16_t joykey)
static void parport_joypad_get_buttons(unsigned port, retro_bits_t *state) static void parport_joypad_get_buttons(unsigned port, retro_bits_t *state)
{ {
const struct parport_joypad *pad = (const struct parport_joypad*)&parport_pads[port]; const struct parport_joypad *pad = (const struct parport_joypad*)&parport_pads[port];
if ( pad ) { if (pad)
{
RARCH_INPUT_STATE_COPY16_PTR(state, pad->buttons); RARCH_INPUT_STATE_COPY16_PTR(state, pad->buttons);
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t parport_joypad_axis(unsigned port, uint32_t joyaxis) static int16_t parport_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -70,11 +70,12 @@ static bool ps3_joypad_button(unsigned port_num, uint16_t joykey)
static void ps3_joypad_get_buttons(unsigned port_num, retro_bits_t *state) static void ps3_joypad_get_buttons(unsigned port_num, retro_bits_t *state)
{ {
if ( port_num < MAX_PADS ) { if (port_num < MAX_PADS)
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] ); RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t ps3_joypad_axis(unsigned port_num, uint32_t joyaxis) static int16_t ps3_joypad_axis(unsigned port_num, uint32_t joyaxis)

View File

@ -126,11 +126,12 @@ static bool psp_joypad_button(unsigned port_num, uint16_t key)
static void psp_joypad_get_buttons(unsigned port_num, retro_bits_t *state) static void psp_joypad_get_buttons(unsigned port_num, retro_bits_t *state)
{ {
if ( port_num < PSP_MAX_PADS ) { if (port_num < PSP_MAX_PADS)
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] ); RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t psp_joypad_axis(unsigned port_num, uint32_t joyaxis) static int16_t psp_joypad_axis(unsigned port_num, uint32_t joyaxis)

View File

@ -607,11 +607,12 @@ static bool udev_joypad_button(unsigned port, uint16_t joykey)
static void udev_joypad_get_buttons(unsigned port, retro_bits_t *state) static void udev_joypad_get_buttons(unsigned port, retro_bits_t *state)
{ {
const struct udev_joypad *pad = (const struct udev_joypad*)&udev_pads[port]; const struct udev_joypad *pad = (const struct udev_joypad*)&udev_pads[port];
if ( pad ) { if (pad)
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad->buttons ); RARCH_INPUT_STATE_COPY16_PTR( state, pad->buttons );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t udev_joypad_axis(unsigned port, uint32_t joyaxis) static int16_t udev_joypad_axis(unsigned port, uint32_t joyaxis)

View File

@ -137,11 +137,12 @@ static bool wiiu_joypad_button(unsigned port_num, uint16_t key)
static void wiiu_joypad_get_buttons(unsigned port_num, retro_bits_t *state) static void wiiu_joypad_get_buttons(unsigned port_num, retro_bits_t *state)
{ {
if ( port_num < MAX_PADS ) { if (port_num < MAX_PADS)
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] ); RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLAR_ALL_PTR(state);
} }
static int16_t wiiu_joypad_axis(unsigned port_num, uint32_t joyaxis) static int16_t wiiu_joypad_axis(unsigned port_num, uint32_t joyaxis)

View File

@ -78,11 +78,12 @@ static bool xdk_joypad_button(unsigned port_num, uint16_t joykey)
static void xdk_joypad_get_buttons(unsigned port_num, retro_bits_t *state) static void xdk_joypad_get_buttons(unsigned port_num, retro_bits_t *state)
{ {
if ( port_num < MAX_PADS ) { if (port_num < MAX_PADS)
{
RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] ); RARCH_INPUT_STATE_COPY16_PTR( state, pad_state[port_num] );
} else {
RARCH_INPUT_STATE_CLEAR_PTR(state);
} }
else
BIT128_CLEAR_ALL_PTR(state);
} }
static int16_t xdk_joypad_axis(unsigned port_num, uint32_t joyaxis) static int16_t xdk_joypad_axis(unsigned port_num, uint32_t joyaxis)

View File

@ -158,12 +158,6 @@ enum analog_dpad_mode
#define GET_HAT_DIR(x) (x & HAT_MASK) #define GET_HAT_DIR(x) (x & HAT_MASK)
#define GET_HAT(x) (x & (~HAT_MASK)) #define GET_HAT(x) (x & (~HAT_MASK))
#define RARCH_INPUT_STATE_BIT_SET(a,bit) BIT128_SET(a, bit)
#define RARCH_INPUT_STATE_BIT_SET_PTR(a,bit) BIT128_SET_PTR(a, bit)
#define RARCH_INPUT_STATE_BIT_GET(a,bit) BIT128_GET(a, bit)
#define RARCH_INPUT_STATE_BIT_GET_PTR(a,bit) BIT128_GET_PTR(a, bit)
#define RARCH_INPUT_STATE_CLEAR(a) BIT128_CLEAR_ALL(a)
#define RARCH_INPUT_STATE_CLEAR_PTR(a) BIT128_CLEAR_ALL_PTR(a)
#define RARCH_INPUT_STATE_ANY_SET(a) ( ((a).data[0])||((a).data[1])||((a).data[2])||((a).data[3])|| \ #define RARCH_INPUT_STATE_ANY_SET(a) ( ((a).data[0])||((a).data[1])||((a).data[2])||((a).data[3])|| \
((a).data[4])||((a).data[5])||((a).data[6])||((a).data[7]) ) ((a).data[4])||((a).data[5])||((a).data[6])||((a).data[7]) )
#define RARCH_INPUT_STATE_ANY_SET_PTR(a) ( ((a)->data[0])||((a)->data[1])||((a)->data[2])||((a)->data[3])|| \ #define RARCH_INPUT_STATE_ANY_SET_PTR(a) ( ((a)->data[0])||((a)->data[1])||((a)->data[2])||((a)->data[3])|| \

View File

@ -810,7 +810,7 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
joypad_info.joy_idx = 0; joypad_info.joy_idx = 0;
joypad_info.auto_binds = NULL; joypad_info.auto_binds = NULL;
RARCH_INPUT_STATE_CLEAR_PTR( p_new_state ); BIT128_CLEAR_ALL_PTR(p_new_state);
input_driver_block_libretro_input = false; input_driver_block_libretro_input = false;
input_driver_block_hotkey = false; input_driver_block_hotkey = false;
@ -912,7 +912,7 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
if (pressed) if (pressed)
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
} }
@ -922,7 +922,7 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
{ {
if (current_input->meta_key_pressed(current_input_data, i)) if (current_input->meta_key_pressed(current_input_data, i))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
} }
@ -930,7 +930,7 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
if (overlay_ptr && input_overlay_key_pressed(overlay_ptr, i)) if (overlay_ptr && input_overlay_key_pressed(overlay_ptr, i))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
#endif #endif
@ -945,7 +945,7 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
if (command_get(&handle)) if (command_get(&handle))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
} }
@ -954,7 +954,7 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
#ifdef HAVE_NETWORKGAMEPAD #ifdef HAVE_NETWORKGAMEPAD
if (input_driver_remote && input_remote_key_pressed(i, 0)) if (input_driver_remote && input_remote_key_pressed(i, 0))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
#endif #endif
@ -1007,9 +1007,10 @@ void input_menu_keys_pressed(void *data, retro_bits_t* p_new_state)
for (i = 0; i < 13; i++) for (i = 0; i < 13; i++)
{ {
if (current_input->input_state(current_input_data, joypad_info, binds, 0, if (current_input->input_state(current_input_data,
joypad_info, binds, 0,
RETRO_DEVICE_KEYBOARD, 0, ids[i][0])) RETRO_DEVICE_KEYBOARD, 0, ids[i][0]))
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, ids[i][1]); BIT128_SET_PTR(p_new_state, ids[i][1]);
} }
} }
} }
@ -1036,7 +1037,7 @@ void input_keys_pressed(void *data, retro_bits_t* p_new_state)
const struct retro_keybind *enable_hotkey = &input_config_binds[0][RARCH_ENABLE_HOTKEY]; const struct retro_keybind *enable_hotkey = &input_config_binds[0][RARCH_ENABLE_HOTKEY];
bool game_focus_toggle_valid = false; bool game_focus_toggle_valid = false;
RARCH_INPUT_STATE_CLEAR_PTR( p_new_state ); BIT128_CLEAR_ALL_PTR(p_new_state);
joypad_info.joy_idx = settings->uints.input_joypad_map[0]; joypad_info.joy_idx = settings->uints.input_joypad_map[0];
joypad_info.auto_binds = input_autoconf_binds[joypad_info.joy_idx]; joypad_info.auto_binds = input_autoconf_binds[joypad_info.joy_idx];
@ -1082,7 +1083,7 @@ void input_keys_pressed(void *data, retro_bits_t* p_new_state)
0, RETRO_DEVICE_JOYPAD, 0, i) 0, RETRO_DEVICE_JOYPAD, 0, i)
) )
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
@ -1090,7 +1091,7 @@ void input_keys_pressed(void *data, retro_bits_t* p_new_state)
current_input->meta_key_pressed(current_input_data, i) current_input->meta_key_pressed(current_input_data, i)
) )
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
@ -1098,7 +1099,7 @@ void input_keys_pressed(void *data, retro_bits_t* p_new_state)
if (overlay_ptr && if (overlay_ptr &&
input_overlay_key_pressed(overlay_ptr, i)) input_overlay_key_pressed(overlay_ptr, i))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
#endif #endif
@ -1113,7 +1114,7 @@ void input_keys_pressed(void *data, retro_bits_t* p_new_state)
if (command_get(&handle)) if (command_get(&handle))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
} }
@ -1123,7 +1124,7 @@ void input_keys_pressed(void *data, retro_bits_t* p_new_state)
if (input_driver_remote && if (input_driver_remote &&
input_remote_key_pressed(i, 0)) input_remote_key_pressed(i, 0))
{ {
RARCH_INPUT_STATE_BIT_SET_PTR(p_new_state, i); BIT128_SET_PTR(p_new_state, i);
continue; continue;
} }
#endif #endif

View File

@ -160,7 +160,7 @@ unsigned menu_event(retro_bits_t* p_input, retro_bits_t* p_trigger_input)
unsigned menu_cancel_btn = (!input_swap_override && unsigned menu_cancel_btn = (!input_swap_override &&
settings->bools.input_menu_swap_ok_cancel_buttons) ? settings->bools.input_menu_swap_ok_cancel_buttons) ?
RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B; RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B;
unsigned ok_current = RARCH_INPUT_STATE_BIT_GET_PTR(p_input, menu_ok_btn ); unsigned ok_current = BIT128_GET_PTR(p_input, menu_ok_btn );
unsigned ok_trigger = ok_current & ~ok_old; unsigned ok_trigger = ok_current & ~ok_old;
ok_old = ok_current; ok_old = ok_current;
@ -221,31 +221,31 @@ unsigned menu_event(retro_bits_t* p_input, retro_bits_t* p_trigger_input)
{ {
menu_event_osk_iterate(); menu_event_osk_iterate();
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_DOWN)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_DOWN))
{ {
if (menu_event_get_osk_ptr() < 33) if (menu_event_get_osk_ptr() < 33)
menu_event_set_osk_ptr(menu_event_get_osk_ptr() + OSK_CHARS_PER_LINE); menu_event_set_osk_ptr(menu_event_get_osk_ptr() + OSK_CHARS_PER_LINE);
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_UP)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_UP))
{ {
if (menu_event_get_osk_ptr() >= OSK_CHARS_PER_LINE) if (menu_event_get_osk_ptr() >= OSK_CHARS_PER_LINE)
menu_event_set_osk_ptr(menu_event_get_osk_ptr() - OSK_CHARS_PER_LINE); menu_event_set_osk_ptr(menu_event_get_osk_ptr() - OSK_CHARS_PER_LINE);
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_RIGHT)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_RIGHT))
{ {
if (menu_event_get_osk_ptr() < 43) if (menu_event_get_osk_ptr() < 43)
menu_event_set_osk_ptr(menu_event_get_osk_ptr() + 1); menu_event_set_osk_ptr(menu_event_get_osk_ptr() + 1);
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_LEFT)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_LEFT))
{ {
if (menu_event_get_osk_ptr() >= 1) if (menu_event_get_osk_ptr() >= 1)
menu_event_set_osk_ptr(menu_event_get_osk_ptr() - 1); menu_event_set_osk_ptr(menu_event_get_osk_ptr() - 1);
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L))
{ {
if (menu_event_get_osk_idx() > OSK_TYPE_UNKNOWN + 1) if (menu_event_get_osk_idx() > OSK_TYPE_UNKNOWN + 1)
menu_event_set_osk_idx((enum osk_type)(menu_event_get_osk_idx() - 1)); menu_event_set_osk_idx((enum osk_type)(menu_event_get_osk_idx() - 1));
@ -253,7 +253,7 @@ unsigned menu_event(retro_bits_t* p_input, retro_bits_t* p_trigger_input)
menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_LAST - 1)); menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_LAST - 1));
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R))
{ {
if (menu_event_get_osk_idx() < OSK_TYPE_LAST - 1) if (menu_event_get_osk_idx() < OSK_TYPE_LAST - 1)
menu_event_set_osk_idx((enum osk_type)(menu_event_get_osk_idx() + 1)); menu_event_set_osk_idx((enum osk_type)(menu_event_get_osk_idx() + 1));
@ -261,50 +261,50 @@ unsigned menu_event(retro_bits_t* p_input, retro_bits_t* p_trigger_input)
menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_UNKNOWN + 1)); menu_event_set_osk_idx((enum osk_type)(OSK_TYPE_UNKNOWN + 1));
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, menu_ok_btn)) if (BIT128_GET_PTR(p_trigger_input, menu_ok_btn))
{ {
if (menu_event_get_osk_ptr() >= 0) if (menu_event_get_osk_ptr() >= 0)
menu_event_osk_append(menu_event_get_osk_ptr()); menu_event_osk_append(menu_event_get_osk_ptr());
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, menu_cancel_btn)) if (BIT128_GET_PTR(p_trigger_input, menu_cancel_btn))
{ {
input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD); input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD);
} }
/* send return key to close keyboard input window */ /* send return key to close keyboard input window */
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_START)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_START))
input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD); input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD);
RARCH_INPUT_STATE_CLEAR_PTR(p_trigger_input); BIT128_CLEAR_ALL_PTR(p_trigger_input);
} }
else else
{ {
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_UP)) if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_UP))
ret = MENU_ACTION_UP; ret = MENU_ACTION_UP;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_DOWN)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_DOWN))
ret = MENU_ACTION_DOWN; ret = MENU_ACTION_DOWN;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_LEFT)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_LEFT))
ret = MENU_ACTION_LEFT; ret = MENU_ACTION_LEFT;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_RIGHT)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_RIGHT))
ret = MENU_ACTION_RIGHT; ret = MENU_ACTION_RIGHT;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_L))
ret = MENU_ACTION_SCROLL_UP; ret = MENU_ACTION_SCROLL_UP;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_R))
ret = MENU_ACTION_SCROLL_DOWN; ret = MENU_ACTION_SCROLL_DOWN;
else if (ok_trigger) else if (ok_trigger)
ret = MENU_ACTION_OK; ret = MENU_ACTION_OK;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, menu_cancel_btn)) else if (BIT128_GET_PTR(p_trigger_input, menu_cancel_btn))
ret = MENU_ACTION_CANCEL; ret = MENU_ACTION_CANCEL;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_X)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_X))
ret = MENU_ACTION_SEARCH; ret = MENU_ACTION_SEARCH;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_Y)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_Y))
ret = MENU_ACTION_SCAN; ret = MENU_ACTION_SCAN;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_START)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_START))
ret = MENU_ACTION_START; ret = MENU_ACTION_START;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_SELECT)) else if (BIT128_GET_PTR(p_trigger_input, RETRO_DEVICE_ID_JOYPAD_SELECT))
ret = MENU_ACTION_INFO; ret = MENU_ACTION_INFO;
else if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RARCH_MENU_TOGGLE)) else if (BIT128_GET_PTR(p_trigger_input, RARCH_MENU_TOGGLE))
ret = MENU_ACTION_TOGGLE; ret = MENU_ACTION_TOGGLE;
} }
@ -314,7 +314,7 @@ unsigned menu_event(retro_bits_t* p_input, retro_bits_t* p_trigger_input)
menu_event_kb_set_internal(RETROK_F11, 0); menu_event_kb_set_internal(RETROK_F11, 0);
} }
if (RARCH_INPUT_STATE_BIT_GET_PTR(p_trigger_input, RARCH_QUIT_KEY)) if (BIT128_GET_PTR(p_trigger_input, RARCH_QUIT_KEY))
return MENU_ACTION_QUIT; return MENU_ACTION_QUIT;
mouse_enabled = settings->bools.menu_mouse_enable; mouse_enabled = settings->bools.menu_mouse_enable;

View File

@ -2315,35 +2315,35 @@ static bool input_driver_toggle_button_combo(
switch (mode) switch (mode)
{ {
case INPUT_TOGGLE_DOWN_Y_L_R: case INPUT_TOGGLE_DOWN_Y_L_R:
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_DOWN)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_DOWN))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_Y)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_Y))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R))
return false; return false;
break; break;
case INPUT_TOGGLE_L3_R3: case INPUT_TOGGLE_L3_R3:
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L3)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L3))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R3)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R3))
return false; return false;
break; break;
case INPUT_TOGGLE_L1_R1_START_SELECT: case INPUT_TOGGLE_L1_R1_START_SELECT:
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_START)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_START))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_L))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_R))
return false; return false;
break; break;
case INPUT_TOGGLE_START_SELECT: case INPUT_TOGGLE_START_SELECT:
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_START)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_START))
return false; return false;
if (!RARCH_INPUT_STATE_BIT_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT)) if (!BIT128_GET_PTR(p_input, RETRO_DEVICE_ID_JOYPAD_SELECT))
return false; return false;
break; break;
default: default:
@ -2375,7 +2375,7 @@ static enum runloop_state runloop_check_state(
retro_bits_t current_input; retro_bits_t current_input;
if ( menu_is_alive && !(settings->bools.menu_unified_controls && !menu_input_dialog_get_display_kb()) ) if (menu_is_alive && !(settings->bools.menu_unified_controls && !menu_input_dialog_get_display_kb()))
input_menu_keys_pressed(settings, &current_input); input_menu_keys_pressed(settings, &current_input);
else else
input_keys_pressed(settings, &current_input); input_keys_pressed(settings, &current_input);
@ -2391,9 +2391,7 @@ static enum runloop_state runloop_check_state(
((settings->uints.input_menu_toggle_gamepad_combo != INPUT_TOGGLE_NONE) && ((settings->uints.input_menu_toggle_gamepad_combo != INPUT_TOGGLE_NONE) &&
input_driver_toggle_button_combo( input_driver_toggle_button_combo(
settings->uints.input_menu_toggle_gamepad_combo, &last_input))) settings->uints.input_menu_toggle_gamepad_combo, &last_input)))
{ BIT128_SET(current_input, RARCH_MENU_TOGGLE);
RARCH_INPUT_STATE_BIT_SET(current_input, RARCH_MENU_TOGGLE);
}
#endif #endif
if (input_driver_flushing_input) if (input_driver_flushing_input)
@ -2401,9 +2399,9 @@ static enum runloop_state runloop_check_state(
input_driver_flushing_input = false; input_driver_flushing_input = false;
if (RARCH_INPUT_STATE_ANY_SET(current_input)) if (RARCH_INPUT_STATE_ANY_SET(current_input))
{ {
RARCH_INPUT_STATE_CLEAR( current_input ); BIT128_CLEAR_ALL(current_input);
if (runloop_paused) if (runloop_paused)
RARCH_INPUT_STATE_BIT_SET(current_input, RARCH_PAUSE_TOGGLE); BIT128_SET(current_input, RARCH_PAUSE_TOGGLE);
input_driver_flushing_input = true; input_driver_flushing_input = true;
} }
} }
@ -2412,14 +2410,14 @@ static enum runloop_state runloop_check_state(
#ifdef HAVE_MENU #ifdef HAVE_MENU
if (menu_driver_binding_state) if (menu_driver_binding_state)
RARCH_INPUT_STATE_CLEAR( current_input ); BIT128_CLEAR_ALL(current_input);
#endif #endif
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
/* Check next overlay */ /* Check next overlay */
{ {
static bool old_should_check_next_overlay = false; static bool old_should_check_next_overlay = false;
bool should_check_next_overlay = runloop_cmd_press( bool should_check_next_overlay = BIT128_GET(
current_input, RARCH_OVERLAY_NEXT); current_input, RARCH_OVERLAY_NEXT);
if (should_check_next_overlay && !old_should_check_next_overlay) if (should_check_next_overlay && !old_should_check_next_overlay)
@ -2431,7 +2429,7 @@ static enum runloop_state runloop_check_state(
/* Check fullscreen toggle */ /* Check fullscreen toggle */
{ {
bool fs_toggle_pressed = runloop_cmd_press( bool fs_toggle_pressed = BIT128_GET(
current_input, RARCH_FULLSCREEN_TOGGLE_KEY); current_input, RARCH_FULLSCREEN_TOGGLE_KEY);
fs_toggle_triggered = fs_toggle_pressed && !old_fs_toggle_pressed; fs_toggle_triggered = fs_toggle_pressed && !old_fs_toggle_pressed;
@ -2454,7 +2452,7 @@ static enum runloop_state runloop_check_state(
/* Check mouse grab toggle */ /* Check mouse grab toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(
current_input, RARCH_GRAB_MOUSE_TOGGLE); current_input, RARCH_GRAB_MOUSE_TOGGLE);
if (pressed && !old_pressed) if (pressed && !old_pressed)
@ -2489,7 +2487,7 @@ static enum runloop_state runloop_check_state(
/* Check quit key */ /* Check quit key */
{ {
static bool old_quit_key = false; static bool old_quit_key = false;
bool quit_key = runloop_cmd_press( bool quit_key = BIT128_GET(
current_input, RARCH_QUIT_KEY); current_input, RARCH_QUIT_KEY);
bool trig_quit_key = quit_key && !old_quit_key; bool trig_quit_key = quit_key && !old_quit_key;
@ -2544,7 +2542,7 @@ static enum runloop_state runloop_check_state(
bool focused; bool focused;
trigger_input = current_input; trigger_input = current_input;
RARCH_INPUT_STATE_CLEAR_BITS( trigger_input, old_input ); RARCH_INPUT_STATE_CLEAR_BITS(trigger_input, old_input);
action = (enum menu_action)menu_event(&current_input, &trigger_input); action = (enum menu_action)menu_event(&current_input, &trigger_input);
focused = pause_nonactive ? is_focused : true; focused = pause_nonactive ? is_focused : true;
@ -2583,7 +2581,7 @@ static enum runloop_state runloop_check_state(
/* Check game focus toggle */ /* Check game focus toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(
current_input, RARCH_GAME_FOCUS_TOGGLE); current_input, RARCH_GAME_FOCUS_TOGGLE);
if (pressed && !old_pressed) if (pressed && !old_pressed)
@ -2596,7 +2594,7 @@ static enum runloop_state runloop_check_state(
/* Check menu toggle */ /* Check menu toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(
current_input, RARCH_MENU_TOGGLE); current_input, RARCH_MENU_TOGGLE);
if (menu_event_kb_is_set(RETROK_F1) == 1) if (menu_event_kb_is_set(RETROK_F1) == 1)
@ -2646,7 +2644,7 @@ static enum runloop_state runloop_check_state(
/* Check screenshot toggle */ /* Check screenshot toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(
current_input, RARCH_SCREENSHOT); current_input, RARCH_SCREENSHOT);
if (pressed && old_pressed) if (pressed && old_pressed)
@ -2658,7 +2656,7 @@ static enum runloop_state runloop_check_state(
/* Check audio mute toggle */ /* Check audio mute toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(
current_input, RARCH_MUTE); current_input, RARCH_MUTE);
if (pressed && !old_pressed) if (pressed && !old_pressed)
@ -2670,8 +2668,7 @@ static enum runloop_state runloop_check_state(
/* Check OSK toggle */ /* Check OSK toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(current_input, RARCH_OSK);
current_input, RARCH_OSK);
if (pressed && !old_pressed) if (pressed && !old_pressed)
{ {
@ -2687,9 +2684,9 @@ static enum runloop_state runloop_check_state(
old_pressed = pressed; old_pressed = pressed;
} }
if (runloop_cmd_press(current_input, RARCH_VOLUME_UP)) if (BIT128_GET(current_input, RARCH_VOLUME_UP))
command_event(CMD_EVENT_VOLUME_UP, NULL); command_event(CMD_EVENT_VOLUME_UP, NULL);
else if (runloop_cmd_press(current_input, RARCH_VOLUME_DOWN)) else if (BIT128_GET(current_input, RARCH_VOLUME_DOWN))
command_event(CMD_EVENT_VOLUME_DOWN, NULL); command_event(CMD_EVENT_VOLUME_DOWN, NULL);
#ifdef HAVE_NETWORKING #ifdef HAVE_NETWORKING
@ -2697,9 +2694,9 @@ static enum runloop_state runloop_check_state(
{ {
static bool old_netplay_flip = false; static bool old_netplay_flip = false;
static bool old_netplay_watch = false; static bool old_netplay_watch = false;
bool netplay_flip = runloop_cmd_press( bool netplay_flip = BIT128_GET(
current_input, RARCH_NETPLAY_FLIP); current_input, RARCH_NETPLAY_FLIP);
bool netplay_watch = runloop_cmd_press( bool netplay_watch = BIT128_GET(
current_input, RARCH_NETPLAY_GAME_WATCH); current_input, RARCH_NETPLAY_GAME_WATCH);
if (netplay_flip && !old_netplay_flip) if (netplay_flip && !old_netplay_flip)
@ -2718,9 +2715,9 @@ static enum runloop_state runloop_check_state(
static bool old_frameadvance = false; static bool old_frameadvance = false;
static bool old_pause_pressed = false; static bool old_pause_pressed = false;
bool check_is_oneshot = true; bool check_is_oneshot = true;
bool frameadvance_pressed = runloop_cmd_press( bool frameadvance_pressed = BIT128_GET(
current_input, RARCH_FRAMEADVANCE); current_input, RARCH_FRAMEADVANCE);
bool pause_pressed = runloop_cmd_press( bool pause_pressed = BIT128_GET(
current_input, RARCH_PAUSE_TOGGLE); current_input, RARCH_PAUSE_TOGGLE);
bool trig_frameadvance = frameadvance_pressed && !old_frameadvance; bool trig_frameadvance = frameadvance_pressed && !old_frameadvance;
@ -2744,7 +2741,7 @@ static enum runloop_state runloop_check_state(
if (runloop_paused) if (runloop_paused)
{ {
check_is_oneshot = trig_frameadvance || check_is_oneshot = trig_frameadvance ||
runloop_cmd_press(current_input, RARCH_REWIND); BIT128_GET(current_input, RARCH_REWIND);
if (fs_toggle_triggered) if (fs_toggle_triggered)
{ {
@ -2769,9 +2766,9 @@ static enum runloop_state runloop_check_state(
{ {
static bool old_button_state = false; static bool old_button_state = false;
static bool old_hold_button_state = false; static bool old_hold_button_state = false;
bool new_button_state = runloop_cmd_press( bool new_button_state = BIT128_GET(
current_input, RARCH_FAST_FORWARD_KEY); current_input, RARCH_FAST_FORWARD_KEY);
bool new_hold_button_state = runloop_cmd_press( bool new_hold_button_state = BIT128_GET(
current_input, RARCH_FAST_FORWARD_HOLD_KEY); current_input, RARCH_FAST_FORWARD_HOLD_KEY);
if (new_button_state && !old_button_state) if (new_button_state && !old_button_state)
@ -2812,9 +2809,9 @@ static enum runloop_state runloop_check_state(
{ {
static bool old_should_slot_increase = false; static bool old_should_slot_increase = false;
static bool old_should_slot_decrease = false; static bool old_should_slot_decrease = false;
bool should_slot_increase = runloop_cmd_press( bool should_slot_increase = BIT128_GET(
current_input, RARCH_STATE_SLOT_PLUS); current_input, RARCH_STATE_SLOT_PLUS);
bool should_slot_decrease = runloop_cmd_press( bool should_slot_decrease = BIT128_GET(
current_input, RARCH_STATE_SLOT_MINUS); current_input, RARCH_STATE_SLOT_MINUS);
/* Checks if the state increase/decrease keys have been pressed /* Checks if the state increase/decrease keys have been pressed
@ -2865,9 +2862,9 @@ static enum runloop_state runloop_check_state(
{ {
static bool old_should_savestate = false; static bool old_should_savestate = false;
static bool old_should_loadstate = false; static bool old_should_loadstate = false;
bool should_savestate = runloop_cmd_press( bool should_savestate = BIT128_GET(
current_input, RARCH_SAVE_STATE_KEY); current_input, RARCH_SAVE_STATE_KEY);
bool should_loadstate = runloop_cmd_press( bool should_loadstate = BIT128_GET(
current_input, RARCH_LOAD_STATE_KEY); current_input, RARCH_LOAD_STATE_KEY);
if (should_savestate && !old_should_savestate) if (should_savestate && !old_should_savestate)
@ -2888,14 +2885,14 @@ static enum runloop_state runloop_check_state(
s[0] = '\0'; s[0] = '\0';
if (state_manager_check_rewind(runloop_cmd_press(current_input, RARCH_REWIND), if (state_manager_check_rewind(BIT128_GET(current_input, RARCH_REWIND),
settings->uints.rewind_granularity, runloop_paused, s, sizeof(s), &t)) settings->uints.rewind_granularity, runloop_paused, s, sizeof(s), &t))
runloop_msg_queue_push(s, 0, t, true); runloop_msg_queue_push(s, 0, t, true);
} }
/* Checks if slowmotion toggle/hold was being pressed and/or held. */ /* Checks if slowmotion toggle/hold was being pressed and/or held. */
{ {
runloop_slowmotion = runloop_cmd_press(current_input, RARCH_SLOWMOTION); runloop_slowmotion = BIT128_GET(current_input, RARCH_SLOWMOTION);
if (runloop_slowmotion) if (runloop_slowmotion)
{ {
@ -2917,7 +2914,7 @@ static enum runloop_state runloop_check_state(
/* Check movie record toggle */ /* Check movie record toggle */
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = runloop_cmd_press( bool pressed = BIT128_GET(
current_input, RARCH_MOVIE_RECORD_TOGGLE); current_input, RARCH_MOVIE_RECORD_TOGGLE);
if (pressed && !old_pressed) if (pressed && !old_pressed)
@ -2930,9 +2927,9 @@ static enum runloop_state runloop_check_state(
{ {
static bool old_shader_next = false; static bool old_shader_next = false;
static bool old_shader_prev = false; static bool old_shader_prev = false;
bool shader_next = runloop_cmd_press( bool shader_next = BIT128_GET(
current_input, RARCH_SHADER_NEXT); current_input, RARCH_SHADER_NEXT);
bool shader_prev = runloop_cmd_press( bool shader_prev = BIT128_GET(
current_input, RARCH_SHADER_PREV); current_input, RARCH_SHADER_PREV);
bool trig_shader_next = shader_next && !old_shader_next; bool trig_shader_next = shader_next && !old_shader_next;
bool trig_shader_prev = shader_prev && !old_shader_prev; bool trig_shader_prev = shader_prev && !old_shader_prev;
@ -2949,11 +2946,11 @@ static enum runloop_state runloop_check_state(
static bool old_disk_eject = false; static bool old_disk_eject = false;
static bool old_disk_next = false; static bool old_disk_next = false;
static bool old_disk_prev = false; static bool old_disk_prev = false;
bool disk_eject = runloop_cmd_press( bool disk_eject = BIT128_GET(
current_input, RARCH_DISK_EJECT_TOGGLE); current_input, RARCH_DISK_EJECT_TOGGLE);
bool disk_next = runloop_cmd_press( bool disk_next = BIT128_GET(
current_input, RARCH_DISK_NEXT); current_input, RARCH_DISK_NEXT);
bool disk_prev = runloop_cmd_press( bool disk_prev = BIT128_GET(
current_input, RARCH_DISK_PREV); current_input, RARCH_DISK_PREV);
if (disk_eject && !old_disk_eject) if (disk_eject && !old_disk_eject)
@ -2971,7 +2968,7 @@ static enum runloop_state runloop_check_state(
/* Check reset */ /* Check reset */
{ {
static bool old_state = false; static bool old_state = false;
bool new_state = runloop_cmd_press( bool new_state = BIT128_GET(
current_input, RARCH_RESET); current_input, RARCH_RESET);
if (new_state && !old_state) if (new_state && !old_state)
@ -2985,11 +2982,11 @@ static enum runloop_state runloop_check_state(
static bool old_cheat_index_plus = false; static bool old_cheat_index_plus = false;
static bool old_cheat_index_minus = false; static bool old_cheat_index_minus = false;
static bool old_cheat_index_toggle = false; static bool old_cheat_index_toggle = false;
bool cheat_index_plus = runloop_cmd_press( bool cheat_index_plus = BIT128_GET(
current_input, RARCH_CHEAT_INDEX_PLUS); current_input, RARCH_CHEAT_INDEX_PLUS);
bool cheat_index_minus = runloop_cmd_press( bool cheat_index_minus = BIT128_GET(
current_input, RARCH_CHEAT_INDEX_MINUS); current_input, RARCH_CHEAT_INDEX_MINUS);
bool cheat_index_toggle = runloop_cmd_press( bool cheat_index_toggle = BIT128_GET(
current_input, RARCH_CHEAT_TOGGLE); current_input, RARCH_CHEAT_TOGGLE);
if (cheat_index_plus && !old_cheat_index_plus) if (cheat_index_plus && !old_cheat_index_plus)

View File

@ -27,8 +27,6 @@
#include "core_type.h" #include "core_type.h"
#include "core.h" #include "core.h"
#define runloop_cmd_press(current_input, id) (RARCH_INPUT_STATE_BIT_GET(current_input, id))
RETRO_BEGIN_DECLS RETRO_BEGIN_DECLS
enum rarch_ctl_state enum rarch_ctl_state