Skip to content

Commit

Permalink
remove lut
Browse files Browse the repository at this point in the history
  • Loading branch information
zoltanvb committed Apr 14, 2024
1 parent 0c67c49 commit 50281aa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
22 changes: 14 additions & 8 deletions input/drivers/test_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ static int16_t test_input_state(
{
if (id < RARCH_BIND_LIST_END)
if (test_key_state[DEFAULT_MAX_PADS]
[rarch_keysym_lut[binds[port][i].key]])
[binds[port][i].key])
ret |= (1 << i);
}
}
Expand All @@ -315,15 +315,14 @@ static int16_t test_input_state(
if (
(id < RARCH_BIND_LIST_END
&& test_key_state[DEFAULT_MAX_PADS]
[rarch_keysym_lut[binds[port][id].key]])
[binds[port][id].key])
)
return 1;
}
break;
case RETRO_DEVICE_KEYBOARD:
if (id < RARCH_BIND_LIST_END)
return (test_key_state[DEFAULT_MAX_PADS]
[rarch_keysym_lut[binds[port][id].key]]);
if (id && id < RETROK_LAST)
return (test_key_state[DEFAULT_MAX_PADS][id]);
break;
}
}
Expand All @@ -347,7 +346,8 @@ static void* test_input_init(const char *joypad_driver)
if (last_test_step > MAX_TEST_STEPS)
last_test_step = 0;

input_keymaps_init_keyboard_lut(rarch_key_map_test);
/* No need for keyboard mapping look-up table */
/* input_keymaps_init_keyboard_lut(rarch_key_map_test);*/
return (void*)-1;
}

Expand Down Expand Up @@ -383,7 +383,7 @@ static void test_input_poll(void *data)
{
input_test_steps[i].handled = true;
RARCH_WARN(
"[Test joypad driver]: Unrecognized action %d in step %d, skipping\n",
"[Test input driver]: Unrecognized action %d in step %d, skipping\n",
input_test_steps[i].action,i);
}

Expand All @@ -394,7 +394,13 @@ static void test_input_poll(void *data)

static uint64_t test_input_get_capabilities(void *data)
{
return UINT64_C(1) << RETRO_DEVICE_JOYPAD;
return
(1 << RETRO_DEVICE_JOYPAD)
| (1 << RETRO_DEVICE_ANALOG)
| (1 << RETRO_DEVICE_KEYBOARD)
/* | (1 << RETRO_DEVICE_MOUSE)
| (1 << RETRO_DEVICE_POINTER)
| (1 << RETRO_DEVICE_LIGHTGUN)*/;
}

input_driver_t input_test = {
Expand Down
8 changes: 4 additions & 4 deletions input/input_keymaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,7 +1961,7 @@ const struct rarch_key_map rarch_key_map_winraw[] = {
* so they can't be placed in a C source file */
#endif

#ifdef HAVE_TEST_DRIVERS
#if 0
const struct rarch_key_map rarch_key_map_test[] = {
/* { RETROK_UNKNOWN ,RETROK_UNKNOWN },*/
{ RETROK_BACKSPACE ,RETROK_BACKSPACE },
Expand Down Expand Up @@ -2002,9 +2002,9 @@ const struct rarch_key_map rarch_key_map_test[] = {
{ RETROK_GREATER ,RETROK_GREATER },
{ RETROK_QUESTION ,RETROK_QUESTION },
{ RETROK_AT ,RETROK_AT },
{ RETROK_LEFTBRACKET ,RETROK_LEFTBRACKET },
{ RETROK_LEFTBRACKET,RETROK_LEFTBRACKET },
{ RETROK_BACKSLASH ,RETROK_BACKSLASH },
{ RETROK_RIGHTBRACKET ,RETROK_RIGHTBRACKET },
{ RETROK_RIGHTBRACKET,RETROK_RIGHTBRACKET },
{ RETROK_CARET ,RETROK_CARET },
{ RETROK_UNDERSCORE ,RETROK_UNDERSCORE },
{ RETROK_BACKQUOTE ,RETROK_BACKQUOTE },
Expand Down Expand Up @@ -2051,7 +2051,7 @@ const struct rarch_key_map rarch_key_map_test[] = {
{ RETROK_KP9 ,RETROK_KP9 },
{ RETROK_KP_PERIOD ,RETROK_KP_PERIOD },
{ RETROK_KP_DIVIDE ,RETROK_KP_DIVIDE },
{ RETROK_KP_MULTIPLY ,RETROK_KP_MULTIPLY },
{ RETROK_KP_MULTIPLY,RETROK_KP_MULTIPLY },
{ RETROK_KP_MINUS ,RETROK_KP_MINUS },
{ RETROK_KP_PLUS ,RETROK_KP_PLUS },
{ RETROK_KP_ENTER ,RETROK_KP_ENTER },
Expand Down

0 comments on commit 50281aa

Please sign in to comment.