3 Home
Brad Grantham edited this page 2019-10-15 10:57:17 -07:00

Welcome to the apple2e wiki!

Joystick support

interface.cpp reads four numbers from joystick.ini. These correspond on your joystick / joypad / gamepad to the GLFW axes you want to use as Apple ][ joystick X and Y axes and the GLFW buttons you want to use for Apple ][ left and right button. apple2e uses the GLFW windowing and event library for joystick input, and there may be no obvious mapping from the thumbstick and buttons on your gamepad to GLFW axis and button numbers.

Here's an example that I use for my Samsung EI-GP20:

3 4 1 3

That means that I'm using whatever GLFW thinks are axes 3 and 4 and buttons 1 and 3 for my Apple paddle and button inputs.

I don't have a good configuration process for getting these numbers. The only thing I have so far is to have interface.cpp print out the active axes and buttons as you move your joystick and press buttons. To do this, set the environment variable PROBE_JOYSTICKS. When apple2e starts up, move your thumbstick in X (to the left and right). With my gamepad, I something like the following:

Axis 3: -0.890196
Axis 3: -0.027455
Axis 3: 0.043137

That means that I use axis "3" for my Apple ][ joystick X (paddle 0). You may see a different number Move the thumbstick in Y (up and down) to get the Y axis. I see something like:

Axis 4: -0.819608
Axis 4: -0.811765
Axis 4: -0.803922

So axis "4" is my joystick Y. Press your button 1 and 2 to get your button numbers. I get:

Button 1: pressed
Button 1: pressed
Button 1: pressed
Button 1: pressed
Button 3: pressed
Button 3: pressed

So in my joystick.ini, I put 3 4 1 3. Place your X and Y axis and button 1 and 2 numbers in your joystick.ini.

  1. If your thumbstick/joystick is loose, you may get a little of the other axis motion printed interleaved with the axis you're trying to test.
  2. Sometimes, for me, my gamepad connects up with different axes for the thumbstick. This is rare, but is annoying when it does happen
  3. Finding your configuration by probing it is pretty sketchy.

I know this isn't ideal. Probably what I need is a special calibration GUI that you could run at any time and save off the result.