Running Classic MS-DOS games on the Pi 400

From LearnLinux.tv Wiki
Revision as of 13:01, 29 December 2020 by Jay (talk | contribs) (→‎Setting up the Pi 400)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

The Raspberry Pi 400 is a complete computer with a built-in keyboard, so why not turn it into a classic PC game system? In this video, I talk about a recent project I worked on for fun where I configured RetroPie to run various MS-DOS games via DOSBox.

Relevant Links
Original Video

Setting up the Pi 400

Install RetroPie onto an SD card

You can download RetroPie from the official download page.

Once downloaded, you can use usbimager to flash the downloaded RetroPie image onto the SD card (which will completely overwrite it). You can download usbimager from its official Gitlab page.

After you finish flashing the SD card, insert it into your Pi 400 and boot it. It will start up, and then reboot again.

Enable SSH (optional)

Although not required, SSH is one method you can use to connect to your RetroPie installation. See the official documentation page for how to enable SSH in RetroPie.

Set localization options (optional)

If you're not in the UK, you may have trouble with the keyboard layout in RetroPie. To resolve it, set the localization options accordingly. To do so, follow the documentation page for Raspberry Pi OS. Consider configuring the locale, keyboard layout, and timezone settings accordingly.

Enable DOSBox

By default, DOSBox is not included by default in RetroPie. To install it, open up a command shell inside RetroPie (I used SSH for this) and execute the following commands:

 cd /home/pi/RetroPie-Setup/
 sudo ./retropie_setup.sh

This will open the RetroPie-Setup script. Once there, navigate to "Manage Packages", then "Manage Optional Packages", then scroll down to "dosbox" and choose to install the binary.

Adding Games

Depending on the game, you can run the installer or just copy the files for the game into the appropriate directory. I created a specific directory for games:

 mkdir ~/RetroPie/roms/pc/.data/

And then I copied files for each game to that directory.

Then, I created config files for each game and stored them in the /home/pi/RetroPie/roms/pc/ directory, and each file is a simple text file with a file extension of ".conf". You'll need one for each game. You can use a preincluded DOSBox config file as a starting template. For example, if you are planning to install Doom on your RetroPie, run the following command to create a file for the game as a starting point:

 cp /home/pi/.dosbox/dosbox-SVN.conf /home/pi/RetroPie/roms/pc/Doom.conf

Then, tweak the /home/pi/RetroPie/roms/pc/Doom.conf file as needed.

Example config files

Here are a few examples of some config files I used in the build that was shown in the video.

Doom II

 [sdl]
 fullscreen       = true
 fulldouble       = true
 fullresolution   = desktop
 windowresolution = original
 output           = openglnb
 autolock         = true
 sensitivity      = 100
 waitonerror      = true
 priority         = higher,normal
 mapperfile       = mapper-SVN.map
 usescancodes     = false
 
 [dosbox]
 language = 
 machine  = svga_s3
 captures = capture
 memsize  = 16
 
 [render]
 frameskip = 0
 aspect    = true
 scaler    = normal3x
 
 [cpu]
 core      = auto
 cputype   = auto
 cycles    = auto
 cycleup   = 10
 cycledown = 20
 
 [mixer]
 nosound   = false
 rate      = 44100
 blocksize = 1024
 prebuffer = 25
 
 [midi]
 mpu401     = intelligent
 mididevice = default
 midiconfig = 
 
 [sblaster]
 sbtype  = sb16
 sbbase  = 220
 irq     = 7
 dma     = 1
 hdma    = 5
 sbmixer = true
 oplmode = auto
 oplemu  = default
 oplrate = 44100
 
 [gus]
 gus      = true
 gusrate  = 44100
 gusbase  = 240
 gusirq   = 5
 gusdma   = 3
 ultradir = "U:\"
 
 [speaker]
 pcspeaker = true
 pcrate    = 44100
 tandy     = auto
 tandyrate = 44100
 disney    = true
 
 [joystick]
 joysticktype  = auto
 timed         = true
 autofire      = false
 swap34        = false
 buttonwrap    = false
 circularinput = false
 deadzone      = 10
 
 [serial]
 serial1 = dummy
 serial2 = dummy
 serial3 = disabled
 serial4 = disabled
 
 [dos]
 xms            = true
 ems            = true
 umb            = true
 keyboardlayout = us
 
 [ipx]
 ipx = false
 
 [autoexec]
 mount c "~/RetroPie/roms/pc/.data/doom2.pc"
 mount u "~/RetroPie/roms/pc/.data/ultrasnd"
 c:
 DOOM2.EXE
 exit

Mortal Kombat 3

 [sdl]
 fullscreen       = true
 fulldouble       = false
 fullresolution   = original
 windowresolution = 1280x800
 output           = openglnb
 autolock         = true
 sensitivity      = 100
 waitonerror      = true
 priority         = higher,normal
 mapperfile       = mapper-SVN.map
 usescancodes     = false
 
 [dosbox]
 language = 
 machine  = svga_s3
 captures = capture
 memsize  = 16
 
 [render]
 frameskip = 0
 aspect    = true
 scaler    = normal
 
 [cpu]
 core      = normal
 cputype   = auto
 cycles    = auto
 cycleup   = 10
 cycledown = 20
 
 [mixer]
 nosound   = false
 rate      = 44100
 blocksize = 1024
 prebuffer = 20
 
 [midi]
 mpu401     = intelligent
 mididevice = default
 midiconfig = 
 
 [sblaster]
 sbtype  = sb16
 sbbase  = 220
 irq     = 7
 dma     = 1
 hdma    = 5
 sbmixer = true
 oplmode = auto
 oplemu  = default
 oplrate = 44100
 
 [gus]
 gus      = true
 gusrate  = 44100
 gusbase  = 240
 gusirq   = 5
 gusdma   = 3
 ultradir = U:\
 
 [speaker]
 pcspeaker = true
 pcrate    = 44100
 tandy     = auto
 tandyrate = 44100
 disney    = true
 
 [joystick]
 joysticktype  = auto
 timed         = true
 autofire      = false
 swap34        = false
 buttonwrap    = false
 
 [serial]
 serial1 = dummy
 serial2 = dummy
 serial3 = disabled
 serial4 = disabled
 
 [dos]
 xms            = true
 ems            = true
 umb            = true
 keyboardlayout = us
 
 [ipx]
 ipx = false
 
 [autoexec]
 mount c "~/RetroPie/roms/pc/.data/mk3.pc"
 imgmount d "~/RetroPie/roms/pc/.data/mk3.pc/iso/mk3.cue" -t iso -fs iso
 mount u "~/RetroPie/roms/pc/.data/ultrasnd"
 c:
 mk3.exe 0666
 exit