Top 5 This Week

Related Posts

How to run DOSBox on your Raspberry PI and turn it into a retro PC

If you were lucky enough to come of age in the golden era of personal computing, you probably have fond memories of using a stack of floppy disks to install the latest game from Babbage’s on your family’s state-of-the-art 386 PC. Back then, Microsoft wasn’t the juggernaut that it is today, and Windows wasn’t an operating system, it was a program that ran on top of a more primitive operating system known as DOS.




Many a PC gamer cut their teeth installing games on DOS and figuring out how to tweak their settings to make it run. But as computers have become orders of magnitude more powerful, these incredible games have been forgotten, either because they are incompatible with modern operating systems, or because they run too fast on modern computers to be played. However, thanks to an open-source project called DOSBox, you can bring the golden age of retro computing back to life.

3:06

Related

You are officially old if you remember these PC parts

Here are five nostalgic components that, despite making our childhood special, failed to withstand the ravages of time

Installing DOSBox on your Raspberry Pi

Get ready to party like it’s 1995

This is the easy part. Assuming you’re starting with a fresh install of Raspberry Pi OS (I’m running Raspberry Pi OS 32-bit Debian Bullseye on a RPi 3B+), open the terminal and run sudo apt update and sudo apt upgrade to make sure all your software is up-to-date. Once that’s finished, install DOSBox by running sudo apt install dosbox in your terminal.


You’re also going to need a place to put your games and programs. You could just dump them in your home directory, but you’ll probably be happier in the long run if you keep things organized, so it’s recommended to make a new folder for your programs in your home folder.

mkdir ~/dos

Now that you’ve got everything set up, you can go ahead and run DOSBox by typing dosbox into your terminal. If everything so far has gone according to plan, a window with an emulated DOS CLI should pop up on your desktop. You can type exit into the terminal to close it.

DOSBox window on Raspberry Pi

Related

5 Raspberry Pi projects you can wear

Take your Raspberry Pi everywhere you go – literally.

Installing DOS games on your Raspberry Pi

Shareware is back, baby!

The next order of business is to find some games. You’ll have to find them on your own, but it shouldn’t be too hard to find a shareware copy of Doom from 1995.


The file you download from the internet will likely be in a .zip format, so the first thing you’ll have to do is decompress it. If you want to decompress it from the terminal, use the unzip command.

unzip source_directory/file.zip -d destination_directory/

If you are installing the latest version of the original Doom shareware, your unzip command should look a lot like this:

unzip ~/Downloads/doom19s.zip -d ~/dos/

unzipping Doom shareware on Raspberry Pi

Alternatively, you can unzip a file using the Raspberry Pi OS GUI.

  1. Start by moving the .zip file into the /dos directory you created earlier.
  2. Right-click on the file icon and select Extract Here.
  3. Profit.

You’re almost ready to play some Doom.


Playing DOS games on your Raspberry Pi

I can’t wait anymore, I need to play Doom!

When you start up DOSBox, you’ll notice that it defaults to drive Z. The drive Z displayed in the DOSBox emulator is virtual and isn’t connected to the filesystem on your Raspberry Pi. If you want to access your game, you’re going to have to tell DOSBox how to get to it. For that, you’ll need the mount command.

When using the mount command, you’ll have to specify a letter for the virtual drive you’re going to create, and a destination in your Raspberry Pi’s filesystem that the virtual drive will link up to. It should look something like this:

mount c ~/dos

mounting directory in DOSBox

Once that’s done, you can hop over to the newly created C drive by typing c:. Once there, you can see that it’s mirroring your ~/dos directory by typing in the dir command. If you’re ready to play some Doom, go ahead and install it by typing install to run the install.bat file. After some initial setup, you’ll have the original Doom running on your Pi.


Doom running on DOSBox on Raspberry Pi

Customizing the DOSBox settings

Dial in your settings

This is a good start, but you may want to tinker with the settings a bit before you call it a day and settle down for a few hours of Master of Orion. The most important thing to know is where the configuration file is. For whatever reason, DOSBox installs itself in a hidden folder in your home directory, so it’s not immediately obvious how to find it.

You can access and edit the config file via the command line with the command sudo nano ~/.dosbox/dosbox-0.74-3.conf. Granted, the exact version of the config file may have changed by the time you read this, so to be sure you’re accessing the right file, you can navigate to the hidden directory first by typing cd ~/.dosbox to access the hidden directory, then type dir to see the contents.


If you want to get there via the GUI, you’ll have to jump through a few hoops first.

  1. Start by opening up the file explorer.
  2. From the View drop-down menu, select Show Hidden Files.
  3. Click on the now-revealed .dosbox directory.
  4. Now you can double-click on the configuration file to edit it.

DOSBox configuration file

So, now that you can edit the configuration file, what should you change? The first thing to do is enable full-screen mode by changing fullscreen=false to fullscreen=true. This will get rid of the small window and give you a more authentic experience.

You also might need to change the cycles setting if your game is running too fast. You can either set it to a fixed number (cycles=fixed 5000 equates to 5 MIPS) or a percentage of your Pi’s max (cycles=max 50% limits DOSBox to using 50% of your CPU’s power).


If you spent any time with a 286 back in the early 90s, you’ll know how important allocating memory was back in that era. By default, DOSBox allocates 16MB of memory, but if you need more, you can change it with the memsize setting (memsize=32 equates to 32MB of memory).

Related

4 deciding factors to help you choose between the Raspberry Pi and other SBCs

The community-favorite Raspberry Pi definitely has its perks. But so do SBCs from other manufacturers…

The final bit of the config file you should definitely change is in the autoexec section. This is where the AUTOEXEC.BAT batch code is recorded. This code runs every time you start up DOSBox. Why add any code here? The biggest reason is so that you don’t have to run the mount command every time you want to play a game. Here’s how you get that done.

Scroll down to the bottom of the config file and add the following lines:

  • @ECHO OFF
  • MOUNT C ~/DOS
  • C:
  • CLS

This will mount your DOS drive, change the directory from Z to C, then clear the screen of all previous commands. The @ECHO OFF line sets it so those commands run invisibly.

There’s a lot more you can do with the config file, so it doesn’t hurt to look at the documentation.


Go back to your DOS gaming roots

You are now the proud owner of a Pentium-powered Raspberry Pi! Sure, there are often lots of better ways of playing the old DOS games that got you into computers in the first place. But there’s something about tinkering with the settings and slogging through the command prompt that really scratches that nostalgic itch. If your goal is authenticity, you can augment your setup with a 3.5” disk drive and install some of the old games that have been in the back of your closet for decades.

#run #DOSBox #Raspberry #turn #retro

source: https://www.xda-developers.com/dosbox-on-raspberry-pi/

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Popular Articles