CRT Terminator DV1000 ISA

User Manual

2025-01-16

Table of Contents

1. Introduction
2. Requirements
3. Technical Features
4. Installation
4.1. Installing The CRT Terminator Card
4.2. Installing The Video Cable To IBM Feature Connector
4.3. Installing The Video Cable To VESA Standard VGA Pass-Through Connector
4.4. VGA Terminator Dongle
5. Configuration
5.1. Jumper Settings
5.2. DIP Switches
5.3. VGA Palette Snoop
5.4. Software Configuration
6. Supported Input Video Modes
7. Recommended Displays
8. Video Upscaling with CRT Terminator
8.1. Pixel Perfect Upscaling DOS 320x200 games
9. Capturing CRT Terminator output for YouTube or Twitch streaming
9.1. Lossless and pixel perfect 70 Hz video capture using VirtualDub
10. Compatible Graphics Adapters
11. Hardware Random Number Generation
12. Hardware Programming Reference
13. Frequently Asked Questions
14. Developer HUD
14.1. Anatomy of a Video Frame
15. Troubleshooting
Appendix A. IBM VGA Feature Connector
Appendix B. VESA Standard VGA Pass-Through Connector
Appendix C. DVI-D Standard
Appendix D. CRT Terminator Supported Output Resolutions
Appendix E. Changelog

Introduction

CRT Terminator Digital VGA Feature Card ISA 1000 is an 8-bit ISA expansion card that works on IBM PC compatibles all the way from the original IBM XT PC up to the hybrid ISA + PCI Pentium era motherboards.

The CRT Terminator board is an expansion card, which means that it does not function as a standalone display adapter. Instead, like the early MPEG decoder cards from the 90s, CRT Terminator leverages an existing VGA-compatible adapter, and connects into the VGA Feature Connector bus of the VGA card via a 2x13-pin ribbon cable.

This VGA Feature Connector bus bypasses the signal degrading digital-to-analog video conversion step (RAMDAC), and enables CRT Terminator to output a fully digital video signal. CRT Terminator converts and upscales this 8-bit palettized digital video into a True Color 24-bit RGB DVI-D output stream that is compatible with HD video on modern flat panel displays.

Two landmark features of CRT Terminator are Multimode and StutterStop. The Multimode feature enables CRT Terminator to be aware of many of the various nonstandard and quirky sized custom VGA video modes that DOS programs utilize, and whenever the VGA output video mode changes, CRT Terminator will readjust its video processing to produce a best matching upscaled resolution. That is, instead of outputting a single fixed output resolution, CRT Terminator will output multiple different video modes depending on the video input content.

Then, in coordination with the target display's upscaling circuitry, CRT Terminator is able to provide an upsampling result that closely resembles "surface area-based" upsampling, which provides vastly superior image quality of scaled up pixel art, compared to point sampling or bilinear filtering alone. For more information, see the later section 8. Video Upscaling with CRT Terminator.

The StutterStop feature is a unique hardware feature that carefully matches the vertical refresh rate of the upscaled video with that of the input video, down to the millihertz level. This ensures that the video upscaling subsystem will exhibit frame stuttering only on the order of once per several minutes, or even more infrequently. This eliminates the presence of any periodic stuttering that is commonly observed in panning motion of video (assuming no stuttering was present in original produced video from the PC).

Enabling Multimode and StutterStop features require some level of nonstandard video mode support from the flat panel display. To allow for most degree of flexibility, CRT Terminator also provides the ability to normalize quirky video modes and output CVT and DMT compliant video signals as a fallback. These features are optionally activated via configuration switches, and we provide tables of our findings for compatibility.

In all cases, the degraded analog video output from the VGA adapter RAMDACs is bypassed. We find that even some of the oldest ISA VGA cards with a reputation of having an unusably blurry or soft analog video quality, such as ATI 28800 and Oak 037, gain a new life and are able to produce a crispy clear digital video output.

Thus the end result is a high quality digital video output with few compromises when viewed on a modern display.

Requirements

CRT Terminator requires the following:

Note: some VGA graphics adapters may require running a utility program from the adapter manufacturer to enable video output on the Feature Connector bus. (e.g. some variants of the S3 Trio 64)

Also, on some VGA adapters, such as the Voodoo 3, the Feature Connector on the board seems to only work for video input (as far as we are aware of at the time of writing), and unfortunately cannot be used to output video to CRT Terminator.

At the time of writing, we do not yet have good experience with the compatibility of different ISA VLB adapters, so we do not state these as supported yet. We recommend either using a ISA or a PCI graphics card.

Also, even though many AGP graphics cards have a VESA Feature Connector, it is unclear if any of these connectors can be used as output - at least in our testing we have not been able to output video from any. AGP graphics cards are currently not supported.

Technical Features

CRT Terminator offers the following features:

all packed into a single 8-bit ISA expansion card!

Installation

This section details the steps to install CRT Terminator.

Installing The CRT Terminator Card

CRT Terminator is an 8-bit ISA card, but may be freely installed in either an 8-bit ISA slot or a 16-bit ISA slot.

However, installation in "Slot 8" of the original IBM XT PC (the slot closest to the Intel CPU) is not supported due to limitations of that slot.

Be sure to fully screw in the CRT Terminator backplane to the chassis. This may seem a bit silly to point out, but since a part of CRT Terminator configuration will be done by flipping DIP switches at the back of the card, it is all too easy to accidentally unseat the card if flipping the switches while the card is not screwed in. Unseating the card during power-on could cause damage to the Feature Connector subsystem or the PC.

Bundled with the adapter are both styles of video cables for connecting CRT Terminator to the Feature Connector slot of your graphics card.

Installing The Video Cable To IBM Feature Connector

If you have an earlier ISA VGA graphics card that predates VESA standardization, it should have the IBM edge connector style Feature Connector interface.

This interface should be keyed with a notch cut out between pins 2 and 3. Pin 1 is always on the narrow side of this connector, like this:

To connect to this IBM style edge connector, the CRT Terminator video cable with a female edge connector socket is used:

Connecting the cable to the CRT Terminator end is easy, because there is only one orientation that the cable fits. This orientation identifies which side of the cable will be Pin 1:

Due to manufacturing source, the side of the cable itself might not be colored to mark pin 1. So double check the pin 1 markers on the connectors to identify pin 1.

On the edge connector end, there will be similar markings as follows:

The connection on the VGA card is made as follows:

Be sure to fully push in the connector. (in the above image, the connector is shown seated only half-way to illustrate the position of the notch)

Make sure you positively identify pin 1 on both the cable and the VGA card when installing.

Installing the cable in incorrect orientation may damage the VGA card, CRT Terminator, PC and/or the PSU. Any damage resulting from incorrect installation will not be covered. So please be very careful to identify the correct cable orientation.

Installing The Video Cable To VESA Standard VGA Pass-Through Connector

If your VGA adapter is of a newer type (~1990-1991 and later), then it is likely to have the VESA Standard VGA Pass-Through Connector (VSVPC). This connector is colloquially also referred to as the VESA Feature Connector.

For more information on this connector, see Appendix B.

This connector is a 2x13 pin grid male pin ribbon header connector, as seen below:

Use the following video cable to connect CRT Terminator to your VGA adapter with a VSVPC connector:

This cable is symmetric, you can plug either end to the CRT Terminator.

Connecting the cable to the CRT Terminator end is easy, because there is only one orientation that the cable fits. This orientation identifies which side of the cable will be Pin 1:

Note that the 2x13 pin VSVPC connector on the VGA adapter is unkeyed. That is, it is possible to connect the video cable to this connector incorrectly, rotated 180 degrees.

To avoid damaging the VGA card, CRT Terminator, PC and/or the PSU, take extra care to correctly locate and match pin 1 on both the cable and the VGA adapter board, like so:

If this cable is connected 180 degrees reversed in incorrect orientation, the high-speed video data pins will overlap with ground pins, potentially causing a short.

Any damage resulting from incorrect installation will not be covered. So please be very careful to identify the correct cable orientation.

If there is any doubt to the correct pin 1 orientation on the board, we strongly recommend using a multimeter to identify the ground pins on the VGA board as a means to double-check the correct installation orientation for the cable.

Warning! Even though VESA did standardize a common orientation and placement for the VSVPC connector for VGA cards, some VGA adapter vendors chose for no apparent reason to lay out the connector in a 180 degrees rotated orientation on the board. So be sure to check the orientation on each VGA adapter separately, instead of assuming a common orientation.

The VGA Terminator Dongle

Many older graphics adapters have an autodetection feature that identifies whether the currently connected display is a monochrome or a color monitor. This is done by identifying resistance on certain pins of the video output cable.

If no VGA video cable is connected, these adapters may boot up in monochrome mode, resulting in displaying grayscale colors also via the Feature Connector.

If you are not using any VGA monitors alongside CRT Terminator (e.g. in dual display or video capture setup) and your video output comes out monochrome, we will need to fool the VGA adapter into thinking that a color monitor would actually be connected.

To achieve this, the VGA terminator dongle was created. This dongle is a dummy block that attaches in the VGA output, and provides the needed identification to the graphics card to think it should output a color image.

This small terminator dongle is actually what gave CRT Terminator the idea for the name.

Just attach it at the end of the VGA adapter, like so:

If your VGA adapter provides color output even without the terminator dongle, or you want to use the VGA output for other purpose, then you can just leave the dongle in the box.

Configuration

CRT Terminator is configured via three different mechanisms:

The jumper settings are used to configure CRT Terminator behavior with respect to the VGA adapter, i.e. they need to be reconfigured if changing to a different VGA adapter.

The DIP switches are used to configure CRT Terminator behavior with respect to the LCD display or video capture device that it connects out to. When changing the output device, these DIP switches will need to be reconfigured.

Finally, the software configuration is used to tune the behavior with respect to different software at runtime.

Jumper Settings

There are seven jumpers on the CRT Terminator DV1000 board. Jumpers J1-6 are located at the top edge of the card for easy access, whereas J7 is located on the board itself. The functionality of these jumpers are summarized in the following table.

Jumper settings J1-J7 Name Description
J1ReservedCurrently unused. Please set to 1-2 (N/C).
J2Automatic Video Sampling Phase DetectionControls whether CRT Terminator will automatically analyze Feature Connector video sampling phase.
1-2 (N/C): Enabled. State of jumpers J3-J6 will be ignored.
2-3: Disabled. Sampling Phase will be manually defined by jumpers J3-J6.
J3Pixel Data Sampling PhaseConfigures the sampling phase that video Data bits are sampled at.
1-2 (N/C): Sample at rising edge of pixel clock.
2-3: Sample at falling edge of pixel clock.
J4Display Enable Sampling PhaseConfigures the sampling phase that video Display Enable line is sampled at.
1-2 (N/C): Rising edge. 2-3: Falling edge.
J5Vsync Sampling PhaseConfigures the sampling phase that video Vsync line is sampled at.
1-2 (N/C): Rising edge. 2-3: Falling edge.
J6Hsync Sampling PhaseConfigures the sampling phase that video Hsync line is sampled at.
1-2 (N/C): Rising edge. 2-3: Falling edge.
J7OverclockingEnables generating output video clocks beyond the manufacturer rated specification.
1-2 (OFF): Overclocking Disabled.
2-3 (ON): Enable overclocking.

Jumpers J1-J6 utilize a three pin scheme to define two different states. State 1-2 ("open", or jumper not connected, N/C above) is set when a jumper bridges the two pins closest to the board PCB. State 2-3 ("closed") is set when a jumper bridges the two pins farthest from the PCB.

It turns out that different VGA adapters utilize different sampling phase conventions for the generated Feature Connector video signal. There was no VESA standard for this (although sampling at the rising phase seems to be most common), and it looks like the correct sampling phase may substantially drift even between different video modes on the same VGA adapter, especially on the older ISA video adapters.

Jumper J2 is used to enable a simple automatic configuration of the sampling phase settings. In this mode, CRT Terminator will continuously analyze which sampling phase it should use for each signal line. It is recommended that this option is enabled (J2 set to 1-2) first to see if this simple automatic scheme will work. The other options are available in case this automatic configuration does not work as expected for a particular VGA adapter.

An incorrect video sampling phase setting typically manifests as a video signal that geometrically drifts or jitters, or continuously loses video sync.

Jumper settings J3-6 enable manually configuring the appropriate video signal sampling phases to use. In order for these jumpers to take effect, jumper J2 must first be set to state 2-3.

Jumper setting J7 unlocks the display output frequency pixel clock limit. The maximum rated output provided by the FPGA board that CRT Terminator uses is a 118.8 MHz pixel clock. If J7 is set to state 1-2: OFF, then CRT Terminator will adhere to this specification, and will always generate a display signal that does not exceed this limit.

If J7 is set to 2-3: ON, then CRT Terminator will ignore this specification, and always attempt to generate the best ideal output clock speed for the display. There is no guarantee that this will produce a stable output video signal however.

Note that enabling overclocking will not void the warranty of CRT Terminator. Feel free to play around. The maximum rated pixel clock speed for DVI-D cables is 165 MHz, which gives a theoretical ceiling as to how fast pixel frequencies might be able to work.

DIP Switches

The back of CRT Terminator looks like follows:

A total of eight DIP switches, organized in two DIP boxes are present.

The first DIP box next to the video output connector contains four switches named 1.1, 1.2, 1.3 and 1.4. The values of these four switches are interpreted as a 4-bit binary number, and this number selects the output video mode.

DIP switches 1.1-1.4 Resolution
Decimal Binary
00000bPassthrough
11000b640x480
20100b800x600
31100b960x720
40010b1280x720
51010b1024x768
60110b1200x900
71110b1280x960
80001b1280x1024
91001b1364x1024
100101b1400x1050
111101b1680x1050
120011b1440x1080
131011b1920x1080
140111b1600x1200
151111b1920x1200

In the DIP switch box, a switch that is flipped down (as indicated by the text ON↓ on the box) denotes a binary 1, and a switch that is flipped away () denotes a 0.

The bits are concatenated into the above table from DIP 1.1 to 1.4, left to right.

For example, the image on the right corresponds to a state 0111b, or decimal 14, or an output video mode of 1600x1200.

The value 0000b selects Passthrough mode. In this mode, CRT Terminator bypasses its video upscaling subsystem (except to normalize scandoubled VGA from e.g. 320x400 to 640x400 and to crop the VGA border) and outputs the input video signal unscaled to the display.

Passthrough mode is useful for enabling the lowest possible latency output from CRT Terminator. Some flat panel displays support the oddball video timings generated by CGA/EGA/VGA video modes better than others, so there is a bit of YMMV at play when using it.

If any other value than Passthrough is selected, then a given Resolution in the above table is chosen. The exact meaning of this selected resolution depends on the state of DIP2.1 switch, see the next table.

DIP switches 2.1-2.4 Description
DIP 2.1OFF: Output Fixed Resolution
ON: Output Multimode
DIP2.2=OFFDIP2.3=OFFStutterStop level 0: Disabled. Output fixed 60Hz
DIP2.2=ONDIP2.3=OFFStutterStop level 1: Sync pixel clocks
DIP2.2=OFFDIP2.3=ONStutterStop level 2: Level 1 + sync vertical porch
DIP2.2=ONDIP2.3=ONStutterStop level 3: Level 2 + sync horizontal porch
DIP 2.4OFF: Disable Developer UI
ON: Show Developer UI

In Passthrough mode, the values of DIP switches 2.1, 2.2 and 2.3 have no effect. That is, Multimode and StutterStop do not apply in Passthrough mode.

Fixed Resolution Output:

If DIP 2.1 is OFF, then the resolution selected by DIP 1.1 - 1.4 denote a fixed output resolution. In this mode, CRT Terminator will always output this specific chosen resolution, using point sampled upscaling.

Use this mode to maximize compatibility of CRT Terminator with picky monitors or video capture cards.

Multimode Output:

If DIP 2.1 is ON (and not running in Passthrough mode), then the resolution selected by DIP 1.1 - 1.4 denote a maximum upscaled output resolution. In this mode, CRT Terminator will dynamically adjust the output resolution based on the current resolution of the input.

This way, for example when playing a Pinball game that uses a custom video mode, the video output will look crisp and well upsampled both in-game and in menus, without needing to manually re-adjust any video output parameters when navigating the game menus.

StutterStop Level

When not operating in Passthrough mode, DIP switches 2.2 and 2.3 select a two bit binary number that activates the StutterStop feature of CRT Terminator.

The StutterStop feature tunes the output refresh rate of CRT Terminator so it best matches the input video rate, even when processed through the video upscaling circuitry.

If both DIPs are OFF (value of 00b), StutterStop is disabled, and CRT Terminator always outputs 60Hz video, even if the input video was e.g. 70 Hz like in DOS VGA video.

If StutterStop is set to any other value, Level 1-3, then StutterStop is enabled. The StutterStop "level" indicates the fine-grainedness or aggressiveness of the video rate matching. Level 3 is most preferable, and we find that many modern displays are compatible with it. (such as ASUS ProArt PA248QV and Philips Brilliance 252B9/00 that we recommend)

However, if the video display is unable to sync e.g. StutterStop Level 3 mode, you can try to run in Level 2 or Level 1 instead, to achieve at least some level of video frame rate matching.

VGA Palette Snoop

In order to enable support for CGA, EGA and VGA video modes (as they are palettized), CRT Terminator snoops the ISA I/O bus to observe the palette write commands as they arrive to the VGA adapter. The term snooping here means that CRT Terminator listens to the communication that takes place on the ISA bus between hardware peripherals, and it recognizes all palette color writes to the hardcoded VGA adapter palette I/O port addresses 3C8h and 3C9h from the PC CPU. With that information, CRT Terminator is then able to recreate the needed palette color entries to convert palettized video into 24-bit RGB.

In particular, this means that the I/O bus configuration on the PC must support this kind of "palette snooping" from the ISA bus, or otherwise palette information will not be observed and colors will come out incorrect.

If you are running a PC setup with a VGA adapter residing on the 8-bit or 16-bit ISA bus, then palette snooping will always be enabled and no further configuration is needed. This is because electronically, the ISA bus is an unswitched I/O hub: all peripherals physically observe all communication on this bus.

If you have an ISA VLB or a PCI video adapter, then the situation is a little bit more complicated. Both of these peripheral buses are switched, and disconnected from the ISA bus, so an explicit solution is required for CRT Terminator to be able to snoop the palette writes. There are four options:

PCI Standard VGA Palette Snoop:

If your VGA adapter is PCI-based, there exists a register bit in the PCI standard to enable PCI palette snoop on the VGA card. This register bit needs to be flipped once at system startup, e.g. in AUTOEXEC.BAT. Both the SNOOP.EXE diagnostics utility ([GitHub] [Download ZIP]) and the CRTT.EXE CRT Terminator configuration utility ([GitHub] [Download ZIP]) can do this.

On one rare VGA card, the Diamond Speedstar 64 CL-GD5434, we observe a quirky VGA firmware bug that the card resets the PCI palette snoop setting on each video mode change. For this specific VGA adapter and others that possibly behave like this, we provide a TSR utility PCITSR.EXE ([GitHub] [Download ZIP]) that keeps the PCI palette snoop register latched to be force-enabled.

BIOS VGA Palette Snoop:

If the motherboard supports a "ISA VGA Palette Snoop" option in the BIOS, then that feature can be used to solve the issue. With this option enabled, the motherboard will post all palette writes to the PCI bus also onto the ISA bus, which allows CRT Terminator to follow all modifications to the VGA palette.

VGA Card Specific Palette Snoop:

Reading the datasheets of some PCI and ISA VLB graphics chips, they provide a built-in programmable option to enable passing through the palette writes from the adapter. The idea with this option is to program the PCI/ISA VLB VGA adapter to stop acknowledging VGA palette write commands back to the CPU. This will cause the CPU to continue propagating these palette write I/O operations onwards to, first in the PCI hub, and then finally reaching the ISA hub as a final destination, where CRT Terminator will then be able to snoop the writes. This requires a hardware configuration support in the VGA adapter, and a software driver that programs the VGA adapter to enable this passthrough.

Software TSR Palette Snoop:

Finally, if there is no configuration option available either in BIOS or with the VGA adapter itself, the last resort may be to revert to utilizing a software polling approach. CRT Terminator provides a DOS software TSR program PALTSR.COM ([GitHub] [Download ZIP]), which periodically polls the VGA palette, and then mirrors the palette over to CRT Terminator I/O address space. This software TSR is unfortunately not compatible with all DOS VGA programs, and will cause a small performance penalty, but on fast systems the performance impact may be unnoticeable.

A C++ reference version of the PALTSR TSR is available ([GitHub] [Download ZIP]). That may be easier to modify if you are more familiar with C++ over X86 assembly. The assembly version consumes about 6KB less RAM.

Note: On PCI and ISA VLB adapters, enabling palette snoop has a small but measurable performance impact on overall graphics performance on some games, e.g. -~4% score measured in Doom timedemo.

Software Configuration

In addition to the jumpers and DIP switches, some aspects of CRT Terminator are configured via software. These settings include:

Our software repository to configure CRT Terminator, and other utilities, can be found on the GitHub repository juj/crt_terminator.

Supported Input Video Modes

The following input video modes are supported:

Standard Mode Number Resolution Refresh Rate Colors
CGA0h40x2570hz*B/W
CGA1h40x25 70hz*16c
CGA2h80x25 70hz*gray
CGA3h80x25 70hz*16c
CGA4h320x20070hz*4c
CGA5h320x20070hz*4c
CGA6h640x20070hz*B/W
MDA7h80x25 70hz*B/W
EGADh320x20070hz*16c
EGAEh640x20070hz*16c
EGAFh640x35070hz*B/W
EGA10h640x35070hz*16c
VGA11h640x48060hzB/W
VGA12h640x48060hz16c
VGA13h320x20070hz256c
VGAMode X320x24060hz256c
SVGA58h,5Ch800x60056hz256c
Nonstandard**N/A≤ 800x600≤ 70hz≤ 256c

*On the original CGA and EGA adapters these were 60hz, but on VGA adapters these run as 70hz.

**CRT Terminator is very widely compatible with many custom video modes that programs from the DOS era utilized. We have tested hundreds of different known programs, games and demoscene demos with CRT Terminator to ensure as broad support as possible.

The maximum supported input video clock is 37.5 MHz. This is generally good for ~800x600@56 Hz, though some input video modes, like 800x600@60 Hz or 1024x768@60i Hz may also work, if you are lucky.

1024x768@60Hz progressive will not work, that is unfortunately beyond the possible speed of the Feature Connector bus (1024x768@60Hz is ~65 MHz pixel clock).

Additionally, CRT Terminator can be used to experiment with some 15bpp, 16bpp and 24bpp input video modes on some specific video adapters.

Recommended Displays

For best results, a display that supports Coordinated Video Timings - Reduced Blanking V2 standard (CVT-RBv2) is recommended. Further, a display that supports even tighter nonstandard video timings as well as arbitrary video resolutions is recommended in order to enable the use of CRT Terminator Multimode and StutterStop features.

Whichever monitor you are using, the output from DOS programs are almost always intended to be viewed in 4:3 aspect ratio. So using a display that supports a Force 4:3 aspect ratio scaling mode is highly recommended.

In the absence of such scaling mode, some monitors support a 1:1 aspect ratio mode. This aspect ratio mode, while not necessarily perfect in all cases, can be a decent fallback for many scenarios.

For best viewing results of content that uses 320x200 or 320x240 resolutions, we recommend acquiring a display with a 1920x1200 resolution that supports up to 75 Hz video and 4:3 aspect ratio control. This will enable frame rate precise crisp pixel perfect and aspect ratio preserved upscaling of input video.

Pixel peeping users who are seeking the best upscaling results for 640x480 resolution content specifically might want to entertain 1280x1024 sized displays with 4:3 or 1:1 aspect ratio control, for a 2x 640x480 → 1280x960 upscaling path, providing thin letterboxes at top and bottom.

Video Upscaling with CRT Terminator

This section describes the video upscaling strategy employed by CRT Terminator.

First note that CRT Terminator supports a Passthrough mode for use cases where upscaling is not desired. In Passthrough mode, minimal on-the-fly video normalization is performed without the use of a framebuffer (i.e. no added latency), to generate a video signal that many modern displays will hopefully be able to synchronize to.

However, Passthrough mode may have some drawbacks:

To help resolve these problems, CRT Terminator provides a video upscaling circuitry that uses a video framebuffer to upscale the input video.

The video upscaling circuitry in CRT Terminator can be utilized in two different modes: Fixed Resolution or MultiMode.

In Fixed Resolution mode, CRT Terminator upsamples the given input video signal to the given fixed output resolution using Point Sampling. The output resolution does not change depending on the input video resolution. This mode is useful for crispest video output, and for e.g. buggy USB video capture cards that get confused on video mode changes.

In MultiMode operation mode, CRT Terminator will upscale the input video by a multiple of an integer factor in both width and height. When viewed with a modern flat panel display's Force 4:3 Aspect ratio option, this produces an end result that is sometimes called "Surface-Area Sampling". This upsampling mode is generally superior to Point Sampling and Bilinear Filtering on low-resolution pixelated source content.

The effect of these different upsampling modes can be observed in practice below on a 320x200 input video signal, which is upsampled to 1440x1080 resolution to be viewed in 4:3 aspect ratio on a 1920x1080 display.


Original 320x200 video (zoomed up 5x in web browser for easier viewing, note the incorrect 16:10 aspect ratio)

Bilinear upsampling to 4:3 (Passthrough mode)

Point-sampled upsampling to 4:3 (Fixed Resolution mode)

Surface Area upsampling to correct 4:3 (MultiMode)

Click on the above thumbnails to pixel peep into the full images in 100% size.

When the effects of CRT Terminator video upsampling and flat panel display upsampling are combined, the different CRT Terminator operation modes produce different final results. The following table compares the pros and cons of the different modes:

Comparison of different CRT Terminator video upscaling modes.
Mode Visual End Result Uses Framebuffer? Added Latency Output Video Mode? Output Aspect Ratio LCD Compatibility
Passthrough Like Bilinear Filtering - Smoothest No Microseconds Varies Varies. Use 4:3 mode on LCD. Nonstandard
Fixed Resolution Point Sampling - Crispest Yes 1-2 frames Fixed if StutterStop is disabled Fixed 4:3 or 16:9. Standard DMT or CVT
MultiMode Like Surface Area upsampling - Balanced Yes 1-2 frames Varies Varies. Use 4:3 mode on LCD. Nonstandard

In general we recommend using MultiMode for best picture quality, and falling back to other modes for compatibility, subject to taste.

It is good to note that in the modes where input resolution changes trigger an output resolution change (Passthrough, MultiMode, and Fixed Resolution with StutterStop enabled), some LCD displays may take a couple of seconds to sync to the changed video mode. So, as an example, when playing Sierra's Black Cauldron or King's Quest, where switching between inventory and game views incur a video mode change, it may be better to use Fixed Resolution mode with StutterStop disabled, to avoid repeated slow video re-syncs. Some video capture boxes or recording software (such as OBS) may also have trouble with video frame rate changing during recording.

In video modes that use a framebuffer to upscale, single-buffering (vsync disabled, ~1 frame of latency) vs triple-buffering (vsync enabled, ~2 frames of latency) can be controlled in software with CRT Terminator configuration utility.

Pixel Perfect Upscaling DOS 320x200 games

Many vintage PC DOS games used the 320x200 pixels resolution. To illustrate the different upscaling modes from previous section, here is a closer comparison.


On a 1920x1080 display, upscale to 1440x1080 using Fixed Resolution mode.

On a 1920x1080 display, upscale to 1440x1080 using MultiMode scaling. (CRT Terminator will upscale to 1280x1000 for the LCD display to upscale to 1440x1080 in 4:3 mode)

On a 1600x1200 or a 1920x1200 display, upscale to 1600x1200 (using either Fixed Resolution or MultiMode operation). Lossless and pixel perfect on real display, video capture suffers from lossy 4:2:0 Chroma.

320x200 captured as Passthrough and upscaled to 1600x1200 in OBS. Lossless and pixel perfect.

Click on the individual images to load them up in full view.

Below is the same image, cropped and zoomed in for comparing closer details.


On a 1920x1080 display, upscale to 1440x1080 using Fixed Resolution mode.

On a 1920x1080 display, upscale to 1440x1080 using MultiMode scaling.

On a 1600x1200 or a 1920x1200 display, upscale to 1600x1200 (using either Fixed Resolution or MultiMode operation will yield the same result in this case) Lossless and pixel perfect on real display, video capture suffers from lossy 4:2:0 Chroma.

320x200 captured as Passthrough and upscaled to 1600x1200 in OBS. Lossless and pixel perfect.

Note that due to use of a lossy 4:2:0 Chroma StarTech video capture device, there is unfortunately a bit of chroma bleed on adjacent pixels in all of the above screenshots except for bottom right. That artifact is not present when viewed on a real LCD display. The image in bottom right shows how to use Passthrough mode to avoid lossy Chroma from degrading visual quality.

The first example (top left), uses Fixed Resolution upscaling to upsample the video when viewed on a 1920x1080 display. This produces the sharpest output when the output video size (1440x1080) is not an exact integer multiple of the input resolution (320x200). There will however be some amount of aliasing visible in games that display two-color dither/raster patterns.

The second example (top right), uses MultiMode upscaling to output the video to 1280x1000, for the LCD display to view in 4:3 1440x1080 mode. This is a great way to balance upscaling 320x200 video on Full HD displays. Note how individual pixels in two-color raster patterns appear evenly sized. (The zoomed up image shows up a bit more blurry than in reality due to 4:2:0 lossy Chroma video capture)

Which one to use depends on taste: Fixed Resolution provides sharpness, whereas MultiMode provides image quality.

For ideal no-compromises upscaling of 320x200 content, the third example (bottom left) shows how CRT Terminator upscales 320x200 input video to 1600x1200 when viewed on a 1200p capable output display. This upscaling is pixel perfect with zero smoothing/blurring. (any smoothing in the screenshot is due to 4:2:0 lossy Chroma video capture)

Using a 1600x1200 (or 1920x1200) display is ideal because that resolution is an integer multiple of popular 320x200, 320x240 and 800x600 resolutions.

Note that we do not recommend getting the popular vintage Dell 2007FPB 1600x1200 display. While it has the preferable 1600x1200 resolution, that display disappointingly does not support StutterStop.

Capturing CRT Terminator output for YouTube or Twitch streaming via OBS

Common use cases for CRT Terminator might be to record video footage from an old DOS PC for archival, video upload or live streaming purposes.

Since CRT Terminator uses a separate video output path from VGA, it is possible to simultaneously use a VGA display to view the analog video output while recording the digital video using a DVI-D video signal compatible USB/PCIe video capture device. E.g. one can play on a CRT at the same time while recording to a PC, without the need to use a separate video splitter.

Note however that some rare PCI VGA adapters have problems with handling the analog VGA palette output simultaneously while PCI palette snoop mode is enabled, so adapter specific oddities may occur.

We have tested a range of USB HDMI video capture devices for compatibility. Coarsely categorizing the results:

An example video capture of Mode 13h content, i.e. 320x200 @ 70 Hz, from an open source game mod Commander Keen in... "Goodbye, Galaxy!" Episode π: Foray in the Forest recorded in CRT Terminator Passthrough mode (640x400 @ 70.362 Hz) from OBS, upscaled to 1600x1200 is available here:

  1. Uploaded to YouTube: Commander Keen - Foray in the Forest - 1600x1200 @ 70.362 Hz.
  2. Direct download link without YouTube recompression: commander_keen_foray_in_the_forest_crt_terminator_1600x1200_70.362hz.mkv (file size: 229MB)

The Foray in the Forest mod contains patches to update Keen 4 to run at 70 fps, instead of the original 35fps that Keen 4-6 games were developed to run at. See juj/KEEN70HZ for more details about Keen refresh rate.

The next section outlines the OBS capture settings that were used to record this video.

General Video Recording Settings

In OBS, in File->Settings menu, there are two tabs, Output and Video that affect video recording. First, the Output settings were configured as follows:

These settings are not particularly specific to CRT Terminator, or vintage DOS PC recording. Video Encoding format was changed to modern NVENC (H.265) from the older H.264. Recording Quality was set to Indistinguishable Quality, Large File Size.

The settings in the Video tab were configured as follows:

In particular, the video canvas size was set to 1600x1200. This is a good resolution for recordings that aim for lossless 4:3 aspect ratio video output. Another good video canvas size for viewing on 1080p displays would be to set 1440x1080. That size would correspond to 4:3 aspect ratioed 1080 lines content.

The FPS value was set to precisely match the video output refresh rate that CRT Terminator states to be outputting. In this instance, it was 70362/1000 or 70.362 Hz. To see the CRT Terminator video refresh rate, either toggle the Developer HUD with the DIP Switch 2.4 at the back of CRT Terminator, or see if the HDMI Video Capture device you are using has a statistics window that displays this value.

Note that even if video refresh rate is set to precisely match the source content, this will not be a locked synchronization in OBS, and occassional frames can and will drop. It is a bit odd that OBS does not seem to support locking the recording refresh rate to the rate of an input video, so this is the closest approximation we found. However, the expected frame drop should occur less than 1/1000th of a Hz, i.e. approximately at most once every 1000 frames, in this case at most every 14.2 seconds.

It should be noted that recording with "odd" refresh rates like this make sense only if viewed on a high refresh rate display. For example, viewing 70Hz video on a 60Hz display is not much different from viewing 60Hz recorded video in the first place. However, when viewing 70Hz video on a high refresh rate gaming display, e.g. a 144 Hz, 240 Hz, 360 Hz or higher, video playback frame stuttering mismatches are minimized.

If recording video for playback at YouTube or streaming to Twitch, it is probably better to record the standard 60 Hz rate in the OBS settings instead, and let OBS frameskip the recorded 70 Hz content.

Video Capture Device Settings

The general video capture settings can be accessed via a Properties window:

The StarTech USB3HDCAP capture device is 4:2:0 Chroma lossy, but fortunately if the video capture is done at exactly 2x the resolution of the original video, the Chroma loss is hidden. Setting CRT Terminator to Passthrough mode will do exactly this for DOS 320x200 mode, i.e. the video will then output at 640x400 resolution, and at original refresh rate.

For USB3HDCAP specifically, it is important to set Resolution/FPS Type to Custom, and then set Video Format to XRGB, or otherwise OBS/USB3HDCAP will apply some kind of own "extra" Chroma loss to the output (we thought Chroma loss in uncompressed/raw video would be idempotent, but apparently the effect does cumulate somehow in OBS). Setting Video Format to XRGB was critical for USB3HDCAP to get a lossless pixel perfect recording.

Unfortunately OBS has a bit awkward UI quirk that setting Video Format to custom then requires that one manually also configures the recording Resolution. There is no way to just say "record whatever input resolution is coming in, but as XRGB." So this was set manually to 640x400. Getting the recording resolution exactly right is critical for pixel perfect captures.

Source Transform Settings

Finally, there are two important settings to adjust for recording pixel art content from DOS.

The first is the Source Transform setting:

Here the Size parameter was set to match the 640x400 video input size, but the Bounding Box Size was set to match the 1600x1200 video output size.

These configurations ensure that OBS will stretch the source video over the 1600x1200 canvas.

Scale Filtering Settings

Finally, to ensure that the video upscaling to 1600x1200 will take place with the pixelated image look, the Video Scale Filtering options were changed to Area mode. This implements surface-area upsampling, which provides great quality output that does not blur like bilinear filtering does. In this specific case (upscaling 320x200 video that is upscaled to 640x400, and then upscaling that to 1600x1200) setting between Area and Point shouldn't matter, and should give identical result. Although in other upscaling scenarios, we prefer the Area mode.

It is worth testing how the other settings here look like, subject to taste.

Lossless and pixel perfect 70 Hz video capture using VirtualDub

If OBS is giving trouble, it makes sense to compare against other video capture software.

In this section, one such software, the old "trusted" VirtualDub is tested. This was a great power tool in the 2000s. It is no longer actively developed (last version is from 2014), but it does support somewhat "raw" video capture from any Windows driver compatible acquisition device.

VirtualDub does not support "modern" live compression of video, so the footage it captures gets enormous quickly. However, given a large enough hard drive and the FFmpeg command line utility, one can use this toolset as a proof of concept at least to show that making lossless pixel and frame rate perfect video captures of DOS content with CRT Terminator is possible.

To illustrate, here are two recordings made with a Cyrix 486 PC -> Hercules Stingray Pro (ARK1000PV) -> CRT Terminator -> USB3HDCAP -> VirtualDub 1.10.4 (x64) -> FFmpeg workflow.

Pinball Fantasies

One of the legendary pinball games on DOS, Pinball Fantasies implements a custom nonstandard video resolution. CRT Terminator recognizes this video mode, and normalizes it to a 400x350 frame to preserve aspect ratio as close as possible and retaining pixel perfect upscaling. To avoid USB3HDCAP lossy 4:2:0 Chroma, video was upscaled to 800x700 using CRT Terminator's MultiMode feature. StutterStop was enabled to Level 3. Refresh rate for the game on the test system was 71.200 Hz.

Here are the settings used to produce the VirtualDub capture.

1. Set Video -> Preview to Progressive - both fields.

2. Set Video -> Capture Pin... settings for RGB24 color space, match the output size to "800x700 default" (it seems that in VirtualDub the default is 640x480, so one needs to change this to the correct resolution that has the text default), and then as a quirk, set the Frame Rate to the specific frame rate of the video input. In this case 71.200.

Note: In this dialog, after typing in the frame rate, do *not* click on Apply or change any other settings, or the input video rate will revert back to 60. The compression/quality settings should not matter here since there is no actual compression done. Click directly on OK.

3. Set Audio -> capture device to Line In, and feed game audio through PC motherboard's Line In input. CRT Terminator does not provide audio.

4. Go to Capture -> Settings... and enter the video frame rate (in this case 71.200) again. Do not click on the "round to nearest millisecond" button.

Note: For some reason, one needs to specify the recording frame rate to both VirtualDub and OBS. There is no possibility to say "capture locked to the input video stream frame rate" as far as we can tell. So when one specifies e.g. a capture refresh rate of 71.200 Hz to VirtualDub or OBS, even when the input video is a matching 71.200 Hz, there can and will still be some occassional frames dropped (even if these drops will come at a rate less than 1/1000th Hz). This is because realistically, video refresh rate is not an integer, like 60, and it is not even a simple fraction, like 71.200 or 71200/1000, but it can practically be seen as an irrational value with infinite number of digits. Any value like 71.200 Hz is only a rounded approximation of a physical process.

The proper software implementation for a video capture software would be to have a "capture locked to input frame rate" option. Neither OBS or VirtualDub have this (or we haven't understood a way to enable it), but they both only support asking the user to specify a refresh rate number to sample the input video at. Maybe a better software capable of losslessly locking to input video frame rate exists still?

Finally, the raw uncompressed .avi video from VirtualDub was encoded as H.265 via the following FFmpeg command line:

ffmpeg -i pinball_fantasies.avi -c:v libx265 -vtag hvc1 pinball_fantasies_800x700_71.200hz.mp4

The final H.265 recorded output can be downloaded here: pinball_fantasies_800x700_71.200hz.mp4 (16.0MB). Web browsers for some reason say that the file is corrupt, but downloading it playing locally with VLC Player worked properly. The video codec information is shown above.

A YouTube upload of this video is available here: DOS VGA Pinball Fantasies lossless upload test.

It looks like YouTube was not at all kind to the video, but resampled it from the 800x700 @ 70.200 Hz format down to 548x480 @ 30 Hz, crushing both the resolution and the refresh rate. When dealing with oddball DOS resolutions like this, the takeaway here is it will definitely be better to upscale the video more with CRT Terminator before uploading to YouTube.

Foray in the Forest

An open source total conversion mod Commander Keen in... "Goodbye, Galaxy!" Episode π: Foray in the Forest is a fan sequel (or prequel?) to Commander Keen 4-6 series. On the DOS test system, it natively runs at 320x200 @ 70.362 Hz.

The VGA adapter implements line doubling (i.e. 320x200 -> 320x400) and CRT Terminator was configured in Passthrough mode, where it provides clock doubling to normalize the aspect ratio (i.e. 320x400 -> 640x400). So USB3HDCAP and VirtualDub see an input video of 640x400 @ 70.362 Hz.

To convert the huge raw uncompressed .avi footage from VirtualDub to much smaller modern compressed formats (H.264, H.265 or VP9 are the current choices), FFmpeg was used, with the following two pass approach:

1. First pass downsampled the video from 640x400 down to 320x200 using nearest neighbor filtering. The idea was to remove the redundant information from the video first. Output codec was set to be raw video as well, to not lose any video signal in this temporary pass.

ffmpeg -i virtualdub_capture.avi -vf scale=320x200 -sws_flags neighbor -pix_fmt bgr24 -vcodec rawvideo intermediate_320x200.avi

2. The second pass upsampled this 320x200 video up to 1600x1200 and encoded that as H.265. Nearest neighbor upsampling was again used to keep the pixelated look.

ffmpeg -i intermediate_320x200.avi -vf scale=1600x1200 -sws_flags neighbor -c:v libx265 -vtag hvc1 foray_in_the_forest_1600x1200_70.362hz.mp4

This two pass resampling strategy was used to avoid an aliasing effect that upsampling the 640x400 input video directly to 1600x1200 might cause (as 1600 is not evenly divisible by 640).

The final H.265 recorded output can be downloaded here: foray_in_the_forest_1600x1200_70.362hz.mp4 (109 MB). Web browsers for some reason say that the file is corrupt, but downloading it and playing locally with VLC Player works properly.

Observing the media parameters in VLC Player verifies the 1600x1200 @ 70.362 Hz rate that closely matches that of the DOS VGA output.

The above video was uploaded to YouTube to observe how it behaves with 1600x1200 @ 70.362 Hz H.265 content. The YouTube video upload be found here: Foray in the Forest lossless DOS 70Hz video capture.

The takeaways are as follows:

This makes one wonder whether there might exist a set of FFmpeg conversion flags that one could use to generate a video file that would not incur YouTube re-encoding. YouTube has a Recommended encoding settings page for video uploads, but it seems to be outdated, as it recommends H.264 instead of VP9.

Differences in Capture Strategies

If you have a capture setup that resembles VirtualDub (i.e. capturing lossless, maybe uncompressed, capture card supports lossless Chroma 4:4:4), it is good to set CRT Terminator DIP 1.1-1.4 Output Settings to Passthrough mode to minimize the number of redundantly upscaled pixels coming in to the capture card. In this mode the source pixels are sent to the video card almost unprocessed (except for border removal and clock doubling passes). Passthrough mode can also help if the video capture device or cable has maximum bandwidth limitations.

On the other hand, if the capture device employs a lossy compression mode, like Chroma 4:2:0 or MJPEG, or if the capture software has problems with processing data without quality loss, then it is expected that first upscaling the video in CRT Terminator will yield better results.

In this case, as long as there are no observed bandwidth limitations for the capture device, then upscaling 320x200 directly to 1600x1200 in CRT Terminator is recommended, as it can simplify the configuration in OBS or another video capture software. So far however, we have unfortunately not met a capture device that could record 1600x1200 @ 70 Hz.

Compatible Graphics Adapters

A major challenge in developing CRT Terminator is that there are hundreds of different (S)VGA adapters that are clones of the original IBM VGA adapter, and the original IBM VGA was not based on a published specification or a hardware design standard.

This means that we do not have a single target to develop CRT Terminator against, but rather, need to test every display adapter one by one for compatibility.

The following table presents the results of many display adapters we have tested CRT Terminator with. It should hopefully guide some expectations, but note that the information provided in the following table is still not an affirmation or a guarantee of support.

That is, even if you have the same graphics adapter with the same graphics chip, there could be qualitative variances that can affect your results.

Legend:

✅: CRT Terminator works.
⚠️: Works, with some caveat.
❌: Does not work with CRT Terminator.

IBM

Name Bus Year FC CRT Terminator Support Notes
IBM VGA 75X9017XM ISA 1988 IBM

Acumos ⇒ Cirrus Logic

Name Bus Year FC CRT Terminator Support Notes
Everex Viewpoint EV-628 (Acumos AVGA1, "CL-GD5401") ISA 1991 IBM
Acumos AVGA 2 ("CL-GD5402") ISA 1992 VESA
Hightech Information System Ltd VGA Card (CL-GD5422) ISA 1993 VESA
Cirrus Logic GD-542x Eval Board (CL-GD5428) ISA 1994 VESA
Cirrus Logic GD-5430 PCI 1994 VESA
Diamond SpeedStar 64 (CL-GD5434) PCI 1994 VESA ⚠️ VGA BIOS bug requires PCITSR.EXE
Cirrus Logic GD-5440 PCI 1995 VESA ❌ Unstable FC video signal
Creative CT6330 Graphics Blaster MA200 CL-GD5446 PCI 1996 VESA
Jaton Corporation Cirrus Logic CL-GD5446 PCI 1998 VESA

Trident

Name Bus Year FC CRT Terminator Support Notes
Trident TVGA8816CSC2 (TVGA 8800CS) ISA 1989 IBM
ASKA ZyMOS POACH 51 (TVGA 8800CS) ISA 1990 IBM
Trident TVGA8900C MQTD023/9218 ISA 1992 IBM
Trident TVGA8900C EQB144001/9220 ISA 1992 IBM
Trident TVGA8900D ISA 1994 VESA
Trident TGUI9440 PCI 1995 VESA
Trident TVGA 9000i-3 PCI 1996 VESA

Tseng Labs

Name Bus Year FC CRT Terminator Support Notes
Tseng Labs ET3000AX ISA 1991 IBM ⚠️Card hangs after BIOS POST on test 486 PC, boots OK on another PC, where superficially tested OK with CRT Terminator.
Diamond SpeedSTAR 24 (Tseng Labs ET4000AX) ISA 1992 VESA
Tseng Labs ET4000/W32p PCI 1995 VESA
Jazz Multimedia G-Force 128 (Tseng ET6000) PCI 1996 VESA

Paradise ⇒ Western Digital

Name Bus Year FC CRT Terminator Support Notes
Paradise PVGA1A-JK ISA 1990 IBM
WDC WD90C30-LR ISA 1992 VESA
WDC WD90C31A-LR ISA 1993 IBM

Avance Logic ⇒ Realtek

Name Bus Year FC CRT Terminator Support Notes
Realtek RTG3106 ISA 1991 IBM
Avance Logic ALG2302 PCI 1995 VESA

S3

Name Bus Year FC CRT Terminator Support Notes
S3 Powergraph X-24 (S3 86C801) ISA 1993 VESA ⚠️Works with CRT Terminator, but hangs in SNOOP.EXE scan.
S3 Vision864 PCI 1994 VESA
Diamond Stealth 64 Video 3200 (S3 Vision 968) PCI 1995 VESA ❌Faulty card? Does not POST.
S3 ViRGE ST-325A PCI 1996 16-bit S3 Local Peripheral Bus (LPB), 26 + 6(8) + 16 = 50 pins ⚠️S3 BIOS quirk: Feature Connector is not enabled at boot, but requires S3 utility (or SNOOP.EXE) to enable.
S3 Trio64V+ PCI Mfg. 1997 VESA ⚠️Works with CRT Terminator, but hangs in SNOOP.EXE scan.
S3 Trio64V2/DX PCI 1996 8-bit S3 Local Peripheral Bus (LPB), 26 + 6(8) = 34 pins

ATI

Name Bus Year FC CRT Terminator Support Notes
ATI 28800-5 ISA 1991 IBM ⚠️Works with CRT Terminator, but card does not implement 1:2 Dot Clock option.
ATI 28800-6 ISA 1992 IBM ⚠️Works with CRT Terminator, but card does not implement 1:2 Dot Clock option.
ATI Mach64 VT2 PCI 1996 ATI Multimedia Channel (AMC)
ATI 3D Rage II PCI 1997 ATI Multimedia Channel (AMC)

Others

Name Bus Year FC CRT Terminator Support Notes
Oak 037C ISA 1990 IBM ⚠️Works with CRT Terminator, but card does not implement 1:2 Dot Clock option.
Genoa SuperVGA 6200 ISA 1991 IBM
Video Seven VGA 1024i (Headland HT208) ISA 1991 IBM
Wang Labs Chips & Technologies F82C452 ISA 1991 IBM
Ahead V5000B ISA 1992 IBM
Hercules Stingray Pro (ARK1000PV) PCI 1995 VESA
MiroVideo 12PD v1.02 (Alliance Semiconductor ProMotion 3210) PCI 1995 VESA ❌Bad color signal on Feature Connector.
MiroVideo 12PD v2.00 (Alliance Semiconductor ProMotion 6410) PCI 1995 VESA ❌Bad color signal on Feature Connector.
Matrox Millennium 2064W PCI 1997 VESA
SiS 6326 PCI 1998 VESA ❌ No output from Feature Connector

Hardware Random Number Generation

When IBM released the VGA adapter, they dropped support for the CGA and EGA light pen feature. However, the hardware registers relating to light pen support still remained in a crippled form, and one of those registers would contain a free-running counter.

In a Headland V7 VGA adapter technical manual from June 1988, the authors noted this quirk, and offered that maybe the feature could be used to generate random numbers:

See page 3-47 in the PDF. In the Vogons thread: "Can your VGA card provide a hardware source for random numbers?" the community got a bit excited to try out various clone VGA adapters, to see whether this behavior was still present in each, and if it could indeed be used to produce random numbers. And for some of them, it totally did!

As a homage to this fun behavior, and observing that vintage PCs really do not have a good fast source to hardware RNGs, we decided to add a proper hardware random number generator to CRT Terminator, in a way that is accessible as fast as possible on a vintage PC.

The hardware I/O port 0125h is dedicated to provide a new random number each time it is read. This random number generator was tested to pass the NIST 800-22 Rev 1a specification for random number generators.

See the Hardware Programming Reference section for details on how to use the RNG.

Hardware Programming Reference

This section provides example code to interact with CRT Terminator from your real mode DOS programs.

I/O Address Space

CRT Terminator uses the ISA I/O bus port range 120h-12Fh for communicating with the ISA card.

The following I/O address ports are provided.

Port Number Name Direction Description
120hCRT Terminator ID PortRead OnlyReading this port cycles to return ASCII values 'C', 'R', 'T' and 'T'. Use this port to identify CRT Terminator with minimal intrusion to the I/O device space.
121hIndex PortRead/WriteSelects the current indexed sub-register to access, or returns the current sub-register index.
122hData PortRead/WriteReads or writes the given 8-bit sub-register selected by the index port.
123h8bpp Palette Index PortWrite OnlySelects the active palette index to write, 0-255.
124h8bpp Palette Data PortWrite OnlyConsecutively write 3 bytes to program a 24-bit color for active palette index. The index is then autoincremented to receive the color for the next palette index (wrapping around to zero after 255).
125hRNG PortRead OnlyEvery read from this port returns a new 8-bit random number from a fast high quality hardware random number generator source that passes the NIST 800-22 Rev 1a specification.
126hFrame Counter PortRead OnlyReading this port returns the lowest 8 bits value of the currently displayed frame number counter.
127hScanline Counter PortRead OnlyReading this port returns the number of scanlines remaining until the start of next vertical blank.
If the adapter is currently in vblank, this port returns 0.
If more than 254 scanlines remain until vblank, this port returns 255.
128hHigh Precision Wallclock Port 0 (LSB bits 7-0)Read Only with Side EffectReading this port latches the 32-bit high precision wallclock time counter and returns the lowest 8 bits of its value.
This wallclock timer has the frequency of 27,000,000 Hz ± 1350 Hz. (Accuracy of 50ppm)
129hHigh Precision Wallclock Port 1 (bits 15-8)Read OnlyReading this port returns bits 15-8 of the latched 32-bit high precision wallclock time counter value.
12AhHigh Precision Wallclock Port 2 (bits 23-16)Read OnlyReading this port returns bits 23-16 of the latched 32-bit high precision wallclock time counter value.
12BhHigh Precision Wallclock Port 3 (MSB bits 31-24)Read OnlyReading this port returns bits 31-24 of the latched 32-bit high precision wallclock time counter value.

Note that the I/O address space used by CRT Terminator is currently fixed and not configurable. This is because CRT Terminator provides several highly performance sensitive I/O ports, so to enable sequences of minimal assembly instructions to interact with CRT Terminator, fixed port assignment is used.

Consulting known I/O address mapping lists, such as

this range of ports is expected to be free from conflicts.

If however such conflicts should arise, a dynamic I/O port mapping assignment may be employed in the future.

Detecting CRT Terminator

The following code may be used to detect the presence of CRT Terminator in a real-mode DOS system.

#include 
#include 

// CRT Terminator ID port: this is a read-only port that cycles to return
// values 'C', 'R', 'T', 'T' on subsequent reads.
#define CRTT_ID_PORT 0x120

int crtt_detect()
{
  static int crtt_found = 0;
  if (!crtt_found)
  {
    disable();
    crtt_found = -1;
    for(int i = 4; i--;) // one of 4 consecutive reads must be a 'C'
    {
      char id = inportb(CRTT_ID_PORT);
      if (id == 'C')
      {
        if (inportb(CRTT_ID_PORT) != 'R') break; // and 'RTT' must follow
        if (inportb(CRTT_ID_PORT) != 'T') break;
        if (inportb(CRTT_ID_PORT) != 'T') break;
        crtt_found = 1; // Found CRT Terminator
        break;
      }
      if (id != 'R' && id != 'T') break; // On anything else than C, R or T, not CRT Terminator.
    }
    enable();
  }
  return crtt_found == 1;
}

int main()
{
  printf("CRT Terminator detected: %s\n", crtt_detect() ? "true" : "false");
  return crtt_detect();
}
Listing 1. Recommended C code to detect CRT Terminator in Borland C++, Turbo C or Turbo C++.

Indexed Registers

In addition to the direct registers presented in the previous table, there are several indexed registers that are provided.

These registers are accessed through the CRT Terminator Index+Data Port pair. First write the index of the desired register to access into the CRT Terminator Index Port (121h), and then the selected register can be accessed via the CRT Terminator Data Port (122h).

Indexed Port Number Name Direction Description
00h-01hCRT Terminator Product IDRead OnlyCRT Terminator Product ID. (16 bits, Little Endian)
02hCRT Terminator Product Revision IDRead OnlyCRT Terminator Product Revision ID.
03hFirmware Revision YearRead OnlyVersion identifier for the firmware.
04hFirmware Revision MonthRead OnlyVersion identifier for the firmware.
05hFirmware Revision DayRead OnlyVersion identifier for the firmware.
06h-09hFeature Connector Pixel ClockRead OnlyPixel clock of the currently received video signal through Feature Connector, in Hz. (32 bits, Little Endian)
0Ah-0DhFeature Connector Hsync RateRead OnlyHorizontal Refresh Rate of the currently received video signal through Feature Connector. (32 bits, Little Endian)
0Eh-11hFeature Connector Vsync RateRead OnlyVertical Refresh Rate of the currently received video signal through Feature Connector. (32 bits, Little Endian)
12hFeature Connector Video PropertiesRead OnlyReturns parameters of the Feature Connector video signal:
Bit 0 - Hsync Polarity
Bit 1 - Vsync Polarity
Bit 2 - Video Signal Present
Bit 3 - Video is Scandoubled
Bit 4 - Video is interlaced?
13hFeature Connector Video Bit DepthRead OnlyBits 0-1:
00h: ≤ 8bpp
01h: 15bpp
10h: 16bpp
11h: 24bpp
14hRead OnlyIf Video Bit Depth is 00h (≤ 8bpp), this field denotes the number of distinct colors in Feature Connector video signal.
15hRead OnlyIf Video Bit Depth is 00h (≤ 8bpp), this field denotes the highest palette ID present in the Feature Connector video signal.
16h-17hRead OnlyFC Horizontal Front Porch length.
18h-19hRead OnlyFC Horizontal Sync length.
1Ah-1BhRead OnlyFC Horizontal Back Porch length.
1Ch-1EhRead OnlyFC Horizontal Visible Screen Width in clocks (not necessarily equal to screen pixel width).
1Eh-1FhRead OnlyFC Horizontal Total Line length in clocks.
20h-21hRead OnlyFC Vertical Front Porch length, in lines.
22h-23hRead OnlyFC Vertical Sync length, in lines.
24h-25hRead OnlyFC Vertical Back Porch length, in lines.
26h-27hRead OnlyFC Vertical Visible Screen Height in lines.
28h-29hRead OnlyFC Vertical Total Lines.
2Ah-2BhRead OnlyFC Screen Width in pixels.
2Ch-2EhRead OnlyFC Screen Height in pixels.
2Eh-2FhRead OnlyFC Left Edge VGA Border Crop.
30h-31hRead OnlyFC Top Edge VGA Border Crop.
32h-33hRead OnlyFC Right Edge VGA Border Crop.
34h-35hRead OnlyFC Bottom Edge VGA Border Crop.
36h-37hRead OnlyFC Leftmost visible pixel x coordinate.
38h-39hRead OnlyFC Topmost visible pixel y coordinate.
3Ah-3BhRead OnlyFC Rightmost visible pixel x coordinate.
3Ch-3EhRead OnlyFC Bottommost visible pixel y coordinate.
3Eh-3FhRead OnlyCurrently selected values of the DIP switches at the back of the card.
40hRead-WriteConfigures currently active features:
Bit 0 - Enable 8bpp colors (disable 6bpp palette)
Bit 1 - Enable Vsync. If set to 1, video is upscaled triple-buffered. If set to 0, video is upscaled without vertical synchronization, and can tear.
Bit 2 - Enable border crop. If set to 1, the video border is cropped away from output image. If set to 0, video border is preserved.
Bits 3-7 - Reserved. Please preserve these bits when writing to this register.
44h-47hISA Bus SpeedRead OnlyMeasured ISA bus clock speed, in Hz.
48hRead OnlyMost Recently Written Palette Index.
49h-4BhRead OnlyMost Recently Written Palette RGB color.
Other IndicesReservedRead Only(Reads will return FFh, but do not assume this)

Hardware RNG

To generate a random byte, issue a 8-bit read from the port 0125h. This can be quickly tested in DOS via the debug command:

16-bit reads to this port will not generate a 16-bit random number, because CRT Terminator is only an 8-bit card. So stick to 8-bit reads only.

The following C++ program prints out ten random numbers.

#include 
#include 

int main()
{
  for(int i = 0; i < 10; ++i)
  {
    unsigned char rng = inp(0x125);
    printf("%d\n", (int)rng);
  }
  return 0;
}
Listing 2. Borland Turbo C++ 3.0 example to generate random numbers from CRT Terminator hardware RNG source.

If the above code is run on a system that does not have CRT Terminator installed, the program will likely output the same byte value ten times. Refer to listing 1 to detect the presence of CRT Terminator before using the above code.

Likewise, random numbers may be generated from within x86 assembly code.

#include 

int main()
{
  for(int i = 0; i < 10; ++i)
  {
    unsigned char rng;
    asm mov dx, 0x125
    asm in  al, dx
    asm mov rng, al
    printf("%d\n", (int)rng);
  }
  return 0;
}
Listing 3. Borland Turbo C++ 3.0 inline x86 assembly example to generate random numbers from CRT Terminator hardware RNG source.

for the relevant bits to be adapted into an existing x86 assembly program.

Frequently Asked Questions

Does CRT Terminator support sending audio through the digital video cable?

No. Audio output over the video cable is not supported. Please use e.g. the 3.5mm Line-In connector of your PC when capturing video+audio for recording and streaming purposes, and an external 3.5mm audio in jack on your display, or a pair of external speakers when playing audio out locally.

Developer HUD

At the back of CRT Terminator board, the DIP switch DIP2.4 enables or disables an onscreen overlay for the video signal. This overlay can be used to diagnose the video signal that CRT Terminator is receiving and outputting.

The HUD is split into three sections, Input (IN:), Middle (MID:) and Output (OUT:), that represent the stages of CRT Terminator video processing pipeline.

The Input section identifies the video signal that is being received through the Feature Connector, before any modification or processing is done on it. The Middle section displays information after CRT Terminator has applied its video geometry processing steps, and the Output section displays what the final generated (upscaled) video parameters are.

Anatomy of a Video Frame

When the user views a single frame of the generated video, say this 320x200 pixels sized Commander Keen picture below:

What actually gets transmitted over the wire by the graphics adapter, in analog VGA, digital Feature Connector, or DVI-D signals, has quite a bit more going on in it. In actuality, a "full" frame of video looks like the following image.

For presentation, the image has been scaled 2x in the horizontal direction. That is, each pair of two adjacent pixels illustrates a single clock cycle when transmitting a frame of a video image over the wire. Only about 71.27% clock cycles transmit a visible pixel from the actual DOS framebuffer. The rest are "padding" that is used to help the receiving monitor to synchronize its operation to the video signal.

Taking a closer look at an individual scanline of this image that is 400 clock cycles long (drawn as 800 pixels wide above), this constitutes of:

  1. 8 clocks of left VGA border (cyan): in this area, the adapter sends a visible color for "overscan" area. These pixels are not part of the DOS VGA framebuffer. Most commonly the VGA border color is black, but in this game, the authors have changed the border color for artistic effect.
  2. 320 clocks of active framebuffer image: this is the actual data scanned out from the VGA memory (at VGA segment A000h).
  3. 8 clocks of right VGA border (cyan): right side overscan border. In this case, the border widths are symmetric, but the VGA adapter can be freely programmed to have lopsided left and right border lengths, or no borders at all.
The above 8+320+8 clocks area is called the Display Enable portion of the image. After this section, the adapter is considered to be in Display Blank and will scan out a black colored pixel. The blank period consists of:
  1. 3 clocks of horizontal front porch (black): This "porch" area enables the cathode ray tube operation to prepare for transition to next scanline.
  2. 48 clocks of horizontal sync (red): Shown here for clarity in red color, although the adapter scans black in this area. The horizontal sync signal commands the CRT beam to advance a scanline and return back to scan the next row of pixels to the screen.
  3. 13 clocks of horizontal back porch (gray): The adapter also scans black here, shown in gray for visual highlight. This porch area gives time to the receiver to prepare its internal operation for receiving a new scanline of pixels.
In this case, the Display Blank portion consists of 3+48+13 = 64 pixels. These lengths have been selected historically somewhat arbitrarily to accommodate the cathode ray driving circuit implementations in CRT displays of the time.

Vertically, a video frame is structured identically, i.e. the image sections are the same: top border, active image, bottom border, front porch, vertical sync and back porch.

Something that is typical for low DOS VGA resolutions like this is that proportionally a relatively long time is spent in vertical blank. The timings used in high resolutions in modern times need a considerably shorter percentage of time in vertical blank. As a result, when input latency of a video upscaler is measured, the latency is typically a tiny bit shorter in the top side of the image, compared to the bottom side. (a difference of about ~1 msecs or so)

Pedantic sidenote: In the earlier image, the "first clock" of a video frame is shown at top-left corner at (0,0) in the VGA border area. This is drawn so for clarity of illustration for the above diagram. For DOS VGA adapters, technically the first clock of a video frame is actually the top-left pixel of the visible framebuffer image, as shown below. This distinction only has a meaning if you are writing code to program the VGA register values yourself. The generated video stream is equivalent, as there are no markers for a "first pixel of a frame" in the video stream itself.

How the VGA adapter registers lay out a video frame. First pixel of a frame shown in top-left (0,0).

Troubleshooting

Hardware and software bugs are collected at the public GitHub issue tracker at https://github.com/juj/crt_terminator/issues.

Contact us directly at .

Improving Feature Connector Video Signal

It may happen that the video signal on CRT Terminator glitches, either intermittently or continuously. This section lists actions that can be employed to reduce glitching.

Manual Sampling Phase Configuration

The jumper J2 on the top edge of CRT Terminator configures the automatic sampling phase detection feature of CRT Terminator. The idea with this feature is to provide a hassle-free configuration for video signal synchronization.

In some cases, this automatic sampling phase detection may not however work properly. If that is the case, it can be disabled by setting J2 to state 2-3. The sampling phase of each of the four signals: Hsync, Vsync, Display Enable and Pixel Data can then be manually selected with jumpers J3-J6.

Solder More Ground Pins

The Feature Connector bus contains multiple ground pins. The reason for this is that it allows the connector to provide a cleaner ground signal to the high speed video pins.

However, unfortunately VESA did a major design mistake in the physical specification of the Feature Connector. If the connector is accidentally installed 180 degrees rotated, the data signals will short directly to ground. It is unclear what kind of protections different SVGA adapters may have against this.

To prevent accidental installation in 180 degrees incorrect orientation, VESA did specify pin 25 to be a keyed N/C pin, likely thinking that the pin could then be physically omitted on the male end of the header, and on the Feature Connector cable, pin 25 could then be blocked out. But unfortunately, this convention never took wind (maybe due to requiring manufacturing custom cables?), and out of all of the ~100 SVGA adapters we have in our test lab, only one or two of them have omitted pin 25.

Therefore it is not possible to provide safe keyed video cables with CRT Terminator, that could not be physically installed in the wrong orientation (unless the customer was asked to physically cut off pin 25 on their graphics card - an awkward, although safe operation).

So to help mitigate accidental short circuits from an incorrect 180 degrees reversed installation of the Feature Connector cable, CRT Terminator by default does not wire some of the ground pins on the PCB.

If your VGA adapter has a really glitchy video signal or you are attempting to make higher input video resolutions work, there are six unsoldered ground traces on the CRT Terminator board, on ground pins a2, a3, a8 through a11. You can attempt to solder these traces together in order to improve the individual ground lines, like so:

There is a small chance that this could improve a glitchy video signal quality. In our testing however, in DOS 320x200, 640x480, 720x400 and 800x600 video modes, these ground lines did not prove to have noticeable effect, so for abundance of caution, these have been left unconnected by default.

If you do decide to try this mod out, be aware that incorrectly connecting the Feature Connector cable rotated 180 degrees in wrong orientation will then result in a catastrophic short to ground. Warranty does not cover this modification.

Disconnect Analog VGA Cable

Maybe a bit surprisingly, the analog VGA output and the digital Feature Connector signal lines are partially shared on the SVGA adapter. This means that interference between the two may occur.

If you are seeing glitches in the digital video signal while the analog VGA cable is connected, but not intended to be used - try disconnecting the VGA cable, and e.g. replace it with the VGA Terminator dongle. This will reduce any interference from the analog VGA circuitry to the Feature Connector video signal.

This interference is not just theoretical, but is observed in practice. See next section.

Use the Shorter Feature Connector Cable

The 30cm long Feature Connector cable is necessary for some SVGA adapter setups where the Feature Connector is located awkwardly. However, whenever there is no need for the longer cable, it is definitely recommended to use the shorter 15cm cable instead.

To illustrate the effect of cable length on signal quality, a stress test was conducted below.

PC Setup: 80 MHz Cyrix 486.
SVGA Adapter: Hercules Stingray Pro (ARK1000PV).
Test Resolution: Windows 3.1 in 1024x768 @ 69.4 Hz progressive 8-bit palettized. Pixel Clock: 74.474 MHz (far out-of-spec, +98.6% above the maximum rated 37.5 MHz pixel clock)
Other: Analog VGA cable connected to Asus PA248QV LCD display.

Test caseResult

A special made extra short 7.5 cm Feature Connector cable.

Both the CRT Terminator and analog VGA picture were intact.

The default 15 cm Feature Connector cable.
Same as above. Signal ok, no difference to the 7.5 cm cable.

The extra long 30 cm Feature Connector cable.

CRT Terminator digital signal has drifted, automatic sampling phase detection is no longer accurate. The long FC cable has caused the analog VGA output signal to degrade.

The above test case shows an exaggerated scenario in out-of-spec pixel clocks on a 1024x768 resolution. On within-spec resolutions with lower pixel clocks (≤ 37.5 MHz) however, degradation of the VGA output side was not observed.

This test illustrates that interference between analog VGA and digital Feature Connector output paths can happen.

Appendix A: IBM VGA Feature Connector

Apparently the IBM Feature Connector first appeared in the following manuals:

However there are some discrepancies, since the above documents both describe a 20-pin connector, whereas the Feature Connector present on the first IBM PS/2 ISA VGA adapter is a 2x13-pin edge connector.

📁 Lost Documents: If IBM ever released any technical documentation related to IBM ISA PS/2 Display Adapter (VGA) 75X9017XM and you might have it, please please share it with us or scan it to archive.org!

Appendix B: VESA Standard VGA Pass-Through Connector

In August 1989, VESA took IBM's existing Feature Connector functionality and standardized it as VESA Standard VS890803: VESA Standard VGA Pass-Through Connector (VSVPC).

This connector is colloquially called the VESA Feature Connector, and became ubiquitous to exist on almost all SVGA adapters in the 1990s. This is the connector that CRT Terminator connects with.

📁 Lost Documents: Unfortunately this standard may to have lost in time, and not even VESA themselves seem to have this specification. If you would happen to have a copy, please please share it with us or scan it to archive.org!

VESA Feature Connector Pinout

The pin diagram from the male end of the VESA Feature Connector (on the SVGA adapter board) looks as follows.

Pin 2
DATA0
Pin 4
DATA1
Pin 6
DATA2
Pin 8
DATA3
Pin 10
DATA4
Pin 12
DATA5
Pin 14
DATA6
Pin 16
DATA7
Pin 18
PIXCLK
Pin 20
DISPEN
Pin 22
HSYNC
Pin 24
VSYNC
Pin 26
Ground
Pin 1
Ground
Pin 3
Ground
Pin 5
Ground
Pin 7
EPIXEL
Pin 9
ESYNC
Pin 11
ECLK
Pin 13
N/C
Pin 15
Ground
Pin 17
Ground
Pin 19
Ground
Pin 21
Ground
Pin 23
N/C
Pin 25
N/C (may be keyed
with no pin)


Example connector orientation. Be sure to check pin 1 orientation on every SVGA adapter individually, since it can vary per vendor.

Note that the pin numbering may differ a bit. The above numbering order (alternating even numbers on one row, odd numbers on the other row of the header) follows a convention found in the user manual of ASUS 3DexPlorerDX, a graphics card that integrates the S3 ViRGE/DX graphics chip.

The above Tseng ET4000AX adapter runs the numbering of the pins with pins 1-13 on one long row of the header, and pins 14-26 on the other row. The original IBM or VESA specifications might have used this convention, although we don't have the document to check.

Ultimately, whichever numbering convention was used, fortunately pins 1 and 26 are identified the same in both of these notations.

The meaning of the different signals are as follows:

When connecting the VESA Feature Connector cable, be careful to check the right orientation, since installing the cable in the wrong orientation will result in shorting data and clock lines to ground. To make matters more challenging, some SVGA vendors rotated the connector on the graphics board 180 degrees from the VESA normative orientation, making identifying pin 1 on each board especially important.

VESA Advanced Feature Connector (VAFC)

After the original VSVPC connector that only carried 8-bit video, VESA expanded the connector standard to 32-bit video in the VESA Advanced Feature Connector (VAFC) standard.

VESA has released to the public the following documents related to their later VESA Advanced Feature Connector (VAFC):

Unfortunately there were only one or two graphics adapters that implemented the VAFC connector, so its adoption was practically nonexistent.

Appendix C: DVI-D Standard

CRT Terminator outputs a TMDS+LVDS encoded video signal over a single-link DVI-D standard.

Appendix D: CRT Terminator Supported Output Resolutions

CRT Terminator is able to output video modes that are shown in the following table. When CRT Terminator is operated in fixed output resolution mode (i.e. MultiMode and StutterStop features are disabled), standard resolutions shown in DIP switch values 0-15 can be configured. These video modes provide support for compatible operation for displays that are not able to sync to historical low resolution DOS or upscaled video modes.

DIP switches 1.1-1.4 and JP7 Resolution Standard Mode Rates Horizontal Timings (clocks) Vertical Timings (lines)
Decimal Binary JP7 (OC) Vertical Rate Horizontal Rate Pixel Clock Front Porch Sync Back Porch Front Porch Sync Back Porch
00000b*PassthroughNonstandard·1·1·1·1·1·1·1·1·1
11000b*640x480DMT60.000 Hz31.5 kHz25.200 MHz896402225
20100b*800x600DMT60.256 Hz37.841 kHz39.960 MHz40128881423
31100b*960x720CVT59.775 Hz44.711 kHz55.800 MHz48961443421
40010b*1280x720DMT60.001 Hz45.000 kHz74.250 MHz110402205520
51010b*1024x768DMT60.004 Hz48.363 kHz65.000 MHz241361603629
60110b*1200x900CVT59.617 Hz55.682 kHz88.200 MHz721201923427
71110b*1280x960CVT59.673 Hz59.434 kHz100.800 MHz801282083429
80001b*1280x1024CVT-RBv260.275 Hz63.529 kHz86.400 MHz832401686
91001b*1364x1024CVT60.000 Hz63.240 kHz91.065 MHz8324016186
100101b*1400x1050CVT-RBv259.685 Hz64.459 kHz95.400 MHz832401686
111101b*1680x1050CVT-RBv259.659 Hz64.432 kHz113.400 MHz832401686
120011b*1440x1080CVT-RBv259.690 Hz66.316 kHz100.800 MHz832401786
131011bOFF1920x1080CVT-RBv253.610 Hz59.400 kHz118.800 MHz832401486
131011bON1920x1080CVT-RBv259.541 Hz66.150 kHz132.300 MHz3832401786
140111bOFF1600x1200CVT-RBv257.351 Hz70.714 kHz118.800 MHz8324019 86
140111bON1600x1200CVT-RBv259.861 Hz73.929 kHz124.200 MHz3832402186
151111bOFF1920x1200CVT-RBv248.371 Hz59.400 kHz118.800 MHz832401486
151111bON1920x1200CVT-RBv260.121 Hz74.250 kHz148.500 MHz3832402186
--OFFMultiMode or
StutterStop
Nonstandard2 ≤ 75.000 Hz·2≤ 118.800 MHz·2·2·2·2·2·2
--ONMultiMode or
StutterStop
Nonstandard2≤ 75.000 Hz·2≤ 199.800 MHz3·2·2·2·2·2·2

1: Varies. Passes through input video signal, with small corrections.
2: Relaxed from CVT-RBv2 timings.
3: Overclocked, support not guaranteed. Single link DVI-D cable can reach a pixel clock up to 165 MHz.

Appendix E: Changelog

This section lists changes to this manual. For precise changes, see GitHub history on the manual/ subdirectory.