Archive Page 2

31
Jan
17

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.

386sx-20

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.

16
Jan
17

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.

25
Dec
16

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.

28
Nov
16

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.

02
Nov
16

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.

 

19
Oct
16

5th Anniversary and general update

Wow a year goes by so very fast! I have managed to get a lot done during this year such as continuing the photography and documentation of my various mother boards, and posts about MS-DOS games. However I’ve not been able to do everything I wanted, such as working on my home brew DOS game or completing the series I started about graphics library bench marking. This is mostly due to not having as much spare time as I used to. I’ve had to take up more domestic duties, especially with the kids going to school. So I’ve not been posting as often as I used to, often because I use the little spare time I have to rest. I’ve still managed roughly one or two posts a month.

As you might have guessed, I am still playing World of Warships and am still enjoying it. I also started playing Minecraft a few months ago after having played the pocket edition with my daughter. It has been a good game to play after all the work is done as it’s generally pretty relaxing to just do some mining, there is some interesting challenge in building automated farms, and it’s a good creative outlet when building what is essentially your home in game. Here’s a bunch of screenshots from around my world and base.

This slideshow requires JavaScript.

I’ve dabbled in playing World of Tanks, but I found I just couldn’t really enjoy the game all that much. I don’t really find it too pay-to-win, I just really didn’t enjoy the new player experience. Basically when you start to get into Tier 2 3 and 4 tanks you get totally nuked by people who have already got 100% crews with skills, equipment and game play experience. The grind to just upgrade your crew is insanely long, at the level I played you’d get the next tank in the line before getting 100% let alone any of the skills. I had plenty of games where I didn’t get to shoot anything because I’d get one-shot by someone I couldn’t see (and couldn’t know they spotted me or how). Because I essentially spontaneously exploded, I had no opportunity to learn what I did wrong. I tried playing artillery, but found that annoying, mostly because RNG meant that many of your shots regardless of aim didn’t count. Needless to say I didn’t have any fun, so I did what anyone would do, I stopped playing.

Content wise I’m getting near the end of my collection of mother boards, so I’ll probably fill its place with stuff that’s been on the back burner for a while. I had considered posting about Minecraft and World of Warships as I’ve been playing them when I get a chance and need to relax, but I didn’t feel they’d fit with what I usually do here, and there isn’t much I could really write about those games. I am still planning on doing Window 9x era games at some point, but they simply will take too much time at this point.

Thank you to anyone who reads, whether it is regularly or just once off.  I still enjoy writing, although I have significantly less time to do so.

10
Oct
16

Space Chase for DOS

Today we’re looking at Space Chase, a little known platform game made in 1993 by Safari Software, one of the first games that they released. It features Jason Storm, a former Marine that takes on dangerous missions. You’re given a mission to stop the organisation known as Evil Guys inc. from taking over the planetary government. It is an platform game much like older games such as Duke Nukem and Dark Ages.

The game uses EGA graphics, which is quite unusual for a game released in 1993. I believe this is because they were supporting old 286 machines, which whilst obsolete, were still common. The game performs well enough that it would probably be playable on a faster 286 machine, but would struggle on the slower machines running at less than 16Mhz.

The sprites and backgrounds are quite detailed compared to say Duke Nukem, but in some ways less appealing. I still quite like the artwork, although many others don’t seem to. Animations look decent and smooth with plenty of frames for each animated sprite.

The only annoyance is with the scrolling, it’s smooth enough, but the distance from the screen edge is shorter moving to the right than it is when moving left. This makes moving right a bit more difficult as you don’t see hazards until you’re nearly on top of it.

Sound effects come from the PC speaker, and are pretty much what you’d expect. Music support is included for Ad lib and compatible cards. The music isn’t quite what you’d expect to find in a platform game, it’s quite relaxed and suites the different pace. I quite liked the music and the mood it set.

If you read the marketing material for the game you’d be expecting a fast-paced action game, perhaps something like Duke Nukem. But Space Chase isn’t as fast paced, although there are action elements and some aspects are clearly inspired by games like Duke Nukem, such as the health pickup which suspiciously looks like a futuristic soft drink can.

The controls are fairly tight, but the jump mechanic is more like what you might find on a console game. For most DOS platform games your jump height is identical no-matter how long or short you hold the jump key. Space Chase on the other hand replicates what usually happens on consoles, the duration of the button press controls the height of the jump. It’s not a bad mechanic, it’s actually quite useful, but as I am more used to DOS games it took a little time to adjust.

As I said before the game play is more relaxed than other more action focused platform games. There are some puzzle elements, such as finding a security node for activating a lift, but it’s not really a puzzle game either. You could think of it as Duke Nukem with simple puzzles added and the action toned down.

There is a limited amount of ammunition for your gun, so you often have to use it sparingly, or simply take a hit from an enemy rather than use a bullet. Avoidance is often the best tactic, and some areas filled with enemies can be skipped altogether. If you run out of bullets you can literally get stuck in some sections as shooting a security node can be necessary for progress.

The level design is pretty decent, exploring them to find score items, ammunition or health is generally a pleasant experience. The only hassle is a few jumps that are difficult because of the low ceiling height. There are areas that are dead ends that you wouldn’t normally need to explore, but they usually contain something as a reward. The difficulty settings change the enemies that appear, with easy have far fewer enemies than normal or hard.

Whilst Space Chase has some minor issues, it is quite a fun platform game to play. It’s relaxed without lacking action, but also not focused on shooting down all the enemies. I played about three quarters of the shareware version and quite enjoyed it. Unfortunately there is no legit way to get the registered version, but the shareware version is available on the Classic Dos Games website.

This slideshow requires JavaScript.




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.

ancientelectronics

retro computing and gaming plus a little more

Retrocomputing with 90's SPARC

21st-Century computing, the hard way

lazygamereviews

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