diff options
Diffstat (limited to 'input.c')
-rw-r--r-- | input.c | 34 |
1 files changed, 34 insertions, 0 deletions
@@ -18,6 +18,10 @@ */ #include "common.h" +#ifndef __LIBRETRO__ +#include "frontend/main.h" +#include "frontend/libpicofe/input.h" +#endif bool libretro_supports_bitmasks = false; bool libretro_supports_ff_override = false; @@ -57,6 +61,7 @@ static void trigger_key(u32 key) } } +#ifdef __LIBRETRO__ u32 update_input(void) { unsigned i; @@ -132,6 +137,35 @@ u32 update_input(void) return 0; } +#else + +u32 update_input(void) +{ + int actions[IN_BINDTYPE_COUNT] = { 0, }; + uint32_t new_key = 0; + unsigned int emu_act; + int which = EACTION_NONE; + + in_update(actions); + emu_act = actions[IN_BINDTYPE_EMU]; + if (emu_act) { + for (; !(emu_act & 1); emu_act >>= 1, which++) + ; + emu_act = which; + } + handle_emu_action(which); + + new_key = actions[IN_BINDTYPE_PLAYER12]; + + if ((new_key | old_key) != old_key) + trigger_key(new_key); + + old_key = new_key; + io_registers[REG_P1] = (~old_key) & 0x3FF; + + return 0; +} +#endif #define input_savestate_builder(type) \ void input_##type##_savestate(void) \ |