Space Nightmare for DOS

I’m not much good at shoot’em up games, which is why today’s game, Space Nightmare has a completely appropriate title. It was made by a Canadian company called Microdem in 1994. It is odd for a DOS game as it uses some high resolution graphics and what appears to be Mode X using 16 colours. Like most shooters it has a fairly throw away story about aliens coming to steal our copper, but what’s really important is you get to blow stuff up!

Graphics support is unusual for a DOS game of the period. The menus are drawn at 640x480x256 if set to use SVGA and 640x350x16 for standard VGA cards. In game it appears to use 320x240x16 which is essentially Mode X, but it appears to be only using 16 of the 256 normally available colours in that mode. The game does perform quite well mostly, with some of the smoother scrolling I’ve seen in game. There is some slow down occasionally which seems to happen when the game is loading an image for displaying the first time. You notice this especially when it loads larger images like those for the end of level boss. This might not happen on actual hardware, I was playing using Dosbox.

Artistically the graphics are quite nice and colourful, for EGA. There is dithering in some of the graphics because of the limited number of colours used. This could be a technical issue with the graphic engine, perhaps it only supports a 16 colour mode? Did they limit it for speed? I’m sure they could have gone with 256 colours and not compromised too much on speed and being in Mode X it should have been easy. So the decision to use 16 colours puzzles me.

Sound comes from either the PC speaker or a Sound blaster card. I couldn’t test the PC speaker sound unfortunately because the game disables it as an option if it detects a sound blaster, which I guess is fair. The music is ok, although the tracks all sound fairly similar they do fit the theme of a shooter like this one. Sound effects are also ok, although weapon sounds get louder as you upgrade them. I suspect it plays the sound once for each shot in air, so once you’re upgraded it adds the sound from many shots together. It could have been implemented better, but you can turn down your volume as needed to compensate.

When starting the game you get to choose between one of three ships. Dynamite only fires forward, but is one of the faster ships, upgrades simply add more projectiles. Blaster is slower, but upgrades add increasing amounts of spread shots which can effectively blanket the upper screen with bullets. Lastly Cancer fires forward only at first, but upgrades add shots going backwards and to the sides equally. I found Cancer the most successful as it allowed me to combat foes coming from more directions much easier.

The enemies are mostly mobile air units of some type. They will often fire a burst of bullets directly at you, so dodging is absolutely necessary. I found this quite hard as the hit boxes for your ships are quite large. You can end up being trapped by several barrages and can’t avoid taking a hit. This wouldn’t be a problem if being hit didn’t take _all_ your power-ups, which leaves you very vulnerable. Whilst you can take more than one hit before dying, this is severely punishing.

I found this game quite hard, I couldn’t get past the second level after many attempts. This could just be because I’ve never really been all that good at this type of shooter. I think that having more than one life, and not losing your power-ups when hit would have made this much more playable for me. People who are fans of vertical shooters (and are better than me at it) will probably find some fun, as long as you’re good at dodging.

This slideshow requires JavaScript.


Making a new GWBasic game.

When I was young I learned to code using GWBasic, a BASIC interpreter that came with MS-DOS 4.01. I’ve posted some code and talked about it in the past, but not really developed anything new, that is until today. I’ve re-written a game from scratch I had lost on a corrupted floppy disk called dodge, yes it’s not much of a name but it basically describes the game play in that you dodge bad guys and collect score items for points.

The original had some basic EGA graphics, but this time I’ve used text-mode characters for a few reasons. Firstly it is easier to implement both in terms of artistry and coding. The original never played well due to slowness in the interpreter and the implementation that I had used. Finally using text mode increases the effective game play area by more than 2 times, which will allow for more interesting levels. I didn’t implement any sound either in the original or the new, but music often doesn’t work well on the PC speaker and I’m not much of a composer.

Being a much more mature programmer I’ve been able to make the game mechanics better and add features that the original never had. There are 5 built-in levels (encoded with RLE) and the capability to load a custom level from a text file. The original only had randomly generated levels that were far simpler. I’ve made the movement of enemies better than the original, and gravity affects most items so that they are reachable.

I could have coded the game using a modern text editor, but for that extra nostalgic feeling I coded the game in the interpreter itself. It’s not as intuitive of course as you can’t simply scroll back and forth through the program, instead needing to use the LIST command to see parts of the program. Luckily editing a line isn’t too bad, as after display it on screen you can edit it easily. The interpreter also has some nifty features that can speed up program entry. Many keywords such as print and input have keyboard shortcuts, usually alt and the first letter of the keyword. This not only sped up program entry, but enabled me to discover keywords when I was a kid before I got the user manual.

Using the interpreter to write the code does however demand much more of your memory, I don’t remember this bothering me much as a kid, but now as an adult I needed to keep notes on the structure of the program and variables used. I would have written these out by hand on a notebook back in the day, but doing the coding with the interpreter running in dosbox meant I could run a text editor for my notes. It’s probably one of my more complex gwbasic programs at 592 lines of code.

Overall it has been quite fun writing with gwbasic again, like revisiting somewhere you went as a kid. I’m making the code available at the usual places, both my download website, and my google drive (in case the website is down). The code should work on QBasic as well as the original interpreter.


Creating a benchmark: part 6 problem solved!

Quite some time ago, in fact more than a year ago now, I was working on a basic series of benchmarks to test the comparative performance of the Borland Graphics Interface (BGI) versus a hand coded graphics library. I ran into a problem with my hand coded library not working on some of my real hardware. I ran the tests on a Pentium MMX @ 200Mhz and a 386sx @ 20mhz, it ran fine on the newer machine whilst failing on the older one. I figured perhaps I was overloading the older graphics chip.

So coming back to the problem today with a renewed sense of determination, I did some reading. There happened to be a book in the university library about programming VGA graphics, and I noted that all of their code only copies single bytes to graphic memory at a time, I was copying 2 bytes (a 16 bit word) at a time so wondered if that might be the issue. I changed it and the program still crashed almost immediately.

After some tinkering and some basic math I worked out that sprites being drawn near to the bottom of the screen were the cause of the problem. The test algorithm actually allows sprites to be drawn partially obscured by the right or bottom edge of the screen. On most VGA cards this isn’t a problem, but the trident chip in the 386sx didn’t like any pixels being drawn outside of the visible frame buffer. After writing some basic clipping into the sprite routines the program worked all the way through.

I’ve tested 3 different programs on two different real machines (as opposed to emulation). BGIbench is the original program that uses the provided graphics libraries that came with Turbo Pascal, I’ve used it in conjunction with the VGA256 BGI driver. VGABench is the initial lazy implementation of a hand made graphics library, it’s implemented entirely in pascal and isn’t optimised at all. Lastly is VGABench2 which is an optimised version of VGABench using assembly where necessary, and in the case of line drawing a better algorithm. All three programs were coded and compiled with Turbo Pascal 6.0 and use the same basic test code.

Each program performs 7 tests based around primitive functions found in the BGI. Each test counts the number of primitives that can be drawn over a period of 30 seconds. VGABench doesn’t have a function for drawing circles so it has no results for that test. The tests in order: put-pixels simply draws individual pixels a random colour. Filled Boxes draws solid coloured rectangles in a pre-defined pattern. Circles draws a number of concentric circles in a per-determined way. Random lines does what you’d expect, drawing lines randomly. Horizontal and vertical lines are similarly obvious. Finally the sprite test draws a 10×10 bitmap at random locations on the screen.

At first glance it’s pretty obvious that optimised, hand written code is significantly faster on the Pentium, particularly for filled boxes and sprites where VGABench2 achieves roughly twice the output to the screen. I managed a five-fold increase in the rate of drawing circles, which is impressive as circles are the hardest to draw. The first VGA Bench however is not really much better than the BGI and in some tests actually performs worse. You’ll note that the put-pixel tests all come out fairly close in terms of results, this is because there is little to optimise there.

I suspected that the reason VGABench2 performed so well is because the code copies 16 bits at a time instead of 8bits. I tested this out by changing it to copy 8bits at a time and found it was still faster than the BGI, but by a much smaller margin. VGABench2 copying 16bits yields about 156k sprites, but modifying it to copy 8bits yielded about 80k compared to BGI which achieves around 73k sprites. The first VGABench demonstrates how important optimisation is. It copies data 16bits at a time, but doesn’t even achieve the performance that BGI does, managing around 68k sprites.


The picture looks quite different on the 386sx machine, with the performance looking much more even with a few exceptions. The BGI seems to perform comparatively well across most categories only lagging behind in drawing circles, filled boxes and sprites. My first lazy implementation, VGABench seems to lag behind in pretty much everything except drawing filled boxes, which barely outperforms the BGI.

The results for VGABench2 are good, but not as good as on the Pentium machine. Line drawing is basically the same speed as the BGI. Filled boxes achieves about twice the speed, and circles about 5 times the speed, but the sprites are comparatively slower at about 1.5 times the speed. The explanation for the performance of sprites and filled boxes is interesting and is related to how the test is implemented. The filled boxes are drawn in a deterministic way, a grid of 10×10 sized boxes, the sprites are distributed randomly. Filled boxes end up being drawn pretty much always on even addresses, and sprites will be drawn on even and odd addresses around the same amount. This affects speed because of something called word alignment.

The 386sx, 286 and 8086 processors have a 16 bit data bus, which means the processor can access 16bits at a time. The memory is organised as a bunch of 16bit words, so when accessing 16 bits on an even address only a single memory word is accessed, and when a 16 bit access needs an odd address, two memory words are required. This means doing 16bit reads/writes on odd addresses are half as fast as on even ones, in fact they are about the same speed as an 8 bit transfer.

In beginning to sum up the series, it’s important to remember why I started it at all. Basically I remembered hearing many people discouraging use of the BGI mostly because it is slow compared to hand crafted code. The tests I’ve done have confirmed this, but I feel that it’s also shown how a lazy (or poor) implementation can be even slower. My optimised code is faster, but took a lot of time and effort to create and is missing many features that the BGI provides, such as support for other graphics cards, clipping, and other graphics primitives that are more complicated. I can see why many people without the time and know-how would have found it easier to simply use the graphics library provided.

That being said, hand written optimised code certainly has an important place as well. It was pretty fun and challenging to try and make something faster, even though I almost certainly didn’t get my code anywhere near as fast as more proficient assembly programmers. Also it’s hand optimised code that made many PC action games possible at all. Gaming on the PC would be very different without the hardware guru’s that could squeeze amazing things out of basic hardware. Writing this has made me reconsider my stance on sticking with the BGI for my platform game, I probably won’t gain a lot of performance, but I may be able to get it to work on older hardware as a consequence.

Code and binaries are available from the pascal downloads.


Mad Painter for DOS

I’ve been away on my usual holiday break and recently got home. Whilst I was away at my parents place it was really quite intensely hot, like 40+ degrees Celsius in the shade. It’s not unusual to get a few days like that where they live, but the heat seemed to linger for longer this year. In heat like that (and without air conditioning) you can’t really do all that much, most people usually just try to keep cool and lie down during the worst heat of the day.

It’s usually a good time to sit and play a game, I usually favour something that doesn’t tax my brain too much which leads us to today’s game. Mad Painter is a fairly simple arcade style maze game. Essentially you are driving a paint truck for your city, painting the road markings as you drive around. You have to paint all the roads to progress to the next level, avoiding a few cars driving around. You’re scored based on how much of the level you paint. I’m playing the shareware episode which only has one city.

The game has EGA graphics and PC speaker sound support. The level is larger than the screen and scrolls around impressively smoothly even on lower speed hardware. In fact you’ll probably want to go for an older 286 machine, an upgraded XT or AT or equivalent cycles in Dosbox. The game runs quite fast even on slower hardware, playing ok at ~500 Dosbox cycles, and probably optimally at around 1000 (about a 286 @ 12Mhz using TopBench to benchmark). Despite this in game speed, the menus and transition screens take much more time to draw and animate. Looking at the graphics in game I wonder if it is using a hacked text mode to achieve the speed, and the other screens use a genuine graphics mode. Sound is pretty basic, but not bad, and you can turn it off if you don’t like it.

The game controls in much the same manner as Pac-man, allowing you to anticipate a turn before you arrive. The maze however is no-where near as dense, so there are fewer places to turn and more potential to be trapped by enemies. Luckily there are only two cars which are however driven by maniacs who speed around like they are driving a super car. It is their speed which makes them hazardous, as they drive randomly and will not seek you out.

Mad Painter serves its purpose well, it’s a fun little distraction that you can quickly play and not have to commit too much effort or time.

This slideshow requires JavaScript.


Xmas Skyroads for DOS

This year I thought I’d try to get a Xmas themed post out before rather than after the day. To that end, today I’m looking at the Xmas edition of Skyroads made in 1993 by Bluemoon Interactive. It’s essentially a driving game, where you navigate a small craft on the sky roads merely trying to get to the end. Like most other Xmas themed games it is a re-skinned shareware game, but unlike those it is shareware itself with an expanded registered version that you could buy. This will be my first time playing Skyroads of any kind. I’ve heard this one is more difficult than the original, so you should keep that in mind and perhaps play the original first.

The games VGA graphics are fairly well done, most of the detail and artistic effort appearing in the backgrounds for the levels. There aren’t many sprites or animations mostly because of the game mechanic more than anything else. The level scrolls towards you and your ship, and does so quite smoothly, but it lacks any detail (such as texture mapping) it basically consists of coloured shapes. Altogether it’s fairly minimalist, but colourful and attractive.

There are minimal sound effects for much the reason there are few sprites, the sound system mostly shines through its background music, which is pretty good. There is plenty of variety and it suites the atmosphere of the game quite well. Interestingly Bluemoon had quite a but of expertise in making music software for the PC. They had made a music tracker called Sound Club, which clearly had a part in making the music here.

The controls aren’t as well engineered as I didn’t get along with them as well as I’d hope. The key layout is fine, only the arrow keys and the space bar are used, but it feels like there is a mild lag in the game controls, as I continually felt that the game was missing key presses. In this game that’s quite important, as precision is key, especially as the levels are fairly challenging. It affects me enough that even on levels I know and have beaten the problem arises.

Mechanically the game works quite well with a few minor exceptions. Jumping and moving feel nice when the controls respond in time, and the ships behaves in a reasonable way. You can’t change direction whilst in mid-air, and some areas of the level can prevent you from changing direction. The only annoyance is the occasional time you collide with an obstacle or fall off when it feels like you shouldn’t have, luckily this isn’t a common occurrence.

I found Xmas Skyroads a little too difficult, but I’m not really who this game was made for. It’s really for anyone who enjoyed the original and wants a more difficult challenge and on that it delivers. I could only beat a handful of the levels, but that’s to be expected. The Xmas theme is fairly light on the ground, it mostly just applies to some of the back grounds, so it’s quite playable at any time of year without feeling too out of place. Bluemoon Interactive made this and the original freeware quite some time ago, you can find it on their website.

This slideshow requires JavaScript.


Heros: The Sanguine Seven for DOS

Today’s game is called Heros: the Sanguine Seven and was made for MS-DOS back in 1993 by Jeffrey Fullerton. He originally sold the game directly himself, but after some minor updates (including correcting the spelling of Heroes) a shareware version was published by Safari software in 1994. It’s an unusual platform game styled after comic book heroes and villains. Some super villains have escaped from gaol, so a band of seven heroes are selected to re-capture them. Today I’m playing the registered version as downloaded from the RGB classic DOS games site, you can also get the game from the authors website here.

It features EGA graphics, but unfortunately suffers from programmers art, it’s not really all that bad, but it’s not a great example of EGA graphics. I totally sympathise as my own graphical efforts suffer from a similar fate. On the flip side the graphic engine is coded exceptionally well, the scrolling is very smooth and the game performs well, even on the equivalent of something like a 286. I also found it cool that cartoon style biff and pow word art float up in the air when ever something takes a hit.

The game supports PC speaker for the main sound effects and Ad Lib FM music. The sound effects are pretty much as good as you can expect from the PC speaker. The music is nicely implemented, but the author chose classical music which is a little odd, but somehow it fits. I suspect the choice of music is partly due to it being royalty free and the difficulty in creating your own.

The game plays much like any other platformer with a few unique twists. The heroes gather in a control room reminiscent of the justice league where you select one to take into the current stage. If your hero happens to run out of strength (your health essentially) a bubble protects them from further harm and you choose another hero to rescue them . You have to rescue every fallen hero before you can finish a stage and the game is over if there are none left in the control room.

The heroes have different special abilities and weaknesses, such as Gumwad sticking to walls and Leadmans inability to swim . Each hero also has some basic stats like in a RPG such as their maximum health and jump height. You can upgrade these stats at the control room with Gems that you find. So as you progress through the game your characters get stronger. The only thing that took me by surprise was the limited ammo that carries across levels, it is easy to run out.

I found the controls work fairly well, but in the context of many of the levels I found it difficult to navigate without taking damage. The level design unfortunately doesn’t work as well, there are many dead ends with no rewards, I ended up wandering around the levels aimlessly never finding the exit. The small screen space makes seeing upcoming hazards difficult to see and react to, unless of course you’ve memorised the level. Enemies continue to shoot and move even when quite a distance off screen, which means you have to dodge incoming fire from quite a distance away. I actually couldn’t finish any of the levels, luckily the archive I got the game in included a save for every level in the game, so I was able to try out more than the first one. Practise and moving more cautiously did seem to help me progress further.

Heros: The Sanguine Seven is certainly very unique for it’s time. There are many really good ideas in the design, such as multiple heroes and the control room. Unfortunately the level design lets it down a little, there aren’t enough health pickups for the amount of damage you take, and there are too many paths with no reward at the end. That being said there is some clever design in the levels and it is quite fun to play. I quite like the quirky heroes and the mechanic around each of their special abilities. The author made it freeware back in 2005, so there’s little reason to not give this unique game a try.

This slideshow requires JavaScript.


Campbell Scientific C20 Cassette interface

Today we’ve got something unusual, a RS-232 Cassette interface made by Campbell Scientific. They seem to have always been specialised in making data logger and acquisition system. I can’t be sure, but I think this device was used for storing digital data on audio cassette, a common media of the time. Micro computers of the time did this as well, but usually had this function built in. It’s likely that this would have been used with machines that didn’t have that capability natively, like a PC or perhaps some scientific equipment that can speak RS-232.

It’s built in a very sturdy and quite large metal enclosure. It feels very well made, the few switches on it (including the small DIP switches) feel like quality components that have held up quite well.

The enclosure probably could have been smaller, but here you can see it probably wasn’t specific to this one device. The card cage only houses two cards here, but could have had 5 which would have been enough room for something more complicated.

Here is the processor board, it has a Z80 CPU which would be running at 4Mhz. Around it are mostly simple logic chips in the 74 series, but directly bellow the CPU are two 2k word x 8bit SRAM chips as well as the EPROM. Interestingly the SRAM chips (CDM6116AE3) were used in the memory expansion socket on the MPF-1, I may be able to use one of these to expand my unit. Handily every chip is socketed, so repair (or salvage) is significantly easier. The board appears to have been designed by hand, as you can see many of the traces are quite curvy, it’s clear a great deal of care went into its design.

The front panel board has very similar construction, everything in sockets and hand designed PCB. All the input and output circuitry is on this board and includes a Z80 serial IO chip and two CTC (counter timer circuit) chips. Given that this is a tape interface there is a distinct lack of DAC or ADC chips, most of the smaller chips are 74 series logic, a couple of opamps and serial line drivers and receivers. I suppose other machines (like the ZX spectrum) didn’t have those chips for storing digital information on tape, so they probably use a similar technique. It does make it clear that analogue or audio data is not supported by this device.

I’m a bit conflicted about what I’ll do with this particular device, the collector in me says keep it, but I don’t have a lot of space or use for it. I may end up just keeping the boards for parts, as they are all fairly usable chips with data sheets available.


Blogs I Follow

Enter your email address to follow this blog and receive notifications of new posts by email.

Mister G Kids

A daily comic about real stuff little kids say in school. By Matt GajdoĊĦ

Random Battles: my life long level grind

completing every RPG, ever.

Gough's Tech Zone

Reversing the mindless enslavement of humans by technology.

Retrocosm's Vintage Computing, Tech & Scale RC Blog

Random mutterings on retro computing, old technology, some new, plus radio controlled scale modelling.


retro computing and gaming plus a little more

Retrocomputing with 90's SPARC

21st-Century computing, the hard way


MS-DOS game reviews, retro ramblings and more...