Difference between revisions of "Arcade Machine"

From Technologia Incognita
Jump to: navigation, search
m
 
(55 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
{{Project
 
{{Project
 +
|picture=IMAG1287.jpg
 
|ProjectSkills=Programming
 
|ProjectSkills=Programming
 
|ProjectStatus=Active
 
|ProjectStatus=Active
Line 5: Line 6:
 
|ProjectPurpose=Fun
 
|ProjectPurpose=Fun
 
}}
 
}}
= Arcade Machine =
+
= Arcade Machine v2 =
 +
As part of the old system being very janky and old, some of us have decided to rework it.
  
We now own a <MODEL> Arcade Machine. The plan is to bring new life into the
+
The old machine is kept around and backed up, and we are moving to a "newer" but still old machine, with a newer operating system: Batocera.
machine by putting a computer in there and hooking that computer to the joystick
+
The goal is to have a cleaner system: for context, the current disk has 2013 gentoo files, and nobody that I (x) asked knew about it.
input and screens. The computer runs MAME and other emulators, such as Amiga
 
or SNES emulators.
 
  
NOTE: Currently, the input mapping instructions are out of date, they will be updated soonish
+
Things that are worth noting:
 +
- The power button is exposed as two male dupont pins, we had to make a janky cable with two female dupont connectors on each side, and poke inside the computer with a screwdriver to find the power button pins.
 +
- The input for BOTH controllers is shown as a single USB keyboard: the JAMMA board inside has a jumper for USB and PS2. The older system used custom written software: [https://github.com/MerlijnWajer/uinput-mapper uinput-mapper]. For this iteration, I asked around in Batocera community and will try their recommendations.
  
== Getting it to work ==
+
= Old Text =
  
There's a basic UvA machine in the Arcade Box; with Wake on Lan. Just send the
+
We own an Arcade Machine, of which we have replaced the contents with
WOL packet to the right mac address, which can be found on the machine:
+
an Intel PC, running Linux. It has a custom game launcher and support
  00:21:70:03:31:1b
+
for many emulators, such as MAME, UAE and other emulators.
  
Here is an example command line that will turn on the machine (etherwake defaults to eth0, so wlan0 is specified)
 
  
  sudo etherwake 00:21:70:03:31:1b -i wlan0
+
See also https://wiki.techinc.nl/Arcade_Machine_Volume_Control
  
Or:
+
== Current Installed Programs ==
  wakeonlan 00:21:70:03:31:1b
 
  
From: http://gsd.di.uminho.pt/jpo/software/wakeonlan/
+
== Games ==
  
=== Input ===
+
==== How to install more systems ====
 +
 
 +
* ssh techinc@10.209.10.44
 +
* cd RetroPie-Setup
 +
* sudo ./retropie_setup.sh
 +
* Manage packages (opt/exp etc. see retropie website) ; select and install
 +
 
 +
==== How to install more games/roms ====
 +
 
 +
* ssh techinc@10.209.10.44
 +
* Put your rom uncompressed in /home/techinc/RetroPie/roms/SYSTEMNAME (check the content of roms to choose the correct folder)
 +
 
 +
=== Native ===
 +
 
 +
* And Yet It Moves
 +
* Aquaria
 +
* Bastion from SupergiantGames
 +
* beathazard
 +
* bit.trip.runner
 +
* cave_story_plus-linux-r100
 +
* hedgewars
 +
* HELI-X42
 +
* jamestown
 +
* luftrausers
 +
* mari0-linux
 +
* NightSky
 +
* Nothing To Hide
 +
* nottetris2
 +
* OpenHexagon1.92
 +
* openinvaders
 +
* OpenSyobonAction
 +
* Raptor: Call of the Shadows
 +
* Rotational_Linux_RC2
 +
* Spirits
 +
* stepmania-5.0
 +
* Super Hexagon
 +
* Superbrothers: Sword & Sworcery EP
 +
* SuperMeatBoy
 +
* super_mario_war
 +
* Thomas Was Alone
 +
* To The To The Moon
 +
* torus-trooper
 +
* Trine
 +
* Trine2
 +
* World Of Goo
 +
* ZenBound2
 +
 
 +
=== Emulation ===
  
==== Arcade Machine input ====
+
==== N64 ====
  
The input can be read as PS2 (and USB); using a chip that we got alongside
+
* Zelda - Ocarina of Time.z64
the Arcade Machine:
+
* m64py
  
http://www.ultimarc.com/jpac.html
+
==== Amiga ====
http://www.ultimarc.com/jpac2.html
 
  
The Arcade Machine input exposes itself as a single keyboard over USB and PS/2.
+
* PiNBALL FANTASIES
This is problematic for most games, with the exception of MAME and a few
+
* jumpnbump
emulators.
+
* AMIGA ROM Packages
 +
* PROJECTX
 +
* Stargoose Warrior
  
The chip does not expose more than one HID, we will have to fiddle around a
+
==== DOS ====
bit to get all the software to read from the input devices as two seperate
 
devices. MAME is known to handle the basic PS2 input just fine (AFAIK),
 
but for other emulators this can be a problem.
 
Solutions include writing our own input driver or perhaps faking a
 
device in X.
 
  
See the "Writing out own input driver" below for more details.
+
* Epic Pinball
 +
* ScummVM Games Collection
 +
* One Must Fall 2097
 +
* Wacky_Wheels
 +
* PARATROO.COM
 +
* SkyRoads
  
Basic instructions:
+
==== MAME ====
  
  ./disable_unusable_keyboard.sh
+
* MAME Roms Packages
  cd uinput-mapper/
 
  make
 
  sudo ./map
 
  
==== Other Input ====
+
== System ==
  
We attached two PlayStation controllers, but I ([[User:Wizzup|Wizzup]]) am not a
+
* dosbox
big fan of them. Regardless, there's a USB hub so feel free to plug in other
+
* git
controllers! It would be nice to have proper SNES ones.
+
* MAME
 +
* MAME 0114b
 +
* MAME32 plus 0.83
 +
* PlayOnLinux
 +
* powerbars - https://github.com/MerlijnWajer/powerbars
 +
* pygame
 +
* ssh server
 +
* uinput-mapper
 +
* Unity3D
 +
* vim
 +
* wahcade
 +
* Wine
 +
* xfce4
 +
* ./git/Arcade - https://github.com/jorants/Arcade
 +
* ./arcade
  
This may be useful: https://www.thinkgeek.com/product/f08d/ and
+
== Plan / Wishlist ==
http://www.amazon.com/Classic-USB-Super-Nintendo-Controller-PC/dp/B002JAU20W
 
Or we can make our own.
 
  
==== Coin Input ====
+
* Get Windex or something to clean the outside case of the device
 +
* Clean up the inside of the machine, bundle cables.
 +
* Create a quick bootstraper script so we can deploy/reinstall the machine
 +
* Deploy RetroPie ?
 +
* Get wireless keyboard/mouse, maybe those mini-keyboard with the trackpad?
 +
* Fix a light inside of the cabinet
  
This should be handled by the Input over PS2/USB as well. It is probably mapped
 
to a key.
 
  
=== Video ===
+
* Get external USB controllers. ([[User:Wizzup|Wizzup]] bought two SNES USB ones and will donate them -- they are currently being shipped)
 +
* New and more physical input buttons
 +
* Make the uinput-software much more user friendly
 +
* Look at the test and volume controls inside of the cabinet
 +
* Improve the launcher and uinput-mapper stuff
 +
* Improve the game launcher
 +
* Add more games (only when they work nicely / well), perhaps we can have a "tested games" launcher and an advanced mode.
 +
* (Re)Paint the cabinet.
 +
* USB/HID controls vs. input-mapper - Wizzup and Justa have to fight that one out...
 +
* have it make coffee (hack a saeco inside for no reason)
 +
* strip the PC and mount it inside - reduce clutter while busy
 +
* investigate less heat production / better ventilation
 +
* We can use it to control a variety of stuff. (light, sound)
 +
* We can hook other consoles into it.
 +
* Some kind of game that integrates with the space? interacts with some light / stuff around the arcade machine
 +
 
 +
 
 +
=== Modifications ===
  
We replaced the built-in monitor with a TFT monitor.
 
  
=== Sound ===
+
[[File:IMAG1286.jpg|200px|thumb|left|First step of redesign control board]]
 +
- Added two fixed wheels and two swivel-wheels under the base
 +
-- To be able to move the thing around
  
The sound works and is connected to the computer as well.
+
- Added a hole that runs from the 'cabinet' part into the 'base' part
 +
-- Since I had the console removed already, it seemed smart to make some
 +
kind of hole in the base AND the cabinet that'd allow running a cable
 +
through for lighting/whatever.
  
=== Common tasks ===
+
- Drilled a hole on the underside of the 'button-table' to let USB
 +
cables through
 +
-- To start getting rid of the 'kabel-salat' that plagues the
 +
arcade-machine, I moved the USB-hub from the 'coin-door' to a location
 +
inside of the cabinet; allowing the keyboard + pad to be connected a
 +
little more tidily. Also in preparation for other (suggested) changes
  
There are a few simple tasks until we've written a pretty interface + set of scritps.
+
- Removed all the blue tape holding the access-hatch closed; replaced it
 +
(for now) with a single screw
 +
-- This is not permanent; but the use of blue tape all over the place
 +
was not making things look nice. The screw is just a kludge. There is a
 +
mechanism on the back of the access-panel that we could re-use, if I
 +
could figure out how it was supposed to work. Simply making a
 +
spring-loaded latch there would work fine too.
  
It mostly boils down to two tasks:
+
== Details ==
  
1) disable/enable the "keyboard" interface: ~/disable_*.sh or ~/enable_*.sh
+
The cabinet we have is a 'generic' model designed to be able to run a
 +
number of games, originally.
  
2) start/stop uinput-mapper with the right configuration:
+
We stuck a PC in there and replaced the CRT with an LCD.
 +
The controls connect to the PC via a 'JPAC' module from Ultimarc;
 +
connected to the PC via PS/2
 +
There are a number of USB-cables running from the PC to other devices.
 +
Including the keyboard + Touch-pad that are currently 'seated' at the
 +
top of the cabinet.
  
  sudo ./uinput-mapper/map_CONFIGNAME
+
The PC runs Linux. It autoboots into an AWESOME desktop that has a
 +
full-screen 'program selection' window open which was programmed by
 +
Wizzup and Control-K as a way to easily be able to select the
 +
game/program/function you'd like to use.
  
And just hit ^C to stop it.
+
The cabinet has the following controls
  
=== Games (with instructions) ===
+
- A coin-return; now used for 'on/off' (wired to 'ATX poweron' i believe)
 +
- Player 2 start (on front edge)
 +
- Player 1 joystick
 +
- Player 1 button 1
 +
- Player 1 button 2
 +
- Player 2 start (on front edge)
 +
- Player 2 joystick
 +
- Player 2 button 1
 +
- Player 2 button 2
  
 +
The cabinet has a light-switch on the back to power on/off the light
 +
that illuminates the logo at the top.
  
==== Super Hexagon ====
+
The cabinet has two speakers. Not clear if volume is wired up via
 +
volume-control button on the inside of the cabinet.
  
Disable uinput-mapper and enable the ``keyboard'' interface.
+
The cabinet is designed to be used either in 'seated' mode or, in it's
 +
current configuration, when standing.
 +
To make this possible, the cabinet is constructed out of two sections. A
 +
main section housing all the electronics, etc, and a 'pedestal' at the
 +
bottom that can be separated from the rest by removing two bolts.
 +
This raises the height of the entire machine about 40cm's or so.
  
  
==== Emulators ====
+
=== Video ===
  
* ZSNES (SNES)
+
We replaced the built-in monitor with a TFT monitor. (TODO: Resolution?)
* UAE (Amiga)
 
* MAME
 
* ...
 
  
== Writing our own input driver ==
+
=== Sound ===
  
<b> Axes to axes, Buttons to buttons </b>
+
The sound works and is connected to the computer as well. (TODO: Document how)
  
Code: https://github.com/MerlijnWajer/uinput-mapper
+
=== Power button ===
  
Compile:
+
The button next to the coin slit is now (also) a power button.
  
  make
+
=== Input ===
  
Run:
+
We have written our own Game Launcher frontend and software to do advanced input
 +
remapping.
  
  sudo ./map
+
==== Arcade Machine input ====
  
Map:
+
The input can be read as PS2 (and USB); using a chip that we got alongside
 +
the Arcade Machine:
  
* Creates two joystick input devices in /dev/input
+
http://www.ultimarc.com/jpac.html
* Both joystick devices are mapped sanely.
+
http://www.ultimarc.com/jpac2.html
* HAT0X / HAT0Y seem to work now that we specified absmin and absmax.
 
  
Keys are mapped like this:
+
The Arcade Machine input exposes itself as a single keyboard over USB and PS/2.
 +
This is problematic for most games, with the exception of MAME and a few
 +
emulators. Some games expect an input device per player, so one "keyboard"
 +
then simply is not enough.
  
  HAT -> HAT0X, HAT0Y
+
To solve this problem we have written software that can split one keyboard up
  Red Buttons, left to right: BTN_0, BTN_1, BTN_2
+
into multiple virtual ones: https://github.com/MerlijnWajer/uinput-mapper ;
  Yellow Button: BTN_3
+
http://hetgrotebos.org/wiki/uinput-mapper
  
  
Notes / Future usage:
+
= Old Old text =
  
* ./disable_unusable_keyboard.sh
+
=== Common tasks ===
* sudo ./uinput-mapper/map &
 
* Run your emulator/game
 
  
== Key remapping ==
+
There are a few simple tasks until we've written a pretty interface + set of scritps.
  
Remapping of keys is trivial, if you know a bit of C (preprocessor).
+
It mostly boils down to two tasks:
Open up custom_map.h and edit to your liking
 
  
Note:
+
1) disable/enable the "keyboard" interface in X (to avoid double input):
* Last argument to KEYMAP can be a statement or a function; which takes a single (value) argument and results in an integer.
 
* You cannot map INPUT keys other than those of type EV_KEY and you cannot map them to OUTPUT joystick keys other than the ones currently defined in the example.
 
* JOYCOUNT defines the amount of joysticks to create.
 
  
<b>Do not forget to recompile:</b>
+
  ~/disable_*.sh or ~/enable_*.sh
  
    make
+
2) start/stop uinput-mapper with the right configuration:
  
 +
  sudo input-read -D /dev/input/by-id/usb-Cypress_I-PAC_Arcade_Control_Interface-event-kbd | sudo input-create configs/techinc.py
  
Example config.h: (See the repository for one with lots of comments)
+
And just hit ^C to stop it.
Note that the INPUT_PATH is incorrect for the arcade machine.
 
  
#include "config_functions.h"
+
== Writing our own input driver ==
 
/* -------------------------------------------------------------------------- */
 
/* ----------------------------- FIRST SECTION ----------------------------- */
 
/* -------------------------------------------------------------------------- */
 
 
#ifndef H_GLOBAL_MAP
 
#define H_GLOBAL_MAP
 
 
/* Set up amount of joysticks here */
 
#define JOYCOUNT 2
 
 
/* Set up event to read from */
 
#define INPUT_PATH "/dev/input/by-path/platform-i8042-serio-0-event-kbd"
 
 
#endif
 
 
/* -------------------------------------------------------------------------- */
 
/* ----------------------------- SECOND SECTION ----------------------------- */
 
/* -------------------------------------------------------------------------- */
 
 
#ifdef H_CONFIGURE_JOYSTICKS
 
#ifndef H_CONFIGURE_JOYSTICKS_SEEN
 
#define H_CONFIGURE_JOYSTICKS_SEEN
 
 
 
/* Configure first joystick.
 
  *
 
  * Here we just tell the program what keys event we will expose and what
 
  * keys we want to use.
 
  *
 
  * If a key is not enabled here, it will never be passed.
 
  */
 
 
/* We want to send ABS and KEY events */
 
JOYSTICK_SET_OPT(EV_ABS, UI_SET_EVBIT, 0)
 
JOYSTICK_SET_OPT(EV_KEY, UI_SET_EVBIT, 0)
 
 
/* Hats:
 
  * We set the absmax and absmin; otherwise the hats make no sense.
 
  */
 
JOYSTICK_ADD_KEY(ABS_HAT0X, UI_SET_ABSBIT, 0)
 
JOYSTICK_SET_LIM(absmax, 1, ABS_HAT0X)
 
JOYSTICK_SET_LIM(absmin, -1, ABS_HAT0X)
 
JOYSTICK_ADD_KEY(ABS_HAT0Y, UI_SET_ABSBIT, 0)
 
JOYSTICK_SET_LIM(absmax, 1, ABS_HAT0Y)
 
JOYSTICK_SET_LIM(absmin, -1, ABS_HAT0Y)
 
 
/* XXX: ALWAYS SET BTN_JOYSTICK TO EXPOSE A JOYSTICK DEVICE */
 
JOYSTICK_ADD_KEY(BTN_JOYSTICK, UI_SET_KEYBIT, 0)
 
 
/* Buttons. */
 
JOYSTICK_ADD_KEY(BTN_0, UI_SET_KEYBIT, 0)
 
JOYSTICK_ADD_KEY(BTN_1, UI_SET_KEYBIT, 0)
 
JOYSTICK_ADD_KEY(BTN_2, UI_SET_KEYBIT, 0)
 
JOYSTICK_ADD_KEY(BTN_3, UI_SET_KEYBIT, 0)
 
 
/* Second joystick ; same comments as first one */
 
JOYSTICK_SET_OPT(EV_ABS, UI_SET_EVBIT, 1)
 
JOYSTICK_SET_OPT(EV_KEY, UI_SET_EVBIT, 1)
 
 
JOYSTICK_ADD_KEY(ABS_HAT0X, UI_SET_ABSBIT, 1)
 
JOYSTICK_SET_LIM(absmax, 1, ABS_HAT0X)
 
JOYSTICK_SET_LIM(absmin, -1, ABS_HAT0X)
 
 
JOYSTICK_ADD_KEY(ABS_HAT0Y, UI_SET_ABSBIT, 1)
 
JOYSTICK_SET_LIM(absmax, 1, ABS_HAT0X)
 
JOYSTICK_SET_LIM(absmin, -1, ABS_HAT0X)
 
 
JOYSTICK_ADD_KEY(BTN_JOYSTICK, UI_SET_KEYBIT, 1)
 
 
JOYSTICK_ADD_KEY(BTN_0, UI_SET_KEYBIT, 1)
 
JOYSTICK_ADD_KEY(BTN_1, UI_SET_KEYBIT, 1)
 
JOYSTICK_ADD_KEY(BTN_2, UI_SET_KEYBIT, 1)
 
JOYSTICK_ADD_KEY(BTN_3, UI_SET_KEYBIT, 1)
 
 
#endif
 
#endif
 
 
/* -------------------------------------------------------------------------- */
 
/* ----------------------------- THIRD SECTION ----------------------------- */
 
/* -------------------------------------------------------------------------- */
 
 
#ifdef H_JOYMAP
 
#ifndef H_JOYMAP_SEEN
 
#define H_JOYMAP_SEEN
 
 
/* First joystick */
 
 
LEGAL_VALUE(e.value == 1 || e.value == 0,
 
    /* HAT */
 
    KEYMAP(EV_KEY, KEY_UP, ABS_HAT0Y, EV_ABS, 0, -)
 
    KEYMAP(EV_KEY, KEY_DOWN, ABS_HAT0Y, EV_ABS, 0, +)
 
    KEYMAP(EV_KEY, KEY_LEFT, ABS_HAT0X, EV_ABS, 0, -)
 
    KEYMAP(EV_KEY, KEY_RIGHT, ABS_HAT0X, EV_ABS, 0, +)
 
 
    /* Red buttons */
 
    KEYMAP(EV_KEY, KEY_LEFTCTRL, BTN_0, EV_KEY, 0, +)
 
    KEYMAP(EV_KEY, KEY_LEFTALT, BTN_1, EV_KEY, 0, +)
 
    KEYMAP(EV_KEY, KEY_SPACE, BTN_2, EV_KEY, 0, +)
 
 
    /* Yellow button */
 
    KEYMAP(EV_KEY, KEY_1, BTN_3, EV_KEY, 0, +)
 
)
 
 
/* Second joystick */
 
 
LEGAL_VALUE(e.value == 1 || e.value == 0,
 
    /* HAT */
 
    KEYMAP(EV_KEY, KEY_R, ABS_HAT0Y, EV_ABS, 1, -)
 
    KEYMAP(EV_KEY, KEY_F, ABS_HAT0Y, EV_ABS, 1, +)
 
    KEYMAP(EV_KEY, KEY_D, ABS_HAT0X, EV_ABS, 1, -)
 
    KEYMAP(EV_KEY, KEY_G, ABS_HAT0X, EV_ABS, 1, +)
 
 
    /* Red buttons */
 
    KEYMAP(EV_KEY, KEY_A, BTN_0, EV_KEY, 1, +)
 
    KEYMAP(EV_KEY, KEY_S, BTN_1, EV_KEY, 1, +)
 
    KEYMAP(EV_KEY, KEY_Q, BTN_2, EV_KEY, 1, +)
 
 
    /* Yellow button */
 
    KEYMAP(EV_KEY, KEY_2, BTN_3, EV_KEY, 1, +)
 
)
 
 
#endif
 
#endif
 
  
== Games ==
+
<b> Axes to axes, Buttons to buttons </b>
  
List of games:
+
Code: https://github.com/MerlijnWajer/uinput-mapper
  
=== Native ===
+
For instructions, see: http://hetgrotebos.org/wiki/uinput-mapper
  
* Jamestown (works with joysticks)
+
And the techinc.py config can be viewed online:
* Syobon (not yet! Ubuntu didn't have it in their repo ☹)
 
  
=== Amiga ===
+
http://googleco.de/uinput-mapper/tree/configs/techinc.py
  
In UAE, just add the games as floppies.
+
Map:
  
* SWIV (Great shoot them up game)
+
* Creates two joystick input devices in /dev/input
* Pinball Fantasies
+
* Both joystick devices are mapped sanely.
 +
* HAT0X / HAT0Y seem to work now that we specified absmin and absmax.
  
=== SNES ===
+
Keys are mapped like this:
  
...
+
  HAT -> HAT0X, HAT0Y
 +
  Red Buttons, left to right: BTN_0, BTN_1, BTN_2
 +
  Yellow Button: BTN_3
  
== Other uses ==
+
== User Interface ==
  
* We can use it to control a variety of stuff. (light, sound)
+
=== Using the menu ===
* We can hook other consoles into it.
 
* ???
 
  
== brain-dump AndreasR ==
+
There is a custom menu for the arcade machine, it should start automaticly.
 +
You can use the left joystick to choose a game/program.
 +
Press the most right button of player 1 to start it.
 +
For games that are not added yet, xterm is also in the menu.
  
https://aur.archlinux.org/packages/mamepgui/
+
=== Restarting the menu ===
  
http://qmc2.arcadehits.net/download.html
+
If the menu is closed and you want to start it, the python script is in "/home/techinc/arcade/game.py", run it using python2.
  
http://mame.mindkiller.com/?section=downloads&project=mame
+
=== Adding programs ===
  
http://gmameui.sourceforge.net/
+
You can use the supllied GUI in the menu, it will ask some questions.
 +
You can either choose a file to run or insert a custom command
 +
Then it asks for a name and descition
 +
Finaly, you will need a picture, you can use the standart questionmark, insert a file or taka a screenshot.
 +
When you take a screenshot, the command will be executed (so make sure it is alright) and after some seconds scrot is used to take a picture.
  
http://www.raspberrypi.org/phpBB3/viewtopic.php?t=15915&p=163781
+
You can also edit the ~/arcade/gamelist.conf file for more flexebilety.
  
http://rbelmont.mameworld.info/?page_id=163
+
Removeing a program can be done by pressing [DEL] in the main menu while you have the program selected.
  
http://gxmame.sourceforge.net/
+
=== Fixing a broken menu ===
 +
Sometimes things go wrong when adding games, specifecly while adding a screenshot, this can make the menu crash.
 +
You can fix it by removing the broken entry from  ~/arcade/gamelist.conf  manualy.

Latest revision as of 22:49, 23 June 2024

Projects
IMAG1287.jpg
Participants Control-k, Maijin, Realitygaps, Wizzup
Skills Programming
Status Active
Niche Software
Purpose Fun

Arcade Machine v2

As part of the old system being very janky and old, some of us have decided to rework it.

The old machine is kept around and backed up, and we are moving to a "newer" but still old machine, with a newer operating system: Batocera. The goal is to have a cleaner system: for context, the current disk has 2013 gentoo files, and nobody that I (x) asked knew about it.

Things that are worth noting: - The power button is exposed as two male dupont pins, we had to make a janky cable with two female dupont connectors on each side, and poke inside the computer with a screwdriver to find the power button pins. - The input for BOTH controllers is shown as a single USB keyboard: the JAMMA board inside has a jumper for USB and PS2. The older system used custom written software: uinput-mapper. For this iteration, I asked around in Batocera community and will try their recommendations.

Old Text

We own an Arcade Machine, of which we have replaced the contents with an Intel PC, running Linux. It has a custom game launcher and support for many emulators, such as MAME, UAE and other emulators.


See also https://wiki.techinc.nl/Arcade_Machine_Volume_Control

Current Installed Programs

Games

How to install more systems

  • ssh techinc@10.209.10.44
  • cd RetroPie-Setup
  • sudo ./retropie_setup.sh
  • Manage packages (opt/exp etc. see retropie website) ; select and install

How to install more games/roms

  • ssh techinc@10.209.10.44
  • Put your rom uncompressed in /home/techinc/RetroPie/roms/SYSTEMNAME (check the content of roms to choose the correct folder)

Native

  • And Yet It Moves
  • Aquaria
  • Bastion from SupergiantGames
  • beathazard
  • bit.trip.runner
  • cave_story_plus-linux-r100
  • hedgewars
  • HELI-X42
  • jamestown
  • luftrausers
  • mari0-linux
  • NightSky
  • Nothing To Hide
  • nottetris2
  • OpenHexagon1.92
  • openinvaders
  • OpenSyobonAction
  • Raptor: Call of the Shadows
  • Rotational_Linux_RC2
  • Spirits
  • stepmania-5.0
  • Super Hexagon
  • Superbrothers: Sword & Sworcery EP
  • SuperMeatBoy
  • super_mario_war
  • Thomas Was Alone
  • To The To The Moon
  • torus-trooper
  • Trine
  • Trine2
  • World Of Goo
  • ZenBound2

Emulation

N64

  • Zelda - Ocarina of Time.z64
  • m64py

Amiga

  • PiNBALL FANTASIES
  • jumpnbump
  • AMIGA ROM Packages
  • PROJECTX
  • Stargoose Warrior

DOS

  • Epic Pinball
  • ScummVM Games Collection
  • One Must Fall 2097
  • Wacky_Wheels
  • PARATROO.COM
  • SkyRoads

MAME

  • MAME Roms Packages

System

Plan / Wishlist

  • Get Windex or something to clean the outside case of the device
  • Clean up the inside of the machine, bundle cables.
  • Create a quick bootstraper script so we can deploy/reinstall the machine
  • Deploy RetroPie ?
  • Get wireless keyboard/mouse, maybe those mini-keyboard with the trackpad?
  • Fix a light inside of the cabinet


  • Get external USB controllers. (Wizzup bought two SNES USB ones and will donate them -- they are currently being shipped)
  • New and more physical input buttons
  • Make the uinput-software much more user friendly
  • Look at the test and volume controls inside of the cabinet
  • Improve the launcher and uinput-mapper stuff
  • Improve the game launcher
  • Add more games (only when they work nicely / well), perhaps we can have a "tested games" launcher and an advanced mode.
  • (Re)Paint the cabinet.
  • USB/HID controls vs. input-mapper - Wizzup and Justa have to fight that one out...
  • have it make coffee (hack a saeco inside for no reason)
  • strip the PC and mount it inside - reduce clutter while busy
  • investigate less heat production / better ventilation
  • We can use it to control a variety of stuff. (light, sound)
  • We can hook other consoles into it.
  • Some kind of game that integrates with the space? interacts with some light / stuff around the arcade machine


Modifications

First step of redesign control board

- Added two fixed wheels and two swivel-wheels under the base -- To be able to move the thing around

- Added a hole that runs from the 'cabinet' part into the 'base' part -- Since I had the console removed already, it seemed smart to make some kind of hole in the base AND the cabinet that'd allow running a cable through for lighting/whatever.

- Drilled a hole on the underside of the 'button-table' to let USB cables through -- To start getting rid of the 'kabel-salat' that plagues the arcade-machine, I moved the USB-hub from the 'coin-door' to a location inside of the cabinet; allowing the keyboard + pad to be connected a little more tidily. Also in preparation for other (suggested) changes

- Removed all the blue tape holding the access-hatch closed; replaced it (for now) with a single screw -- This is not permanent; but the use of blue tape all over the place was not making things look nice. The screw is just a kludge. There is a mechanism on the back of the access-panel that we could re-use, if I could figure out how it was supposed to work. Simply making a spring-loaded latch there would work fine too.

Details

The cabinet we have is a 'generic' model designed to be able to run a number of games, originally.

We stuck a PC in there and replaced the CRT with an LCD. The controls connect to the PC via a 'JPAC' module from Ultimarc; connected to the PC via PS/2 There are a number of USB-cables running from the PC to other devices. Including the keyboard + Touch-pad that are currently 'seated' at the top of the cabinet.

The PC runs Linux. It autoboots into an AWESOME desktop that has a full-screen 'program selection' window open which was programmed by Wizzup and Control-K as a way to easily be able to select the game/program/function you'd like to use.

The cabinet has the following controls

- A coin-return; now used for 'on/off' (wired to 'ATX poweron' i believe) - Player 2 start (on front edge) - Player 1 joystick - Player 1 button 1 - Player 1 button 2 - Player 2 start (on front edge) - Player 2 joystick - Player 2 button 1 - Player 2 button 2

The cabinet has a light-switch on the back to power on/off the light that illuminates the logo at the top.

The cabinet has two speakers. Not clear if volume is wired up via volume-control button on the inside of the cabinet.

The cabinet is designed to be used either in 'seated' mode or, in it's current configuration, when standing. To make this possible, the cabinet is constructed out of two sections. A main section housing all the electronics, etc, and a 'pedestal' at the bottom that can be separated from the rest by removing two bolts. This raises the height of the entire machine about 40cm's or so.


Video

We replaced the built-in monitor with a TFT monitor. (TODO: Resolution?)

Sound

The sound works and is connected to the computer as well. (TODO: Document how)

Power button

The button next to the coin slit is now (also) a power button.

Input

We have written our own Game Launcher frontend and software to do advanced input remapping.

Arcade Machine input

The input can be read as PS2 (and USB); using a chip that we got alongside the Arcade Machine:

http://www.ultimarc.com/jpac.html http://www.ultimarc.com/jpac2.html

The Arcade Machine input exposes itself as a single keyboard over USB and PS/2. This is problematic for most games, with the exception of MAME and a few emulators. Some games expect an input device per player, so one "keyboard" then simply is not enough.

To solve this problem we have written software that can split one keyboard up into multiple virtual ones: https://github.com/MerlijnWajer/uinput-mapper ; http://hetgrotebos.org/wiki/uinput-mapper


Old Old text

Common tasks

There are a few simple tasks until we've written a pretty interface + set of scritps.

It mostly boils down to two tasks:

1) disable/enable the "keyboard" interface in X (to avoid double input):

 ~/disable_*.sh or ~/enable_*.sh

2) start/stop uinput-mapper with the right configuration:

 sudo input-read -D /dev/input/by-id/usb-Cypress_I-PAC_Arcade_Control_Interface-event-kbd | sudo input-create configs/techinc.py

And just hit ^C to stop it.

Writing our own input driver

Axes to axes, Buttons to buttons

Code: https://github.com/MerlijnWajer/uinput-mapper

For instructions, see: http://hetgrotebos.org/wiki/uinput-mapper

And the techinc.py config can be viewed online:

http://googleco.de/uinput-mapper/tree/configs/techinc.py

Map:

  • Creates two joystick input devices in /dev/input
  • Both joystick devices are mapped sanely.
  • HAT0X / HAT0Y seem to work now that we specified absmin and absmax.

Keys are mapped like this:

 HAT -> HAT0X, HAT0Y
 Red Buttons, left to right: BTN_0, BTN_1, BTN_2
 Yellow Button: BTN_3

User Interface

Using the menu

There is a custom menu for the arcade machine, it should start automaticly. You can use the left joystick to choose a game/program. Press the most right button of player 1 to start it. For games that are not added yet, xterm is also in the menu.

Restarting the menu

If the menu is closed and you want to start it, the python script is in "/home/techinc/arcade/game.py", run it using python2.

Adding programs

You can use the supllied GUI in the menu, it will ask some questions. You can either choose a file to run or insert a custom command Then it asks for a name and descition Finaly, you will need a picture, you can use the standart questionmark, insert a file or taka a screenshot. When you take a screenshot, the command will be executed (so make sure it is alright) and after some seconds scrot is used to take a picture.

You can also edit the ~/arcade/gamelist.conf file for more flexebilety.

Removeing a program can be done by pressing [DEL] in the main menu while you have the program selected.

Fixing a broken menu

Sometimes things go wrong when adding games, specifecly while adding a screenshot, this can make the menu crash. You can fix it by removing the broken entry from ~/arcade/gamelist.conf manualy.