I just received my PocketChip and have been using Pico-8 on my mac with a usb controller. I can get the controller working with Joystick and the calibration tool on the command line on the PocketChip, but Pico-8 doesn't seem to recognize it.
Is this a bug or am I missing a step somewhere? Any help is appreciated.
@kittedm4ster I have not done the SDL config, I will look into that.
@mrh The PocketChip is cool for more than just Pico-8. It is nice to have an all inclusive prototype system.
@rwmpelstilzchen the keyboard is very clicky and takes some getting used to. I wouldn't recommend developing on it with out an external keyboard. Playing the games is okay, it just takes a bit to get use to the keyboard, but as you can tell by my initial question I would much rather use the NES USB controller to play.
Overall I would say it is a really hard system to beat for the price, I even ordered a second one.
I just got my PocketC.H.I.P the other day and I found this post because I am looking to use a USB controller as well.
The superclicky buttons on the PocketC.H.I.P are okay, but not ideal. Personally, for Pico-8 games, I find them easier to use than a computer keyboard, but a USB controller would be way better. Some games are easier to play using them than others, obviously, but in my experience it is uncomfortable when you have to hold down a button for a long period of time, or move around precisely using the directionals.
I would sincerely appreciate any help I could get in getting my usb controller to work with Pico-8 using PocketC.H.I.P, keeping in mind I am a noob and am new to programming with anything :/ would I use the Linux terminal on my PocketC.H.I.P?
This is the controller I have...
That controller isn't in the SDL database:
so you need to do a couple of things to get it working:
- Download SDL gamepad tool
- Run it and create a new mapping (sometimes d-pad maps to left analog depending on if it reports axis or buttons)
- Copy mapping string and paste it into Pico-8 sdl_controllers.txt
- Restart Pico-8
For the benefit of the community post your configuration string here and make a pull request to include it in the SDL DB.
This may only work for wired controllers as far as I know?
@randmcnasty you can use any version of the gamepad tool to create the configuration during. Do you have access to PC or Mac?
Or you can even use another gamepad testing app to get the button values and edit the configuration string yourself. The format is quite straight forward.
Thanks a lot! I will try probably tomorrow, as I'm pretty busy all day today. I tried a little last night, but I wasn't sure which info to paste...plus it was confusing because I'm using an nes style controller and the example is like an xbox controller or something...Can you please show me an example of what the format would typically look like? Thanks again.
This example is my SFC30 controller (made by 8bitdo)
351200000000000021ab000000000000,SFC30 Joystick,a:b1,b:b0,x:b4,y:b3,back:b10,start:b11,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Mac OS X,
here it is split into multiple lines
351200000000000021ab000000000000, SFC30 Joystick, a:b1, b:b0, x:b4, y:b3, back:b10, start:b11, leftshoulder:b6, rightshoulder:b7, leftx:a0, lefty:a1, platform:Mac OS X,
on second glance that first long number (made up of USB vendor_id 1235 and product_id ab21) is formatted differently between linux, windows and mac. but it's easy to deduce the linux format by using PS3 controller example that appears on all three platforms in the list link
If in doubt post your string here and I will help.
I did a write-up about this process and added in the necessary stuffs for bluetooth controllers. Still haven't been able to get my Wii U Pro controller working on the pocketchip yet, but I need something if I'm going to play most games on the Pocketchip considering the arrow keys are ridiculously crappy. Up + Left is nigh impossible.
So this is the mapping string I got using the controller hooked up to a windows pc... I would need it to work on PocketC.H.I.P. though, which uses Linux.
It was a little weird because the tool uses a controller style I am not too familiar with (xbox?)... my usb controller is based on the nes style which has 8 buttons, and it skipped some directional buttons, so I had to click the "prevous" button to map those ones....Also, I think I mapped what would be the "select" button on the usb controller to be the "back" button so I hope that would not cause issues... anyways, I hope it works.
Great! You just skip the buttons you don't want to map.
You say your controller has 8 buttons but the link you provided shows a NES style controller with only four buttons and a d-pad? Maybe you have the SNES style pad which would have 8 buttons plus a d-pad?
For the d-pad either map it as the d-pad in the game tool (if it lets you map the d-pad as four individual buttons) or skip that and map it as two axes when you get to the double headed arrows on the left joystick in the config tool.
Maybe you need to redo the mapping? Make sure to skip every button except the ones you want to map. Make sure your final string has as many button pairs as you have buttons.
Let me know if it's different this time around.
Anyway, my informed guess for you is a string that starts:
Anyway, the important thing is that we "just" need to convert 79001100000000000000504944564944 part from Windows format string to one that will work on Linux.
to show my working, here are the values for PS3 controller:
4c050000000000006802000000000000 (Mac OS X)
my values for PS3 are...
vid:pid = 054c:0268
they are encoded in the strings byte swapped as 4c05 and 6802, and it's easy to spot where they are in each string format.
the part 504944564944 of the Windows string is HEX and simply translates as "PIDVID" so we can safely ignore that.
So we just need to figure out how to represent the values for your controller...
vid:pid = 0079:0011
in a Linux format string as 7900 and 1100
That's easy but the Linux string also has some extra numbers in there so I found a similar controller and am copying the other parts of the string from that.
Substituting it all in, I get:
here's where I got a bit more info:
You're not alone, randmcnasty. I got my wii u pro controller to work with an emulator, but I still can't get Pico8 to see it. I think we need to petition Zep to change how adding controllers works. I've never heard of having to add controller figurations to a file before.
@Vlek Blame SDL2 :(
@randmcnasty the "leftx" part of your string says to me that it's not mapped correctly. you've got maps for A,B,BACK/SELECT,START,UP,DOWN,LEFT,RIGHT and LEFTX.
Anyway, I just discovered a linux app to generate the config. Try this!
Boy, this stuff is complicated for a noob like me... I had to take a break for a day or two and now, coming back to it, I still don't understand.
Do I have to type that into my Linux terminal after sudo apt-get (or whatever)?
Also, I don't understand anything from the links and I don't know what to do..... Sometimes I click on something and it takes me to the same page, or I click on something and it gives me a 404 error.
I appreciate all your help(and patience!)
Hey no worries.
Basically, the way things work on Linux is that you have to install any tools or apps yourself. With PocketCHIP there's a bunch of stuff already installed, like Pico-8.
Maybe the tool we need is installed? Try typing:
...at the command line.
If you get "command not found" or similar, then you need to install it yourself.
This can be done two ways:
- Download source and compile to get the executable file
- Install the executable file using a package manager
And those two are explained elsewhere but the links above provide information to help.
At this point we really need somebody with a PocketCHIP and prior Linux knowledge to help us out.
Yeah, "command not found"...
I asked about this same question on the C.H.I.P. forums and didn't really get any good answers :(
I'm going to email the guys at NextThingCo. and see what they say... I will also check with a buddy of mine who uses Linux.
So, I "sort of" got my controller to work using some info I got from someone over at the C.H.I.P. forums... The only problem is that both the "A" and "B" buttons do the same thing... they both control the "X" button in Pico-8, and so I have no control for the "Z" button... It may be an issue with the particular controller I am using though... Currently I am awaiting a response over there to see if it is the same issue they are having with a different "nes style" controller...
For more info, check out the post here:
OK, I tried to map from using the Windows version and copied it to the Linux section of the db file. Only thing that worked on there was select as the ESC button. Here is my mapping:
79000418000000000000504944564944,NES/FC/SFC Joypad To USB BOX,a:b1,b:b0,back:b6,start:b7,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,platform:Linux,
79000418000000000000504944564944,NES/FC/SFC Joypad To USB BOX,a:b1,b:b0,back:b6,start:b7,dpup:b12,dpdown:b14,dpleft:b15,dpright:b13,platform:Linux,
Both Windows and jtest-gtk are registering the dpad as buttons and hat, simultaneously. So it's 2 things here... can't figure out the string and how to handle the mapping when it registers 2 different things at the same time.
Alternatively, here is my USB to Wii adapter with my Classic controller:
791d0103000000000000504944564944,Dual Box WII,a:b2,b:b1,x:b3,y:b0,back:b8,guide:b10,start:b9,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7,platform:Linux,
Nothing works on this one
Update: Looked through the other controllers in the db... Able to connect my Ouya controller to it and play some nes roms via Mednafen with that controller. Went back into Pico-8 and still nothing. I did notice there is a keyconfig option but I can't seem to hit a del key without connecting an external keyboard, and I'm not up to it this late to see if that's actually my issue. More after I get out of work tomorrow.
@matt of course! As i mentioned in my original post, I copied the text to my file and Select was the only thing reacting as my ESC key... Nothing else. That was my NES controller to that USB BOX. (Sorry, I was referring to the SDL file to the database file... interchangeable-sh ;) )
I have the same problem on pocketchip. What i don't understand is the same controllers (a cheap snes clone and a 8bitdo fc30 pro) are working perfectly, without any configuration, on my Linux computer. I ve copied the sdl conf but it's the same. I'll look at the configuration tool.
I've tried the gamepadtool but it's only for windows (and mac), it's sort of working with wine but I don't think the mappings are correct.
I've also tried my official Sony PS3 controller (which is also working out of the box on pico8 on different linux computers), with the sdl_controllers.txt file in the ~/.lexaloffle/pico-8 folder, and there is no response as well (the sdl_controllers.txt file is empty on the other computers, which doesn't prevent to work ok on them btw).
Something is probably missing in the pico8 build for pocketchip (or on the pocketchip itself). I've installed all I could which was related to sdl2.
I see with lsmod that hid_sony was loaded (but for led_class which is probably useless). I've also loaded manually hid_generic , usbhid and hid.
If I "cat /dev/input/js0" I can see data when I press on the gamepad.
 Ark, I see now the problem was we need to START PICO8 TWICE to make it work, see https://bbs.nextthing.co/t/usb-controller-for-pico-8-on-pocketc-h-i-p/5077/11
[Please log in to post a comment]