How to play Game Boy games on Linux Terminal

The Linux Terminal, while certainly a fun place to be, isn't particularly famous as a console gaming platform - thanks largely to its limited ASCII and Braille output.

 But its Spartan interface is almost perfect for recreating the screen of the original 1989 Nintendo Game Boy. Here's how to play Game Boy games on your terminal.

Why emulate Game Boy in Terminal?

How to play Game Boy games on Linux Terminal Picture 1How to play Game Boy games on Linux Terminal Picture 1

 

Nintendo's Game Boy is one of the most successful game consoles ever created and has introduced generations of children and adults to the joys of games like Tetris, Pokemon and the Super Mario Land series.

With a 4 MHz processor and a 47x43mm screen, the Game Boy can easily fit in a pocket and provides approximately 15 hours of gameplay from 4 AA batteries. In the late 1980s and early 1990s, the Game Boy was a must-have accessory for any teenager and completely dominated the mobile gaming market.

The popularity and longevity of the console means that there are thousands of officially licensed Game Boy games. By running an emulator in your terminal, you can turn your terminal into a rich library of playable games.

As the name suggests, the php-terminal-gameboy-emulator is written in PHP - a language commonly used to create websites - and although the project's readme only states that it supports PHP 5.6, PHP 7 and HHVM, but it runs almost flawlessly on PHP versions up to 8.2.

With the php-terminal-gameboy-emulator, you are also not limited to computers and can run sessions via Secure Shell (SSH) on remote machines. However, because it's running on a terminal, your Game Boy game won't have any sound.

You also won't be able to save the game. If these limitations bother you, there are dozens of great emulators available on Linux.

Warning : You should only use ROMs that you legally own. You can find lots of Game Boy homebrew ROMs at Homebrew Hub.

How to install php-terminal-gameboy emulator on Linux

Before installing php-terminal-gameboy-emulator, you must make sure that you have PHP installed. To test this, open a terminal and enter:

php -v

This command will return the version number of your installed PHP package. If it returns "php: command not found", you don't have PHP installed.

To install PHP on Arch and related distributions, enter:

 

sudo pacman -S php

On Debian and its derivatives:

sudo apt install php

For the Fedora family, you first need to add the Remi PHP repository:

sudo dnf -y install http://rpms.remirepo.net/fedora/remi-release-XX.rpm

.where XX is your Fedora version number. Now, let's enable the repository:

sudo dnf module enable php:remi-8.1 -y

Finally, you can install PHP with:

sudo dnf install php -y

Now that PHP is installed, use the wget tool to download the php-terminal-gameboy-emulator:

wget https://raw.githubusercontent.com/gabrielrcouto/php-terminal-gameboy-emulator/master/bin/php-gameboy.phar

Make it executable with:

sudo chmod +x php-gameboy.phar

Move the binary file to your path so it is executable from anywhere on the system;

sudo mv php-gameboy.phar /usr/local/bin/php-gameboy

Play great Game Boy games in Linux Terminal

To start the game with the php-terminal-gameboy-emulator, you need to pass the name of the ROM file as an argument. For example:

php-gameboy ~/gbroms/tetris.gb

The ROM will load almost instantly and you'll be faced with the familiar grayscale splash screen of whichever game you choose.

In the video below you can see that the emulator is fully capable of running Street Fighter II, and this writer is just as proficient with the terminal version as he is with the original handheld - controlling Ryu convincingly to defeat Guile in the first round.

Street Fighter II on gameboy emulator in Linux Terminal

You'll also notice that although php-terminal-gameboy-emulator does a convincing job of recreating the Game Boy's dot matrix display in your terminal, there are still occasional visual artifacts. How often they appear and how severe they are will depend on the game you are playing.

The emulator control functions are as follows and unfortunately cannot be remapped:

Controlled by keyboard

Control on console

WASD

D-Pad navigation

Comma (,)

A

Dots (.)

B

N

Select

M

Start

4.5 ★ | 2 Vote