Maldita Castilla joypad support
-
@mediamogul Can you suggest any? ;)
-
Sure. The ones I'm aware of are 'Joymap', 'Linux Joystick Mapper' and 'xboxdrv'.
I've put together a guide for 'xboxdrv' here if you choose to use it.
-
@mediamogul Hey thanks! I'll take a look at xboxdrv then :)
I thought it was only for xbox controllers... -
With a name like 'xboxdrv', who could blame you. At one time it probably only handled XBox 360 controllers. XBMC (XBox Media Center) was faced with the same identity crisis once it started supporting multiple systems. It only took them twelve years to re-brand as 'Kodi'.
-
@mediamogul Hey! So I started following your tutorial and I got stuck just at the beginning xD
I run:
cat /proc/bus/input/devices
and I got this:
I: Bus=0003 Vendor=04f3 Product=0103 Version=0111 N: Name="HID 04f3:0103" P: Phys=usb-20980000.usb-1.3/input0 S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:04F3:0103.0001/input/input0 U: Uniq= H: Handlers=sysrq kbd leds event0 B: PROP=0 B: EV=120013 B: KEY=10000 7 ff800000 7ff febeffdf f3cfffff ffffffff fffffffe B: MSC=10 B: LED=7 I: Bus=0003 Vendor=04f3 Product=0103 Version=0111 N: Name="HID 04f3:0103" P: Phys=usb-20980000.usb-1.3/input1 S: Sysfs=/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.1/0003:04F3:0103.0002/input/input1 U: Uniq= H: Handlers=kbd event1 B: PROP=0 B: EV=1f B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 130c13 b17c000 267bfa d941dfed 9e1680 4400 0 10000002 B: REL=40 B: ABS=1 0 B: MSC=10 I: Bus=0003 Vendor=0001 Product=0001 Version=0001 N: Name="retrogame" P: Phys= S: Sysfs=/devices/virtual/input/input2 U: Uniq= H: Handlers=kbd event2 B: PROP=0 B: EV=3 B: KEY=1680 0 12040 50280002
and then:
ls /dev/input/by-id/
Shows me this:
usb-04f3_0103-event-if01 usb-04f3_0103-event-kbd
I'm using Adafruit's Retrogame right now. That's the only "joystick" I'm seeing here, right?
Is that a problem? Or should I delete it?
Btw, I'm using arcade controlls via GPIO, if that's of any help. -
@hiulit said in Maldita Castilla joypad support:
That's the only "joystick" I'm seeing here, right? Is that a problem? Or should I delete it?
It's registering as a keyboard event, but it should be capable of being mapped in the same way. While I have never personally attempted to, it should just be a matter of mapping the keyboard event codes to the virtual XBox controller rather than the
ABS_
andBTN_
event codes mentioned in the guide. -
@mediamogul Ok, so when I run:
evtest /dev/input/event2
I get this:
Input driver version is 1.0.1 Input device ID: bus 0x3 vendor 0x1 product 0x1 version 0x1 Input device name: "retrogame" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 1 (KEY_ESC) Event code 19 (KEY_R) Event code 21 (KEY_Y) Event code 28 (KEY_ENTER) Event code 30 (KEY_A) Event code 38 (KEY_L) Event code 45 (KEY_X) Event code 48 (KEY_B) Event code 103 (KEY_UP) Event code 105 (KEY_LEFT) Event code 106 (KEY_RIGHT) Event code 108 (KEY_DOWN) Properties: Testing ... (interrupt to exit)
And when I hit a button, I get this:
Event: time 1475954839.991566, type 1 (EV_KEY), code 19 (KEY_R), value 1 Event: time 1475954839.991566, -------------- EV_SYN ------------ Event: time 1475954840.139875, type 1 (EV_KEY), code 19 (KEY_R), value 0 Event: time 1475954840.139875, -------------- EV_SYN ------------
What should I do with this information? Because in your tutorial you mention
ABS_
andBTN_
but I don't see any of that :PHow can I use these lines with the output I have?
--evdev-absmap ABS_*=x1,ABS_*=y1,ABS_*=x2,ABS_*=y2,ABS_*=lt,ABS_*=rt,ABS_*=dpad_x,ABS_*=dpad_y \ --evdev-keymap BTN_*=a,BTN_*=b,BTN_*=x,BTN_*=y,BTN_*=lb,BTN_*=rb,BTN_*=tl,BTN_*=tr,BTN_*=guide,BTN_*=back,BTN_*=start \
Thanks again! And sorry to bother you... :)
-
This is purely hypothetical, but you might be able to map the virtual XBox 360 event by changing all the
ABS_
andBTN_
references toKEY_
, such as:--evdev-absmap KEY_*=x1,KEY_*=y1 \ --evdev-keymap KEY_*=a,KEY_*=b \
If that doesn't work then I believe you'll have to try and find mapping software that can specifically map keyboard keys to event types. One of the two other options I listed above may be capable of that, but I can't say for sure.
-
can you use an 8bitdo snes30 controller and start it in keyboard mode?
-
I'm afraid not. Since then I've learned that while this feature is on the drawing board and has even been coded, it currently isn't implemented and there has been no development in over a year.
-
@hiulit hi. Did you end up sitting this out? I'm going through the exact same process with xboxdrv on another thread with @mediamogul but seem to have hit a similar roadblock.
Would love to hear your progress and status.
Thanks.
-
@pjft Not on my part, I haven't been successful :(
-
so here is what i have found out. Maldita Castilla will not play unless it sees the controller input with a input0
i had to remove all my settings and IR input to even get it to work.
I dont know if @mediamogul knows how to get xboxdrv to set the keyboard map to input0
for me my IR input takes that spot. so this game will not work for me.
maybe there is a way to reserve that placement for different input. that is beyond me
as you see my HID it taking the
input0
and this is what Maldita Castilla looks for its input. so we need to reserve this input from being taken and set it for a keyboard map.I know this is not a answer but more info never hurts.
I: Bus=0003 Vendor=1d57 Product=ad02 Version=0110 N: Name="HID 1d57:ad02" P: Phys=usb-3f980000.usb-1.4/input0 S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:1D57:AD02.0001/input/input0 U: Uniq= H: Handlers=sysrq kbd leds event0 B: PROP=0 B: EV=12001f B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 130c13 b17c007 ffa67bfa d941dfff febeffdf f3cfffff ffffffff fffffffe B: REL=40 B: ABS=1 0 B: MSC=10 B: LED=7 ```
-
@ExarKunIv
Does your joystick/gamepad use this IR input?If not try plugging in your joystick/gamepad into USB port 1 on your RPi
-
Oh, wow. This is definitely a great find.
I am unsure of how exactly we'll be able to systematically fix this, but knowing about this can already help narrowing down approaches to make it work.
If you start your OS with just a keyboard plugged in, and then plug in your controller, and then unplug the keyboard, will input0 be free? If you run xboxdrv from SSH, will it create a virtual pad on input0?
-
i have a 8bitdo. so sadly this will not work for me
and i use the IR for KODI and it is connect to USB 3 -
I: Bus=0003 Vendor=1d57 Product=ad02 Version=0110 N: Name="HID 1d57:ad02" P: Phys=usb-3f980000.usb-1.4/input0 S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/0003:1D57:AD02.0001/input/input0 U: Uniq= H: Handlers=sysrq kbd leds event0 B: PROP=0 B: EV=12001f B: KEY=3007f 0 0 0 0 483ffff 17aff32d bf544446 0 0 1 130c13 b17c007 ffa67bfa d941dfff febeffdf f3cfffff ffffffff fffffffe B: REL=40 B: ABS=1 0 B: MSC=10 B: LED=7 I: Bus=0003 Vendor=1d57 Product=ad02 Version=0110 N: Name="HID 1d57:ad02" P: Phys=usb-3f980000.usb-1.4/input1 S: Sysfs=/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1/0003:1D57:AD02.0002/input/input1 U: Uniq= H: Handlers=mouse0 event1 B: PROP=0 B: EV=17 B: KEY=1f0000 0 0 0 0 0 0 0 0 B: REL=103 B: MSC=10 I: Bus=0000 Vendor=0000 Product=0000 Version=0000 N: Name="Xbox Gamepad (userspace driver)" P: Phys= S: Sysfs=/devices/virtual/input/input2 U: Uniq= H: Handlers=js0 event2 B: PROP=0 B: EV=b B: KEY=7fdb0000 0 0 0 0 0 0 0 0 0 B: ABS=3001b I: Bus=0005 Vendor=3810 Product=0009 Version=0100 N: Name="8Bitdo FC30 Pro" P: Phys=b8:27:eb:47:c7:78 S: Sysfs=/devices/platform/soc/3f201000.uart/tty/ttyAMA0/hci0/hci0:11/0005:3810:0009.0003/input/input3 U: Uniq=e4:17:d8:7a:6a:7d H: Handlers=js1 event3 B: PROP=0 B: EV=1b B: KEY=ffff0000 0 0 0 0 0 0 0 0 0 B: ABS=30627 B: MSC=10
here is my inputs. and i know to fix the problem all i have to do it disconnect the HID, but i have it hardwired to my Pie so it is a little hard and defeats the point.
-
I'm using arcade buttons via GPIO using Adafruit's Retrograme, a GPIO-to-virtual-keyboard utility, so essentially I have two keyboards connected to the Raspberry Pi.
The keyboard connected to the USB is always
input0
.
And the virtual keyboard isinput1
. So Maldita Castilla will never work with this one :(Is there an 'easy' way (or any kind of way :P) to change
input0
forinput1
?Also, if I connect the keyboard to the USB no. 2 (as shown in the image above) and I have an 8Bitdo via bluetooth, will the 8Bitdo be
input0
or will it be the keyboard? -
Ok, when I launch Maldita Castilla via terminal, I see this code:
GAMEPAD: 4 axis values (last) at 0x76289660 GAMEPAD: Enumerating 5 GAMEPAD: device name 8Bitdo NES30 GamePad GAMEPAD: buttons - 16, axes - 8 GAMEPAD: 4 axis values (last) at 0x76289620 GAMEPAD: 4 axis values (last) at 0x76289600 GAMEPAD: 4 axis values (last) at 0x762895e0
So, it recognizes the gamepad, right? Shouldn't it be working then? :(
-
one would think, but as of yet no one knows. personally unless someone goes in to the code and changes something to have the game look for other
inputs
i don't think it will work for anyone who has more then one thing connected to the pi. or is using xboxdrv.i hope, but im not holding my breath
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.