# pinHP Arcade Image

Setup Instructions

Hardware

Make sure your Raspberry Pi does not make unwanted contact with the Pi2Jamma board. Put some electrical tape or insulating paper between your Pi2Jamma and the USB ports of the RPi to prevent damage or strange software behaviour.

All Raspberry Pi 4 models (RAM doesn't matter) are supported, a Pi 3 / 3 B / 3 B+ is recommended though. While its increased computing power makes a handful of more games playable, the changed graphics chip of the Pi 4 produces some jitter effect, displaying slightly shaking pixels. The better the monitor, the more this is visible. See an example video in this thread in the Pi2Jamma Facebook support group.

Initial software setup

Use a disk imaging program like "Win32DiskImager" (included in the distribution) to write the image file to a Micro-SD card (at least 16 GB size).

A USB flash drive containing ROMs and configuration settings is recommended, but optional. Boot with an empty, formatted USB flash drive. The system will detect it and create the folder structure automatically.

ADVANTAGES OF USING A USB FLASH DRIVE

IF FOR WHATEVER REASON YOU WANT TO RELY ON THE SYSTEM SD CARD ONLY

Pi2Jamma / Pi2SCART setup

All files required are stored inside the rpi2jamma directory on either the USB flash drive or the SD card's RPI_DATA partition. The most important subdirectory is roms_advmame - place your game ROMs there and you are good to go.

Since version 20OCT21, there are lots of options to organize games on the fly. Go to Options  Filter Games and Options  Group Games for actual filtering or grouping, Options  Filter Settings to select even more filter values: Select your favourites out of a list of 390 manufacturers, 29 genres and 10 game systems.

Outdated, but still possible:
You can manually sort ROM files into subfolders, that will also show up in the game menu. Individual display names can be set with the ".title" file inside each directory. Write the name into the file and nothing else. Names preceded by a "." (dot) will hide the directory completely, making it inaccessible from the menu. Names preceded by a "#" (hash sign) will show a blank line in the menu, but leave it accessible.

Important:
The hardware mode (Pi2Jamma or Pi2SCART) should be auto detected at boot. However, if it is not set properly, controls of a Jamma cabinet will not work or, on Pi2SCART, weird characters will flash on the screen. If for some reason your system got confused and you are not able to set or save the hardware mode via the control menu properly, you need to edit the config.ini configuration file, located inside the rpi2jamma directory on either the USB flash drive or the SD card's DATA partition. Find the entry "pi2scart_mode=" near the top of the file and set it to "Y" for Pi2SCART or "N" for Pi2Jamma operation.

Quick start

MENU CONTROLS

MAME CONTROLS

Configuration / hidden features

Select the Options menu. Advanced configuration settings are available.

If advanced settings are not visible, click into any of the empty lines between Back and About three times (slowly) within 10 seconds to activate the menu. Hide the settings menu again to keep your system childproof.

Settings are stored in "config.ini" on the USB flash drive.
Individual text can be edited in "language.ini" on the USB flash drive.

Adjust your CRT monitor hardware settings using a test card: Options  Screen Settings  Monitor Test Card.
All individual game resolutions are optimized accordingly. If the test card looks OK, games will do as well.

Subdirectories

Extended game menu / favourites

There are options to display up to three filtered game menus: "Fav. Games", "More Games" and "All Games" (Options  Game Menu Settings). Display names of those menus can be edited in "config.ini" or via the menu.

To add games e.g. to the "Fav. Games" list, click on "Select Fav. Games" (Options  Game Menu Settings). The screen turns green. Go back to the games list as if you would want to start a game. Any game selected now will be added to the "Fav. Games" list.

"Deselect Fav. Games" or "Select Autostart Game" work in the same way.

Changes are applied when leaving edit mode.

Alternatively, pushing P2-Start from the games menu adds the game to the Fav. Games list (needs to be configured from the Control Settings menu). By default, P2-Start activates the screensaver.

Lots of more individual filtering and grouping options are available from Options  Filter Games / Options  Group Games.

Autostart a game

The system can boot right into a game: Options  Game Menu Settings  Select Autostart Game.

Screensaver

You can boot directly into a screensaver: Options  System Settings  Boot into Screensaver.

The screensaver activates itself after an idle time of 10 minutes (default, can be edited in "config.ini" or via the menu) only when the menu is shown, NOT during a game. Activate "Idle Exit" in the MAME section of the configuration menu to automatically exit a MAME game (if supported by the game).

Screen orientation

Screen orientation can be set to horizontal, vertical or automatic. Automatic is useful for rotatable monitors. Options  Screen Settings  Orientation.

Quick switch of screen orientation is possible by pressing P2-Start if the option is set in the System Settings Menu.

Support for Quadro cabinets with rotatable monitors. Requires hardware modifications.

Orientation of MAME games has to be set here:

Game selection

Use Joystick to select your games.

MAME controls

See instructions, how to change controls.

MAME info

MAME settings menu

Press TAB while inside a game to enter the MAME settings menu.

When a game is internally using a "super resolution" (making it possible to run at exact refresh rates, yet Mame can still output pixel perfect resolutions), if you TAB into the settings, unreadable small lines will be shown on a vertical monitor. You need to temporarily change the game's resolution before entering the menu. While in the game, press "." (dot) or "," (comma) to cycle through available resolutions, until the menu becomes readable. Then you can TAB in.

You can as well backup MAME settings from the Options  Backup/Restore menu, edit the advmame.rc configuration file and restore it via the menu.

Keyboard

A USB keyboard may be attached to configure AdvanceMAME general and/or individual game settings.

Start any game. No need to play, the title screen is sufficient. Press the TAB key to access AdvanceMAME options.

Keyboard mapping

Coin1: 5
P1 Start: 1
P2 Start: 2
P1 Button1 (Fire): Left-CTRL
P1 Button2: Left-ALT
P1 Button3: q

Change buttons or keyboard settings

E.g. change the action to quit a game. This a MAME setting, so we need to access the MAME settings menu.

Ultimarc® ServoStik

An  Ultimarc® ServoStik can be triggered to automatically switch between 4- and 8-way joystick restriction. Check System Settings Menu  System Settings  Enable ServoStik. An additional menu item Toggle ServoStik will be available from the Options menu, to manually switch the ServoStik. You can as well define Player2-Start button to toggle the ServoStik position: System Settings Menu  System Settings  P2-Start Button.

N.B.: Toggle ServoStik will override any automatic switching for the very next game started.

To configure ServoStik settings for individual games, select Options  Set Games 4-8-Way. Settings for most games are predefined. You can as well manually add an appropriate joystick parameter to the game definition entry in "_games.template" inside the "roms_advmame" directory. By default, only 4-way games are explicitly marked. If no "joy" parameter ist set, the system switches to 8-way.

Example:
game {rom ="1942" title ="1942 (set 1)" params ="-0ONE-0TWO-0TRE-1ALL-0FAV" orientation ="v" joy ="8" }
game {rom ="pacman" title ="Pac-Man (Midway)" params ="-0ONE-0TWO-0TRE-1ALL-0FAV" orientation ="v" joy ="4" }

How to connect to a Wi-Fi network

How to SSH into the system

Username: pinhp
Password: root

(If you have trouble transferring data with e. g. SCP software, connect as user: root / password: root)

Example Windows 10:

The DOS (FAT32) partition containing games and system settings, in use only if no USB flash drive is present, is mounted at /mnt/data

Tip:
The very last line of the Options menu ("3 times slowly") serves a special purpose: It forces a menu rebuild (useful when adding/removing games in a live system via SSH). Also, debug information is written to the /tmp directory.

Advanced instructions

The screen is not centred? How to adjust modelines in advmame.rc.

Customization

The system checks for the presence of custom scripts during boot up, before and after each MAME game and during system shutdown. Working examples, e. g. how to switch GPIO pins, to control relays for illumination of individual buttons depending on each game, are provided.

The following scripts will be executed, if present with their exact file names in /root/scripts/custom:

Since a child process does not have access to its parent's variables, the current pinHP variables are dumped into /tmp/pinhp_variables right before running a script, making it possible to grep the values. The other way round, if you need to change pinHP variables, you can declare them in /tmp/external_vars. The main script sources this file right after executing the custom script.