summaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authoraliaspider2014-12-09 01:59:02 +0100
committeraliaspider2014-12-09 01:59:02 +0100
commit50df6df600745247af98d0f6ed52f80043c9922b (patch)
tree216798810143c77fe838b1dfbaced3aba0e986fe /input.c
parent38158f67e2d8a9c8c43b3b3598a56f3d86a727f8 (diff)
downloadpicogpsp-50df6df600745247af98d0f6ed52f80043c9922b.tar.gz
picogpsp-50df6df600745247af98d0f6ed52f80043c9922b.tar.bz2
picogpsp-50df6df600745247af98d0f6ed52f80043c9922b.zip
fix undefined referances.
Diffstat (limited to 'input.c')
-rw-r--r--input.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/input.c b/input.c
index a2f147f..51e70cf 100644
--- a/input.c
+++ b/input.c
@@ -345,7 +345,29 @@ void init_input()
#elif defined(__LIBRETRO__)
-/* todo */
+static retro_input_state_t input_state_cb;
+void retro_set_input_state(retro_input_state_t cb) { input_state_cb = cb; }
+
+u32 update_input(void)
+{
+// return;
+ unsigned i;
+ uint32_t new_key = 0;
+
+ if (!input_state_cb)
+ return 0;
+
+ for (i = 0; i < sizeof(btn_map) / sizeof(map); i++)
+ new_key |= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, btn_map[i].retropad) ? btn_map[i].gba : 0;
+
+ if ((new_key | key) != key)
+ trigger_key(new_key);
+
+ key = new_key;
+ io_registers[REG_P1] = (~key) & 0x3FF;
+
+ return 0;
+}
#elif defined(PC_BUILD)