Configuring a trackball and spinner with Retropie — Micro Center

Configuring a trackball and spinner with Retropie

edited October 7 in Retro Arcade/Gaming

Recently I've been taking a look at one of our new products, the Atari USB Spinner. The Atari USB Spinner can replace one of the arcade buttons, or it can be mounted in a 1 1/8” hole drilled in the control panel. It's connected to your Rapberry Pi or other computer via USB and acts as a mouse. This article focuses on configuring your games so you can use both the trackball and spinner. Although I’m using the Ultimate Fight Stick with Trackball, these instructions will work for any setup with both a trackball and spinner such as a full size cabinet with a trackball installed.


If you’re using a controller without a trackball the spinner is plug and play, but getting both the trackball and spinner working together takes a little more work. Before we get started I want to explain the technical issue using both at once causes- skip the next paragraph if you just want to get to the fix.

The trackball and spinner are both seen by the Raspberry Pi as a mouse. The trackball is essentially an old school ball mouse flipped upside down, and the spinner uses an optical encoder and microcontroller to emulate a mouse that only provides one dimension of motion. These devices are known to the Linux side of the Raspberry Pi as “mouse1” and “mouse0”. Each game listens to one mouse at a time. The default global setting is mouse0. Since we want some games to listen to mouse0 and some to listen to mouse1, we need to create per game configuration files for each game that should be using mouse1. While there is a way to get the names of each mouse used by the Linux operating system from the command line, Retroarch (the program running the emulators) aliases the mice differently so it’s best to determine which device is which by plugging both in and loading up a game.

The instructions below were written for Micro Center’s Retropie image that is distributed with our retro gaming kits (like the Atari Pi Kit and Stand Up Arcade kits) and the Atari Games SD card. These instructions might not work perfectly for other images, but should give you a good starting point.

In addition to a Retropie setup you’ll also need a USB keyboard connected to the Raspberry Pi. You can also SSH into the Pi using terminal on Linux or macOS or PuTTy, WSL, or another terminal or SSH program on Windows, but setting up an SSH connection won't be covered in this guide.

First, we need to identify which device is the default. Hook up both the spinner and track ball with the system powered off, then boot it up. You can determine which device is the default by opening a game like Avalanche or Crystal Castles and trying both controllers. One should allow you to move, and one should be unresponsive. Make note of which one works, as this is the default “mouse” with index 0. In my case this was the track ball, so I’ll be creating config files for games I want to play with the spinner. If neither are working, it's possible you've selected a game that doesn't support mouse inputs. Many home consoles (Like the Atari 2600) will not work with either controller. Exit the game and return to the main menu.

From the main menu press shift+f4 on your keyboard. This will open the terminal. You should see some ASCII art, system information, and a flashing cursor at the end of a line that says [email protected]:


Most of the screenshots in this guide end with the command raspi2png –p screenshots/#.png. You can ignore these lines, it’s just the command I used to take screenshots of the terminal.

Type the following command, which will move us into the directory our roms are stored in:

cd RetroPie/roms

Next, type ls to get a list of files and sub directories in this directory. You should see a sub directory for each game system:
Type cd <system name> to get into the sub directory of the system you want to create a config for. In my case I’ll be creating a config file for the arcade game Avalanche, so I’ll use the command cd arcade. Now that we’re in the sub directory for our game system, we can see a list of the games we have installed using ls.

We’ll use nano to create a new file, so use the command below to open an empty file for our game:

nano <game name>.cfg

Nano is a command line text editor that’s great for quick changes like these. Make sure the file extension for the rom (.zip in the case of arcade games) and .cfg are included in the filename. In my case, I used nano avalnche.zip.cfg. Note the misspelling of “avalanche”- this is how the rom is named, and it’s important to use the exact name of the rom.

After running this command you should be greeted by a mostly empty window. There will be a list of commands at the bottom and a banner at the top that says “GNU Nano” and the file name, like this:

This is our empty file. Add the following lines:

input_player1_mouse_index = “2”

config_save_on_exit = false

This tells our game to listen to the mouse with index 2, and not to overwrite the config file when the game is exited. Press ctrl+x to exit nano, press y to save changes, and press enter to save the file. You can verify the file was created using `ls`. Reboot the system from the command line with this command:

sudo reboot

Load up the game you just configured and try out the controllers. Your default controller should be unresponsive, but the second controller should work now. In my case I could move the tower in Avalanche with the joystick or spinner, but not the trackball.

Creating files for more games is even easier. The cp command lets us make a copy of a file. All we need to do is use cd to get back into the directory our games are stored in and copy the config file we just made. For example, I wanted to use the spinner for Tempest as well, so I used the following commands:

cd RetroPie/roms/arcade

cp avalanche.zip.cfg tempest.zip.cfg

Here I’ve used the ls command before and after using cp to duplicate a config file. This let me verify the copy was successfully created:


Those of you with a bit of Linux experience might be tempted to find the mouse indexes in /dev/input/, but I found the information listed here doesn’t match the index used by Retroarch. Retroarch assigns its own indexes to the mice which don’t match the indexes assigned by Linux.

The new spinner feels much more natural for games that only involve 1 dimension of movement like Tempest and Avalanche, but isn’t great for games like Crystal Castles that involve 2 dimensional movement. Having both mounted in your cabinet is the best of both worlds, and a few minutes of configuration is all it takes to get both controllers up and running.


Comments

  • I will be buying this shortly to try it, and will report back.
    Very cool to see these quality controls for reasonable prices.
  • edited October 17
    I've wanted to add the AtGames Ultimate Legends Arcade cabinet, because it "just works". All the controls you need, ability to add lots of game ROMS, with none of the headaches of wrestling with Raspberry Pi and associated software emulations. However, I don't have the space for this cabinet, so I'm picking up the Legends Gamer Pro control panel instead.  All the features, but portable. However, the one thing the Ultimate Legends cabinet has that the Gamer Pro is missing is a spinner. I'm trying to determine whether there is a way to drop this Atari USB spinner into this control panel somehow (either removing one of the 7th or 8th buttons from the panel and replacing with the spinner, or drilling one additional hole near the trackball area for it). and just plugging the spinner into the available USB on the back of the panel.  Does anyone with experience with the AtGames Legends products and this Atari USB spinner know whether the Legends will detect this added controller and allow me to use it for the select games that need it to play properly?  https://www.samsclub.com/p/legends-gamer-pro-se-tabletop-arcade/prod24923281?xid=plp_product_1

  • got the spinner today:

    package:
    =============
    contains the spinner top, spinner bottom part with connector, 1 connector pcb-> usb

     

    Installation:
    ----------------------------------
    choose a button to replace or drill hole in panel

    1) unlock and open up panel
    2) locate button, and disconnect wiring to button
    3) unscrew washer around button, and unscrew the button
    4) attach connecter with USB to bottom of spinner
    5) thread spinner through the button hole
    6) tighten washer to secure spinner
    7) put spinner top on shaft

     
    ===============================
    thoughts and quick tests
     its a very sturdy and heavy duty spinner, good weight
    and spins very freely.

     looks good with the atari symbol on it. and the ridges
    on the side make for a good grip
    its very silent.

     test
    ===================
    ran a quick test on MAME for windows.
    the spinner is recognized as a mouse input.
    fired up tempest, adjust the settings and sensitivity
    to the lowest, and was able to play just fine.

     further tweaks for other games will be needed.
    will be testing it out on the xbox one with tempest also.

     recommendation:
    ==================
    price / value is definitely worth it, and the fact you don't
    have to drill into a panel makes it superior just for that.
    no tools are needed to install, and no maintenace afterwards.
    good value, and sturdy build make it worth $49.99

    recommended  5/5 stars
    later
    -1
  • negative1negative1
    edited October 18
    The total length of spinner and controller is about 2 1/2 inches.

    Here is a comparison with the normal button:




    here it is inside:
    -------------------




    later
    -1
  • @negative1 Thanks for taking the time to write up your experience and upload the detailed pictures! I'm glad to hear you're enjoying the product.
Sign In or Register to comment.