QuickScreen For The IBM PC/PCjr
Paul W. Carlson
The short machine language routine created by this program allows you to display BSAVEd graphics screens from DOS without booting BASIC. No machine language knowledge is required to use the program. It requires BASICA with a color/graphics card for the PC or cartridge BASIC for the PCjr.
Imagine this scene: You want to show someone a high-resolution graphics display that you've saved on disk with a BSAVE command from BASIC. After waiting for BASIC to load, you must then load and run a program to set the desired graphics mode and BLOAD your file. As that program runs, the display slowly appears on the screen in two passes, lessening its visual impact.
This program creates a machine language routine, SHOWIT.COM, which both simplifies and speeds up the process of displaying such screens on your PC or PCjr. With this program, you can enter a single command at the DOS prompt: The graphics information is read rapidly from disk and appears on the screen instantaneously.
To get started, type in, save, and run the BASIC program below. This program writes the machine language routine contained in the DATA statements into a file on the disk named SHOWIT.COM. Unless you made typing errors while entering the program, a message appears indicating that SHOWIT.COM has been successfully created. SHOWIT.COM is the name used for the file created by this program; be sure you do not use that name for the BASIC program itself.
Using The Routine
The SHOWIT.COM routine will display graphics screens that were saved from a BASIC program with a statement such as this:
DEF SEG=&HB800:BSAVE "filename"
Don't worry if you used 16384 or &H4000 instead of 16192 in this statement. SHOWIT.COM will still work properly.
Like other machine language programs, SHOWIT.COM is run by typing its name at the DOS prompt (without the COM extension). Here's the syntax you should use:
After the command SHOWIT, you must type two additional items of information. The filename identifies the graphics file you wish to display. Next comes a slash character (/) and a resolution identifier. Here are the resolution identifiers to use:
M0 medium resolution with palette 0
Ml medium resolution with palette 1
H high resolution
SHOWIT.COM allows you to display a medium-resolution screen with a different color palette from the one used when creating the screen. For example, suppose you had a program that contained the statements SCREEN 1:COLOR 0,0 and you BSAVEd the display with a filename of DAZZLE. The original display uses color palette 0 (the number following the comma in the COLOR statement), which produced the colors green, red, and brown. If you enter the command SHOWIT DAZZLE/M1 from the DOS prompt, you get the same display except in cyan, magenta, and white. The H identifier is used only for displays BSAVEd from a program that uses the SCREEN 2 statement.
You can precede the filename with a drive designation or with a drive designation and a pathname. All of the following are legal commands:
SHOWIT B: \ BAS \ PICS \ DAZZLE/M1
You would normally use a pathname only if you had a hard disk with files stored in separate subdirectories. As is the case with all DOS commands, either upper-or lowercase letters may be used for any part of the command. You may have noticed that when a display is BSAVEd, the file is saved on disk with an extension of BAS. To save you some typing, SHOWIT.COM automatically adds the BAS extension to the filename you supply. In fact, you'll get an error message if you include the extension. After SHOWIT.COM has displayed the picture, press any key to clear the screen, exit the program, and return to DOS.
Batch File Slide Show
Like any other DOS command, SHOWIT.COM can be used in batch files. Among other things, this permits you to create a slideshow display of several graphic screens. To illustrate, this short batch file displays the screens PIC1, PIC2, and PIC3 in sequence:
After each screen is shown, you press any key to clear the screen, load the next display, and flash it on the screen.
SHOWIT.COM produces three different error messages. The first is the usage message, which appears as a reminder if you type a SHOWIT command with incorrect syntax. It consists of the word Usage followed by a model of correct syntax. The second error message is File not found, which means that SHOWIT.COM was not able to locate the specified graphics file. If you don't specify a drive, this program always uses the currently active drive.
The third error message is File not BSAVED with DEF SEG= &HB800. This means that the program found a file with the specified name, opened it, read the first seven bytes, and determined either that it had not been BSAVEd or that it had been BSAVEd with the wrong segment address. Finally, DOS itself might display the message Bad command or filename in cases where you misspell SHOWIT or the disk in the active drive does not contain SHOWIT.COM. In all cases, you return to the DOS prompt after the error message.
For instructions on entering this program, please refer to "COMPUTEI's Guide to Typing In Programs" in this issue of COMPUTE!.
AD 10 ' Program to create SHOWIT
JO 20 '
OH 30 OPEN "SHOWIT.COM" FOR OUTP
UT AS 1
FE 40 PRINT#1,CHR$(&HE9);CHR$(&H
EG 50 FOR N=1 TO 16432:PRINT#1,C
OG T=0:FOR J=1 TO 377:READ A$
FE 70 T-T+N:PRINT#1,CHR$(N);:NEX
LC 80 IF T=33221! THEN PRINT"SHO
WIT.COM SUCCESSFULLY CREAT
LA 90 PRINT CHR$(7);"***** ERROR
IN DATA STATEMENTS *****"
DO 100 DATA 00,00,00,55,73,61,67
ON 110 DATA 73,68,6F,77,69,74,20
LH 120 DATA 5D,5B,70,61,74,68,6E
KI 130 DATA 5D,3C,66,69,6C,65,6E
OR 140 DATA 3E,7B,2F,6D,7B,30,20
FE 150 DATA 2F,68,7D,0A,0D,24,46
HM 160 DATA 20,6E,6F,74,20,66,6F
DD 170 DATA OA,0D,24,46,69,6C,65
10 180 DATA 74,20,42,53,41,56,45
MM 190 DATA 69,74,68,20,44,45,46
NO 200 DATA 47,31),26,48,42,38,30
AB 210 DATA 24,BE,80,00,8D,3E,0A
MD 220 DATA BA,0C,E3,OE,FC,46,8A
JN 230 DATA 74,0D,88,05,46,47,E2
CP 240 DATA 36,41,EB,5F,90,C6,05
FM 250 DATA 05,42,47,C6,05,41,47
PJ 260 DATA 47,C6,05,00,46,BA,04
LE 270 DATA 04,3C,4D,75,1A,C7,06
CH 280 DATA 00,46,8A,04,3C,30,74
HF 290 DATA 75,CA,2C,30,32,E4,A3
ON 300 DATA 15,3C,68,74,OB,3C,48
N6 310 DATA 16,36,41,EB,18,90,C7
MF 320 DATA 06,00,BD,16,0A,41,42
FC 330 DATA 3D,CD,21,73,09,8D,16
AF 340 DATA 09,CD,21,C3,8B,DB,8D
NA 350 DATA B9,07,00,B4,3F,CD,21
DN 360 DATA 01,BA,04,3C,FD,74,06
DN 370 DATA 41,EB,DE,46,BB,04,3D
CF 380 DATA 02,EB,F0,BD,16,0A,01
PC 390 DATA B4,3F,CD,21,BB,00,06
PD 400 DATA C9,BA,4F,18,CD,10,A1
NO 410 DATA 10,A1,32,41,3D,04,00
KN 420 DATA 1E,34,41,B7,01,B4,0B
NO 430 DATA 00,BB,BE,C0,8D,36,0A
MB 440 DATA B9,00,20,FC,F3,A5,B4
LM 450 DATA B8,00,06,32,FF,33,C9
NA 460 DATA CD,10,BB,00,02,33,DB
ME 470 DATA 10,BB,02,00,CD,10,C3