Moonmarch
Posts: 133
Joined: Thu Mar 07, 2019 1:34 am

DOSBox 0.74-3 MSDOS x86 emulator

Sun Jul 14, 2019 9:13 am

Version 0.74-3 of the DOSBox program was released recently, the previous version of DOSBox was version 0.74-2 if you do not have plans to build the DOSBox source code, you can always install the DOSBox program included in the Debian repository, this is version 0.74 of the DOSBox program:

Code: Select all

sudo apt install dosbox
Here is a link to the DOSBox website:

https://www.dosbox.com/

To download the DOSBox source code, open the terminal:

Code: Select all

wget https://sourceforge.net/projects/dosbox/files/dosbox/0.74-3/dosbox-0.74-3.tar.gz
To unpack the file:

Code: Select all

tar -xzf dosbox-0.74-3.tar.gz
Before building the source code you will need to download and install all relevant dependencies from the Debian repository, the list of dependencies needed for the DOSBox program can be found in the INSTALL document located in the dosbox-0.74-3 folder, if you do not install all needed dependencies the program will not compile successfully.

Here are dependencies you will need to compile the source code all other listed dependencies are optional:

Code: Select all

sudo apt install autoconf autotools-dev automake libsdl1.2-dev
I'm having difficulties building DOSBox 0.74-3 on Raspbian Buster when I wrote this guide I compiled the DOSBox program with Raspbian Stretch, until this situation is sorted out the SVN build of DOSBox compiles successfully with dynamic recompiler on Raspbian Buster, here are the instructions on how to compile the SVN build of DOSBox:

Install subversion:

Code: Select all

sudo apt install subversion
Download the SVN repository:

Code: Select all

svn checkout https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk dosbox-code-0
Build the DOSBox SVN program:

Code: Select all

cd dosbox-code-0

Code: Select all

./autogen.sh

Code: Select all

./configure

Code: Select all

make -j2
To build the DOSBox 0.74-3 program:

Code: Select all

cd dosbox-0.74-3

Code: Select all

./autogen.sh

Code: Select all

./configure

Code: Select all

geany config.h
After opening config.h with Geany here are the lines of code that need to be edited:

Line 37: /* #undef C_CORE_INLINE */
Line 37: #define C_CORE_INLINE 1

Line 51: /* #undef C_DYNREC */
Line 51: #define C_DYNREC 1

Line 91: #define C_TARGETCPU UNKNOWN
Line 91: #define C_TARGETCPU ARMV4LE

Line 94: /* #undef C_UNALIGNED_MEMORY */
Line 94: #define C_UNALIGNED_MEMORY 1

Ctrl + s to save then Ctrl + q to quit, after closing Geany in the terminal run the command:

Code: Select all

make -j2
Compiling the program will take at least 15 minutes, to open the program:

Code: Select all

cd src

Code: Select all

./dosbox
To change the configuration settings open the dosbox-0.74-3.conf or dosbox-SVN.conf file located in /home/pi/.dosbox hidden directory, here are some settings that should be included in the dosbox config file:

[sdl]
windowresolution=640x480
output=surface

[render]
scaler=normal2x

[cpu]
core=auto
cycles=auto

Using different settings can slow down the DOSBox program you can always edit the settings manually core dynamic should be available in the CPU settings, to run the DOSBox program in full screen you will need to enable full KMS drivers in raspi-config.

Games that I tested using the DOSBox emulator all tested games are completely playable:

-Wolfenstein 3D
-Spear of Destiny
-Ultimate Doom
-SimCity 1989
-Dune 2
-Doom 2
-SimCity 2000 Special Edition
-Descent

Update August 21st 2019:
-Added how to build DOSBox SVN explanation
-Miscellaneous improvements

Update August 17th 2019:
-Added dependency list
-Miscellaneous improvements

Update August 12th 2019:
- Added edit config.h explanation
- Miscellaneous improvements
Last edited by Moonmarch on Wed Aug 21, 2019 8:32 am, edited 3 times in total.

fruitoftheloom
Posts: 20685
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: DOSBox 0.74-3 MSDOS x86 emulator

Sun Jul 14, 2019 9:24 am

Moonmarch wrote:
Sun Jul 14, 2019 9:13 am
Version 0.74-3 of the DOSBox program was released recently, the previous version of DOSBox was version 0.74-2 which was more difficult to compile on the RPI computer in comparison to the recent version, the latest release requires no additional command line arguments or adjustments to config files to compile successfully.

If you do not have plans to build the DOSBox source code, you can always install the DOSBox program included in the Debian repository, this is version 0.74 of the DOSBox program:

Code: Select all

sudo apt-get install dosbox
Here is a link to the website:

https://www.dosbox.com/

To download the source code, open the terminal:

Code: Select all

wget https://sourceforge.net/projects/dosbox/files/dosbox/0.74-3/dosbox-0.74-3.tar.gz
To unpack the file:

Code: Select all

tar -xzf dosbox-0.74-3.tar.gz
Before building the source code you will need to download and install dependencies from the Debian repository, the list of dependencies needed for the DOSBox program can be found in the INSTALL document located in the dosbox-0.74-3 folder, install all of the dependencies.

To build the program:

Code: Select all

cd dosbox-0.74-3

Code: Select all

./autogen.sh

Code: Select all

./configure

Code: Select all

make -j2
Compiling the program will take at least 10 minutes, to open the program:

Code: Select all

cd src

Code: Select all

./dosbox
To change the configuration settings open the dosbox-"version".conf file located in /home/pi/.dosbox directory, here are some settings that you should adjust in the dosbox config file:

core=dynamic
cycles=auto

To run the program in fullscreen you will need to enable full KMS drivers in raspi-config.

Here are some games that I tested using the DOSBox emulator, didn't try out any full 3D games:

Runs at full speed:
-Wolfenstein 3D
-Spear of Destiny
-Ultimate Doom
-SimCity 1989
-Dune 2

Runs with slowdown:
-Doom 2

Somewhat playable:
-SimCity 2000 Special Edition

APT is Debian's preference:

Code: Select all

sudo apt update
sudo apt install dosbox

DOSBOX (0.74-2-3+deb10u1)

https://packages.debian.org/buster/dosbox
Retired disgracefully.....

Moonmarch
Posts: 133
Joined: Thu Mar 07, 2019 1:34 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Sun Jul 14, 2019 7:22 pm

I used the "sudo apt update" command, I did notice my computer did update, I was wondering why some programs would not update after running the apt-get update && apt-get upgrade command, to update a program what I did instead was run the apt-get install "program name" command which would update the program manually, thanks for the advice.

After searching Google I noticed today, apt is a program that is used similarly to tar which is a program that you can use to unpack tar.gz files, which will have commands that you can use with the program, the same situation with apt, is there a difference between apt and apt-get I would say both commands are different commands that you can use with the apt program, for a while I was only using apt-get update, apt-get upgrade, apt remove, apt autoremove, apt-get install, there are more commands you can use with apt.

I haven't installed Raspbian Buster yet, I will eventually my plan was to format the SD card then reinstall the operating system, the same idea with large Windows 10 updates, I format the hard drive then reinstall the operating system.

fruitoftheloom
Posts: 20685
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: DOSBox 0.74-3 MSDOS x86 emulator

Sun Jul 14, 2019 7:33 pm

Moonmarch wrote:
Sun Jul 14, 2019 7:22 pm
I used the "sudo apt update" command, I did notice my computer did update, I was wondering why some programs would not update after running the apt-get update && apt-get upgrade command, to update a program what I did instead was run the apt-get install "program name" command which would update the program manually, thanks for the advice.

After searching Google I noticed today, apt is a program that is used similarly to tar which is a program that you can use to unpack tar.gz files, which will have commands that you can use with the program, the same situation with apt, is there a difference between apt and apt-get I would say both commands are different commands that you can use with the apt program, for a while I was only using apt-get update, apt-get upgrade, apt remove, apt autoremove, apt-get install, there are more commands you can use with apt.

I haven't installed Raspbian Buster yet, I will eventually my plan was to format the SD card then reinstall the operating system, the same idea with large Windows 10 updates, I format the hard drive then reinstall the operating system.


https://wiki.debian.org/Apt

http://manpages.ubuntu.com/manpages/xen ... apt.8.html

.
Retired disgracefully.....

User avatar
leilei
Posts: 18
Joined: Wed Jun 26, 2019 2:26 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Sun Jul 14, 2019 10:19 pm

I recommend building from source as I don't think the binaries downstream have the ARM dynamic recompiler included (probably for debian security reasons).

The Pi3B gets roughly 486dx2-66 performance on the arm dynarec with max cycles and is somewhat playable for Duke Nukem 3D. Output=surface without scaling is fastest for the old VC4 driver. Also keep in mind that 15-30fps was perfectly acceptable in the era! Getting spoiled by 60fps wasn't until 1998 with the advent of 3d cards, write caching, PCI/AGP2X and such.

Moonmarch
Posts: 133
Joined: Thu Mar 07, 2019 1:34 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Mon Jul 15, 2019 12:12 am

My guide is not completely original, I decided to write the guide to let people know MS DOS emulation is possible on the RPI without needing to use a fork of DOSBox or use Retropie OS, the DOSBox program from the Debian repository was not able to run Doom 1993 at all for some reason, don't know if the forks of DOSBox will run faster on the RPI computer or are even currently in development.

Here are some guides on compiling DOSBox I found on the RPI forums:

DOSBOX with GLES2 + tv shader + dynamic recompiler:
https://www.raspberrypi.org/forums/view ... 8&t=110957

compiling dosbox with dynamic recompilation support:
https://www.raspberrypi.org/forums/view ... hp?t=95421

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: DOSBox 0.74-3 MSDOS x86 emulator

Mon Jul 15, 2019 2:14 pm

There is also FastDOSBox for the Raspberry Pi computers. Yes it is a bit older, though I am fairly sure it is still a good bit faster. Unfortunately the original site went down, though it is still on the Web Archivie at:
https://web.archive.org/web/20130629010 ... tware.html

You will probably want the Raspbian version of the three versions provided.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

Moonmarch
Posts: 133
Joined: Thu Mar 07, 2019 1:34 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Wed Jul 17, 2019 6:16 am

Thanks for the link FastDOSBox was one of the programs I was searching for after several days of adjusting settings on the DOSBox program from the Debian repository when I started using the RPI computer, I'll build the program one of these days, I heard about FastDOSBox I didn't use the program, because the program was not being actively developed there is no official website the last version released was 1.6 that was released in 2014.

If I had to choose to compile a program that runs video games or certain video games, I would compile a open source game engine for example system shock, which I will build one of these days don't know when, not every game has a source port, if I can't compile the game engine then I will use a MS DOS emulator.

Srandista
Posts: 5
Joined: Fri Sep 14, 2018 2:05 pm

Re: DOSBox 0.74-3 MSDOS x86 emulator

Thu Aug 01, 2019 10:18 am

leilei wrote:
Sun Jul 14, 2019 10:19 pm
Also keep in mind that 15-30fps was perfectly acceptable in the era! Getting spoiled by 60fps wasn't until 1998 with the advent of 3d cards, write caching, PCI/AGP2X and such.
Yeah, as you said, 15-30fps was acceptable back then, but from my point of view, it shouldn't be now (and I mean even for those old DOS games nowadays). I remember, that I was able to tolerate it, because I didn't know any better, but now, I really want to enjoy those games, and that means that I want to play them with acceptable framerate, which really is 60+. That is also a reason, why I don't use my RPi3B+ for DOSBox, because raw power of that SBC just isn't enough for good DOS experience. I'm really interested, how RPi4 fares in this matter (but it should be much, much better).

altharic
Posts: 26
Joined: Sun Apr 29, 2018 7:27 pm

Re: DOSBox 0.74-3 MSDOS x86 emulator

Fri Aug 02, 2019 10:34 pm

What exactly are you guys wanting dosbox to do Doom for example runs better on the pi as chocolate doom as a source port?

I do have a rpi4 and have compiled it from source and I do have a lot of old dos software what would be a good test?

Nightblair
Posts: 2
Joined: Tue Aug 06, 2019 7:15 pm

Re: DOSBox 0.74-3 MSDOS x86 emulator

Tue Aug 06, 2019 7:22 pm

Hello. I've been testing dosbox on RPI4 (my first RPI, so I can't compare it to previous one) and I find the performance adequate with Dosbox with dynarec. I've tried running Heroes of Might and Magic 2 and it's playable with dynamic and max cycles. I've tried to set cycles manually and it seems like it can run around 20000 cycles, then starts to be bad.

However, the sound is choppy no matter what I do. I still hear small pauses. I tried to change blocksize, and prebuffer, even lower the sample rate, but it's still the same. I'm not sure what is the reason. Might it be RPI scaling processor frequency?

EDIT: this is the case for all games, even these running much lower fixed cycles at full speed.
Last edited by Nightblair on Wed Aug 07, 2019 10:23 am, edited 1 time in total.

Moonmarch
Posts: 133
Joined: Thu Mar 07, 2019 1:34 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Wed Aug 07, 2019 8:19 am

If any game does not run at full speed with cycles=max then the game will have slowdown regardless of cycle count, because the CPU is being maxed out which can cause game to be unplayable I'm going to say games that came out after 1994 will not run on the DOSBox program on a RPI computer at full speed I do have more games that I can test, Quake, Fantasy General, Descent 2, Fallout, I don't have enough room on my SD Card right now some of these games require at least 1 GB of hard drive space, and I will need to extract the install files, I purchase DOS games from the Good Old Games website.

There are games that will require a virtual hard drive to install the game within DOSBox, and you will need to run the SETUP.EXE program which I will say is the reason why DOSBox is not for everyone, you will need to configure display settings, sound settings, etc., there are games that don't require any setup programs you instead run the game executable within DOSBox once you locate the game directory within the DOSBox program.

User avatar
leilei
Posts: 18
Joined: Wed Jun 26, 2019 2:26 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Wed Aug 07, 2019 11:54 am

altharic wrote:
Fri Aug 02, 2019 10:34 pm
What exactly are you guys wanting dosbox to do Doom for example runs better on the pi as chocolate doom as a source port?
Doom's a trustworthy landmark game for anything DOS. Chocolate Doom shouldn't render it irrelevant (it's still not quite dos doom perfect either)

Nightblair
Posts: 2
Joined: Tue Aug 06, 2019 7:15 pm

Re: DOSBox 0.74-3 MSDOS x86 emulator

Sat Aug 10, 2019 7:33 am

Looks like my woes with Dosbox was that it was not actually compiled with dynarec support after all.

Looking at Retropie installer scripts I've found the correct way how to do it:
  • Unpack it somewhere, then in the directory run:

Code: Select all

./autogen.sh
./configure --disable-opengl
sed -i 's|/\* #undef C_DYNREC \*/|#define C_DYNREC 1|' config.h
sed -i 's/C_TARGETCPU.*/C_TARGETCPU ARMV7LE/g' config.h
sed -i 's|/\* #undef C_UNALIGNED_MEMORY \*/|#define C_UNALIGNED_MEMORY 1|' config.h
make
make install
Heroes of Might and Magic 2 is running great now, no stuttering at 40000 cycles.

Moonmarch
Posts: 133
Joined: Thu Mar 07, 2019 1:34 am

Re: DOSBox 0.74-3 MSDOS x86 emulator

Sat Aug 10, 2019 8:17 am

I see what I forgot to include in the guide I did compile the source with dynamic core enabled using the SVN build of DOSBox not the 0.74-3 source code, I assumed the SVN build and the 0.74-3 source code were the same, because I downloaded the SVN build within the same week DOSBox was updated to 0.74-3, I'll update the guide when I have the chance Nightblair thanks for noticing.

When I downloaded the DOSBox SVN code I didn't need to adjust the config.h file to enable all available options I'll double check to be on the safe side.

Return to “Gaming”