advmame, dolphin bar, and wii controller gun
-
I'm trying to setup a wii controller gun and dolphin bar with retropie 4.6 on a Pi 4. In mode 2 the dolphin bar behaves like a keyboard and mouse. Unfortunately I can't get it to work with advmame. I've been trying to get it to work with various games but the game that shows the most promise is police trainer.
When I start the game I can remap the coin and player1 start and the game works but the gun works as a joystick vice mouse (point up and the cross hairs move up etc).
I tried cat /dev/input/js0 and sure enough moving the gun generate a whole pile of activity on js0 and mouse0.
To debug I installed the pixel desktop - the gun works great as mouse pointer - definitely brings a new meaning to closing a window.
Long story short I think my issue is that advmame is giving preference to the joystick when for specific games I need it to default to the mouse.
I uploaded my advmame.cfg to pastebin https://pastebin.com/ydPtPy6y
/opt/retropie/emulators/advmame/bin/advmame --version gives,
AdvanceMAME 3.9
Compiled Apr 21 2020 with gcc-8.3.0Drivers (in priority order):
Video: fb sdl none
Sound: alsa oss sdl none
Keyboard: event raw sdl none
Joystick: event raw sdl none
Mouse: event raw sdl noneDirectories:
Data: /opt/retropie/emulators/advmame/share/advanceConfiguration (in priority order):
Host configuration file (R): /opt/retropie/emulators/advmame/etc/advmame.rc
Command line (R)
Home configuration file (RW): /home/pi/.advance/advmame.rc
Data configuration file (R):
/opt/retropie/emulators/advmame/share/advance/advmame.rcI'd welcome any suggestions.
Jonathan
-
@jmbooth2000 said in advmame, dolphin bar, and wii controller gun:
I'm trying to setup a wii controller gun and dolphin bar with retropie 4.6 on a Pi 4. In mode 2 the dolphin bar behaves like a keyboard and mouse. Unfortunately I can't get it to work with advmame. I've been trying to get it to work with various games but the game that shows the most promise is police trainer.
Have you tried testing it with
advm
?
On the PI4, the config you have (device_mouse raw
) might not work, try withdevice_mouse sdl
. -
are you sure that your lightgun is being seen as mouse 0? maybe its mouse 1?
input_map[p1_lightgunx] mouse[0,x]
input_map[p1_lightguny] mouse[0,y] -
@mitu When I try advm I get nothing on mouse0 when I move. Interestingly if I cat /dev/input/mouse0 it shows lots of activity so at the kernel level there is definitely action.
One possible complication is that I have a logitec K400+ wireless keyboard which is also plugged in. That I switched the order of the usbs and it shows up a mouse1 and when I press a button / move sure enough advm see the activity as mouse1 (it works).
I tried swapping to device_mouse raw from sdl as part of the debugging I have swapped back still nothing.
Thanks
Jonathan -
@jmbooth2000 I look in the xorg logs and sure enough the wii appears with input from both js0 and mouse 0. See below. As I said it works as a mouse in X but this confirms that the hardware is working and its at least somewhat setup. I'm not sure why udev is tagging the wii remote as a joystick...
[ 1359.980] (II) config/udev: Adding input device HJZ Mayflash Wiimote PC Adapter Mouse (/dev/input/event1)
[ 1359.980] () HJZ Mayflash Wiimote PC Adapter Mouse: Applying InputClass "libinput pointer catchall"
[ 1359.980] (II) Using input driver 'libinput' for 'HJZ Mayflash Wiimote PC Adapter Mouse'
[ 1359.982] (II) systemd-logind: got fd for /dev/input/event1 13:65 fd 24 paused 0
[ 1359.982] () HJZ Mayflash Wiimote PC Adapter Mouse: always reports core events
[ 1359.982] () Option "Device" "/dev/input/event1"
[ 1359.982] () Option "_source" "server/udev"
[ 1359.986] (II) event1 - HJZ Mayflash Wiimote PC Adapter Mouse: is tagged by udev as: Mouse
[ 1359.987] (II) event1 - HJZ Mayflash Wiimote PC Adapter Mouse: device is a pointer
[ 1359.987] (II) event1 - HJZ Mayflash Wiimote PC Adapter Mouse: device removed
[ 1359.987] () Option "config_info" "udev:/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.1/0003:0079:1802.0005/input/input1/event1"
[ 1359.987] (II) XINPUT: Adding extended input device "HJZ Mayflash Wiimote PC Adapter Mouse" (type: MOUSE, id 8)
[ 1359.987] () Option "AccelerationScheme" "none"
[ 1359.987] () HJZ Mayflash Wiimote PC Adapter Mouse: (accel) selected scheme none/0
[ 1359.987] () HJZ Mayflash Wiimote PC Adapter Mouse: (accel) acceleration factor: 2.000
[ 1359.987] () HJZ Mayflash Wiimote PC Adapter Mouse: (accel) acceleration threshold: 4
[ 1359.992] (II) event1 - HJZ Mayflash Wiimote PC Adapter Mouse: is tagged by udev as: Mouse
[ 1359.992] (II) event1 - HJZ Mayflash Wiimote PC Adapter Mouse: device is a pointer
[ 1359.995] (II) config/udev: Adding input device HJZ Mayflash Wiimote PC Adapter Mouse (/dev/input/js0)
[ 1359.995] (II) No input driver specified, ignoring this device.
[ 1359.995] (II) This device may have been added with another device file.
[ 1359.997] (II) config/udev: Adding input device HJZ Mayflash Wiimote PC Adapter Mouse (/dev/input/mouse0)
[ 1359.997] (II) No input driver specified, ignoring this device.
[ 1359.997] (II) This device may have been added with another device file.
[ 1359.999] (II) config/udev: Adding input device HJZ Mayflash Wiimote PC Adapter Consumer Control (/dev/input/event2)
[ 1359.999] () HJZ Mayflash Wiimote PC Adapter Consumer Control: Applying InputClass "libinput keyboard catchall"
[ 1359.999] (II) Using input driver 'libinput' for 'HJZ Mayflash Wiimote PC Adapter Consumer Control'Thanks for any additional help
Jonathan -
@jmbooth2000 Pulling my hair out here with the dolphin bar. Current advmame.rc config file is,
device_mouse raw
device_raw_firstkeyhack no
device_raw_mousedev[0] /dev/input/by-id/usb-HJZ_Mayflash_Wiimote_PC_Adapter-if01-event-mouse
device_raw_mousedev[1] /dev/input/mouse1
device_raw_mousedev[2] /dev/input/mouse2
device_raw_mousedev[3] /dev/input/mouse3
device_raw_mousetype[0] ps2
device_raw_mousetype[1] ps2
device_raw_mousetype[2] ps2
device_raw_mousetype[3] ps2When I run advm I get,
Driver event, mouses 1
mouse 0 '0079_1802', axes 1, buttons 0
axe 0 [hwheel]Press Break to exit
mouse 0, [], [ 0] ( 0 ms)
which shows there are no buttons and only one axes.when I run "evtest /dev/input/by-id/usb-HJZ_Mayflash_Wiimote_PC_Adapter-if01-event-mouse" in another window i get,
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x79 product 0x1802 version 0x1001
Input device name: "HJZ Mayflash Wiimote PC Adapter Mouse"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event code 275 (BTN_SIDE)
Event code 276 (BTN_EXTRA)
Event type 2 (EV_REL)
Event code 8 (REL_WHEEL)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 414
Min 0
Max 512
Event code 1 (ABS_Y)
Value 358
Min 0
Max 400
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Which is total correct and better yet when I press the buttons / move the gun they update.Even when the are both running in parallel evtest outputs the right results and advj outputs nothing... Arg...
Any suggestions or pointers greatly appreciated. The wii gun works perfectly with pixel and in the retroarch gui but behaves like a joystick in advmame.
Is there anyway to get advm to output more logging? Something weird is going on as there are both pointing to the same device.
Thanks
Jonathan -
You can add
-log
parameter toadvm
and it will produce anadvm.log
file in the current folder. Open it and paste its contents on pastebin.com. -
result https://pastebin.com/B83gPae7
Some key sections pasted below - first the good news
event: open device /dev/input/event1
event: driver:1.0.1
event: device vendor:0x0079 product:0x1802 version:0x1001 bus:0x0003 (usb)
event: name:"HJZ Mayflash Wiimote PC Adapter Mouse"
event: physical_location:"usb-0000:01:00.0-1.3/input1"
event: EV_0x0: 0x0 0x1 0x2 0x3 0x4
event: EV_KEY: BTN_LEFT BTN_RIGHT BTN_MIDDLE BTN_SIDE BTN_EXTRA
event: EV_REL: REL_WHEEL
event: EV_ABS: ABS_X[val:0,min:0,max:512,fuzz:0,flat:0] ABS_Y[val:0,min:0,max:400,fuzz:0,flat:0]
event: EV_MSC: 0x4
event: desc:"HJZ Mayflash Wiimote PC Adapter Mouse"Which seems like good news until you read on and see,
event: open device /dev/input/event1
mouseb:event: not a mouse on device /dev/input/event1Which seems to say the device on event1 isn't a mouse and explains why it doesn't treat it as a mouse. As a reminder evtest /dev/input/event1 confirms it is a mouse and detects key presses and movement correctly. It also works as a mouse in pixel and retroarch.
Seems like either I have a weird configuration issue that is tricking advm into not recognizing this is a mouse or perhaps a software bug?
Thanks for any help
Jonathan -
@jmbooth2000 said in advmame, dolphin bar, and wii controller gun:
Seems like either I have a weird configuration issue that is tricking advm into not recognizing this is a mouse or perhaps a software bug?
Advmame doesn't consider the device a mouse, it's looking at
EV_REL
and notEV_ABS
(https://github.com/amadvance/advancemame/blob/9873ffe3dce1e65746f88e3667e771ee5045b621/advance/linux/event.c#L2243). Looks like it's not supporting absolute pointing devices ? -
Ouch. Sounds like i may be at a dead end if advmame doesn't support absolute pointing devices - argh.
-
Can't say for sure, but it doesn't seem to try the
raw
input option, which would search for/dev/input/mouseX
. -
@jmbooth2000 thanks anyway.
-
That being said, you should try one of the other MAME emulators - Mame2003 has mouse support and RetroArch seems to detect your mouse. As a plus, it supports absolute pointing devices.
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.