• Please review our updated Terms and Rules here

IBM EGA and Commander Keen 4-6, Keen Dreams

Great Hierophant

Veteran Member
Joined
Mar 22, 2006
Messages
1,928
Location
Massachusetts, USA
My IBM EGA card, fully upgraded to 256KB, has an issue with Commander Keen's later graphics engine. The issue is randomly wrong-colored pixels appearing in the main game. These pixels can be "corrected" in many places by scrolling the so that they are no longer visible on the screen and then returning. However, often new randomly colored, wrong pixels will appear. Sometimes there are a lot of pixels, sometimes only a few.

This issue does not occur in other EGA games I have tried with this card, including games like Secret Agent and Commander Keen 1-3 which also use EGA panning registers for smooth scrolling. I have an Everex EV-657 EGA card which works flawlessly with Keen 4-6. I have tried the IBM card on a PC/XT and a 486DX2/66 and both systems exhibit the same behavior. I have also tested the IBM card with the official diagnostics diskette and a third party application, CheckIt. Both programs report no memory errors or other errors. I have also tried all the options I am aware of that may affect the video rendering : /nopan, Fix Jerky Scrolling and SVGA Compatibility fix. I have also tried the patch here : viewtopic.php?f=61&t=54291&hilit=keen+ega#p591383. Nothing has been successful.

I have taken some screenshots with my Datapath E1s to demonstrate the issue. The first image shows the level in Keen 4 on the IBM EGA card as you enter the level :

Keen 1.jpg

The second image shows the same area after you enter and exit the stone building :

Keen 2.jpg

Finally, the third image shows what the Everex EGA card will display :

Keen 3.jpg

Two other observations I would note is that I do not recall ever seeing discolored pixels on "sprites". I also notice similar issues in Shadow Knights and Dangerous Dave in the Haunted Mansion, which used earlier versions of the later Keen Engine. Dangerous Dave in Copyright Infringement showed no issues, nor did Catacomb 3-D. I have never seen this happen on a more typical EGA game, even those like PGA Tour Golf which I know uses more than 64KB of EGA graphics memory.

I tried the Donut demo by Scali and it worked OK except that DOSBox showed black on the donut where my card shows blue. I also tried The Space Pigs Megademo and it worked without issue (except for 640x350x16/64 sequences, which I cannot observe due to a lack of display or converter).

So, is this an issue anyone has found with their EGA cards and these games, or does my card have some subtle flaw or damage which this engine shows?

I have this on cross-posted on VOGONS. The only thing I haven't done is to replace RAM.

Because this forum likes to butcher the quality of attached pngs into lossy jpgs, the original pngs are located here : http://www.mediafire.com/file/rkx581c0j3udki2/Keen.zip/file
 
Based on the screenshots, I'm thinking that either the VRAM is flaky, or the original IBM EGA card has occasional problems with 16-bit writes (either data or port writes). Unfortunately, you'd need a second IBM EGA card to verify either theory: If the second card works fine, then the RAM on your first card is bad. If the second card also has issues, then it's a design problem with the card and/or the software doing something slightly wrong.
 
When you first enter the level (I assume you are not moving before taking the screen shot?), do the discolored pixels appear at about the same places, or are they at significantly different places?

If they are at different places, I'd suspect some kind of intermittent problem moving data around.
 
When you first enter the level (I assume you are not moving before taking the screen shot?), do the discolored pixels appear at about the same places, or are they at significantly different places?

If they are at different places, I'd suspect some kind of intermittent problem moving data around.

Different places, it is wholly random if and where you will see the "bad" pixels and how many there will be. This tends to make me think that the RAM is not bad on my card. Also, if there was an issue with bad RAM, I would expect to see issues in games like the ones offensive_Jerk had : http://www.vcfed.org/forum/showthread.php?43098 and I haven't seen a bad pixel from Commander Keen 1 or PGA Tour Golf.
 
Last edited:
Right, when I have seen issues similar to this in the past it was usually some odd incompatibly with a system's ISA slots. But in this case you have tested on different systems, so the issue must be on the EGA board.

I'd expect Keen 4-6 and Keen Dreams does something just a hair different from other programs to boost performance. It sort of looks like one bit is momentarily flaking out on each pixel as it draws each map tile. In some places it seems to be every pixel (every 4 bits) and others, every other pixels (every 8 bits). Although I'm not familiar with exactly how it lays out the EGA memory.

The source code to Keen Dreams is available, perhaps that could yield some clue to narrow things down.
 
Different places, it is wholly random if and where you will see the "bad" pixels and how many there will be.

Do the bad pixels change every screen refresh, or are they "fixed" as bad once they are written badly? (ie. a video might help).

Does this always happen with Keen 4 without fail, and does it never happen with other software?

The bad pixels in your screenshot are stretches of bad pixels that correlate to one or more bytes not being written correctly in one of the four planes. Causes of this are:

  1. Bad VRAM
  2. Broken software
  3. Bus issues
  4. Faulty EGA latches
  5. Faulty DAC
If the bad pixels are random then it's probably not #1. If Keen4 was truly broken it would show up on many more systems, so it's not strictly #2. So that leaves #3 - #5, and answering the questions I posed will help pick which one.
 
Do the bad pixels change every screen refresh, or are they "fixed" as bad once they are written badly? (ie. a video might help).

Does this always happen with Keen 4 without fail, and does it never happen with other software?

The bad pixels in your screenshot are stretches of bad pixels that correlate to one or more bytes not being written correctly in one of the four planes. Causes of this are:

  1. Bad VRAM
  2. Broken software
  3. Bus issues
  4. Faulty EGA latches
  5. Faulty DAC
If the bad pixels are random then it's probably not #1. If Keen4 was truly broken it would show up on many more systems, so it's not strictly #2. So that leaves #3 - #5, and answering the questions I posed will help pick which one.

I'm betting on #4. I know it isn't #5, faulty DAC, because I see these bad pixels on my Tandy CM-5 RGBI monitor. I also tend to think it isn't #3 because I have tried this card on two systems of varying bus speeds, an IBM PC/XT and a 486, and they show up on both machines.

The bad pixels are fixed, once they appear they will stay there as though they were meant to be there. The only thing that may remove them is scrolling the screen so they are not visible, then returning to it.

It happens only with games that use the graphics engine that drives Keen 4 : Keen 5, Keen 6, Keen Dreams, Shadow Knights, Dangerous Dave in the Haunted Mansion. All developed by ID Software.

Either my latch chip has a really subtle flaw or these games are employing the latches in a way that is not compatible with the IBM EGA card but is with clones.

I'll see about video.
 
I have a fully populated IBM EGA card in my XT-286 with a 5154 monitor.
Copied the KEEN4 game but I'm not sure its the same version you have.
The graphics look different, there are two houses at the entry to the level.
I don't see any of the color issues you mentioned.
Let me know if you want me to try anything else.

IMG_20190527_175540166.jpg
 
I'm fairly sure he was on one of the second levels. The first one does not have much opportunity to look up and down.

If I have understood things right, Great Hierophant is using an RGB "CGA" monitor. That requires slightly different settings and operation of the EGA card as shown here http://www.minuszerodegrees.net/ibm_ega/ibm_ega_switch_settings.htm.

mikey99, can you set your dip switches to "CGA" and see if there is any difference in the way Keen behaves? (I believe the IBM 5154 EGA monitor will work fine in place of an actual IBM 5153.)

I have an IBM EGA card myself, but it does not have the memory expansion board, so keen will not run properly. It tries to run, but displays empty gibberish.
 
I have a fully populated IBM EGA card in my XT-286 with a 5154 monitor.
Copied the KEEN4 game but I'm not sure its the same version you have.
The graphics look different, there are two houses at the entry to the level.
I don't see any of the color issues you mentioned.
Let me know if you want me to try anything else.

View attachment 53528

That is good news, the game can work perfectly with IBM EGA. Now the only issue is to figure out why mine does not!
 
The suggestion of freeze spray or even just compressed air is a good idea. Something this intermittent is likely, but not guaranteed, to change behavior with different thermal conditions. If you spray a particular chip and the problem goes away for a moment, then that is a likely culprit.
 
The bad pixels are fixed, once they appear they will stay there as though they were meant to be there. The only thing that may remove them is scrolling the screen so they are not visible, then returning to it.

That's consistent with "they were copied incorrectly".

Either my latch chip has a really subtle flaw or these games are employing the latches in a way that is not compatible with the IBM EGA card but is with clones.

My guess is that iD is doing 16-bit port writes and your EGA card (not your specific card, but that card's design) can't handle it. There were VGA cards not compatible with that technique either; a REP OUTSB would work to change the entire 256-color palette, but REP OUTSW would result in garbled colors.
 
Tangentially related: if I were to design an aftermarket DRAM daughter board for the IBM EGA adapter, would you guys prefer 4116 or 4164 ICs?
 
IBM's EGA memory board, at least the one shown on Minuszerodegrees, uses 4x16k chips. 1x16k would need 4 times the number of chips. I doubt anyone would have a problem if something more "modern" were used, perhaps get the thing down to a single RAM chip.
 
IBM's EGA memory board, at least the one shown on Minuszerodegrees, uses 4x16k chips. 1x16k would need 4 times the number of chips. I doubt anyone would have a problem if something more "modern" were used, perhaps get the thing down to a single RAM chip.


The only original one I've seen is the one Great Heirophant showed me which had 12 chips on it
 
My Graphics Expansion Board has twenty five chips on it, a 74LS04 hex inverter and twenty four 16K x 4bit chips. I suggest using 64K x 4bit chips, which would cut the number of RAM chips from twenty four to six. There will need to be a few extra chips needed with the larger capacity chips to rearrange the CAS and RAS addressing signals.
 
My Graphics Expansion Board has twenty five chips on it, a 74LS04 hex inverter and twenty four 16K x 4bit chips. I suggest using 64K x 4bit chips, which would cut the number of RAM chips from twenty four to six. There will need to be a few extra chips needed with the larger capacity chips to rearrange the CAS and RAS addressing signals.

Yeah my mistake I was going off memory only picturing the left half of the pic you sent me, and then conflating it with the 4164s on the mainboard. Not thinking too clearly today apparently.

So the question is 4416 vs 4464.
 
Back
Top