Page 1 of 1

Getting the 8bitdo SFC30 to work with FreePie?

Posted: Wed Sep 26, 2018 5:14 pm
by Moromillas
Hi,

I just got a new controller, the SFC30 (I think they changed the name to just "SF" at one point) by 8bitdo, and I'm having a hell of a time trying to get it working with FreePie.

Trying to do a simple diagnostics.watch() and go from there, but the only inputs seem to be xbox360[0]?
Tried loading up x360ce but it doesn't seem compatible with FreePie?

I've tried a ton of searches.
Any ideas for getting this working?

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Wed Sep 26, 2018 9:29 pm
by Moromillas
I got it working.
I used joystick[1] instead of xbox360[0] and it worked.

For anyone stumbling across this via a search, here's my code:

Code: Select all

def ini():
	speech.say("penis")

def keymap(b, k):
	if b:
		keyboard.setKeyDown(k)
	else:
		keyboard.setKeyUp(k)

def stickmap(b, a, k):
	if b == a:
		keyboard.setKeyDown(k)
	else:
		keyboard.setKeyUp(k)

def buttons():
	keymap(joystick[1].getDown(0),		Key.B)			#B
	keymap(joystick[1].getDown(1),		Key.A)			#A
	keymap(joystick[1].getDown(2),		Key.Y)			#Y
	keymap(joystick[1].getDown(3),		Key.X)			#X

	keymap(joystick[1].getDown(4),		Key.L)			#L
	keymap(joystick[1].getDown(5),		Key.R)			#R

	keymap(joystick[1].getDown(6),		Key.Backspace)	#Select
	keymap(joystick[1].getDown(7),		Key.Return)		#Start

def sticks():
	stickmap(joystick[1].y,		-1000,		Key.UpArrow)		#Dpad Up
	stickmap(joystick[1].y,		1000,		Key.DownArrow)		#Dpad Down
	stickmap(joystick[1].x,		-1000,		Key.LeftArrow)		#Dpad Left
	stickmap(joystick[1].x,		1000,		Key.RightArrow)		#Dpad Right

if starting:
	ini()

buttons()
sticks()



diagnostics.watch(joystick[1].getDown(0))		#B
diagnostics.watch(joystick[1].getDown(1))		#A
diagnostics.watch(joystick[1].getDown(2))		#Y
diagnostics.watch(joystick[1].getDown(3))		#X
diagnostics.watch(joystick[1].getDown(4))		#L
diagnostics.watch(joystick[1].getDown(5))		#R
diagnostics.watch(joystick[1].getDown(6))		#Select
diagnostics.watch(joystick[1].getDown(7))		#Start

diagnostics.watch(joystick[1].y)				#Dpad Y
diagnostics.watch(joystick[1].x)				#Dpad X
Have a good one.

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Thu Sep 27, 2018 5:37 am
by Jabberwock
SFC30 by default provides DirectInput, not XInput. That is why joystick[] is needed. By the way, you can refer to it by name as well, e.g. joystick["Your Controller Name"], so that the script is not confused if you attach and detach more controllers.

To switch to XInput you need to do this:
Alternatively, you can also hold the X-button while powering on your controller to use Xinput without having to install Xpad(as long as you are using the latest firmware for your controller). This will basically make every program recognise your controller as if it were an XBOX 360 controller.
according to this post:

https://www.reddit.com/r/8bitdo/comment ... _sfc30_as/

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Thu Sep 27, 2018 11:13 am
by Moromillas
Ok, I got it paired as an XInput controller.

You actually have to re-register a new controller, and it's more pressing both X and start for about a second, then releasing both. Then the LED does a double blink for XInput pairing.

It shows up as "8bitdo SFC30(x)" and pairs as "Xbox Bluetooth Gamepad". But here's the thing though... In FreePie, the xbox360[] inputs don't register anything, and instead of joystick[1], it's now joystick[0].
Weird hey.

Perhaps there's something wrong with the drivers. I'm going to try ripping out all the HID drivers and Bluetooth drivers out, installing Toshiba again and starting from scratch. ...Tomorrow.

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Thu Sep 27, 2018 12:58 pm
by Jabberwock
I am not sure all XInput is seen by the plugin as XBox360 controller... What is wrong with using joystick[]?

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Thu Sep 27, 2018 4:02 pm
by Moromillas
Well, there's nothing wrong with it. It works fine, for the SFC30.

I figured it's a good idea to get it working for other 8bitdo controllers.
Some of them have 2 joysticks and a dpad, and joystick[] only has the one x and y.

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Thu Sep 27, 2018 11:40 pm
by Jabberwock
joystick[] supports as many axes as Windows does, they are only named differently (rz, xRotation, sliders[0] etc.). It also supports the hat (which some controllers map the dpad to).

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Fri Sep 28, 2018 4:12 am
by Moromillas
Ah, I didn't know joystick[] could do that, I've not used it before, just xbox360[].

I also found the location of the proper names of the joysticks, from a post you made 4 years ago.
Thanks for that.

It's in:
HKEY_CURRENT_USER\System\CurrentControlSet\Control\MediaProperties\PrivateProperties\Joystick\OEM\
somewhere.
But, all the controllers, they're all named "Bluetooth HID Port" under OEMName.
Fortunately, you can just modify that to whatever name you like. So you modify one of them. Then test if that's the controller you're trying to program for.

Re: Getting the 8bitdo SFC30 to work with FreePie?

Posted: Fri Sep 28, 2018 5:48 am
by Jabberwock
If you type in „joystick[0].” you get the autocompletion list, so you can check out what properties and methods the given entity has. Unfortunately, it does not work with joystick names.

I am glad that you find that info useful. freePIE is so useful (and fun) for me, that I try to help any way I can. Alas, I am not much of a programmer...