
https://youtu.be/-9X8fRGjmJ8 best watched in 720p on a 50Hz monitor.
That program was indeed called SPINNER. It is from The Micro User. Specifically Volume 7, Issue 10, December 1989.steve3000 wrote: ↑Sun Jul 26, 2020 11:46 pmIt reminds me of a much simpler but larger (I think?) spinning ball demo, possibly a type-in from Micro User BITD (wasn't the Beebug one above). It took a very long time to render, so I remember 'optimising' it during computer club at school, by dumping the final rendered screen to the econet for instant-load and then went round loading it up on a whole room of Beebs...
Code: Select all
10REM > Spinner
20REM by Jim Burdus
30REM (c) The Micro User
40MODE2
50REM >> Archimedes series >>
60REM MODE12
70VDU23,1,0;0;0;0;0;
80VDU19,0,4;0;19,1,0;0;19,2,7;0;
90VDU19,3,0;0;19,4,1;0;19,5,1;0;
100VDU19,6,1;0;19,7,1;0;19,8,7;0;
110VDU19,9,7;0;19,10,7;0;19,11,7;0;
120VDU19,12,3;0;
130PROCbackground:PROCstars
140y%=253:GCOL0,1
150PROCell(640,200,y%,162):K%=-11
160VDU29,0;0;24,640;0;1279;1023;
170FOR x%=285 TO 0 STEP-SQR(285-x%)-1
180J%=7-SQR(285-x%)MOD8+4:GCOL 0,J%
190IF J%<>K% IF ABSx%>32 PROCell(640,512,x%-32,y%)
200K%=J%:NEXT
210VDU29,0;0;24,0;0;640;1023;:K%=-1
220FOR x%=285 TO 0 STEP-SQR(285-x%)-1
230J%=SQR(285-x%)MOD8+4:GCOL 0,J%
240IF J%<>K% IF ABSx%>32 PROCell(640,512,x%-32,y%)
250K%=J%:NEXT
260L%=0:B%=4:dir=1:spd%=5
270REPEAT:*FX19
280FOR C%=0 TO 7
290IF C%<4 VDU19,(C%+L%)MOD8+B%,1 ELSE VDU19,(C%+L%)MOD8+B%,7
300NEXT
310T%=TIME+spd%
320REPEAT UNTIL TIME>T%
330IF INKEY-122 dir=1
340IF INKEY-26 dir=-1
350IF INKEY-82 dir=0
360IF INKEY-58 IF spd%>0 spd%=spd%-1
370IF INKEY-42 IF spd%<40 spd%=spd%+1
380L%=(L%+dir)MOD8:IF L%=-1 L%=7
390UNTIL FALSE
400:
410DEFPROCbackground
420VDU 29,640;512;:GCOL0,2
430FOR X=-10000 TO 10000 STEP 400
440MOVE 0,100:MOVEX-100,-512
450PLOT 85,X+100,-512:NEXT:GCOL0,2
460PROCfill(-640,0,1280,512)
470Y=-8:YM=1.2:F=0:GCOL 3,2
480REPEAT F=NOTF
490IF F PROCfill(-640,Y,1280,Y*YM-Y)
500Y=Y*YM:UNTIL Y<-600:GCOL 0,1
510PROCfill(-640,-30,1280,512)
520VDU29,0;0;:ENDPROC
530:
540DEF PROCfill(X%,Y%,x%,y%)
550REM >> Master series >>
560REM MOVE X%,Y%:PLOT101,x%,y%:ENDPROC
570REM >> Archimedes series >>
580REM RECT.FILL X%,Y%,x%-X%,y%-Y%:ENDPROC
590IF Y%>y% t%=y%:y%=Y%:Y%=t%
600FOR Q%=Y% TO y% STEP 4
610MOVE X%,Q%:DRAW x%,Q%:NEXT
620ENDPROC
630:
640DEF PROCstars:LOCAL L%
650GCOL 0,12:FOR L%=1 TO 250
660PLOT69,RND(1280)-1,RND(524)+500
670NEXT:VDU26,29,0;0;:ENDPROC
680:
690DEF PROCell(X%,Y%,M%,N%)
700REM >> Master series >>
710REM MOVE X%,Y%:MOVE X%+M%,Y%
720REM PLOT 205,X%,Y%+N%:ENDPROC
730REM >> Archimedes series >>
740REM ELLIPSE FILL X%,Y%,M%,N%:ENDPROC
750LOCAL CA,SA,Ct,St,Ca,Sa,Cp,Sp
760LOCAL A%,x%,y%,S%,T%:S%=60
770Ct=COSRADT%:St=SINRADT%
780Ca=COSRAD(360/S%):Cp=1
790Sa=SINRAD(360/S%):Sp=0
800MOVE M%*Ct+X%,M%*St+Y%
810FOR A%=1 TO S%
820CA=Cp*Ca-Sp*Sa:SA=Sp*Ca+Cp*Sa
830x%=M%*Ct*CA-N%*St*SA+X%
840y%=M%*St*CA+N%*Ct*SA+Y%
850MOVE X%,Y%:PLOT 85,x%,y%
860Cp=CA:Sp=SA:NEXT:ENDPROC
As was the original Amiga boing ball. I think it is ace to see a boing ball pretty much as good as the Amiga's original CES one on a model B
So incredible... best basic demo in 5 lines EVERKweepa wrote: ↑Mon Aug 03, 2020 3:06 pmYeah, the ball is made up of 8 different colours, so the ball rotation is in four steps.
Then, the vertical lines of the background grid are two different colours.
So in total there are 13 used colours (8 for the ball, 1 cyan background, 1 blue shadow, 2 vertical grid lines, 1 horizontal grid line).
And as Big Ed says, the screen base address is updated to move the ball around.
Line 4 calculates the new screen start address A% (actually it's the address divided by 8 ). &600 is the original base address (&600 x 8 = &3000). X% is calculated on line 5 - this just bounces back and forth so it moves the screen horizontally. 80*INT(U%*2.5-U%*U%*.1) moves the screen in a parabola vertically (a parabola has the form Ax^2 + Bx + C).
Then line 5's VDU 23,0,12,A%/256...23,0,13,A%... sets the screen base address.
Yep, 100% BASIC.