HGCIBM.COM Version 2.01 Copyright (C) Athena Digital, Gary Batson 1986, 1987 145 Green Hills Rd. - Athens, Ga. 30605 - (404) 354-4522 This manual dated April 20,1987 1 CONTENTS HGCIBM.COM Acknowledgements ............................................. 3 Trademarks ................................................... 3 Using HGCIBM.COM ............................................. 3 Precautions .................................................. 3 Installation ................................................. 4 Using the Command Line ....................................... 5 HGCTEST program .............................................. 5 Sales and Distribution Policies .............................. 6 User Comments ................................................ 6 History ...................................................... 6 Future ....................................................... 7 Changes and Corrections ...................................... 7 Technicalities ............................................... 8 Extended Functions ........................................... 8 This program is distributed as Shareware. All rights are reserved except for distribution of the program and its documentation IN ITS ENTIRETY and un-modified. You may test and use this program for 30 days, after which you must register it, destroy it, or pass in along to a friend. If you would like to keep HGCIBM, see the pricing below. This DOES NOT APPLY to those who contributed to HGCIBM Version 1.11. Those individuals are welcome to this upgrade without further remuneration. Please accept it with my THANKS!! Athena Digital 145 Green Hills Rd. - Athens, Ga. - (404) - 354 - 4522 USING HGCIBM.COM The purpose of this program is to provide owners of Hercules Graphics Cards* a means to run software written for the IBM* Color Graphics Adapter, and to introduce a commercial version of the Athena Digital emulator called ATHENA.SYS (T) which offers added functionality. PRECAUTIONS MONOCHROME DISPLAY DAMAGE !!! This program will not damage your display, but certain application software certainly can. Programs which attempt to by- pass the BIOS (Basic Input/Output System) to set the CRT operating parameters will cause severe problems. Fortunately since most software operates in standard modes, most software vendors permit BIOS to set up the controller for them even if they later write to screen ram directly. HGCIBM will intercept the BIOS calls for all standard modes and program the controller correctly. Writing directly to screen ram is permitted and the emulator will still work properly. When trying an un-tested (with HGCIBM) program for the first time, watch your display carefully for signs of gross distortion or shrinking when the program sets graphics mode. IF THIS OCCURS, RE-BOOT OR TURN OFF YOUR COMPUTER IMMEDIATELY. The display should return to normal quickly when you re-boot. 3 INSTALLATION To install the emulator, you must tell it what mode to start out in, and a little information about your hardware. There are three "modes" of operation for HGCIBM as follows: The /E[mulate] mode enables the emulator to respond to bios calls to set standard CGA modes and provides maximum compatibility with programs expecting to use the Color Graphics Adapter, but displays the information on your Hercules adapter. When the emulator is in this mode, the text buffer is at segment B800 and the equipment flag is set to indicate that a CGA card is present. Alas, you can't fool all the programs all the time. Some of them read the equipment flag and then try to manipulate the crt controller directly in order to provide faster screen output. Naturally they try to do this at the CGA port addresses (which don't exist) and will hang the system (ATHENA.SYS provides algorithms to circumvent these hang-ups). A re-boot will cure the problem and you should then remember to either un-install the emulator before running these programs or simply place it in /M(ono) mode or /C[GA] mode (if you have a physical CGA) as described below. The /M[ono] mode effectively disables HGCIBM without uninstalling it. The monochrome card is selected and Video BIOS control returns to the computer's ROM (Read only Memory). The /C[ga] mode also disables HGCIBM and returns control to ROM except the physical Color Graphics Adapter is selected if it exists. There are also 3 installation switches available to warn HGCIBM about special hardware. During initialization, the program tries to determine if a Color Graphics Adapter is present. If it is, the program will not install unless you assure it that the Color Graphics Adapter in your system is compatible with Hercules Graphics cards. If yours is or you have a Leading Edge computer, then you should use these switches: The /H[ercules compatible] switch instructs HGCIBM to install and allow the emulation mode even though a Color Graphics Adapter is present. You may use this switch on installation if you have a Hercules compatible CGA card in your system. If a CGA card is present, HGCIBM will abort installation unless the /H switch is used. Also note that some software will output to the CGA registers (3D4, 3D5, 3D8, etc.) to adjust video parameters. This can wreak havoc on the real CGA adapter while in Emulation mode. If the CGA is not physically present, this output causes no problems and is ignored by Hercules adapters. The /L[eading Edge] switch instructs HGCIBM to install if the Leading Edge Model D is connected to a TTL display. 4 The /U[n-install] switch instructs the emulator to reset all vectors and remove itself from memory, freeing the space for other programs. You may un-install the emulator provided that other programs have not altered vectors 8h and 10h, but memory may become segmented if you have loaded another resident program after HGCIBM. The system will be left in the same condition it was in before the installation. (i.e. monochrome display). USING THE COMMAND LINE Simply type the command HGCIBM with a mode switch to install or change to that mode. If you have special hardware, ADD the hardware switch to the mode switch on the same command line as shown in the following examples: HGCIBM /M - installs in (or changes to) MONO mode (emulation disabled) HGCIBM /C - installs in (or changes to) CGA mode (emulation disabled) HGCIBM /E - installs in (or changes to) Emulation mode. HGCIBM /U - un-installs the emulator HGCIBM /M/H - informs HGCIBM that a Hercules compatible CGA is physically present. HGCIBM /M/L - informs HGCIBM that you have a Leading Edge computer. These commands may be issued from a batch file if desired. Hardware switches are needed only on installation. To change modes after installation, just enter the command as above. HGCIBM always checks to see if it is already installed and will process the command correctly. HGCTEST PROGRAM This program is provided for you to test the operation of HGCIBM with your computer configuration. Before running HGCTEST, Load the emulator with the /E[mulate] switch. HGCTEST.BAS runs under BASICA. Just enter BASICA HGCTEST to run it (assuming BASICA is on the default drive with HGCTEST). The program is a simple graphics demo and is self explanatory. If you have a basic compiler, the demo program can be compiled to test the compiler. SALES AND DISTRIBUTION POLICIES - HGCIBM.COM There is no limitation on distribution of HGCIBM.COM as long as no remuneration is accepted in connection with it's distribution, and as long as it is distributed un-modified and in it's entirety. You are permitted a 30 day trial period to decide whether or not you wish to keep HGCIBM or purchase ATHENA.SYS after which you must either register it with Athena Digital, destroy it, or pass it along to someone else. The registration fee for HGCIBM.COM is $9.95 in check or money order. OEMS and Dealers are encouraged to support ATHENA.SYS with their products, but may be permitted to distribute HGCIBM with their materials provided that Athena Digital receives the registration fee. Those interested should contact Athena Digital for details. USER COMMENTS Let us know what you think. Any criticism is better than none and will help to steer us along a path which is in the majority's best interest. Your suggestions need not be limited to graphics. Any comment regarding Athena Digital programs or documentation is welcome. Thank you for your support. ENHANCEMENTS o Version 2.01 contains a SUBSET of Athena Digital's own video bios and will support a wider range of compatibles as well as the AT. This also provided a means for improved screen behavior in color text mode, and faster screen operations if bios is used. o All standard video modes are now supported. The 320 x 200 mode supports two intensities(colors). Color 1 and color 2 will appear identical, where color 3 will be high intensity. Forty column text is supported but will be displayed on the left half of the screen only at the same resolution as eighty column text. All four pages of 80 column text (or 8 pages of 40 column text) are available on true Hercules cards. Some of the compatibles will support only one text page at 80 columns, and 2 at 40 columns. o Version 2.01 provides extended bios calls which assembly language programs can use to determine if HGCIBM is present, and what version it is. TECHNICALITIES HGCIBM installs itself between two BIOS (Basic Input/Output System) interrupts. The two interrupts used in this way are hex 10 (BIOS video) and hex 8 (timer). The later is used only while in graphics mode. HGCIBM will fail to function properly if it is not given control during the above interrupts. Other software using interrupt 8 be called on a priority basis, preempting HGCIBM if necessary. HGCIBM version 2.01 no longer passes interrupt 10h (while in emulation mode) since it was learned that compatible ROM bios was not always entirely compatible. If you have other software using interrupt 10h, try loading it after HGCIBM. You can still control HGCIBM after the interrupt is changed but you will not be allowed to un-install it. HGCIBM need be loaded only once each time the computer is started since it attaches itself to BIOS and stays in memory until re-boot or it is commanded to un-install. The memory usage has increased to about 5k now due to bypassing of ROM video bios in emulation mode, but does provide much improved color text emulation and should be compatible with a wider variety of machines. HGCIBM.COM EXTENDED VIDEO FUNCTIONS This section is provided for those familiar with IBM PC assembly language. The following calls are made through the standard video interrupt 10H. ; (AH)=B0h SetContext - (AL) contains context value In HGCIBM, these functions simply enable or disable the emulation modes. As can be seen, most mode numbers mimic those provided by the standard PC bios. The difference between these modes and the standard AH=0 call is that the driver behavior switches are modified before the mode change. A call here for any of the standard modes will disable the emulator bios and pass calls to the computer's rom. A call here higher than 7 will enable the emulation modes. These changes affect the way HGCIBM interprets calls to the standard bios function 0 as shown below. These calls cannot be used to overide the hardware setup determined by HGCIBM during initialization. Calls for invalid context switches are ignored and the call returns with the carry flag set: HGCIBM function calls: TARGET MODE EMULATION TARGET ADAPTER Standard Modes: (HGCIBM will re-enable ROM bios) (AL)=0 disabled CGA 40x25 b/w text (AL)=1 disabled CGA 40x25 Color text (AL)=2 disabled CGA 80x25 BW text (AL)=3 disabled CGA 80x25 Color text (AL)=4 disabled CGA 200x320 Color grph (AL)=5 disabled CGA 200x320 BW grph (AL)=6 disabled CGA 200x640 BW grph (AL)=7 disabled MONO 80x25 BW text CGA Emulation Modes: (correspond to Standard modes 0 - 6) (AL)=20 - (AL)=26 enabled HERC page at B800h Hercules only modes are not supported by HGCIBM. ; (AH)=BFh AthenaState - Return the current driver state. (AL) = Current mode (as set in call B0h) (AH) = Character Columns on screen (BH) = Current Active Display Page (DX) = Installed options, switch states D0 = 1 if mono or hercules card is installed. D1 = 1 if cga card is present D3 = 1 if hercules modes/cga emulation are allowed. D4 = 1 if emulation modes are enabled *HGCIBM supports D0,D1,D3,and D5 only. Others will always be 0. (CX) = ATHENA/HGCIBM version number (CH) has major version (CL) has minor version * set cx to 0 before calling function BFh, if 0 is returned, ATHENA.SYS or HGCIBM.COM (version 2 or higher) are not installed. If the major version is greater than or equal to 3, the response is from ATHENA.SYS. HGCIBM.COM will not be upgraded past major version 2.00. All future enhancements will be limited to ATHENA.SYS or language libraries. HGCIBM function calls: ; (AH) = 0 SetMode - (AL) contains new mode value The new mode is set according to the current switches and the screen is cleared. STANDARD MODES: NEW MODE EMULATION FLAG TARGET SCREEN (AL)=0 disabled CGA 40x25 b/w text enabled HERC 40x25 emulation (AL)=1 disabled CGA 40x25 Color text enabled HERC 40x25 emulation (AL)=2 disabled CGA 80x25 BW text enabled HERC 80x25 emulation (AL)=3 disabled CGA 80x25 Color text enabled HERC 80x25 emulation (AL)=4 disabled CGA 200x320 Color grph enabled HERC 200x320 emulation (AL)=5 disabled CGA 200x320 BW grph enabled HERC 200x320 emulation (AL)=6 disabled CGA 200x640 BW grph enabled HERC 200x640 emulation (AL)=7 don't care MONO 80x25 BW text one page (resets emulation flag and returns to ROM)