Saturday, April 17, 2021

DOSBox-X, the missing link on Raspberry Pi

🕐🕐🕐🕐 Duration: Days
🔧🔧 Difficulty: Medium
🌟🌟 Interest: Serviceable

If you want to run x86 games, you have two main solutions out there: DOSBox and Wine-x86 (with Box86)

However, the game coverage using both these solutions is not complete: some 16-bit games that began on early Windows 95/Windows 98 don't run with Box86 (and ptitSeb doesn't plan to extend Box86's coverage to 16-bit games) and DOSBox will not run Windows games.

Is there a solution?

So far DOSBox-X has early Windows versions support (95, 98 and even ME).
We are going to see here how to install DOSBox-X and a Windows version and our test game will be "Command and Conquer: Red Alert" (with the runnable RA95.exe).

QEMU-system?

QEMU-system will install Windows 95/98/ME as well and might be faster than DOSBox-X. However, Windows in QEMU-system is very unstable and will not give playable results. As we are going to see hereafter DOSBox-X gives a stable solution (even if slow) to play old 16-bit games.

Installing DOSBox-X

DOSBox-X doesn't provide a Raspberry Pi version on their site. We are going to need to compile it. Hereafter is how to do:

  • From a started Raspberry Pi OS, go to console (ctrl-alt-F1) and type:

cd ~/

git clone https://github.com/joncampbell123/dosbox-x/

sudo apt-get update

sudo apt-get install -y build-essential automake libx11-dev libxkbfile-dev libxext-dev libncurses5-dev libavcodec-dev libswscale-dev libavformat-dev

sudo apt-get install -y automake libsdl2-dev libsdl2-mixer-dev libsdl2-ttf-dev libsdl2-image-dev libsdl1.2-dev

  • Then we need to do a bit of hacking since Raspberry Pi will not be able to handle make -j3 in the current case. Edit "build file":

cd ~/dosbox-x

        nano build

  • In "build" file, go to the end and replace:
./configure --enable-core-inline --disable-debug --prefix=/usr "$@" || exit 1
make -j3 || exit 1 
    BY:
./configure --enable-core-inline --disable-debug --prefix=/usr "$@" || exit 1
make -j1 || exit 1
  • Secure your voltage if you don't have a decent voltage supply:
    • Remove all unnecessary devices (eg. external HDD)
    • Lower your cpu frequency if necessary:
          sudo apt-get install cpufrequtils
          sudo cpufreq-set -g userspace
          sudo cpufreq-set -f 1000Mhz
  • You are ready to:
        cd ~/dosbox-x
        ./build
  •  Restart any crash with:
        make -j1  
 
Estimated duration: 1 hour

Installing Windows

Follow the guide on DOSBox-X site. For example:

https://dosbox-x.com/wiki/Guide%3AInstalling-Windows-98

Follow installation method 2.

Tips:

  • It will take one to two days.
  • I would decrease the weight of Windows as much as possible.
    • For the sake of this guide, I installed a Windows 98 SE version.
    • For the purpose of gaming, I would install a stable Windows 95 version (less power-hungry). For example, Win95 C without IE4.
  • You should at least make a 2GB IMG because additionnal drive support doesn't work well.
  • Install your system on a SD card, not on a mechanic hard disk as it will be faster.
  • So far there is no sound support on DOSBox-X/Win98SE. It is advised to disable sound in the game configuration. (REDALERT.INI provided if necessary)
Windows 98 Raspberry Pi OS Raspbian Buster DosBox-x
A windows 98 installation running on
Raspberry Pi OS buster on a Raspberry Pi 3B+


 

Performance

Performance is quite slow. It is advised to play from a SD card. Also using DOSBox frameskip and OpenGL setting will help it get faster. A sample dosbox-x.conf will be available here. For here I advise you to get a high end Pi to get your old 16-bit games running although Red Alert is playable on a Pi3B+ with a decent dosbox.conf.
 

You might want to add "boot c:" at the end of the dosbox.conf file so it directly starts in Windows.
You might also want to decrease frameskip from my dosbox.conf if you are running a more performant or a less resource-greedy (eg Windows 95) system on DOSBox-X

"Command and Conquer Red Alert": is it running?

Yes! It runs. Important notes:
  • Redalert.ini has to be configured without sounds
  • It is advised to remove intro from Redalert.ini (Here is a version that you can place in your Redalert directory)
  • Red Alert is slow to load (count more or less 2 minutes before you reach main menu).
  • Playing map is slow but playable
  • I have used ptitSeb's GL4ES to get a decent OpenGL support.
Raspberry Pi Raspbian Redalert95 RA95 running Red Alert
Redalert "RA95.EXE" started in
Raspberry Pi OS on Raspberry Pi 3B+


Sound

Sound is configurable in Windows 98. You can select in control panel> system > peripherals > sound peripherals > "Sound blaster 16, AWE32 or compatible" as driver and use your DOSBox-X settings as Adress, IRQ, low and high DMA. 
For instance, if you are using default settings, you will have adress 220, IRQ 7, LDMA 1 and HDMA 5. Sounds will play if you test them in Windows 98.
 
However, the sound compatibility stops there. If you want to bridge this driver to running games it will not run. Games will freeze and refuse starting. I sadly had to retreat to a no sound configuration to get "Red Alert" running in Windows 98.

RetroPie?

Running DOSBox-X is .sh script-based and doesn't need an xserver. So you can simply put your .sh scripts in "Ports" sections. 
If you want a full screen, you might have to scaler in your dosbox.conf inside [render]:
 
[render]
scaler=normal2x
 
OR:
 
[render]
scaler=normal3x
 
However the script will always start your Windows 95 or Windows 98 machine, not go straight to your game. You can put a quick link to your game in your start menu to go directly to your game. 
 
You will also have to quit your virtual machine manually (start menu > shutdown).
Also note that older Pi's will not benefit OpenGL support in RetroPie. Only Pi 4's and newer.

Expectations

You can expect all RTS and TBS to play on your Raspberry quite fluidly. For FPS games and action games like "Wing Commander 3", give a shot to a Windows 95 installation on a Pi 4. It might nevertheless be too slow to be decently playable on a Pi 3. However some of these games (like "Wing Commander 3") also have a VGA version for DOS which will make them playable on older devices.

In terms of compatibility, this fills the last gap and guarantees that we can actually play our Windows 95 early 16-bit games.

The pi gamer

No comments:

Post a Comment

Play ET: Legacy on Raspberry Pi [FPS]

🕐🕐 Duration: A few hours 🔧 Difficulty: Easy 🌟🌟🌟🌟 Interest: Hours of fun