home *** CD-ROM | disk | FTP | other *** search
- 1000 STATP%=241:DATP%=240:' status and data ports for the graphics card
- 1010 GOSUB 1190:PRINT" <<< LOAD or DUMP GRAPHICS SCREEN >>>":PRINT:PRINT:PRINT
- 1020 PRINT"Purpose:":PRINT:PRINT" To save the screen graphics into a data file or to restore the screen"
- 1030 PRINT" graphics from data file":PRINT:PRINT:PRINT"Method:":PRINT
- 1040 PRINT" Each pixel on the graphics screen represent one bit of data. On the"
- 1050 PRINT" 512x490 pixel screen that is 31,360 bytes of data. The reading of the"
- 1060 PRINT" graphics screen is done byte-wise by issuing command to read from the"
- 1070 PRINT" screen memory.":FOR I%=1 TO 6:PRINT:NEXT:INPUT"Press ENTER to continue. ",A$
- 1080 M%=22:N%=1:GOSUB 1200:INPUT"Load or dump the graphics screen? (L/D) ",A$:IF A$<>"L" AND A$<>"D" THEN 1080
- 1090 IF A$="L" THEN LD%=1 ELSE LD%=0:' set the flag, load=1 dump=0
- 1100 GOSUB 1190:FOR I%=1 TO 10:PRINT:NEXT:PRINT" Type the filename in UPPER case. No check on file existence or"
- 1110 PRINT" legality is provided. Drive letter and colon can be included."
- 1120 GOSUB 1200:LINE INPUT"Filename: ",A$:IF A$="" THEN 1130 ELSE 1150
- 1130 GOSUB 1200:INPUT"Exit this program? (Y/N) ",A$:IF A$<>"Y" AND A$<>"N" THEN 1130
- 1140 IF A$="N" THEN 1000 ELSE END
- 1150 F$=A$:FL%=1:GOSUB 1240:IF LD%=1 THEN 1160 ELSE 1170
- 1160 BT%=165:GOSUB 1270:FOR I%=1 TO 30912:GET#1,I%:BT%=ASC(R$):GOSUB 1270:NEXT:CLOSE:GOSUB 1310:GOTO 1130
- 1170 BT%=164:GOSUB 1270:FOR I%=1 TO 30912:GOSUB 1280:LSET R$=CHR$(BT%):PUT#1,I%:NEXT:CLOSE:GOSUB 1310:GOTO 1130
- 1180 ' Codes are for the Televideo terminal
- 1190 PRINT CHR$(27)CHR$(42):RETURN:' clear the whole screen
- 1200 GOSUB 1220:PRINT CHR$(27)CHR$(89):GOSUB 1220:RETURN:' clear to the end of screen from the current cursot position
- 1210 GOSUB 1220:PRINT CHR$(27)CHR$(84):GOSUB 1220:RETURN:' clear to the end of line from the current cursot position
- 1220 PRINT CHR$(27)CHR$(61)CHR$(M%+31)CHR$(N%+31);:RETURN:' direct cursor address (set the cursor position)
- 1230 ' Subroutine to open a data file for random access, F$=filename, FL%=rec length
- 1240 OPEN"R",#1,F$,FL%:FIELD#1,FL% AS R$:RETURN
- 1250 ' Subroutines to send data to the GDC-512 board
- 1260 BT%=INT(WD%/256):GOSUB 1270:BT%=(WD% AND 255):GOSUB 1270:RETURN:' Subroutine to output a 16-bit data
- 1270 IF (INP(STATP%) AND 1)>0 THEN 1270 ELSE OUT(DATP%),(BT% AND 255):RETURN:' Subroutine to output a 8-bit data
- 1280 IF (INP(STATP%) AND 2)=0 THEN 1280 ELSE BT%=INP(DATP%):RETURN:' Subroutine to read a 8-bit data
- 1290 GOSUB 1280:WD%=BT%*256:GOSUB 1280:WD%=WD%+BT%:RETURN:' Subroutine to read a 16-bit data
- 1300 ' Subroutine to reset the GDC512 but not to clear the graphics
- 1310 OUT(STATP%),1:OUT(STATP%),0:RETURN
- 1320 END