Friday 13 February 2015

Install OpenTyrian

In this tutorial, I will show how to install OpenTyrian, an open source port of the DOS vertical shoot'em up Tyrian. Insane at the Raspberry Pi forum has amended the original source code of OpenTyrian to add SDL with dispmanx support. He has been able to recreate the best Tyrian experience for the pi. As Tyrian was made freeware in 2004, there's every reason to check it out.


[UPDATE November 2015]  You can now install OpenTyrian from the RetroPie setup script. Please update the script if you have not done so recently.

Configure and Install Dispmanx


Create a clone of the dispmanx repository using the command below.

git clone https://github.com/vanfanel/SDL12-kms-dispmanx.git
 
The OpenTyrian source code expects dispmanx to be in the /opt/sdl-dispmanx folder so move and rename with the following command:

sudo mv ~/SDL12-kms-dispmanx/ /opt/sdl-dispmanx

To configure dispmanx, run the following commands:

cd /opt/sdl-dispmanx
CFLAGS="-Ofast -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard" ./configure --prefix=/opt/sdl-dispmanx --disable-video-opengl --enable-video-dispmanx --disable-video-fbcon --disable-video-kms --disable-video-directfb --disable-oss --disable-alsatest --disable-pulseaudio --disable-pulseaudio-shared --disable-arts --disable-nas --disable-esd --disable-nas-shared --disable-diskaudio --disable-dummyaudio --disable-mintaudio --disable-video-x11 --disable-input-tslib

To install, run the following command:

make && sudo make install

This step takes about 15 minutes.

Compile OpenTyrian


Download and unzip the source code.

wget -c https://sites.google.com/site/dosonthepi/opentyrian.zip
unzip opentyrian.zip

Compile with the following commands 

cd ~/opentyrian
make release
 
This step takes about 10 minutes.

Download version 2.1 of the game data to the same folder as the binary. 

wget -c http://www.camanis.net/tyrian/tyrian21.zip
unzip -j tyrian21.zip -d data

You can test your binary by typing the following command:

./opentyrian

Configure Game Controllers


You can configure game controllers in-game. Start a game, any mode, episode, difficulty, it's not important. Choose Options and then Joystick. If you have a game controller plugged in, you will see a screen as below with buttons already assigned.



To re-configure, use the arrow keys on a keyboard to select an action, FIRE, CHANGE FIRE etc. Press ENTER on a keyboard to highlight and then the button on your game controller that you wish to map. Repeat for other buttons. I have not been able to remove the default mappings so take care not to have any conflicts.

I found that, with dispmanx sdl still installed, I could move my fighter left and right with the keyboard but not with the analogue stick of my PS3 controller. To fix this, uninstall sdl-dispmanx with the following commands:

cd /opt/sdl-dispmanx
sudo make uninstall

Integrate into Retropie


Create a script, opentyrian.sh, in the ports folder that will be used to launch the game from Emulationstation.

cd ~/RetroPie/roms/ports
sudo nano opentyrian.sh

Copy and paste the code below.

#!/bin/bash
cd /home/pi/opentyrian
/opt/retropie/supplementary/runcommand/runcommand.sh 0 "./opentyrian"

Save and exit. Next make the opentyrian.sh executable.

sudo chmod +x opentyrian.sh

Restart emulationstation and OpenTyrian will appear in the Ports category.