Classic Computer Magazine Archive COMPUTE! ISSUE 92 / JANUARY 1988 / PAGE 20

Saving Double-Hi-Res

I really enjoy using DOS 3.3 and double-hi-res graphics on my Apple IIc, and I recently started using your Chrome program. But when I BSAVE a double-hi-res picture and BLOAD it later, only half the picture is displayed. Could you please show me an easy way to save and load double-hi-res pictures?

Kobie Gantt

When an Apple is in double-hi-res mode, it stores the picture in an unusual way. Half of the picture goes in the hi-res page 1 memory area, addresses $2000–$3FFF, and the other half goes in the alternate memory bank in the same $2000–$3FFF range. Only Apples with more than 64K of memory have this alternate memory bank. Machine language programs can access this area by telling the Apple's hardware to read or write to the alternate bank. Unfortunately, DOS 3.3, ProDOS, and the Applesoft BASIC interpreter all lack a direct way to access this bank.

The solution is a simple ML (machine language) program that copies the contents of the alternate bank over into main memory. Then, you can BSAVE a big block of main RAM that contains both halves of the picture. Later on, when you BLOAD the file back in, you can use another ML program to put half of the picture back into alternate RAM where it belongs. Listed below are two BASIC file-creator programs. When you type in and RUN the first one, it creates a binary file called DHGRSAVE. This ML program puts a double-hi-res picture entirely into main RAM. After typing BRUN DHGRSAVE, you can save the picture with this command:

BSAVE picture, A$2000, L$4000

where picture is the name you wish to use for the picture file.

Type in and RUN the second program to make a binary file called DHGRLOAD. It prepares a file for display as a double-hi­res picture. If your Apple II is in text mode when you BLOAD a picture, you'll need to enable double-hi-res to see what you've loaded. To do this, first type PR # 3 to enable the 80-column text display. Then type these three POKEs:

POKE 49246,0
POKE 49239,0
POKE 49232,0

Although Chrome and Chrome II work with DOS 3.3 only, the ML programs below work in ProDOS as well. If you create a picture with Chrome and BSAVE it, you can transfer it to ProDOS if you like.

70 FOR I = 6144 TO I + 47 : READ A : POKE I, A : C = C + A : NEXT
80 IF C < > 8244 THEN PRINT "DATA ERROR" : STOP
90 PRINT CHR $ (4); "BSAVE DHGRLOAD, A $l800, L $30"
100 DATA 160, 0, 132, 252, 132, 254
110 DATA 169, 32, 133, 253, 169, 64
120 DATA 133, 255, 141, 1, 192, 173
130 DATA 87, 192, 177, 252, 141, 85
140 DATA 192, 145, 252, 141, 84, 192
150 DATA 177, 254, 145, 252, 200, 208
160 DATA 239, 230, 253, 230, 255, 165
170 DATA 253, 201, 64, 208, 229, 96
10 FOR I = 4096 TO I + 47 : READ A: POKE I, A : C = C + A : NEXT
20 IF C < > 8244 THEN PRINT "DATA ERROR" : STOP
30 PRINT CHR$ (4); "BSAVE DHGRSAVE, A $1000, L $30"
40 DATA 160, 0, 132, 252, 132, 254
50 DATA 169, 32, 133, 253, 169, 64
60 DATA 133, 253, 141, 1, 192, 173
70 DATA 87, 192, 177, 252, 145, 254
80 DATA 141, 85, 192, 177, 252, 141
90 DATA 84, 192, 145, 252, 200, 208
100 DATA 239, 230, 253, 230, 255, 165
110 DATA 253, 201, 64, 208, 229, 96