Showing posts with label Gaming. Show all posts
Showing posts with label Gaming. Show all posts

Sunday, November 11, 2018

Emulating MS-DOS on a Raspberry Pi and Playing Games using DOSBox

I have a soft spot for MS-DOS, as it was the first PC operating system I used. It started in 1984 with Compaq luggable computers available for loan at Caltech and at JPL when I worked there over the summer of '84. I don't ever recall using IBM's version, PC-DOS, as I never recall using IBM hardware. But thanks to using 100% IBM compatibles rather than offshoots like Tandy computers, it really didn't matter.

The first PC we bought, one of our first large purchases as a couple, was the first Compaq Deskpro (Model 1, 8086), Compaq's first foray into desktops after the success of the Compaq portable.

Compaq Deskpro Model 1 (8086) via this site.
So I have a soft spot for DOS computing.

I've wanted to put DOS on small, modern hardware for awhile. My first project is using the Raspberry Pi 3.

I have a RasPi mounted to the official Raspberry Pi display.
Raspberry Pi and official LCD display (photo via this site)
The only hardware you need to add is a keyboard (a mouse helps for setup). I have a couple of wired keyboards with built-in trackpads. Any USB keyboard that the Pi will recognize will do.

There are many Raspberry Pi tutorials on loading Dosbox, the MS-DOS emulator for Raspberry Pi. This one at PiMyLifeUp appears to be just fine, I think I followed a different one but they are very similar.

I set Dosbox to use the directory dos under /home/pi as my MS-DOS disk. I mapped this to drive C:\

I added a link to the graphical interface under games.

How to get the files from my PC to the Pi? There are many ways to do this, some more painful than others. 

I used this guide at Raspberry Pi HQ to use SAMBA to map my DOS directory as a network shareable location. This guide may also help.

I said public=yes which means anyone can access my Pi but I suggest you have the login. My SAMBA setup allows access to the entire /home/pi directory - you might want to just map the dos directory for more security.

In Windows file explorer, in the location bar type \\raspberrypi\pi and you should see your files. Note that you'll have to enter a password if you configured it.

Copy over your games. Our favorite is Rogue, redone for PC from the DEC VAX et al. sources. Wikipedia. You can play it in-browser here to try it out via Internet Archive (it's some sort of hacked copy there though). You can see it being played by someone in this Youtube video.

Rogue is in color and is ASCII graphics like alot of early text games and programs. I think our copy was ported from Unix and not a copy of the Epyx release, Techers did a lot of porting to MS-DOS from Unix back then.

I still had the original files from the '80s to I copied them over to the Pi and they appear in a subdirectory in Dosbox. And it runs like a champ!


If you are looking for MS-DOS Games/software, you can Google around. One site I found is abandonia.com which looks good. In all their software, they have Rogue also if you want it.

Hopefully this has given you some ideas for how to set up your own MS-DOS emulator. If you think I skipped steps or it is unclear, there are other sites that may have better step by step.

I hope to run a real 8088 code emulator on hardware soon. It all depends on time.

Tuesday, February 5, 2013

Esplora LCD Pong Game

The Arduino Esplora is blooming as a game platform. This includes use as a standalone game machine as documented in my previous posts.  Add an Adafruit 1.8 inch TFT LCD display or the official Arduino display onto the little-documented expansion header and the Esplora is a game platform rather than a controller.
Add an LCD to your Esplora and you have a standalone gaming platform
The first game on an Esplora + LCD was a platform bounce game I ported from work by R0d0t.  But I also eyed a Pong game posted to Youtube by David Rutherford.

So I contacted David and he sent me over the code the other day.  David stated the code was not textbook code - besides adding Esplora button presses, I did some reformatting and documentation.

The Arduino may be powered by a USB cable to your PC, a USB phone brick, or a phone backup battery.

So here I present the classic one-player Pong game.  It uses the Esplora right-hand buttons 2 and 4 (up and down) to allow the player to move their paddle up and down.  First player to 5 wins.  The Arduino plays a good game but can make some bonehead moves every now and then - definitely not easy to beat it.

To start a new game, you press the right button (labeled Switch 3).
Player's paddle on screen is on the left, control buttons to the right.  Excuse my photography...
You can download the code for free on Github at https://github.com/TheKitty/EsploraApps.

You can mod the game but it may not be the simplest process.  I looked into use of the joystick for paddle control and I found it sluggish.  The game may be sped up by not drawing the lines and score after every ball move.  Perhaps the gameplay calculation conditional statements could be a bit clearer.  If you do speed up the game, you should have something to govern the ball speed - I would suggest the slider below the display controlling a delay.

If you want a cleaner version of the code, the official Arduino.cc website has a version of Pong at https://www.arduino.cc/en/Tutorial/EsploraTFTPong