diff options
author | neonloop | 2023-01-26 00:59:49 +0000 |
---|---|---|
committer | neonloop | 2023-01-26 00:59:49 +0000 |
commit | b54c30613e5a4ade90aa81e832c90f9ab5307cb7 (patch) | |
tree | b376811c679ce6dcfc02507662333220fc43e517 | |
parent | f8689b36cf36bf9bba607739f99037c915e3b10d (diff) | |
download | picoarch-b54c30613e5a4ade90aa81e832c90f9ab5307cb7.tar.gz picoarch-b54c30613e5a4ade90aa81e832c90f9ab5307cb7.tar.bz2 picoarch-b54c30613e5a4ade90aa81e832c90f9ab5307cb7.zip |
Forces poll for input before reading
Fixes arduous which reads input but never polls
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | core.c | 10 | ||||
-rw-r--r-- | core.h | 1 | ||||
-rw-r--r-- | main.c | 2 |
4 files changed, 13 insertions, 2 deletions
@@ -525,7 +525,7 @@ Comment=Small screen libretro frontend Exec=picoarch %f Icon=sdlretro_icon SelectorBrowser=true -SelectorDir=/mnt/FunKey/.picoarch/cores +SelectorDir=/mnt/Libretro/cores SelectorFilter=so Terminal=false Type=Application @@ -34,6 +34,7 @@ static char system_dir[MAX_PATH]; static struct retro_disk_control_ext_callback disk_control_ext; static uint32_t buttons = 0; +static int polled = 0; static int core_load_game_info(struct content *content, struct retro_game_info *game_info) { struct retro_system_info info = {}; @@ -534,10 +535,14 @@ static void pa_input_poll(void) { handle_emu_action(which); buttons = actions[IN_BINDTYPE_PLAYER12]; + polled = 1; } static int16_t pa_input_state(unsigned port, unsigned device, unsigned index, unsigned id) { if (port == 0 && device == RETRO_DEVICE_JOYPAD && index == 0) { + if (!polled) + pa_input_poll(); + if (id == RETRO_DEVICE_ID_JOYPAD_MASK) return buttons; @@ -696,6 +701,11 @@ void core_apply_cheats(struct cheats *cheats) { } } +void core_run_frame(void) { + polled = 0; + current_core.retro_run(); +} + void core_unload_content(void) { sram_write(); @@ -65,6 +65,7 @@ int core_open(const char *corefile); void core_load(void); int core_load_content(struct content *content); void core_apply_cheats(struct cheats *cheats); +void core_run_frame(void); void core_unload_content(void); const char **core_extensions(void); void core_unload(void); @@ -698,7 +698,7 @@ int main(int argc, char **argv) { do { count_fps(); adjust_audio(); - current_core.retro_run(); + core_run_frame(); perform_emu_action(); #ifdef FUNKEY_S if (should_suspend) { |