xboxdrv dpad-as-axis: is it possible? (ps3 controller + intellivision)
mustangfanatic01 last edited by
I've been trying to write an xboxdrv configuration to make my DualShock3 controller work for intellivision games using jzintv. It's so close to perfect, but I cannot figure out how to map the D-PAD correctly.
Pi Model: 4b 2GB ram
Power supply: Official 5.1v 3A
RetroPie Version: official image: retropie-buster-4.7.1-rpi4_400.img
After sleuthing these forums for awhile, I found a good controller setup for using Playstation controllers with Intellivision, thanks to Dudleydes. He was able to have the right analog stick send the numeric keypresses 1-9, left stick handle the direction disc, and the d-pad also handle the direction disc.
The core of this comes from the xboxdrv config section (swapping d-pad/right analog):
ABS_X = x1
ABS_Y = y1
ABS_Z = DPAD_X
ABS_RZ = DPAD_Y
ABS_HAT0X = x2
ABS_HAT0Y = y2
(There is something about the right analog stick sending xbox d-pad codes to jzintv that allows it to work with the numeric key presses. When trying to use the xbox's analog x2/y2 it will not work. I suspect because it just outputs a series of directional "down" presses instead of the "up"/"down" presses you get with the DPAD_X/DPAD_Y (HAT).)
This works perfectly when I use my PS4 controller, however the PS3 controller does not output ABS_HAT0X / ABS_HAT0Y. It outputs BTN_DPAD_UP, BTN_DPAD_DOWN, BTN_DPAD_LEFT, BTN_DPAD_RIGHT.
For the life of me I cannot figure out how to map these 4 discrete directional buttons to the xbox's 2nd analog stick (x2/y2). As I am using all of the other available buttons that the xbox controller can output (Start, Guide, Back, A, B, X, Y, LB, RB, LT, RT, TL, TR, DU, DD, DL, DR), I have nothing else to map to. I can't map to DU, DD, DL, DR since jzintv will be mapping d-pad (Hat) inputs to the 1-9 keypad.
Is there any way to map BTN_DPAD_UP to axismap? I tried the following, but it doesn't work.
BTN_DPAD_UP -= y2
BTN_DPAD_DOWN += y2
I have read the xboxdrv man page (3 times):
The docs for mapping an intellivision controller:
Mapping a Controller for Intellivision
The docs for Universal mapping with xboxdrv:
Universal Controller Calibration & Mapping Using xboxdrv
At this point, it would be smarter to just buy another PS4 controller and call it a day, but I've been wracking my brain over this for days and am fixated on figuring it out. It HAS to be possible. I don't really understand it all well enough, particularly how UI-AXISMAP, UI-BUTTONMAP, EV_REL work.
If I could just make the D-pad send 4 distinct codes, I could map them appropriately in jzintv, but there are no xbox buttons left to map to. Is it possible to send keyboard keys when using the d-pad? I noticed that jzintv recognizes when I press stuff on my keyboard, and maybe I could bind to those.
I know that xboxdrv is powerful enough to handle this, I just cannot figure out how; have been completely stuck. Here is what I have so far, and it works perfectly, except the d-pad doesn't do anything since there is no mapping.
[xboxdrv] evdev = /dev/input/event1 silent = true detach-kernel-driver = true deadzone-trigger = 15% deadzone = 4000 mimic-xpad = true trigger-as-button = true #dpad-as-button=true [evdev-absmap] ABS_X = x1 ABS_Y = y1 ABS_RX = DPAD_X ABS_RY = DPAD_Y [evdev-keymap] #BTN_DPAD_DOWN = DD #BTN_DPAD_UP = DU #BTN_DPAD_LEFT = DL #BTN_DPAD_RIGHT = DR BTN_SOUTH = a BTN_EAST = b BTN_WEST = x BTN_NORTH = y BTN_TL = lb BTN_TR = rb BTN_TL2 = lt BTN_TR2 = rt BTN_THUMBL = tl BTN_THUMBR = tr BTN_SELECT = back BTN_MODE = guide BTN_START = start [axismap] -y1 = y1 -y2 = y2 [calibration] x1 = -32767:0:32767 y1 = -32767:0:32767 x2 = -32767:0:32767 y2 = -32767:0:32767
MAP 0 ; Game interface ADD_COMBO 2 JS1_BTN_08 JS1_BTN_09 COMBO2 QUIT ; Select + Start JS1_BTN_10 RESET ; PS button JS1_BTN_09 PAUSE ; Start ; Keypad JS1_BTN_04 PD0L_KPC ; Clear key mapped to L1 JS1_BTN_05 PD0L_KPE ; Enter key mapped to R1 JS1_BTN_03 PD0L_KP0 ; Key 0 mapped to Triangle JS1_BTN_06 PD0L_KP0 ; Key 0 also mapped to L2 JS1_BTN_11 PD0L_KP0 ; left analog stick btn press also 0 JS1_BTN_07 PD0L_KP5 ; Key 5 R2 JS1_BTN_12 PD0L_KP5 ; right analog stick btn press also 5 JS1_BTN_00 PD0L_A_T ; Top Action button mapped to Cross JS1_BTN_02 PD0L_A_L ; Bottom left Action button mapped to Square JS1_BTN_01 PD0L_A_R ; Bottom Right Action button mapped to Circle ; Hat / D-Pad (Right analog stick because xboxdrv) ; Keypad 1 to 9 (except 5) JS1_HAT0_NW PD0L_KP1 JS1_HAT0_N PD0L_KP2 JS1_HAT0_NE PD0L_KP3 JS1_HAT0_W PD0L_KP4 JS1_HAT0_E PD0L_KP6 JS1_HAT0_SW PD0L_KP7 JS1_HAT0_S PD0L_KP8 JS1_HAT0_SE PD0L_KP9 ; Left analog stick mapped to Direction Disc JS1A_E PD0L_J_E JS1A_ENE PD0L_J_ENE JS1A_NE PD0L_J_NE JS1A_NNE PD0L_J_NNE JS1A_N PD0L_J_N JS1A_NNW PD0L_J_NNW JS1A_NW PD0L_J_NW JS1A_WNW PD0L_J_WNW JS1A_W PD0L_J_W JS1A_WSW PD0L_J_WSW JS1A_SW PD0L_J_SW JS1A_SSW PD0L_J_SSW JS1A_S PD0L_J_S JS1A_SSE PD0L_J_SSE JS1A_SE PD0L_J_SE JS1A_ESE PD0L_J_ESE ; D-pad also mapped to Direction Disc ;?? PD0L_J_N ;?? PD0L_J_E ;?? PD0L_J_S ;?? PD0L_J_W
Any help would be greatly appreciate so I can sleep at night again :)