aboutsummaryrefslogtreecommitdiff
path: root/core.c
diff options
context:
space:
mode:
authorneonloop2023-01-26 00:59:49 +0000
committerneonloop2023-01-26 00:59:49 +0000
commitb54c30613e5a4ade90aa81e832c90f9ab5307cb7 (patch)
treeb376811c679ce6dcfc02507662333220fc43e517 /core.c
parentf8689b36cf36bf9bba607739f99037c915e3b10d (diff)
downloadpicoarch-b54c30613e5a4ade90aa81e832c90f9ab5307cb7.tar.gz
picoarch-b54c30613e5a4ade90aa81e832c90f9ab5307cb7.tar.bz2
picoarch-b54c30613e5a4ade90aa81e832c90f9ab5307cb7.zip
Forces poll for input before reading
Fixes arduous which reads input but never polls
Diffstat (limited to 'core.c')
-rw-r--r--core.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core.c b/core.c
index 34810a5..2f37a5a 100644
--- a/core.c
+++ b/core.c
@@ -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();