Bypass navigation menu
RGB Classic Games
Keeping the classics alive
Currently hosting 566 great games!
Return to index

CHAPTER 4 - GRAFIX Utility Programs

This chapter discusses TANDY11 and ADJMEM the two utility programs provided with the GRAFIX package.

TANDY11

Tandy corporation made excellent computers in the Tandy 1000 SL/TL/RL. They had 2 things previous members of the Tandy 1000 series family didn't have: digital sound and 640x200x16 color graphics. The special 640x200x16 color graphics mode was of special interest to me since I have been programming the 320x200x16 color graphics mode for some time. When I got my Tandy 1000 SL Technical Reference Manual, I was shocked that there wasn't even a mention of this special video mode. There was documentation for the digital sound interface, but not the 640x200x16 color graphics mode. I came across a program that used this video mode and with DEBUG I was able to see how to the program accessed it. This limited information enabled me to figure how the video memory was set up and how to program the video system registers to enter the 640x200x16 color graphics mode. I was now able to start programming in this special graphics mode.

The reason I wrote this program was that all the other video modes on the Tandy 1000 series computers are supported by the system BIOS (Basic Input/Output System), but not the 640x200x16 color graphics mode. If the system BIOS supports the video mode you want to work in, then you have a full set of built in video functions at your disposal. These include entering a particular video mode, writing characters to the screen, scrolling the screen up or down, setting the cursor position, etc. Without them, you have to include that logic in every program you write separately. Seeing this was not the best situation to say the least, I wrote a set of BIOS routines that are memory resident. These can be called just like any other BIOS routine. They effectively duplicate the functions included in Tandy's regular video BIOS. So now instead of including scores of lines of Assembler code to enter the 640x200x16 color graphics in every program you write, you can simply do it in 2 lines of Assembly language like this:

    MOV     AX,11           ;Set up 640x200x16 color graphics mode
    INT     10H             ; ..

I'd say that was a lot easier, wouldn't you. You can also do it from any high level language like BASIC, C, or PASCAL as long as that language has access to BIOS services on your computer. So now to have full access to this video mode, you only have to install this program when you start up your computer. Just put the following command in your AUTOEXEC.BAT file:

	TANDY11

The program verifies that the computer is a Tandy 1000 SL/TL/RL before attempting to install itself into memory.

ADJMEM

IBM compatible computers other than the Tandy 1000 use a video adapter that has the video memory contained on the adapter itself. The Tandy 1000 video adapter uses the very top portion of DOS memory as video memory. (The exceptions to this are the Tandy 1000 TX, TL, RL which have the ability to add an extra 128K of memory which is then used as the video memory. The full 640K of DOS memory is then available at all times). Please note ADJMEM does not apply to the PCjr as it maps video memory from the bottom, while the Tandy 1000 does it from the top. A PCjr requires a memory management driver like jrconfig.sys to protect and relocate video memory.

The following table shows the memory requirements for each screen mode used on the Tandy 1000:

Mode # Screen Mode Colors Memory Required Video Pages
0-1 40x25 Text 16 16K 8
2-3 80x25 Text 16 16K 4
4-5 320x200 Graphics 4 16K 8
6 640x200 Graphics 2 16K 8
8 160x200 Graphics 16 16K 8
9 320x200 Graphics 16 32K 4
10 640x200 Graphics 4 32K 4
* 11 640x200 Graphics 16 64K 2

* - Tandy 1000 SL/TL/RL only supported through the use of the TANDY11 program

The video pages for the graphics mode are based on reserving 128K of video memory. The Tandy 1000 has the ability to address this much video memory. Multiple video pages are useful for high performance animation. The GRAFIX programming package supports multiple video pages.

The top 16K of DOS memory is always protected by BIOS at start-up. If one of the 32K or greater graphics modes are used that area of memory is left unprotected. This can result in a hung computer if precautions are not taken. Historically, when you protected that portion of memory the only way to get it back was reboot your computer. That is why I wrote this program. It dynamically protects that extra memory and then allows you to get it back again.

The following batch file shows how you could protect the 32K of memory necessary while working in BIOS screen modes 9 or 10 and then release it again:

	ECHO OFF
	REM Protect 32K of video memory
	adjmem -16
	REM Run required application
	program
	REM Release protected system memory
	adjmem +16

Now, instead of losing that memory while you are developing your program you can protect the memory and then release it again without having to reboot your computer.

To use the program just type ADJMEM +### or ADJMEM -### to add or subtract the desired K bytes from your Tandy 1000's memory. Here are some examples:

    ADJMEM -16      ;Protect 32K of the Tandy 1000's memory
    ADJMEM +16      ;Release 16K of the Tandy 1000's memory

    ADJMEM -48      ;Protect 64K of the Tandy 1000's memory
    ADJMEM +48      ;Release 48K of the Tandy 1000's memory

    ADJMEM -112     ;Protect 128K of the Tandy 1000's memory
    ADJMEM +112     ;Release 112K of the Tandy 1000's memory

The program accepts any value from -112K to +112K validating that you are not adding or subtracting more memory than is already necessary. I wrote the program to accept this range of values to accommodate the Tandy 1000's ability to address up to 128K of video memory. The program verifies that the computer is a Tandy 1000 before attempting to adjust the system memory. If the Tandy 1000 has a 128K memory expansion option installed, no memory will be protected.

I hope you find this program as useful as I have. It can really come in handy if you do a lot Tandy 1000 graphics programming in one of the 32K video modes or even the 64K mode on the Tandy 1000 SL/TL.