Log In  

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.

P#23064 2016-06-17 14:10 ( Edited 2017-03-12 06:25)

have you added a mapping to your sdl_controllers.txt (in ~/.lexaloffle/pico-8)?

P#23084 2016-06-17 18:18 ( Edited 2016-06-17 22:18)
:: mrh

How is the PocketChip with Pico-8? I was thinking of ordering one.

P#23085 2016-06-17 19:02 ( Edited 2016-06-17 23:02)

And in particular, how is the super-ultra-clicky keyboard? How comfortable is it for playing games (there is no D-pad, but keys arranged in a + shape)? What about typing (PICO-8 code, of course…)?

P#23092 2016-06-17 21:40 ( Edited 2016-06-18 01:40)

@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.

P#23127 2016-06-18 14:59 ( Edited 2016-06-18 18:59)

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...


P#23128 2016-06-18 15:12 ( Edited 2016-06-18 19:20)
:: matt

That controller isn't in the SDL database:

so you need to do a couple of things to get it working:

  1. Download SDL gamepad tool
  2. Run it and create a new mapping (sometimes d-pad maps to left analog depending on if it reports axis or buttons)
  3. Copy mapping string and paste it into Pico-8 sdl_controllers.txt
  4. 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?

P#23134 2016-06-18 16:51 ( Edited 2016-06-18 21:09)

Great info, but it looks like the Linux version of SDL gamepad tool is "coming soon" according to the link (?)

P#23135 2016-06-18 17:10 ( Edited 2016-06-18 21:10)

Do you think it would be difficult to mount together a controller and a PocketCHIP?

P#23137 2016-06-18 17:17 ( Edited 2016-06-18 21:17)
:: matt

@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.

P#23159 2016-06-18 21:35 ( Edited 2016-06-19 01:36)

Yes, I do have access to a pc... So I just get use my pc to get the values, then type those into the ...controllers.txt on my PocketC.H.I.P?

P#23162 2016-06-18 22:40 ( Edited 2016-06-19 02:40)
:: matt

Yes, though I'd recommend cut and paste or file transfer rather than typing it. Whatever is easiest and least error prone for you.

P#23191 2016-06-19 06:32 ( Edited 2016-06-19 10:32)

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.

P#23203 2016-06-19 10:56 ( Edited 2016-06-19 14:56)
:: matt


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

SFC30 Joystick,
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.

P#23236 2016-06-19 15:25 ( Edited 2016-06-19 19:26)
:: Vlek

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.

P#23284 2016-06-20 11:02 ( Edited 2016-06-20 15:02)
:: matt

Great, thanks for that.

P#23301 2016-06-20 14:47 ( Edited 2016-06-20 18:47)
:: Vlek

Is there any way to check if pico-8 accepts the sdl button layout that was added to sdl_controllers.txt?

P#23313 2016-06-20 16:08 ( Edited 2016-06-20 20:08)
:: matt

You mean other than pressing buttons on the customer whilst in a game?

P#23359 2016-06-21 10:03 ( Edited 2016-06-21 14:03)

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.

79001100000000000000504944564944,USB Gamepad1,a:b2,b:b1,back:b8,start:b9,dpup:a4,dpdown:a0,dpleft:a1,dpright:a2,leftx:a3,platform:Windows,

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.

P#23360 2016-06-21 10:34 ( Edited 2016-06-21 14:34)
:: matt

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:

my notes:

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:
4c056802000000000000504944564944 (Windows)
4c050000000000006802000000000000 (Mac OS X)
030000004c0500006802000011010000 (Linux)

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.

0300000000f000000300000000010000,RetroUSB.com RetroPad,a:b1,b:b5,x:b0,y:b4,back:b2,start:b3,leftshoulder:b6,rightshoulder:b7,leftx:a0,lefty:a1,platform:Linux,

Substituting it all in, I get:

here's where I got a bit more info:

P#23397 2016-06-21 14:17 ( Edited 2016-06-21 18:28)

here is what i pasted... it is not working :[

03000000790000001100000000010000,USB Gamepad1,a:b2,b:b1,back:b8,start:b9,dpup:a4,dpdown:a0,dpleft:a1,dpright:a2,leftx:a3,platform:Linux,

P#23436 2016-06-22 09:45 ( Edited 2016-06-22 13:45)
:: Vlek

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.

P#23437 2016-06-22 11:52 ( Edited 2016-06-22 15:52)
:: matt

@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!



P#23438 2016-06-22 13:13 ( Edited 2016-06-22 17:22)

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.

What is:


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!)

P#23544 2016-06-24 10:18 ( Edited 2016-06-24 14:18)
:: matt

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:

  1. Download source and compile to get the executable file
  2. 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.

P#23547 2016-06-24 11:25 ( Edited 2016-06-24 15:27)

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.

P#23551 2016-06-24 11:56 ( Edited 2016-06-24 15:56)
:: matt

If I can get the same controller as you, cheap and quick, I'll buy one.

P#23571 2016-06-24 18:52 ( Edited 2016-06-24 22:52)

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:


P#25457 2016-07-17 14:35 ( Edited 2016-07-17 18:35)
:: matt

Progress! Nice.

I'm not really sure what to suggest to get A and B behaving differently, they seem to be mapped differently.

Sorry! I'll keep thinking.

P#25472 2016-07-17 20:12 ( Edited 2016-07-18 00:12)

I got this iBuffalo controller (looks like a Super Famicom controller) that was recommended and it works perfectly!!! This makes Pico-8 sooo much easier to play on PocketC.H.I.P!

P#25881 2016-07-26 00:54 ( Edited 2016-07-26 04:54)

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.

P#26249 2016-08-01 02:26 ( Edited 2016-08-01 08:00)
:: matt

Are you actually putting the line for your controller in the sdl_controllers.txt file in your Pico-8 config directory?

P#26329 2016-08-02 12:01 ( Edited 2016-08-02 16:01)

randmcnasty how did you get the iBuffalo controller working? Did it just work when you plugged it in or do you need to install anything? Also do both of the pico8 buttons work on it?

P#26808 2016-08-12 15:02 ( Edited 2016-08-12 19:02)

@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 ;) )

P#26928 2016-08-15 01:23 ( Edited 2016-08-15 05:23)

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.

P#26971 2016-08-16 00:09 ( Edited 2016-08-16 04:09)

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.

[edit] 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

P#26980 2016-08-16 04:10 ( Edited 2016-08-16 08:41)
:: termit

SDL2 GamepadTool now available for linux too: http://www.generalarcade.com/gamepadtool/linux/

P#38181 2017-03-12 01:25 ( Edited 2017-03-12 06:25)

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-05-18 08:27:16 | 0.063s | Q:63