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.
Throwing Shade…rs.
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.
Conclusion
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!
References
- 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
Although it seems like an clunky way of playing Dos games, I’ve found the DosBox core in RetroArch is a very solid experience and you can use a huge number of shaders (as well as map a modern controller – good for some games e.g. Alone in the Dark).
I didn’t like CRT or scanline shaders in the past, but I noticed some games looked kind of.. “dead”. For instance, I remember Lemmings really popping, the green and purple lettering, the rocky background texture shown between levels, but it looks dull on a modern display. I’ve found Easymode-CRT Halation with physical brightness setting on the monitor turned up full is a great combo. The halation provides colour bleed to smooth out the textures, the aparature grill provides some sharpness, and the brightness on the monitor is required to punch through the aparature grill.
Lemmings is a fine example, and I noticed the exact same feeling when playing it. I remember trying shaders in retroarch a while back, and I think I’ll try them again someday if I ever go back to retroarch – I tend to use it sparingly because I find the cores are great for gaming on some platforms, but then I’ll need to go against the actual emulator to get support for something unique I’m doing – like mouse support in Stella wasn’t available with the Atari 2600 core for retroarch but was working in the emulator. I digress – I like them in some games, especially those I remember playing with with that scanline effect in my youth. Another example for me is the Gold Box TSR/SSI games on the C64/IBM PC.
Man, Ben, it sure sounds like you’ve really spent some time trying out some combinations of shader and physical tweaks yourself!
I think part of why I haven’t tried to flex the DosBox core in retroarch as of late is the switch to GoG instead of trying to manually install or setup a lot of the cd images and disk images I’ve saved off over the years. I may have to consider it for Alone in the Dark though, because that game is on my bucket list and a modern controller will probably help the torture of going through that game again (I don’t think I actually finished it). ๐
Question โ I am literally UNABLE to get Dosnox-Optionals to launch an executable (a game) from a batch file or command line.
If I do it Interactively, as in starting a DOSbox shell and then typing the name of the gameโs executable, it works fine.
However if I launch DOSbox-optionals with the executable on the command line, it does not even attempt to run the executable. Anybody see this issue?
Example:
DOSbox c:\gamedir\game.exe
Does NOTHING… I just get a DOSbox shell with a Z: prompt.
Because of this, I cannot simply drop DOSbox-optionals as a direct replacement for my existing emulator front end.
Allan, I’ll boot my retro PC up tonight and take a look. I think you’re right, I recall having to do something with the command line and autoexec script.
So, what I ended up having to do on my end is put the autoexec related stuff into the dosbox configuration files under the [autoexec] section. Unfortunately I have to create one for each game I want to launch – in my case it’s a select set of games so I’m okay with it, but it could be painful if you’re trying to create a very generic launcher.
Example batch file to launch Dune 2:
Then in the ‘global’ config I have my basic drive mappings that I use regardless of my dos games, applies to all dosbox sessions:
Following that, in my Dune2 dosbox.conf, I have the specific game launch:
I can see why it’s not as ideal as a command line, but it does work.
I think DOSBox Optionals reverses the -noconsole function so it’s unnecessary to include (unless you *want* the console).
Anyway, thanks for the heads-up on Optionals. I found this post about a week ago and have been loving that crt-lottes. I’ve been going through my GOG library, replacing vanilla DOSBox and SCUMMVM with Optionals, and am surprised at how much the shader has refreshed my enjoyment of childhood favorites. Being able to force close with Alt-F4 whenever I fatally screw up a conf and crash the emulator is also super handy.
Thanks, Ben, glad the article gave you some new things to try. I found that I was able to replace a good amount of the games with this, though some I would occasionally need the old dos box for now and then (like the Gold Box Series from SSI/TSR if you use the Gold Box Companion app which is coded to read specific memory parts of the original Dosbox.)
I felt the same as you did – there are games that are much more enjoyable playing with the nostalgic look and feel compared to just straight up flat coloring on a modern monitor!
Thank you for the very informative article, didn’t know about this interesting DOSBox fork!
Do you know if it is possible to use this fork with the Tyrells shaders, particularly the pixel perfect from here?
https://github.com/tyrells/dosbox-svn-shaders
I noticed that they are .glsl format while the ones included with the fork are in .frag and .vert extensions.
Thanks!
Hey Simone,
Glad you enjoyed the article! I’ve not looked into Tyrell’s shaders so I’ve not seen anything in regards to combine both that and DOSBox Optionals. The only thing I could think if you haven’t tried is looking at that VOGONS board and see if there’s anything that might move your search further. If you find anything out, let me know! I imagine it will be one of those ‘feel free to implement’ and compile and build your own things, but who knows.
-Krystof
This is amazing. Unfortunately for me, I’m not a programmer. Is there a guide anywhere you could point me to get Optionals compiled and running? CRT-easymode is magic and I need it. How drastic is the curvature in the easymode shader?
Hi Jubsy,
I didn’t compile DosBox Optionals myself either – check out the github page and the releases tab for downloads you should be able to try out: https://github.com/MartyShepard/DOSBox-Optionals/releases – Download the .zip file instead of the src files (i.e. DOSBox.SVN.r4397.Optionals.Build.on.Dec.25.2020.183550.7z). I’ve not tried the most recent builds but that’s all I did – not to say you won’t have to understand dosbox configuration and such, but no compiling necessary on my end at least. As far as the curvature, I don’t recall easymode having as much curvature as lottes did, but those values are tweaked by editing those files from the Optionals download (under the dosbox/data/shaders directory after you unpack the zip). Hope that helps!
Thank you for pointing me in the right direction! Not sure where I was trying to download from but I couldn’t see that compiled build where I was. Appreciate it!
Your tweaks to lottes are great. Now I just need to find a 6-pack of whatever I was drinking last time I played these games.
Thanks, Jubsy, and I’m glad you found the build! Good luck finding that six pack! ๐
Thank you so much for this article. It gave me all information that I needed. Especially the Chipmunk issue would have driven me nuts if I wouldn’t have had your article. THANK YOU!
You’re quite welcome, and I’m glad it helped get rid of those Chipmunks! That one definitely took a bit to find a fix for. ๐
I’m on macOS and I’m deep in love with the OpenEmu shader called NTSC VCR, which is perfect for retro NES gaming and such, I am so much more engaged in the gameplay due to this visual effect.
Now I stumbled upon here trying to find something similar for DOS retro gaming. DOSBox CRT looks good to me, minus the actual CRT border indeed. Maybe that’s tweak able. Anyway, Windows only it seems. On Mac there was a DOSBox frontend called Boxer, which is sadly outdated now (32 bit only), but I’m looking for a tool where I can configure the games ones and then have a nice visual representation of my gaming options. That’s for example what I miss about RetroArch. I hate that interface. Personal tastes I’m sure, but I’ll keep looking. I saw the little discussion about Lemmings in the comments, and really want to play Lemmings through a good shader. Lemmings was huge back in the day. Anyway, nice to see this, and just dropping in to say yes, I agree, shaders matter! Retrogaming and emulation is nothing without good shaders. ๐
Thanks for the comment, sjogert! Have you tried DOSBOX-X at all yet? I’ve switched over to that and they do have some nice shader support available, and it seems to be freshly maintained. https://dosbox-x.com Granted, it’s all manual, and while dosbox-x comes with shader examples (at least on the Windows build), there doesn’t seem to be a tool, but the dosbox-x UI does allow some selection of opengl shaders to quickly switch between them. Nevertheless, totally agree – Lemmings in particular just begs for a good shader – it looks so much better that way!