The CGA Compatibility Tester v0.5a, 20090218 by trixter@oldskool.org http://www.oldskool.org/pc/cgacomp The CGA Compatibility Tester, as its name implies, is a program that benchmarks and stresses nearly every capability of the IBM Color Graphics Adapter (CGA). This can be used to: - Verify that your clone CGA card is 100% compatible with the real IBM CGA - Similarly, verify how badly your non-CGA card screws up CGA emulation - Benchmark adapter RAM speed, to compare with other adapters - Calibrate your CGA RGB monitor for maximum enjoyment - Satisfy your curiousity about how CGA can be tweaked - Display neato 16-color transparent copper bars through the power of sheer awesome (see the horizontal retrace detection test) As an added bonus, a suite of hardware and video adapter detection routines are included, so you can probe the machine's insides to see what is installed. Testing Features: Adapter memory speed benchmarks: Interleaved opcode/adapter memory read benchmark Interleaved opcode/adapter memory write benchmark Adapter Memory-only read benchmark Adapter Memory-only write benchmark Color Select and Mode Control Register tests: Border/Overscan color Medium-res graphics background color High-res graphics foreground color Palette display (all six medium-res palettes) Textmode manipulation: 40-column test Textmode highcolor background (ie. disable blink) Textmode cursor manipulation CGA "snow" anomoly Font display (simulated via 40-col mode) Monitor Calibration: Brightness calibration Contrast calibration Moire pattern (high-res horiz/vert/50%) Display of 16 colors MC6845 CRTC programming: Horizontal retrace demo Vertical retrace detection Row reprogramming (80x100) Row/Column reprogramming (90x30) Interlaced mode test Horizontal/Vertical sync position test Start Address register test Running the Program: Running The CGA Compatibility Tester is as simple as typing "cga_comp" and hitting enter. Every test is menu-driven, and follows this convention: - Use arrow keys and ENTER to select a menu entry - A description of the test will pop up - Choose "continue" to run the test or "abort" to change your mind and go back DISCLAIMER: I have a vintage collection just like you, and I would never intentionally damage hardware. That being said, you run this program at your own risk. I cannot be held liable for any damage that may occur to your vintage computer hardware by running any of these tests. By using this program, you agree to the above wording. Limitations of version 0.5: - Composite color tests not implemented due to programmer laziness - Row/column reprogramming not implemented in graphics mode due to lack of motivation (it *IS* implemented in text mode, and it uses the same methods, so this is no great loss) - Lightpen Interface not tested because I do not own a light pen. If you want this supported, send me a light pen! Hell, send me one anyway! - 4 colors in 640x200 mode (yes, 640x200x4) not implemented because, while the *mode* works, IBM didn't implement things properly and memory is incompletely decoded (every other byte column is garbage) Notes and Oddities: The interlaced support, as implemented by IBM in the CGA and as connected to an IBM 5153 color RGB monitor, is broken. Not in this program, but in the way IBM implemented interlaced mode. What is *supposed* to happen is that interlaced mode would display one frame of scanlines, then display a second frame of scanlines but slightly offset so as to fill in the gaps between the first set of scanlines. What ACTUALLY happens on the real hardware is that every set of scanlines, whether odd or even, are displayed in the same locations. This has the effect of mashing both sets of scanlines together; this is not the intent of interlaced video modes, and results in a nearly unviewable display. (This was tested with a composite display as well as RGB and the results were no better.) If you've ever wondered why no program in the history of the IBM PC ever used interlaced CGA mode, now you know! The mouse support is broken (cursor disappears after the first test). Don't use the mouse for now. Greets: Greets go to: Jeff "Hargle" Leyda (for suggesting it in the first place) Andrew "Digger" Jenner (for CRTC reprogramming clarification) Great Hierophant (CGA ROM dump) and John Elliott (explaining ROM layout) Fallo (interlacing confirmation) The Vintage-Computer.com forum owner (for a great set of forums!) The OWB. You know who you are. Chris Scussel (for always enlightening conversation) Version History: 0.1: Testing release, has half the functions added 0.2: Added rest of testing functions 0.3: Added system and graphics detection library 0.4: Added 8087 emulator (detection routines require $N+); also created a video of the program in action on real hardware for reference. Visit the website for a link to the video. 0.5: Fixed 8088 detection logic (hopefully didn't break NEC logic!) Fixed and removed 8087-specific code; removed 8087 emulator 0.5a: Fixed PC detection logic Added Tandy 1000 detection logic Reduced memory requirements (should run quite comfortably on 128KB machines) Todo: - Figure out why the mouse cursor disappears. Don't use the mouse for now.