Last Updated on September 26, 2022.
The basic version of DOSBox does not contain support for ‘shaders’. Those little bits of code and configuration that can make a modern retro gaming screen look cell shaded, dotted like an old school CRT monitor, or even curved and blurred like an old TV tube. So how do I get shaders? We have to utilize a fork or variant of DOSBox. Let’s run a comparison of these shaders in a MSDOS Retro Gaming screenshot session of DOOM.
I have plans for three dioramas. One is complete – the C64 years. I still have an Atari 2600 and IBM PC diorama to do, and the latter is a bit more technically challenging when it comes to actually playing the games. Not only do I have to worry about DOS games, but Windows 3.1, Windows 95, and even some Windows 98 gaming, and attempting to make all of those games work on one small PC that will host the actual gameplay.
Why DosBox at all?
Between the old copies of games I have on CD and floppy images (I saved a lot of crap digitally if not physically), the actual CDs themselves, and sites like GOG.com, I’ll be able to relive a lot of my old gaming days. This is, of course, thanks in no small part to a little program called DOSBox.
From their site to explain it best: DOSBox is an emulator that recreates a MS-DOS compatible environment (complete with Sound, Input, Graphics and even basic networking). This environment is complete enough to run many classic MS-DOS games completely unmodified.
It’s the de facto standard for running DOS games on modern hardware.
I am 32 flavors and then some
To that end, there’s almost always a variant of DOSBox that gains popularity for a while because DOSBox ‘proper’ doesn’t support every single feature a DOS gamer might want to utilize when playing a game (e.g. Voodoo 3Dfx support). There are a decent number of variants that fall under the label of ‘SVN Builds’, you can check em all out here: https://www.dosbox.com/wiki/SVN_Builds.
One of the most popular variants today is called DOSBox ECE, standing for Enhanced Community Edition. It emulates 3Dfx hardware and supports up to 384 MB of ram, two things that the standard DOSBox build doesn’t cover.
Remember that you don’t have to use one version of DOSBox for every single game you play, although if you could, that would be ideal from a configuration management standpoint, as each variant may have different config file options available.
Now we have variants like DOSBox X, SVN Daum, ECE, and even CRT, which first caught my eye because, while I don’t always play with shaders (I dislike them on VICE), I wanted to see what the DOSBox world had to offer me. However, I wanted a relatively recent version of DOSBox with shaders. The hunt begins.
DOSBox CRT is close but no cigar
DOSBox CRT fit the bill at first – it’s essentially DOSBox 0.74 with a custom shader to give that real CRT look and feel. As much as I liked the inner screen rendering of it, this version essentially paints a CRT border around the screen that becomes part of your DOSBox window… I did not find this palatable:
Good job and a nod to Mattias Gustavsson for compiling his custom shader work into DOSBox. It just wasn’t for me. So our hunt continues. I didn’t want to use Retroarch for this, and I wanted something a little more recently maintained…
An Optionals requirement is found
I stumbled across another DOSBox variant called DOSBox Optionals, created by Marty Shepard with near latest enhancements of DOSBox ECE, standard DOSBox, and other patches people have released that aren’t incorporated into the ‘standard DOSBox’ build. Marty has done a fantastic job of grouping all of these enhancements into a single DOSBox build that also supported the shader patch by duganchen. VOGONS thread about that support here.
I downloaded and extracted DOSBox Optionals and opened up the dosbox.conf. Yikes! The sheer number of options and documentation to each option compared to the normal DOSBox install was amazing. I recommend trying it out – I’ve tried a handful of titles with it thus far and they’ve worked, though I did discover a speech pitch issue. I’ll cover that later in this post.
So without any ‘shaders’… What does DOSBox Optionals look like? Let’s compare shader to non shader. Given that I’m scaling my screen up, my no-shader view will have a slight blurring to it – but that’s not the shader.
Using DOSBox Optionals I took a ‘before and after’ screen shot of ‘no shader‘ and the ‘crt-lottes_mod‘ shader. You can drag the vertical slider below with your mouse and immediately see a difference.
Please note that the new defaults (scaler=none, aspect=on) are needed for the shaders to work as designed.
The results? Immediate shift to a more ‘dot-based’ look, a little darker and very much closer to a curved CRT. Compare yourself – the left side is without any shader and the right side is with ‘crt-lottes_mod’ selected. Drag the line to move your comparison from left to right.
Let’s zoom in and see what it looks like:
I’m impressed. You really get a sense of the dots and CRT nature of the view, and the phrase ‘dot pitch’, which I haven’t thought about in probably a decade, comes right back like it was yesterday. This isn’t just any simple scan-line filter.
Quick rundown of 13 shaders in DOSBox and DOOM
What about some of the other shaders? Let’s take a look – you can use the compare slider to look at the same screen shot of DOS and the same screen shot area of DOOM and compare shaders. I imagine one shader might be good for one game and one for another – or if you’re playing CGA, EGA, VGA, or ANSI text games, you very well might want a specific kind of shader for those resolutions and colors.
For me, I’ve really got my eye on crt-lottes_mod and crt-easymode. GTU looks like a contender as well. Some of these other shaders are just nuts – FixingPixelArt gives one hell of a blur for example, and the xbr (#4,#5) shaders give it a ‘behind stained-glass’ feel to me.
Modifying shaders for testing
As much as I like crt-lottes_mod, I have some tweaks I’d like to make:
- I don’t like curvature shaders. I know it’s trying to be more realistic, it’s just so damn off-putting to me, I’d like to disable it.
- It’s a little too dark – I’d like to increase the brightness a little bit.
I started to wonder – if I do this, does it end up looking like crt-easymode? Let’s tweak it a bit and find out.
I’m going to head over to the SHADERS/crt-lottes_mod.frag file and tweak a few values:
#define warpX 0.000 //0.021, 0.007 #define warpY 0.000 //0.045, 0.021 #define brightboost 1.0
Let’s compare crt-easymode to my custom-mod-v1:
Granted, you could spend all day playing around with parameters, and while I feel the lottes_mod definitely has a lot more in the way of customization options, I’m leaning towards crt-easymode even with the modifications I made to flatten lottes and brighten the screen. This is just to get something going to see if I like it enough. It’s also a little lighter on the GPU than lottes will be from what I gather, which is good since I won’t be playing my DOSBox titles on a super high end modern machine.
DOSBox Optionals comes with free Chipmunks
Once I found a shader setting I wanted to try out for a bit, I needed to test a few titles on DOSBox Optionals to make sure it worked for my gaming tastes. Optionals comes packaged with a demo for DUNE2, one of the first Real Time Strategy games, and a Westwood classic.
I fired up the demo and as soon as the voice synthesis came on, I could tell something was just a bit… chipmunky. This was with default settings that come with the DOSBox Optionals install. Listen to this:
This did *not* happen running the same DUNE 2 demo on regular DOSBox, so I knew it was something specific to Optionals. But what? What patch is inserting Alvin into my games? I found this VOGONS thread referencing elevated pitch in DOSBox, calling out this code in particular:
I found a reference to Goldplay while searching the DOSBox Optionals repository:
Snippet pulled from https://github.com/MartyShepard/DOSBox-Optionals/blob/master/dosbox/tOptionals/src/hardware/sblaster.cpp at the time of this writing.
So, Goldplay. We’re now just a bit above my pay grade – it’s DMA transfers, sample rates, and IRQ programming. Nevertheless, I set
goldplay = true in the dosbox.conf and voila:
I’ll have to keep that configuration option in mind in the future if something seems off in Speech. But between DUNE2, the demo and the game, along with Ultima Underworld, I needed to have this setting set to true for speech to sound proper.
Got some shader settings you like? I’d love to know if there’s a favorite preset or game/app you use a particular shader for. I’ll probably stick with crt-easymode for now, though I might look at the shader configuration and tweak a few things and see what happens. That’s what shader configs are all about – experimentation – because if a shader just isn’t doing anything for you, and it’s not reminding you of the monitor model you played that game on – tweak it!
- https://github.com/MartyShepard/DOSBox-Optionals – DOSBox Optionals Repo
- https://github.com/duganchen/dosbox_shaders – Duganchen’s shaders included in DOSBox Optionals
- https://mattiasgustavsson.itch.io/dosbox-crt – DOSBox CRT Build
- https://www.vogons.org/viewtopic.php?t=33896 – VOGONs thread regarding sample rate and DMA for SoundBlaster devices
- http://filthypants.blogspot.com/2015/04/more-crt-shaders.html – A good article referencing example shots of these shaders utlized in other emulators like RetroArch.
- https://emulation.gametechwiki.com/index.php/CRT_Shaders – General Shaders article – references a lot of shaders converted over to DOSBox (Duganchen’s build) and included in DOSBox Optionals.
- https://scalibq.wordpress.com/2017/03/12/dma-activation/ lots of technical information but references SoundBlaster GoldPlay