kristofer sweger Home

ANSIPLUS and Windows

Users of Windows 98, 95, 3.1 or NT 4 should consider using ANSIPLUS as well. The ANSIPLUS driver works well under Windows, and because ANSIPLUS is a CON device driver, local copies of it are included in each Windows virtual DOS machine. This means that all the ANSIPLUS internal state variables, and those of its integrated console features, will be local to each virtual machine, so there is no way they can interfere with each other. This section discusses how to work around the specific limitations imposed on ANSIPLUS DOS sessions by Windows or by Windows in combination with other software.

The following topics are covered here: Loading options, Full screen vs. windowed DOS sessions, Copy and paste, Scroll-back, Color palettes, Beep tone, International usage, and Windows NT.

Loading Options

All ANSIPLUS memory loading options are compatible with Windows, with the following exceptions:

Full Screen vs. Windowed DOS Sessions

The VWFD.386 Windows Virtual Device Driver for Windows 3.x or 9x, which is supplied with ANSIPLUS, is required to test whether a DOS virtual machine is running full screen or in a window. If the VWFD.386 driver is not installed, ANSIPLUS will have no way of knowing whether it is running full screen under Windows, so it must assume that a DOS session is in a window and disable three features:

The ANSIPLUS INSTALL program automatically copies the VWFD.386 file to the WINDOWS\SYSTEM directory, and then adds the following line to the [386Enh] section of the Windows SYSTEM.ini file:


VWFD.386 can be installed to Windows 98, 95 or 3.x.  It will not work with Windows NT.

Copy and Paste

When key input is pasted from the Windows clipboard, it is made available to programs by ANSIPLUS via the Int 16h key input interrupt. But Microsoft, in their wisdom, has disabled Int 2Fh/AH=17h access to the Windows clipboard by a virtual DOS machine while it is executing an Int 16h key input interrupt. To get around this limitation, ANSIPLUS copies data to and from the Windows clipboard in the background during hooked Int 28h DOS Idle, Int 1Ch User Timer Tick and Int 21h DOS call interrupts. However:


The recommended storage location for scroll-back data under Windows is expanded memory (EMS). Use of EMS for scroll-back instead of video RAM (as was done by ANSIPLUS drivers before Release 3.10) eliminates compatibility problems with Windows video drivers apparently caused by memory accesses to video RAM not on the visible part of the virtual screen.

The standard Windows 3.x DOSPRMPT.pif and _DEFAULT.pif files both allow programs to access EMS memory. A sample PIF file with suggested PIF settings (for the MS-DOS command prompt) is included with the ANSIPLUS package in the file APLUS.pif. These settings are recommended, but not necessary, for all DOS applications that depend on scroll-back under Windows.

Under Windows, when a 386 Enhanced Mode DOS session starts, ANSIPLUS will try to allocate 64K of private expanded memory (EMS) for scroll-back (48K if ANSIPLUS code was loaded into EMS). If the EMS is not available (for example, if the Windows PIF file for the application does not provide expanded memory), then the driver will attempt to use video RAM for scroll-back instead, if that option has been specifically enabled. ANSIPLUS provides a configurable feature that can prevent Windows EMS from being allocated for scroll-back and force any Windows DOS session scroll-back to reside in video RAM. This is not advised, however, because scroll-back in video RAM under Windows is not reliable when used with many Windows video drivers.

Using video RAM for scroll-back under Windows 3.x has problems, particularly for DOS applications run in a window. One difficulty is that when a DOS application is run in 386 Enhanced Mode, Windows will not maintain a full 32K of text mode RAM unless the Windows PIF file specifies High Graphics and Retain Video Memory. If these PIF settings are not used, then the first time that ANSIPLUS needs to access the scroll-back storage area, Windows may present a message claiming that there is not enough memory for the application to correctly display information. If this happens, just click on OK, then hit Alt+Enter to switch to a full screen display and proceed. Scroll-back data will also likely be lost when the focus is switched from task to task, as with the Alt+Tab key, or when changing display modes. Even with these PIF settings, some Windows 3.1 video drivers (eg., 256-color ET-4000) will not work correctly when video RAM outside the visible screen is accessed, resulting in loss of scroll-back text or incomplete updating of the screen. You therefore should exercise caution before relying on video RAM for scroll-back.

Starting with ANSIPLUS Release 3.1, scroll-back lines are captured under Windows as they are completed, rather than as they scroll off the top of the screen. This change was necessary because some Windows 3.1 video drivers (eg., Microsoft VGA) trap BIOS scrolling requests completely and do not pass them through to the DOS virtual 8086 when running a DOS session in a window. This makes it impossible for ANSIPLUS to know when the screen has scrolled if a BIOS call was used to do it. Some important DOS programs now mix DOS output and BIOS calls for scrolling (eg., 4DOS 5.0 and NDOS 8.0 when displaying multi-colored directories).

Color Palettes

Full screen DOS programs in Windows will use the same colors that they do when run under DOS. When the same program is run in a window, its 16-color palette will be determined entirely by Windows and the Windows video driver. ANSIPLUS will have no control over the palette when running in a window.

Under Windows, when a DOS session is run in a window using Microsoft's VGA video driver (and possibly others), ANSIPLUS's pink color may appear as white. This can be corrected by converting pink to light magenta with the program provided with ANSIPLUS. Including in AUTOEXEC.bat will change pink to light magenta for all DOS applications in and out of Windows. Running it within a Windows DOS session will change the color for only that DOS session. However, will not work if run in WINSTART.bat because it is not a TSR.

Some 256-color drivers for Windows apparently assume that the OEM 256-color palette has been loaded when the 256-color mode was selected, and never define the colors that Windows will use. Because of this, ANSIPLUS normally does not load its default colors when a 256-color mode is selected under Windows. This can be overridden by a configurable feature.

Beep Tone

When Windows is running in 386 Enhanced mode, and a DOS program running in the background outputs a Ctrl+G, the background programís virtual 8086 may not be running fast enough to accurately time the tone. Because of this, the tone can drag out and sound strange. Disabling ANSIPLUS tone generation under Windows restores the original Windows sound driver, but makes the tone frequency and duration non-changeable.

International Usage

When the DISPLAY.sys driver is used with Windows 3.x, the colors and other variables of either ANSIPLUS or the DOS ANSI.sys driver are not localized to each virtual 8086. This appears to be because DISPLAY.sys is a CON device driver that calls the previous CON driver (i.e., ANSIPLUS) to control the console, so DOS actually has two CON drivers active at the same time. Windows only localizes the first CON driver it finds on the DOS device chain, and this will be the most recent CON device installed, which is DISPLAY.sys, not ANSIPLUS. Two system setup changes are required to circumvent the problem:

If the DISPLAY.sys driver is in use and ANSIPLUS code has been loaded into expanded memory, the SETAPLUS LOCALCON command must be executed before Windows is started, and the LOCAL=CONAPLUS line must be added to SYSTEM.ini! If not, Windows will probably crash the first time a DOS program or session is started.

These system setup changes are totally unnecessary if the DISPLAY.sys driver is not being used.

Windows NT

Support for DOS applications under Windows NT 4.0 is limited by what that operating system allows a virtual DOS machine to do.  Therefore, some ANSIPLUS features cannot be made to work as well as desired:

© Copyright 2000-2007, Kristofer Sweger. All rights reserved.
Rev. 10/16/07