DISCOVER
X

Raspberry Pi: Retro Gaming Mania Part 2 – DosBox

March 30, 2013 7:37 pm 3 Comments
FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail

scooters magic castleWelcome to the part 2 of Raspberry Pi Retro Gaming Mania, today we’ll take a look at DosBox, the greatest DOS emulators around. We are going to go through the least painful ways setting up DosBox from beginning to playing a game on the Raspberry Pi.

By the way if you haven’t read it yet, the part 1 of this series is about RetroPie/RetroArch.

Install DosBox

This is really easy on the Raspberry Pi. Simply boot up to the command line and enter this command:

This will install dosbox automatically on your system.

Setup Your Resolution

To make our hardware process less rendering later on, I recommend using lower resolution on your Raspberry Pi. This way the machine won’t have to deal with graphics scaling.

So, like indicated in my previous installation guide, let’s set the hdmi_mode to lower resolution.

  1. Open /boot/config.txt (you can use vi in the terminal or leafpad on the graphical desktop)
  2. Set hdmi_mode to: hdmi_mode=4 
    • It’s possible to comment out your previous mode for later use so you won’t have to keep referring to the lookup table.
  3. Save the config file
  4. Restart your Raspberry Pi. You should then get larger fonts everywhere, not so pretty, but functional.

Prepare Your Game

scooters magic castleYou can get old DOS games from great many abandonware websites as well as gog.com, which is one of my favourite website by the way. However if you are getting DOS games from gog.com you’ll have to extract the files and then transfer the game files to the Raspberry Pi, because as far as I know GOG installer only works on Windows and OSX.

Anyway, let’s download a game from http://www.abandonia.com. This is one of the most complete abandonware website out there, support them too if you can.

For the purpose of our exercise, we will use a children game called Scooter’s Magic Castle. I used to own the game and used to play it on my 486DX machine with Sound Blaster 16.

So start you graphical desktop if you haven’t:

Then open your web browser and download your game.

Extract the game to a directory of your choice. The directory that I’m using is:

So that’s it for the game preparation, we now have to make it work with DosBox

Setup the DosBox Configuration

Remember that by default DosBox loads the dosbox.conf on your current directory.

Therefore since our directory is /home/pi/dos/scooter, let’s create a dosbox.conf file under this directory. So go ahead and use VI or Leafpad to create this file.

My configuration for this game is the following:

In the sdl section I have set the full resolution to 640 x 480 to match the Raspberry Pi’s screen resolution settings that we set in the previous section. I have also set this game to start in fullscreen immediately for better experience.

As you can see in the next sections of the configuration file I have also set frameskip to 12, the animation won’t be as fluid but it helps with performance. Furthermore core has been set to auto and cycle to 888. The cycle is an approximation with a bit of trial and error, I simply tune the cycle up and down to hit the sweet spot, we’ll talk about this more later.

Notice that I have set all of the uneeded speakers and soundcards off. This is an attempt to lighten the load of the emulator so that it won’t need to emulate the uneeded hardware components.

Lastly, the autoexec is one of the most important portion of the config. This is simply the commands that you wish to run when starting dosbox. In this autoexec, we mounted our game directory as the drive c. We then change our current working directory to drive C. Then we run scooter.bat to start our game.

Start Your Game

So here we go, our game is set an ready to use.

  • startx, if you haven’t
  • cd dos/scooter, navigate to your game directory
  • dosbox, run dosbox, it’ll load the config automatically and because of our autoexec the game will load automatically.

Performance Enhancement

scooters magic castleIn order to experiment with the correct CPU cycle, I found the best way is by going out of fullscreen mode the toggle cycle up and cycle down. You’ll see the numbers printed out on the terminal that you are running on.

  • Go out of fullscreen: alt + enter
  • Experiment with cycle up and down: ctrl + F11 or ctrl + F12

Useful Shortcuts

I always forgot these dosbox hotkeys so I’ll provide you with the link to the DosBox website here.

This way you’ll know how to force exit, release mouse pointer, cycle up/down and many more.

Closing

So there you go, by now you should have one full working game on your Raspberry Pi and with that basic configurations that I just showed you, you should be able to adapt that to any other dos games. Have fun :)

FacebooktwitterredditpinterestlinkedinmailFacebooktwitterredditpinterestlinkedinmail
Tags: , , ,

Categorised in: , , ,