I’ve got a PS3 controller, but using it with Ubuntu is a huge hassle, not that it doesn’t work mind you, it’s just that most software doesn’t seem to expect 28 axes and 19 buttons that overlap with each other. I’m even perfectly happy using it with a USB cable but I am scorned nonetheless.

Anyway, while I don’t have a perfect solution, I have a good enough solution for ZSNES. ZSNES normally confuses the axes and buttons when configuring different keys, so the input dialog is basically useless. But, I noticed the start/select/PS buttons all don’t have axes so I guessed that the seemingly arbitrary values ZSNES uses for those specific keys were the only correct ones. So I used select (310 according to zsnes, and button 0) to determine the offset for the buttons.

Basically it means (310 + button #) = zsnes button #. At least on my computer. So I used jstest to get the button numbers and hand-edited my ~/.zsnes/zinput.cfg, ending up with this in the player 1 section:

; Player 1 Input
; Input Device: 0 = Unplugged, 1 = KEYBOARD/GAMEPAD
pl1contrl=1
; Keys for Select, Start, Up, Down, Left, Right, X, A, L, Y, B, R
pl1selk=310
pl1startk=313
pl1upk=314
pl1downk=316
pl1leftk=317
pl1rightk=315
pl1Xk=322
pl1Ak=323
pl1Lk=320
pl1Yk=325
pl1Bk=324
pl1Rk=321

It works perfectly. Oh, and one last tip. I’m not sure how everyone experiences this, but the controller gives me no input until I press the PS button. This has the strange effect of turning on my PS3 when I unplug the controller later, but whatever.

7 Responses to “ZSNES and a sixaxis controller”

  1. Chazz Says:

    Thanks for this guide, got my zsnes controls working flawlessly. And my PS3 also comes on after unplugging the controller, weird…

  2. Evan L. Schemm Says:

    Works great. Please note that the starting value of 310 may not be the same for everyone (mine was 312). So, I had to add two to each of the values above. Then it works great!

  3. Bob Says:

    This works wonderfully for me, but I can only get one PS3 controller working with ZSNES and I want to play two player games. I can get two controllers working with me NES emulator but I need help figuring out ZSNES.

  4. Max Says:

    Bob: I only own one, so I can’t help you out there. Try using the same method as me, map a key to select on the second controller, then use that as the offset for the rest of the keys (you can get key offsets using jstest to get the button offsets)

    Good luck!

  5. Tam Says:

    Hey!

    Thanks for this guide and I was wondering if you got the Analog sticks working?
    Thanks again

  6. ben Says:

    perfect now i will play super mario world all night x

  7. roy Says:

    Thanks for sharing this tip! For anyone curious, the offset for dual shock 3 (white) is +4 from the settings above. In other words, pl1selk=314, pl1startk=317, etc..

Leave a Reply