snes9x-rpi controls broken? Retroflag Gpi
-
Parameters: Executing: SDL1_VIDEODRIVER=dispmanx /opt/retropie/emulators/snes9x/snes9x "/home/pi/RetroPie/roms/snes/Earthworm Jim (USA).sfc" Rate: 44100, Buffer size: 1024, 16-bit: yes, Stereo: yes, Encoded: no Could not find joystick mapping forMicrosoft X-Box 360 pad, use default No ROM file header found. "EARTHWORM JIM" [checksum ok] HiROM, 32Mbits, Type: ROM only, Mode: 21, TV: NTSC, S-RAM: 0Kb, ROMId: AEJE Company: 4G
-
@SinisterSpatula OK, so the gamepad is detected correctly, but I'm not sure why the mapping doesn't work - maybe it's just using the name but gamepad has different key codes.
I started a ROM - with a SNES style USB controller - and it played fine (minus the emulator exit, which is not mappable), without any re-configuration. I also got the same type of messages in the log, but despite the 'default' mapping being used, it worked fine.
EDIT: Can you try with
sdl2-jstest
(from here) to see how your controller is detected ? -
@mitu That's very interesting! We're the select and start buttons working? For me, the start button does nothing, and the A/B/X/Y were in the wrong order.
-
@SinisterSpatula Yes, buttons looked fine - though I didn't make use of L/R much.
-
@mitu said in snes9x-rpi controls broken?:
sdl2-jstest
Sorry, Iinux is not really my strong suit. I was able to clone the git, and run the cmake, but I couldn't seem to do "make" or "make isntall". Not sure what arguments I'm supposed to add to them. Edit: actually the cmake fails, saying the gamecontrollerdb.txt is a symlink that is "dangling" I assume not there.
-
@SinisterSpatula Must have changed since I last installed it. You can try with this version, which doesn't need additional files.
-
@mitu It tells me unable to open Joystick 1. Uhg. It's probably something unique to the Gpi-case I'm thinking, if you tested it with a usb controller and it worked for you. I'll see if I can try using a usb controller also, with a different pi, and see if I'm able to compile a version and change button mapping around. I'm also curious to try a usb keyboard with it on a different pi and see what happens. Maybe others here that have a Gpi case are also looking into this, and we can help each other to get it working. I appreciate your help greatly.
-
@SinisterSpatula If you haven't tried
lr-snes9x2002
, I suggest you try to see how it performs.xboxdrv
may also be a solution for re-mapping the gamepad without any re-compilation - useful for a drop-in configuration. -
@mitu Yeah, that's what I'm really puzzled about. I've gotten extremely savvy with xboxdrv and I've used it with many of these older cores now. When I tried using it with this one, it just refused to receive or process any of the key events I sent it, except for two, escape (quit) and backspace (speed up the cpu). And when I connected a bluetooth keyboard and it did the same thing, that's what made me think it must be the core itself. My fork of snes9x-rpi for Gpi is here: https://github.com/SinisterSpatula/snes9x-rpi
-
I feel like I'm SOOO Close to this now. I was able to modify the code for the joystick detection skipping over Js0 (the retroflag xpad joystick) and get snes9x to grab Js1 instead (xboxdrv joystick). You would think that would be all it takes right? Wrong. So there is some weirdness happening even with that. The button assignments seem to change practically at random. They are one way for one launch, and then they shift around on the next launch. So I'm pretty much abandoning Joystick buttons and going for keyboard input. I know exactly the area of the code I need to change but still working out the best way to change it. It reads like "first we get all the joystick players, and then we get keyboard players". So I think because it was finding joysticks, the keyboard keys became player 2 (which is why none of the movement keyboard keys affected player 1). So if I find away for it to take NO joysticks, the keys should become player 1. That is my current goal.
-
@SinisterSpatula Since it uses SDL, just disable the joystick sub-system initialisation - https://wiki.libsdl.org/SDL_InitSubSystem - and see if that leaves you with just the keyboard controls.
-
@SinisterSpatula Hi. I use
xboxdrv
on my 4 player arcade machine where it is really handy, but I'm just wondering what you consider is or will be the benefit of usingxboxdrv
andsnes9x-rpi
on the GPI. I received the GPI a couple of days ago and am using one of the standard snes libretro emulators - I'm not sure which because I'm not at home at present. The libretro emulator, though, seems pretty good to me. -
@spud11 The default SNES emulator on the pi zero is lr-snes9x2002 - It runs okay, but has some pretty choppy sound and some slowdown on some of the more demanding titles (at least in my experience). Snes9x-rpi runs extremely smooth on the Retroflag GPi Case. If @SinisterSpatula can get the controls working I'd love to switch emulators.
-
@pomme Thanks. That explains it well.
-
Apparently I missed a very important thing when I went down this rabbit hole of working on snes9x-rpi. There exists "pisnes" and it is based on the same code as snes9x-rpi, and it's much further developed. I have no clue why snes9x-rpi is even a listed emulator on the retropie wiki. So yeah, you should totally switch emulators, but pay no attention to snes9x-rpi. I just wasted a week or more for no reason on it. And I've learned an important lesson. Research every option before you think there is only one. However, if for some reason pisnes still has slow down, I did infact get snes9x-rpi working for the gpi. Maybe try both and see which you like better. You can get my gpi version here (you'll need to compile from source using my repo as the source). modify the snes9x.sh in scriptmodules to point to my repo, then build from source. [removed my fork of snes9x-rpi, just use pisnes instead. It's better in every way.]
-
@SinisterSpatula That's really interesting (but am sorry you spent such a lot of time on snes9x-rpi).
I'll install both pisnes and your version of snes9x-rpi and give them both a crack. Did you wind up using xboxdrv too? If so, could I please ask whether you could set out the code you used? Thanks.
-
@spud11 This is my xboxdrv code for start+select=quit:
#quit (select+start), requires /etc/udev/rules.d/99-xboxdrv.rules if [ "$2" = "snes9x" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv \ --evdev /dev/input/by-id/usb-RetroFlag_GPi_Case_RetroFlag_01-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --evdev-keymap BTN_SELECT=back,BTN_START=start \ --ui-buttonmap back+start=KEY_ESC \ & fi
-
@spud11 I just checked pisnes, and yes there is absolutely no reason to ever use snes9x-rpi. Pisnes is exactly the same, and so much better in many ways. I wouldn't even bother with it. [https://www.reddit.com/r/retroflag_gpi/comments/c6wjle/need_help_trying_to_get_snes9x_compiled_for_gpi/espa4wv?utm_source=share&utm_medium=web2x](link url)
-
@SinisterSpatula Thanks so much for all of this. You've done some terrific work with
xboxdrv
. The guru on this forum withxboxdrv
is @mediamogul.xboxdrv
has so many amazing options. -
@SinisterSpatula Hi. On a new Retropie 4.5 image, I've been playing around with
xboxdrv
and Vice (the non-libretro Commodore 64 emulator). I've got some working code, albeit it is not perfect. It enables exiting withselect
+start
and entering theF12
menu withselect
+x
. Perhaps best of all though is that there is no need to switch the GPi (usingselect
+left dpad
) fromhat
tojoystick/axis
modes, which you would otherwise need to do with Vice. (The--trigger-as-button
seems to help with this.)My
sdl-vice
file which goes in the/opt/retropie/configs/c64/
folder is as follows:[C64] MenuKey=293 MenuKeyUp=119 MenuKeyDown=115 MenuKeyLeft=97 MenuKeyRight=100 MenuKeySelect=102 MenuKeyCancel=101 MenuKeyPageUp=280 MenuKeyPageDown=281 MenuKeyHome=278 MenuKeyEnd=279 SoundDeviceName="alsa" SoundSampleRate=22050 SoundBufferSize=100 AspectRatio="1.000000" SDLWindowWidth=384 SDLWindowHeight=272 VICIIVideoCache=0 VICIIDoubleSize=0 VICIIFullscreen=1 VICIIFilter=0 SidEngine=0 SidModel=1 KeySet1North=119 KeySet1East=100 KeySet1South=115 KeySet1West=97 KeySet1Fire=102 KeySet2North=121 KeySet2East=106 KeySet2South=104 KeySet2West=103 KeySet2Fire=107 JoyDevice1=3 JoyDevice2=2 Mouse=1 ETHERNETCARTBase=56832 Acia1Base=56832
The
xboxdrv
code is as follows:if [ "$2" = "vice-x64" ] then sudo /opt/retropie/supplementary/xboxdrv/bin/xboxdrv >> /dev/shm/runcommand.log 2>&1 \ --evdev /dev/input/by-id/usb-RetroFlag_GPi_Case_RetroFlag_01-event-joystick \ --detach-kernel-driver \ --silent \ --force-feedback \ --deadzone-trigger 15% \ --deadzone 4000 \ --mimic-xpad \ --trigger-as-button \ --evdev-absmap ABS_X=x1,ABS_Y=y1,ABS_RX=x2,ABS_RY=y2,ABS_Z=lt,ABS_RZ=rt \ --ui-axismap X1=KEY_A:KEY_D,Y1=KEY_S:KEY_W \ --evdev-keymap BTN_SOUTH=a,BTN_EAST=b,BTN_NORTH=x,BTN_WEST=y,BTN_TL=lb,BTN_TR=rb,BTN_THUMBL=tl,BTN_THUMBR=tr,BTN_MODE=guide,BTN_SELECT=back,BTN_START=start,BTN_TRIGGER_HAPPY3=du,BTN_TRIGGER_HAPPY4=dd,BTN_TRIGGER_HAPPY1=dl,BTN_TRIGGER_HAPPY2=dr \ --evdev-absmap ABS_HAT0X=dpad_x,ABS_HAT0Y=dpad_y \ --ui-buttonmap b=KEY_F,y=KEY_Y,a=KEY_W,x=KEY_SPACE+KEY_ENTER,lb=KEY_1+KEY_Y,rb=KEY_2+KEY_N \ --ui-buttonmap back=KEY_ESC,start=KEY_SPACE+KEY_ENTER,back+x=KEY_F12,back+b=KEY_Y,back+a=KEY_N,back+start=KEY_LEFTALT+KEY_Q \ --ui-buttonmap du=KEY_W,dd=KEY_S,dl=KEY_A,dr=KEY_D \ & fi
The keys used are
W, S, A, D
for movement andF
for fire.On the GPi, the
B
button is fire and I've mapped theA
button to theW
key so that for platform games, instead of pushing up on the dpad, you can just press theA
button to jump.I've tested this on Commando Arcade 2015, Berzerk Redux, Aviator Arcade II, Paradroid and Bruce Lee. All work fine. However, Boulder Dash got to the menu screen, but I couldn't get it to actually start the game.
Hope this is helpful.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.