summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorneonloop2021-03-31 21:10:18 +0000
committerneonloop2021-03-31 21:10:18 +0000
commitc85afd6f386706d01a3f234a13a7de4a93c66b67 (patch)
tree2c49f7d0193cea2bb1996a18c745b3dfbb17c008
parent257175870d76d889de9b5f906ab16a15420a48fa (diff)
downloadsnes9x2002-c85afd6f386706d01a3f234a13a7de4a93c66b67.tar.gz
snes9x2002-c85afd6f386706d01a3f234a13a7de4a93c66b67.tar.bz2
snes9x2002-c85afd6f386706d01a3f234a13a7de4a93c66b67.zip
Fixes ignoring other controller buttons
-rw-r--r--.gitignore2
-rw-r--r--shell/input/sdl/input.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 8be1f2b..b8fd241 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
pocketsnes*
*.o
*.so
+snes9x
+snes9x2002 \ No newline at end of file
diff --git a/shell/input/sdl/input.c b/shell/input/sdl/input.c
index bf6cff5..ad70881 100644
--- a/shell/input/sdl/input.c
+++ b/shell/input/sdl/input.c
@@ -26,6 +26,9 @@ static uint32_t joypad = 0;
uint32_t S9xReadJoypad(int32_t port)
{
+ // Only 1P is supported
+ if (port != 0) return 0;
+
SDL_Event event;
static const uint32_t snes_lut[] =
{
@@ -43,9 +46,6 @@ uint32_t S9xReadJoypad(int32_t port)
SNES_TR_MASK
};
- // Only 1P is supported
- if (port > 0) return joypad;
-
while (SDL_PollEvent(&event))
{
switch (event.type)