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.

4


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


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


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…)?


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

TIA


That controller isn't in the SDL database:
https://github.com/gabomdq/SDL_GameControllerDB?files=1

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?


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


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


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


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?


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


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.


Sure!

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.


Great, thanks for that.


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


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


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.


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:
03000000790000001100000000010000

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:
03000000790000001100000000010000

here's where I got a bit more info:
http://forums.nesdev.com/viewtopic.php?f=5&t=10793


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,


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!

SDL/test/controllermap.c

https://wiki.archlinux.org/index.php/Gamepad#Joystick_not_working_in_FNA.2FSDL_based_games
https://steamcommunity.com/sharedfiles/filedetails/?id=530593095
https://aur.archlinux.org/packages/controllermap/


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:

SDL/test/controllermap.c

?
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:

controllermap

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


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.


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


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:

https://bbs.nextthing.co/t/usb-controller-for-pico-8-on-pocketc-h-i-p/5077


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.


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!


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,

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


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


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?


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

[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


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


Necro post, but I recently was trying to connect an 8BitDo and documented my experience.



[Please log in to post a comment]