First post, by i386
Hi all!
This topic about my small program, CT.EXE
It has been designed for visual testing CGA/MDA/HGC video cards, and VGA/EGA compatibility
with original CGA card. The idea for the program was born during conversations with Rio444.
Command line options:
CT 0 - mode 0 check, character generator symbols are shown first, then color bars.
This mode is 40x25 monochrome when connected to NTSC TV, and color on the
CGA/EGA monitor (switching screens for this and other tests is done by pressing
any key on the keyboard).
CT 1 - mode 1 check, character generator symbols are shown first, then color bars.
This mode is 40x25 color when connected to an NTSC TV, and color on the CGA/EGA
monitor.
CT 2 - mode 2 check, character generator symbols are shown first, then color bars.
This mode is 80x25 monochrome when connected to NTSC TV, and color on the CGA/EGA
monitor.
CT 3 - mode 3 check, character generator symbols are shown first, then color bars.
This mode is 80x25 color when connected to an NTSC TV, and color on the CGA/EGA
monitor (my CGA card in this mode also was black/white on the TV and showed stripes
instead colors)
CT 4 - check graphic color mode 4 (320x200), first showing colors with different palettes
and backgrounds when it programming via BIOS int10h, then same, but direct write to VRAM
and 6845 regs (here we have the greatest incompatibility with EGA cards). Text labels show
colors as they must be on original CGA.
CT 5 - checking graphics mode 5 (320x200, it is color on the monitor and B/W on TV),
first showing colors with different palettes (on real CGA card palettes do not switch in
this mode; EGA cards sometimes switch palettes) and backgrounds, when programming
via int10h, then the same using direct write. This mode most often does not work correctly
on EGA cards. Text labels also show colors as they must be on original CGA.
CT 6 - checking graphics mode 6 (640x200), it is B/W. First test via int10h, then direct write.
Screens with foreground green/green HI also were added to the screens sequence.
Warning - a lot of of EGA cards have a bug in the its BIOS, and when we change foreground
color in mode6, EGA BIOS actually changes the background, which physically impossible
on the original CGA card at all! This that rare case when direct control can be more reliable than int10h!
CT L - check non-standard CGA color mode 160x100. From EGA cards, that I own, mode worked
on CHIPS 82C435 card
CT C - composite NTSC test. Designed to test the "artifact" mode colors on NTSC TV.
You can read about "artifact" mode colors here:
https://en.wikipedia.org/wiki/Color_Graphics_ … artifact_colors
This test has simple benchmark, it measures the time it takes to fill the screen via BIOS
int10h in mode 4. The first 4 tests are mode 4, the last 2 are mode 6. Switching to mode 6
is carried out using the direct I/O method, here possible incompatible with some EGA/VGA
cards. The program also disables color suppression on the composite output in mode 6.
CT 7 - MDA/Hercules text mode test
CT H - Hercules graphics mode test, viewing BMP file 800600BW.BMP. Image can be move
with the arrow keys, PgUp/Down and move up and down until Home/End stops. Can view
another file (CT H filename). The program is not a full-fledged viewer. Only BMP files with
resolution 800x600, B/W, 1bit per pixel and line layout from bottom to top are supported.
CT T - checks for the presence of video cards in the system.
Attention - the presence of a CGA does not necessarily mean a CGA card, it can also mean
detecting the 6845 HW model in EGA, in my opinion this may be useful. So I write CGA 6845......OK
Switching between video adapters
CT SM - switch to MONO
CT SC(0-3) - switch to CGA, mode 0-3
CT SE(0-3) - switch to EGA, mode 0-3 (in many cases you can switch to EGA
as on CGA)
Attention!
1. Along with the switching, I also gave the opportunity to switch the mode within 0-3.
And an active adapter if it is CGA shows as 40x25 or 80x25. But this is optional coincides
with the video mode, namely reflects the equipment flags that Most programs do not
change when changing mode (when switching through my
program I change the flags).
2. A situation may occur with the supposed absence of an active adapter. For example, If EGA
was configured as MONO and switch to secondary CGA card, that's ok. But if you will try switch
to EGA again, it will not happen and the active adapter will show as NONE. To switch in this case,
you need to run command CT SH, for switch to monochrome (that emulated by EGA).
Comment:
The program was intended to be experimental, so the presence of a CGA card when checking
CGA modes is not checked, because to check compatibility you can try to perform CGA tests
on both EGA and partially MDA (text modes). Therefore please don't experiment with the original
IBM MDA monitor and similar ones that do not have protection! Due to the use of int10h, the card
being tested, must be configured as primary adapter. This does not apply to the 160x100 test, it is
completely direct and even possible with primary MDA/HGC to do output the image to CGA card.
The MDA test is similar to the CGA test in this regard. But the HGC test checks for the presence
hercules, because its tests are not compatible with anything other than hercules, and the output
always goes on HGC card.
On later boards with ISA, such as Slot1 with AWARD4.5, CGA/HGC support is implemented
similar in principle - we collected you from old sources, use it anyway no one will 😀 So for example,
the function of printing a character without attributes sometimes spontaneously starts interpreting
the value in BL as an attribute (in my case it prints blue text).
At first I thought it was a bug in the my program, but then I pay my attention that the BIOS of the
built-in SCSI controller (ASUS P2L97-DS) suddenly sometimes starts printing text in blue. And with
HGC - sometimes it gives an underlined line. There are other bugs with colors in modes 4 and 5.
Hence, "reference" behavior of CGA/HGC should be checked on XT/286 and like.
I express my gratitude to Rio444 for help, advice with the program and testing.
The program is written entirely in MASM 5.1 assembler. The source also attached. The BMP and IMG files
must be in the same directory as the program.