Pinbox Toolkit
From PinballControllers Wiki
Contents |
About
The Pinbox Toolkit is a series of Linux helper scripts designed to get you up and running quickly with game development using the P-ROC, PyProcGame and Python programming language on Linux. The installation also includes PinMAME patched to work with Linux and the P-ROC. To date, this system has been tested with a variety of Ubuntu distributions, Debian and Linux Mint. This will work on most systems with 'apt-get' functionality.
In a nutshell, the script downloads and installs all prerequisites for PinMAME including GCC, SDL, ZLib and other internal dependencies, Python 2.6, PyYAML, YAML-CPP, libusb, libftdi, libpinproc, pypinproc and pyprocgame.
Note that the script internally uses apt-get to download and install packages. An internet connection is required.
Downloading
The Pinbox Toolkit can be downloaded from here or by issuing the following command:
wget http://pinbox.catster.net/pinbox-toolkit.tar.gz
Installation
Installation is simple, first extract the archive by issuing the following command:
tar -zxpvf pinbox-toolkit.tar.gz
Next, issue the following command
./install
The installer will prompt you for your user account password. This is due to the fact that apt-get has to run under root privileges. Enter your current user account password on the local system.
Depending on how many packages your system has and your internet connection speed, this could take several minutes.
If the installation fails, check the Diagnosing Installation Errors page for various problems and solutions.
After the installation completes, on many systems you may need to reload your shell environment variables. To do so, issue the following command:
source ~/.bashrc
Congratulations! If all went well, you have a complete software installation that should be ready to power your custom code or even factory code through PinMAME.
Testing Things Out
To test to make sure the installation went well, try the following (and make sure to hit ENTER following all commands):
First, go into python by typing:
python
Next, import the pinproc module by typing:
import pinproc
If the screen throws you right back to '>>>' then Python sees libpinproc/pypinproc properly. If the command throws back an ImportError message along the lines of "cannot find libpinproc.so.0.9" or something similar, make sure you executed the 'source ~/.bashrc' command as outlined in the installation instructions.
If you still have issues, technically speaking, the path where libpinproc.so.0.9 resides (usually /usr/local/bin) must be inside of your LD_LIBRARY_PATH environment variable.
Try importing pyprocgame by typing:
import procgame
Again, if the screen throws you right back to '>>>' then Python sees pyprocgame properly.
Exit the Python interactive console by typing:
quit()
Running PinMAME
After installing the toolkit, regular PinMAME functionality can be invoked by typing:
xpinmamed.SDL
A shortcut command has been devised. Inside of the pinbox-toolkit/ directory you can run PinMAME by typing:
./runpinmame <rom file> <yaml file>
Game ROMs
A comprehensive collection of PinMAME game roms can be found at The Internet Pinball Database. Just search for your game and download the PinMAME romset for the version you want!
NOTE: Don't unzip the zipped ROM files. PinMAME handles that internally.
Diagnosing Installation Errors
Problem: PinMAME installation fails with the following error:
MAME_NO_UNUSED=1 -I. -Isrc -Isrc/includes -Isrc/unix -Ixpinmamed.obj/cpu/m68000 -Isrc/cpu/m68000 -DMAME_DEBUG -o xpinmamed.obj/cpu/i8085/i8085.o -c src/cpu/i8085/i8085.c src/cpu/i8085/i8085.c: Assembler messages: src/cpu/i8085/i8085.c:234: Error: can't encode register '%ah' in an instruction requiring REX prefix. src/cpu/i8085/i8085.c:300: Error: can't encode register '%ah' in an instruction requiring REX prefix. src/cpu/i8085/i8085.c:372: Error: can't encode register '%ah' in an instruction requiring REX prefix. src/cpu/i8085/i8085.c:455: Error: can't encode register '%ah' in an instruction requiring REX prefix. make: *** [xpinmamed.obj/cpu/i8085/i8085.o] Error 1
Solution: A change to the 'makefile.unix' file in the pinmame source directory is required:
cd pinmame-2.2-linux-proc/
Open the 'makefile.unix' file in your favorite text editor:
nano makefile.unix
Hit ctrl+w and search for "MY_CPU". By default, the makefile is configured for i386. People have found success on various architectures by changing the MY_CPU value to i386_noasm. To use this value, comment out the MY_CPU = i386 line by putting a # in front. Then remove the # and space in front of MY_CPU = i386_noasm.
Save the changes by hitting ctrl+x. When the prompt asks for confirmation to save the changes, hit Y and ENTER.
Rerun the installation by running the following commands:
cd .. ./install
Special thanks to leave it to beaver for finding and posting this solution