How to play Game Boy games on Linux Terminal

 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 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

May be interested

  • How to use sed command in LinuxPhoto of How to use sed command in Linux
    whether you are dealing with configuration files, scripts, or even plain text, sed is the tool that helps you manipulate text quickly and efficiently.
  • 5 reasons why people love the Linux command linePhoto of 5 reasons why people love the Linux command line
    many people are afraid of the command line. they see it as something for software developers or geeks. but the command line is merely another way of interacting with a pc, and there are some tasks that are very easy to do with the cli.
  • How to install Grafana on Alma LinuxPhoto of How to install Grafana on Alma Linux
    grafana is a free, open source monitoring and data visualization software. by default, it supports graphite, elasticsearch, prometheus and other databases.
  • How to use the Ping command in LinuxPhoto of How to use the Ping command in Linux
    ping serves as an important diagnostic tool for network engineers, system administrators, and even curious technology enthusiasts.
  • How to Customize Linux TerminalPhoto of How to Customize Linux Terminal
    it seems like no matter what distribution you use, the terminal emulator is the most boring thing. the good thing you can do is make it look a little better with lots of customization options.
  • What is Gentoo Linux? How to install?Photo of What is Gentoo Linux? How to install?
    gentoo linux is a powerful and scalable distribution that sticks to the original source-based package management mechanism.