Saving the HGR Screen
by Scott Gordon
and Solomon Swift

The following SmartBASIC program will allow you to save an HGR screen to tape/disk/ hardrive. The program splits the screen into four files, 2,560 bytes in length each (which shows up in the directory as 3K). These four files are arranged in the following format:

file#1: First half of bit image table
file#2: Second half of bit image table
file#3: First half of color table
file#4: Second half of color table

Program listing:

10 REM routine to SAVE pictures that SmartPAINT can load/print/edit
100 LOMEM :33000:POKE 16149, 255:POKE 16150, 255
110 DATA 1,0,10,17,0,32,33,0,116,205,29,253,201
120 FOR x=65520 TO 65532:READ ml:POKE x, ml:NEXT
130 REM insert your program between line numbers 130 and 64999
140 REM set pn$ to equal the base file name, then
150 REM gosub 65100 to save the file
160 REM for example, 2000 pn$="-name-":gosub 65100
200 HGR:PRINT " enter program lines containing";
210 PRINT " hplots, shapes, etc. Then,"
220 PRINT " save the picture with":? " GOSUB 65100.";
230 VTAB 22:HTAB 1:GET go$
65000 END
65100 POKE 65525, 32:CALL 65520
65110 VTAB 22:HTAB 1:PRINT CHR$(4); "bsave #1,A29696,L2560"
65120 POKE 65525, 42:CALL 65520
65130 VTAB 22:HTAB 1:PRINT CHR$(4); "bsave #2,A29696,L2560"
65140 POKE 65525, 0:CALL 65520
65150 VTAB 22:HTAB 1:PRINT CHR$(4); "bsave #3,A29696,L2560"
65160 POKE 65525, 10:CALL 65520
65170 VTAB 22:HTAB 1:PRINT CHR$(4); "bsave #4,A29696,L2560"
65180 PRINT CHR$(4); "rename #1, "; pn$+".HRP"
65190 PRINT CHR$(4); "rename #2, "; pn$+".HR2"
65200 PRINT CHR$(4); "rename #3, "; pn$+".HR3"
65210 PRINT CHR$(4); "rename #4, "; pn$+".HR4":RETURN

When SmartBASIC loads these four files in, it first sends the bit image data (files 1&2) to the Video Display Processor (VDP). Even though the VDP displays the screen's pattern, you won't be able to see it until the color data has been loaded. You should see the first half of your screen display after the third file has loaded. The second half will be visible after the fourth file has loaded.

10 REM routine to LOAD SmartPAINT pictures within your own programs
100 LOMEM :33000:POKE 16149, 255:POKE 16150, 255
110 DATA 1,0,10,17,0,32,33,0,116,205,26,253,201
120 FOR x=65520 TO 65532:READ ml:POKE x, ml:NEXT
130 REM insert your program between line numbers 130 and 64999
140 REM set pn$ to equal the base file name, then
150 REM gosub 65100 to load the file
160 REM for example, 200 HGR:pn$="bomber":gosub 65100
65000 END
65100 VTAB 22:HTAB 1:PRINT CHR$(4); "bload "; pn$+".HRP"
65110 POKE 65525, 32:CALL 65520
65120 VTAB 22:HTAB 1:PRINT CHR$(4); "bload "; pn$+".HR2"
65130 POKE 65525, 42:CALL 65520
65140 VTAB 22:HTAB 1:PRINT CHR$(4); "bload "; pn$+".HR3"
65150 POKE 65525, 0:CALL 65520
65160 VTAB 22:HTAB 1:PRINT CHR$(4); "bload "; pn$+".HR4"
65170 POKE 65525, 10:CALL 65520:RETURN

This format is fully compatible with PowerPAINT and ShowOFF I.

A word of advice: this format isn't ideal for multiple pictures on a one diskette. The problem lies in the fact that each picture requires four directory entries. You should be able to save 8-10 pictures on a 160K diskette. Otherwise, you might find yourself receiving an error even though there's plenty of space left on your diskette.

Back to Top