home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib25b.dsk
/
DHR.DEMO.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
3KB
|
71 lines
1 REM **********************
2 REM * DHR.DEMO *
3 REM * BY ALGIS MATYCKAS *
4 REM * COPYRIGHT (C) 1985 *
5 REM * BY MICROSPARC, INC *
6 REM * CONCORD, MA 01742 *
7 REM **********************
50 REM INITIALIZE AND SET UP HGR SCREEN
60 HOME : HGR : HCOLOR= 3: PRINT
70 PRINT CHR$(4);"BLOAD DOUBLE.HIRES"
80 DHR = 768: REM ADDRESS OF DOUBLE HI-RES ROUTINE
90 HPLOT 140,0 TO 140,159: HPLOT 0,159 TO 279,159
100 INVERSE : VTAB 21: PRINT " DOUBLE HIRES HIRES"; TAB( 40);" "
110 VTAB 22: PRINT TAB( 40);" ";
120 VTAB 23: PRINT TAB( 40);" ";: NORMAL
130 REM **** DRAW BOX ****
140 VTAB 22: HTAB 15: PRINT "50 X 50 BOX"
150 REM DOUBLE HI-RES
160 FOR X = 115 TO 165: CALL DHR,1,X,55: NEXT
170 FOR Y = 55 TO 105: CALL DHR,1,165,Y: NEXT
180 FOR X = 165 TO 115 STEP -1: CALL DHR,1,X,105: NEXT
190 FOR Y = 105 TO 55 STEP -1: CALL DHR,1,115,Y: NEXT
200 REM STANDARD HI-RES
210 FOR X = 185 TO 235: HPLOT X,55: NEXT
220 FOR Y = 55 TO 105: HPLOT 235,Y: NEXT
230 FOR X = 235 TO 185 STEP -1: HPLOT X,105: NEXT
240 FOR Y = 105 TO 55 STEP -1: HPLOT 185,Y: NEXT
250 GOSUB 630: GOSUB 610: REM WAIT FOR KEYSTROKE AND DIVIDE SCREEN
260 REM **** DRAW CIRCLE ****
270 VTAB 22: HTAB 12: PRINT "CIRCLE RADIUS 50"
280 REM DOUBLE HI-RES
290 XC = 140:YC = 80:R = 50:PA = 0:PB = 6.28318:DP = .0174532778
300 FOR P = PA TO PB STEP DP:X = R * COS(P):Y = R * SIN(P):X = XC +X:Y = Y +YC: CALL DHR,1,X,Y: NEXT
310 REM STANDARD HI-RES
320 HCOLOR= 3
330 XC = 210:YC = 80:R = 50:PA = 0:PB = 6.28318:DP = .0174532778
340 FOR P = PA TO PB STEP DP:X = R * COS(P):Y = R * SIN(P):X = XC +X:Y = Y +YC: HPLOT X,Y: NEXT
350 GOSUB 630: GOSUB 610
360 REM **** DRAW SINE WAVE ****
370 VTAB 22: HTAB 1: INVERSE : PRINT TAB( 15);" ";: NORMAL : PRINT "SINE WAVE";: INVERSE : PRINT TAB( 40);" ";: NORMAL
380 REM DOUBLE HI-RES
390 FOR A = 0 TO 278
400 X = (A -140)/38:Y = SIN(X):YP = 96 -(Y *30): IF YP <0 AND YP >191 THEN 420
410 CALL DHR,1,A,YP
420 NEXT
430 REM STANDARD HI-RES
440 FOR A = 140 TO 278
450 X = (A -210)/19:Y = SIN(X):YP = 96 -(Y *30): IF YP <0 AND YP >191 THEN 470
460 HPLOT A,YP
470 NEXT
480 GOSUB 630: GOSUB 610
490 REM **** DRAW DIAGONAL ****
500 VTAB 22: INVERSE : PRINT TAB( 8);" ";: NORMAL : PRINT "PARALLEL DIAGONAL LINES";: INVERSE : PRINT TAB( 40);" ";: NORMAL
510 REM DOUBLE HI-RES
520 FOR X = 0 TO 159: CALL DHR,1,X,X: NEXT
530 REM STANDARD HI-RES
540 HPLOT 140,0 TO 220,159
550 GOSUB 630
560 REM INSTRUCTIONS *****
570 TEXT : HOME : PRINT TAB( 14);"DOUBLE HIRES": VTAB 3: PRINT "CALL DHR,C,X,Y": PRINT : PRINT " DHR=DECIMAL LOCATION OF DOUBLE HI-RES ROUTINE"
580 PRINT : PRINT " C=COLOR (0=BLACK,1=WHITE)": PRINT : PRINT " X=X COORD. RANGE (0 TO 559)": PRINT : PRINT " Y=Y COORD. RANGE (0 TO 191)": VTAB 20: PRINT " END OF DEMO"
590 END
600 REM SUBROUTINE TO DIVIDE SCREEN
610 HGR : HCOLOR= 3: HPLOT 140,0 TO 140,159: HPLOT 0,159 TO 279,159: RETURN
620 REM SUBROUTINE TO WAIT FOR RETURN TO BE PRESSED
630 VTAB 24: PRINT TAB( 13);"PRESS <RETURN>";
640 X = PEEK( -16384): IF X <128 THEN 640
650 POKE -16368,0
660 IF X < >141 THEN 640
670 VTAB 24: HTAB 1: CALL -958
680 RETURN