Raspberry Pi Setup Guide

From Sinden Lightgun
Revision as of 19:06, 19 April 2024 by Widge (talk | contribs) (→‎Installation)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Setting up your Raspberry Pi to run BareBones 9

BareBones 9 is the community-made image that is pre-configured to let you get you up, running and ready to play your favourite lightgun games on the Rasperry Pi 4.

Version 9 has been designed with the idea that most people would like to have a mixed bag of lightgun and non-lightgun games on their system so particular attention needs to be given to the way that your games are named and the locations where they are placed on your SD card.

Version 9 also has the following additional features:

  • RetroArch 1.10’s fullscreen border;
  • A fix to a bug in RetroArch 1.10 whereby the Y-axis is not treated correctly;
  • Bezels for the majority of lightgun games;
  • Generic bezels for non-lightgun games, including some dynamic bezels;
  • Pre-set and applied configurations and settings for all known-working games;
  • StormedBubbles versions of MAME emulators featuring quality-of-life hacks and fixes for many games;
  • Version 1.8 Sinden Lightgun drivers;
  • Exclusive Golly Ghost scoreboard for 16:9 screens;
  • A brand new Sinden Lightgun menu and calibration screen;
  • A category for plug-n-play games;
  • And much more!

Please note that the following guide is a work in progress.

Requirements

Sinden Lightguns
Sinden Lightguns

You will need:

  • a Raspberry Pi 4, any of the variants will do, the amount of RAM will make no difference.
  • adequate cooling (a fan and heatsinks should do)
  • A suitable power supply for your Pi that is capable of delivering 5V @ 3A, preferably the official Raspberry Pi power supply
  • A micro-SD card, minimum 16GB capacity, but the more space you have, the more games you can install.
  • An HDMI to micro-HDMI cable for connecting to your TV.
  • A USB game controller
  • A Sinden Lightgun

Video guide for visual people

Raspberry Pi4 Sinden Lightgun image -  BareBones v9 install, setup and calibration with demos

Installation

Download the latest BareBones 9.1 image from Mediafire or OneDrive. Filename bb9.1.img.xz md5 checksum 4F6A8C0EBA484C9B708D4F1CEE25B70A 

(The older BB9.0 can still be downloaded from Mediafire or OneDrive, however we strongly recommend using the newer 9.1 image which includes bug fixes and improvements).

There's no need to extract the .img file from the .xz. Use software such as BalenaEtcher or Raspberry Pi Imager to then flash the image to your micro-SD card. The two programs mentioned are capable of writing the image without extracting from the compressed .xz file, but if your image fails to work then it might be more reliable to extract the .img file and reflash it.

Running for the first time

Make sure you connect the micro-HDMI cable to the port closest to the USB-C power socket on the board

Once you have your freshly flashed card, carefully slot it into the Micro-SD slot in your pi.

Connect the TV to your pi ensuring that you plug the cable into the micro-HDMI port that is nearest to the USB-C port on the pi. Be mindful that some cases (notably Argon cases) might rearrange the order of the ports, if your pi boots up to a blank screen, or just some plain text, try the other HDMI port.

The USB boot order on a Raspberry Pi

Connect your Sinden Lightgun(s) to the pi. The player order is determined by the USB port so connect them in this order – 1. top-right (blue), 2. bottom-right (blue), 3. top left (black), 4. bottom-left (black).

Connect the USB controller into any other USB port

Plug the power supply into the USB-C port.

Once the power supply is connected, the raspberry pi will boot up. On first boot, the images filesystem will self-expand to fill the whole SD card so it may take a little longer than usual to boot the first time.

When the pi has finished booting you will be asked to configure your game controller. Hold any button on your controller to start configuring the buttons then follow the prompts on-screen. Do not attempt to configure your Sinden Lightgun as a controller!

Once that’s done you’ll be presented with the EmulationStation front end and you will see the Sinden Lightgun collection available.

At this point we recommend that you then connect your Raspberry Pi to your local Wi-Fi as this will likely be the primary way you will transfer games onto your system. You can do this by going to the RetroPie group and the Wi-Fi settings option in the list.

We strongly advise you not to update RetroPie or Retroarch, as doing so may break the functionality of BareBones.

Calibrating your gun(s)

The calibration screen in Barebones 9

In the Sinden Lightgun menu you will see a “Test and Calibration” sub-menu. Enter it then select the test for the port number (as specified above) for the gun you want to calibrate. If a gun is connected, it will load the calibration screen.

Look down the iron sights to see if the mouse cursor lines up with the sights. If not, follow the advice on screen to calibrate the gun. The gun’s X and Y offset calibration will be saved to the gun when you exit the utility.

If the cursor dances around the screen apparently randomly, then this probably means that your gun’s camera is having difficulty seeing the on-screen border. Follow the advice in the Troubleshooting section of the wiki to remedy this.

Installing BIOS and Games

We wish we could provide you with the complete package all ready to go, but unfortunately we cannot legally provide you with the BIOS files and gameROMs you need. So you’ll need to find these on your own.

Some systems require BIOS files to run games properly. Refer to the RetroPie documentation at https://retropie.org.uk/docs/ to find out what BIOS files are expected by each emulator and exactly where to place them. Most console BIOS files go directly in the /home/pi/RetroPie/BIOS folder with few exceptions.

In order for the preset BareBones configuration files to be effective you need to follow two rules :

  • the games need to be named correctly according to the no-intro naming convention; and
  • they need to be placed in the correct locations.

First, we’ll deal with the location. In the /home/pi/RetroPie/roms folder you will find the subfolders for each system supported (and many others). Some of those system folders have a subfolder called Lightgun_Games or similar (the Sega systems have slight differences to the name which is important for the configurations to distinguish between them as they use the same emulator). Lightgun games for those systems should be placed in the Lightgun_Games subfolders.

All systems that require it will have this folder already in place for you. Daphne is an exception to this which uses Actionmax and Hypseus emulators which do not play nicely with subfolders, so daphne games should be set up as per the existing guidance in the wiki.

Secondly, the filenames must match what the config files are expecting. We’ve decided to go with the no-intro naming scheme here as a widely recognised standard. Check the compatibility list for the filenames expected. The only Retroarch-based exceptions here are the C64 system and Tic-80. As far as we know there is one online source that provides a working set of C64 lightgun games and we decided to match the filenames from that set for simplicity’s sake, and Tic-80 doesn't follow no-intro naming, so we didn't deviate from the filenames as they are named on the Tic-80 site from where they can be downloaded. Daphne also doesn’t require this rule to be adhered to as it is not a Retroarch-based system.

Barebones has been pre-configured to use the most appropriate and best-performing emulator for MAME-based arcade games, and as different arcade emulators require ROMs from different ROMsets it is important to make sure you use the correct ROMs. Using a ROM from a mismatched set may result in poor performance or a non-working game. Check the compatibility list for the correct ROMset versions needed for each game and any additional files that arcade games might require.

Any non-lightgun games you’d like to add can go in the main folder for the system.

After you add games, restart EmulationStation so it will refresh the games lists and you will find any systems that you’ve added games to will now be visible and selectable in EmulationStation.

When you launch a Lightgun Game, if it has a game-specific config file, that games configuration will be loaded up, along with its bezel and border. If the game doesn’t have a specific config file then it will load the generic config, bezel and border for Lightgun Games of that system. And if you load a non-lightgun game it will, that game will load with a borderless generic bezel for that system.

Playing Games

Before you start playing any lightgun games you must first “start” the guns. Go into the Sinden Lightgun category of EmulationStation. You can choose to start all connected guns at once using any of the Start All… options for either no-recoil, single-shot-recoil or automatic-recoil.

If you have multiple guns connected and each player wants a different recoil option, perhaps one of you prefers not to have recoil while the other does, then you can go into the Start Guns Individually subfolder and start the appropriate configuration for each gun individually.

If you make a mistake and start the wrong process, you will need to stop the gun process you started before starting the correct one. So run the Stop script to stop all processes, then start your guns again.

Once your guns are started, now you can launch the game you want to play. If everything went to plan, when the game launches you should be able to get straight into playing a game.

If you find your guns don’t respond at all try and exit the game, run the Stop guns script then run a Start All script. Restart the game – If your guns work then perhaps you started the wrong script before. Otherwise, if your guns still don’t work, explore the troubleshooting section for further advice.

If your guns do work but they don’t respond very well, you may need to refine your gun cameras settings, and/or the brightness/contrast settings of your TV. Refer to the troubleshooting section of the wiki for further advice.

Overscan

Example of a display with bad overscan settings. Note that you cannot see the white border and part of the image, including the game's title is cut off.
Example of a display with good overscan settings. The white border is clearly visible around the edges and fits neatly within the TV's frame.

Overscan is a behaviour in certain television sets, in which part of the input picture is shown outside of the visible bounds of the screen. If you start a game and you can see bezels but no border then your TV is not displaying the whole image, but actually cropping off the edges. Follow the advice in the FAQ to resolve this.

Overclocking

Whilst your Pi, as it is, can run many games, there are a few games that would benefit from the extra performance that can be gained from overclocking the CPU and GPU. Bear in mind that the Raspberry Pi is a low-cost computer with limited capability, we've tried our best to get as much working as possible, but an overclock may be necessary for some of those outliers.

For advice on overclocking your Pi, please read the detailed section in the FAQ.

What if I do something wrong!?

If you accidentally delete or change one of the config files and want to restore it to its original state, backups of the config files are available an Widge's github repository. You can also download a zip of the whole repo using this link: https://github.com/Widge-5/sinden-barebones-configs/archive/refs/heads/main.zip

Upgrading from BB9.0 to BB9.1

What changes are applied in the update?

  • Fix to Player 2 button configurations on recoil scripts;
  • Functionality to change border thickness of retroarch-games in-game, with hotkey+GunBackRight button combo;
  • Fix to rom folder ownership permissions which prevented the addition of roms in some folders;
  • Reinstall of usbromservice, to fix the non-functioning auto-mounting USB drives feature;
  • Updated lr-mame2003-plus which fixes alignment in Maximum Force;
  • Updated StormedBubbles versions of the mame cores which introduces support for following ARCADE games:
    • Avalanche, Bomb Bee, Battle Shark, Cutie Q, Destroyer, Gee Bee, Lock On, Monkey Magic, Seawolf, Seawolf 2, Space Harrier, Sky Raider, Tail Gunner, Top Gunner, Wild Pilot;
  • lr-mame-StormedBubbles pre-assigned as the emulator to run the above newly supported games.;
  • Corrections to emulators designated to run the following ARCADE games:
    • Firefox (lr-mame2010-StormedBubbles), Point Blank 2 (lr-mame2010-StormedBubbles), Sports Shooting USA (lr-flycast);
  • An update script at /home/pi/SBupdater.sh which you can run at any time in the future to ensure you are using the latest StormedBubbles MAME versions.
  • A readme.txt file in the daphne rom folder with advice on how to set up the actionmax symbolic links.
  • Updated hypseus, actionmax and supermodel ini files with universal exit commands set
    • Depending on the controller you use, this might be start+select, L1+R1 or L2+R2 (the button code system is completely different from one controller to the next, this was the best compromise to ensure all controller types are covered)
    • Actionmax and Hypseus can also be exited by pressing the gun's d-pad right arrow. Keyboard Escape also still exits.
    • Supermodel can also be exited by pressing both gun-right-side buttons together. Keyboard Escape also still exits.
  • New precise gun calibrations applied to the following ARCADE games:
    • Sports Shooting USA, Golly Ghost, Point Blank 2, Area 51, Maximum Force, Area 51 / Maximum Force Duo, Police Trainer, Sharpshooter;
  • Corrections to button configs for a few games (e.g. Alien 3 which previously launched grenades when a coin was inserted)
  • New bezel overlays for all newly supported games and some already-supported games that were missing overlays before. (If you are using a 4:3 display and have taken steps to remove the bezels, you will need to repeat the process for the new games listed);
  • System launching images.
  • Change of colour for the barebones custom theme improving clarity of the EmulationStation front end. (If you have changed your theme to another, then you will be unaffected by this change)
  • Support for C64 port of Duck Hunt
  • Updated C64 config files which correct accuracy for most C64 games.

Before you start

In order to download and run the update, your pi needs to be connected to the internet.

Just a few commands is all it takes to update from BB9.0 to BB9.1. Ideally you should run these commands from the command line directly on the Raspberry Pi, or via SSH using PuTTY.

Be aware that not all SSH terminal utilities are created equally and we can only really vouch for PuTTY as being reliable. Some SSH utilities cause the install script to fail when downloading the new files (Windows Terminal is a known culprit), so please either use the command line on the pi itself or SSH with PuTTY.

It would be very wise to make a backup of your image beforehand in case of unexpected side effects. The update script has been thoroughly tested, but it is possible that some customisations you may have made to your image might be undone, cause conflict or have a random unknowable effect. The update is, first and foremost, an update from a standard BB9.0 image and it isn't possible to account for every personal choice and preference made so keep that in mind if you have made some significant personalisation to your barebones image.

How to run the update

If you intend to run the update form the command line interface directly on the Pi, press F4 on your keyboard to exit EmulationStation.

Or, if you plan to run it via SSH using PuTTY, log into your Pi as normal.

Then enter the following commands :

cd /home/pi/
wget https://github.com/Widge-5/sinden-barebones-configs/raw/BB-9.1/home/pi/bb91update.sh
chmod +x bb91update.sh
sudo ./bb91update.sh

You will be asked to confirm that you wish to proceed, the script will then check to ensure that you are running it on a BB9.x system before proceeding.

The script can take around 15minutes to complete but this may vary depending on your internet connection.

Upgrading from BB8 to BB9

RECOMMENDED BB9 UPGRADE INSTRUCTIONS: It's almost as simple as copying all your ROMs, media & BIOS files to a fresh BB9 image:

  1. First, back up your existing image using Win32DiskImager or equivalent backup software just in case something goes wrong during the upgrade.
  2. Before deleting your old image, copy all BIOS files, ROMs, media (if you've scraped videos, etc) and gameslist.xml file from your existing image for each of the various systems to a temporary location. Basically, you need all the files in your ../roms/[GAMESYSTEM] for each system. Ideally if you scraped videos and marquees on your old image, you selected to have the files saved in /roms/[GAMESYSTEM] within a media subfolder. If not, you'll have to locate the video/marquee files and transfer them to your new image using WinSCP, FileZilla or equivalent. If you look in the "gameslist.xml" file within a given system you should be able to tell where the scraped videos are stored and transfer them over to the new image. Worst case scenario, if you can't locate the media files, you'll have to rescrape your new BB9 image.
  3. Reflash your SD Card with the BB9 image.
  4. Boot the new BB9 image, set up wifi/LAN networking and transfer all of your BIOS files, ROMs and media to the new image, taking care to place them in the correct rom folders - take note of the advice above regarding the filenames and locations of your roms.
  5. Restart and you should be up and running.

Note: BB9 is preconfigured for some of the arcade games to work on different emulators from BB8 (e.g. lr-stormed-bubbles, lr-mame-2010,etc.);

Check the compatibility list to see what files and ROMsets are recommended for the new emulators.

As always, if you have any troubles please hit us up on the Sinden discord for help!

Some Notes on Configuring Emulators for non-BareBones builds

Nintendo DS:

  • Set core option pointer type to "touch"

Playstation:

  • Gun Calibration: If you only have one gun and the game requires you to calibrate both guns you can cheat by switching the port 2 mouse index to 0 when the time comes to calibrate the 2p gun. Once complete just remember to switch it back. You can also create a save state once you calibrate your guns so that way the next time you start the game, just restore the save state and you're past calibration!
  • Nuvee Guncon Patch: See instructions on the Justifier Patching page

TIC-80

In core options:

  • Set pointer device to touchscreen
  • Enable crop border
  • Add mouse pointer