home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib33b.dsk
/
CIRCLE.DEMO.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
2KB
|
63 lines
10 REM **********************
20 REM * CIRCLE.DEMO *
30 REM * BY BRENT IVERSON *
40 REM * COYPRIGHT (C) 1988 *
50 REM * BY MICROSPARC, INC *
60 REM * CONCORD, MA 01742 *
70 REM **********************
80 HOME : ONERR GOTO 590
90 PRINT CHR$(4)"BLOAD CIRCLE": POKE 216,0
100 :
110 REM ---FUNCTIONS A & B
120 REM GET THE HI & LO BYTES
130 REM OF THEIR ARGUMENTS
140 REM ...NUMBERS >=0 ONLY!
150 :
160 DEF FN A(T) = (T/256 - INT(T/256)) *256
170 DEF FN B(T) = INT(T/256)
180 :
190 REM ---CLEAR SCREEN, SET
200 REM CENTER OF CIRCLE AT
210 REM CENTER OF SCREEN
220 :
230 HGR
240 X = 140:Y = 80
250 :
260 REM ---MAIN LOOP
270 :
280 FOR R = 0 TO 160 STEP 20
290 :
300 REM ---GET RANDOM, NON-BLACK
310 REM HCOLOR
320 :
330 HC = INT( RND(1) *7) +1: IF HC = 0 OR HC = 4 THEN 330
340 HCOLOR= HC
350 :
360 REM ---GOSUB CIRCLE-CALLING
370 REM SUBROUTINE
380 :
390 GOSUB 540
400 NEXT
410 IF PEEK( -16384) <128 GOTO 280
420 TEXT : END
430 :
440 REM ---END OF MAIN LOOP
450 :
460 :
470 REM ---POKE THE LO & HI
480 REM BYTES OF THE
490 REM PARAMETERS FOR
500 REM THE CIRCLE ROUTINE
510 REM WHERE IT EXPECTS
520 REM THEM, THEN CALL IT.
530 :
540 POKE 768, FN A(X): POKE 769, FN B(X)
550 POKE 770, FN A(Y): POKE 771, FN B(Y)
560 POKE 772, FN A(R): POKE 773, FN B(R)
570 CALL 24576
580 RETURN
590 E = PEEK(222):EL = PEEK(218) +256 * PEEK(219): CALL -3288: POKE 216,0
600 HOME : VTAB 12: IF E = 6 OR E = 7 THEN PRINT "CIRCLE FILE NOT ON THIS DISK": GOTO 630
610 IF E = 8 THEN PRINT "I/O ERROR--CHECK DRIVE DOOR": GOTO 630
620 PRINT "ERROR "E" IN LINE "EL: END
630 PRINT "RETURN TO TRY AGAIN, ESCAPE TO QUIT";: GET Z$: PRINT : ON Z$ < > CHR$(27) GOTO 80: END