Any short type-ins for unattended Beebs?

discussion of beeb/electron applications, languages, utils and educational s/w
User avatar
AndyF
Posts: 1270
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Tue Oct 09, 2018 8:33 am

Hehe, thats quite good. =D> =D>

It sort of reminds me of the Technician Ted (Spectrum) animated loading screen, quite a feat imo at the time to do that with animation and a counter during loading...
ted_load.gif
ted_load.gif (2.65 KiB) Viewed 2093 times
Sadly no 'B version, it may *just* of ported over reasonably well. Only original ZX and ported over CPC version of this, no C64 or other versions...
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Sat Oct 13, 2018 1:21 am

This program will draw the BBC Microcomputer Owl, and then bounce the owl around the screen 8)

Code: Select all


   10 MODE 1:VDU 23,1,0;0;0;0;
   20 VDU23,224,126,255,255,255,255,255,255,126,23,225,0,126,126,126,126,126,126,0
   30 FOR Y%=0 TO 20:READ A$:FOR X%=1 TO 17
   40 IF MID$(A$,X%,1)="*" GCOL0,1:MOVE X%*20,1023-(Y%*20):VDU5,224:GCOL0,2:MOVE 4+(X%*20),4+(1023-(Y%*20)):VDU225,4
   50 NEXT:NEXT
   60 xx%=40:yy%=20:ud%=TRUE:lr%=TRUE
   70 :
   80 REPEAT
   90 IF yy%=31 ud%=FALSE ELSE IF yy%=13 ud%=TRUE
  100 IF ud%=TRUE yy%=yy%+1 ELSE yy%=yy%-1
  110 Y%=yy%*640
  120 IF xx%=81 lr%=FALSE ELSE IF xx%=24 lr%=TRUE
  130 IF lr%=TRUE xx%=xx%+1 ELSE xx%=xx%-1
  140 X%=xx%*8:Z%=((X%+Y%)MOD&5000)+&3000
  150 OSCLI("FX19")
  160 VDU23;12,Z% DIV 2048;0;0;0,23;13,(Z% MOD 2048) DIV 8;0;0;0
  170 FOR DELAY=0 TO 50:NEXT
  180 UNTIL FALSE
  190 :
  200 DATA "* * * * * * * * *"
  210 DATA " *     * *     * "
  220 DATA "*   *   *   *   *"
  230 DATA "   * *     * *   "
  240 DATA "*   *       *   *"
  250 DATA " *     * *     * "
  260 DATA "* *     *     * *"
  270 DATA " * *         *   "
  280 DATA "* * * * * * *   *"
  290 DATA " * * * *         "
  300 DATA "* * * * *       *"
  310 DATA " * * * *         "
  320 DATA "  * * * *       *"
  330 DATA "   * * * *       "
  340 DATA "    * * * *     *"
  350 DATA "     * * * *     "
  360 DATA "      * * * *   *"
  370 DATA "       *   * *   "
  380 DATA "      *   *   * *"
  390 DATA " * * * * * *   * "
  400 DATA "                *"
  
Last edited by Andrew_Waite on Tue Oct 16, 2018 1:59 pm, edited 4 times in total.

Coeus
Posts: 1313
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Coeus » Sun Oct 14, 2018 9:30 pm

Andrew_Waite wrote:
Sat Oct 06, 2018 4:36 pm
I am pleased with this one, it draws a starfield then planets in the foreground.
I like it. Looking at it I was interested to see the optimisation of creating lookup tables of SIN/COS to make up for these functions being slow. That can be further optimised by taking advantage that SIN and COS are essentially the same function, one leading the other by 90 degrees so the table calculation can be done as below, cutting the "Calculating" time about in half (22s to 11s).

Code: Select all

   10 MODE1:PRINT"CALCULATING!":VDU19,1,6;0;19,2,5;0;19,3,3;0;
   20 DIM C(360),S(360)
   30 :
   40 FOR N%=0 TO 270
   50 C(N%)=COS(PI*(N%/180)):S(N%+90)=C(N%)
   60 NEXT
   70 FOR N%=0 TO 90
   80 S(N%)=SIN(PI*(N%/180)):C(N%+270)=S(N%)
   90 NEXT
  100 :
  110 REPEAT
  120 :
  130 CLS
  140 FOR N%=1 TO 1023
  150 GCOL0,(N%MOD3)+1
  160 PLOT 69,RND(1279),RND(1024)
  170 NEXT
  180 :
  190 FOR P%=0 TO 10
  200 :
  210 GCOL0,0
  220 A%=RND(1279):B%=RND(1023):R%=RND(100)+100
  230 :
  240 FOR N%=0 TO 345 STEP 15
  250 MOVE A%,B%:MOVE A%+(R%*C(N%)),B%+(R%*S(N%)):PLOT 85,A%+(R%*C(N%+15)),B%+(R%*S(N%+15))
  260 NEXT
  270 :
  280 REM MOVE A%,B%:PLOT 153,R%,0 :REM BBC MASTER Option to replace lines 220,230,240
  290 :
  300 FOR M%=0 TO 90 STEP 3
  310 GCOL0,(((M%)DIV3)MOD3)+1
  320 FOR N%=M% TO 180-M%
  330 X%=R%*S(N%):Y%=R%*C(N%)*RND(1):PLOT 69,X%+A%,Y%+B%
  340 NEXT
  350 NEXT
  360 NEXT
  370 :
  380 UNTIL FALSE
  390 NEXT
  400 :
  410 UNTIL FALSE
Last edited by Coeus on Sun Oct 14, 2018 9:30 pm, edited 1 time in total.

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Mon Oct 15, 2018 7:41 pm

Coeus wrote:
Sun Oct 14, 2018 9:30 pm
Looking at it I was interested to see the optimisation of creating lookup tables of SIN/COS to make up for these functions.
Yes, that optimimation is a great idea.

As SIN(x) and COS(x) for all x can both be calculated from one quadrant of SIN(x) or COS(x) the code can be optimised for speed further, as shown below.

Code: Select all


   10 MODE1:PRINT"CALCULATING!":VDU19,1,6;0;19,2,5;0;19,3,3;0;
   20 DIM C(360),S(360)
   30 :
   40 FOR N%=0 TO 90:A=SIN(PI*(N%/180))
   50 S(N%)=A:S(180-N%)=A
   60 S(N%+180)=-A:S(360-N%)=-A
   70 C(90-N%)=A:C(N%+90)=-A
   80 C(270-N%)=-A:C(N%+270)=A
   90 NEXT
  100 :
  110 REPEAT
  120 :
  130 CLS
  140 FOR N%=1 TO 1023
  150 GCOL0,(N%MOD3)+1
  160 PLOT 69,RND(1279),RND(1024)
  170 NEXT
  180 :
  190 FOR P%=0 TO 10
  200 :
  210 GCOL0,0
  220 A%=RND(1279):B%=RND(1023):R%=RND(100)+100
  230 :
  240 FOR N%=0 TO 345 STEP 15
  250 MOVE A%,B%:MOVE A%+(R%*C(N%)),B%+(R%*S(N%)):PLOT 85,A%+(R%*C(N%+15)),B%+(R%*S(N%+15))
  260 NEXT
  270 :
  280 REM MOVE A%,B%:PLOT 153,R%,0 :REM BBC MASTER Option to replace lines 220,230,240
  290 :
  300 FOR M%=0 TO 90 STEP 3
  310 GCOL0,(((M%)DIV3)MOD3)+1
  320 FOR N%=M% TO 180-M%
  330 X%=R%*S(N%):Y%=R%*C(N%)*RND(1):PLOT 69,X%+A%,Y%+B%
  340 NEXT
  350 NEXT
  360 NEXT
  370 :
  380 UNTIL FALSE

Last edited by Andrew_Waite on Mon Oct 15, 2018 7:44 pm, edited 5 times in total.

Coeus
Posts: 1313
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Coeus » Mon Oct 15, 2018 10:08 pm

Andrew_Waite wrote:
Mon Oct 15, 2018 7:41 pm
As SIN(x) and COS(x) for all x can both be calculated from one quadrant of SIN(x) or COS(x) the code can be optimised for speed further, as shown below.
Well spotted. Initialisation down to 3s.

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Wed Oct 17, 2018 12:37 am

Please find below code to draw the Mandelbrot Set, the Tricorn Fractal and the Burning Ship Fractal in MODE 1.

All three fractals take many hours to draw on a BBC Micro (The Mandelbot Set takes 19h20min), so I have added a line of code so that these programs can also be run at much higher speed (only a few seconds) on a PC with Richard Russell's BBC BASIC for Windows. The resolution of the BB4W versions can also be greatly improved by changing both 'STEP 4's to 'STEP 1".

The Mandelbrot Set.

Code: Select all


   10 T%=TIME:zoom=500
   20 MODE 1:GCOL 0,1:VDU29,640;512;
   30 FOR Y=-512 TO 512 STEP 4
   40 FOR X=-640 TO 640 STEP 4
   50 i=0
   60 zx=0
   70 zy=0
   80 cx=(X/zoom)-0.6
   90 cy=Y/zoom
  100 REPEAT
  110 xt=zx*zy
  120 zx=(zx*zx)-(zy*zy)+cx
  130 zy=(2*xt)+cy
  140 i=i+1
  150 UNTIL (i=100) OR (((zx*zx)+(zy*zy))>=4)
  160 :
  170 REM COMMENT OUT ONE OF THE TWO LINES BELOW!
  180 REM VDU 19,1,-1;(i*5);0;0;:REM BBC BASIC FOR WINDOWS VERSION
  190 GCOL 0,i:REM BBC MICRO VERSION
  200 PLOT 69,X,Y
  210 NEXT
  220 NEXT
  230 REM PRINT (TIME-T%)/100;" seconds."
  
The Tricorn Fractal.

Code: Select all


   10 T%=TIME:zoom=300
   20 MODE 1:GCOL 0,1:VDU29,640;512;
   30 FOR Y=-512 TO 512 STEP 4
   40 FOR X=-640 TO 640 STEP 4
   50 i=0
   60 zx=0
   70 zy=0
   80 cx=(X/zoom)-0.2
   90 cy=Y/zoom
  100 REPEAT
  110 xt=(zx*zx)-(zy*zy)+cx
  120 zy=(-2*zx*zy)+cy
  130 zx=xt
  140 i=i+1
  150 UNTIL (i=100) OR (((zx*zx)+(zy*zy))>=4)
  160 :
  170 REM COMMENT OUT ONE OF THE TWO LINES BELOW!
  180 REM VDU 19,1,-1;(i*5);0;0;:REM BBC BASIC FOR WINDOWS VERSION
  190 GCOL 0,i:REM BBC MICRO VERSION
  200 PLOT 69,X,Y
  210 NEXT
  220 NEXT
  230 REM PRINT (TIME-T%)/100;" seconds."
  
Burning Ship Fractal.

Code: Select all


   10 T%=TIME:zoom=250
   20 MODE 1:GCOL 0,1:VDU29,640;512;
   30 FOR Y=-512 TO 512 STEP 4
   40 FOR X=-640 TO 640 STEP 4
   50 i=0
   60 zx=0
   70 zy=0
   80 cx=X/zoom
   90 cy=Y/zoom
  100 REPEAT
  110 xt=(zx*zx)-(zy*zy)+cx
  120 zy=ABS(2*zx*zy)+cy
  130 zx=ABS(xt)
  140 i=i+1
  150 UNTIL (i=100) OR (((zx*zx)+(zy*zy))>=4)
  160 :
  170 REM COMMENT OUT ONE OF THE TWO LINES BELOW!
  180 REM VDU 19,1,-1;(i*5);0;0;:REM BBC BASIC FOR WINDOWS VERSION
  190 GCOL 0,i:REM BBC MICRO VERSION
  200 PLOT 69,X,Y
  210 NEXT
  220 NEXT
  230 REM PRINT (TIME-T%)/100;" seconds."

The Mandelbrot Set / Nice detail.

Code: Select all


   10 T%=TIME:zoom=7000
   20 MODE 1:GCOL 0,1:VDU 29,640;512;
   30 FOR Y=-512 TO 512 STEP 4
   40 FOR X=-640 TO 640 STEP 4
   50 i=0
   60 zx=0
   70 zy=0
   80 cx=(X/zoom)-1.43
   90 cy=Y/zoom
  100 REPEAT
  110 xt=zx*zy
  120 zx=(zx*zx)-(zy*zy)+cx
  130 zy=(2*xt)+cy
  140 i=i+1
  150 UNTIL (i=100) OR (((zx*zx)+(zy*zy))>=4)
  160 :
  170 REM COMMENT OUT ONE OF THE TWO LINES BELOW!
  180 REM VDU 19,1,-1;(i*5);0;0;:REM BBC BASIC FOR WINDOWS VERSION
  190 GCOL 0,i:REM BBC MICRO VERSION
  200 PLOT 69,X,Y
  210 NEXT
  220 NEXT
  230 REM PRINT (TIME-T%)/100;" seconds."

Detail of the 'rigging' of the Burning Ship Fractal. Compare to this picture from the Wikipedia article : https://en.wikipedia.org/wiki/Burning_S ... l_Zoom.png

Code: Select all


   10 T%=TIME:zoom=40000
   20 MODE 1:GCOL 0,1:VDU29,640;512;
   30 FOR Y=-512 TO 512 STEP 4
   40 FOR X=-640 TO 640 STEP 4
   50 i=0
   60 zx=0
   70 zy=0
   80 cx=(X/zoom)-1.770
   90 cy=(Y/zoom)-0.034
  100 REPEAT
  110 xt=(zx*zx)-(zy*zy)+cx
  120 zy=ABS(2*zx*zy)+cy
  130 zx=ABS(xt)
  140 i=i+1
  150 UNTIL (i=100) OR (((zx*zx)+(zy*zy))>=4)
  160 :
  170 REM COMMENT OUT ONE OF THE TWO LINES BELOW!
  180 REM VDU 19,1,-1;(i*5);0;0;:REM BBC BASIC FOR WINDOWS VERSION
  190 GCOL 0,i:REM BBC MICRO VERSION
  200 PLOT 69,X,-Y
  210 NEXT
  220 NEXT
  230 REM PRINT (TIME-T%)/100;" seconds."

Last edited by Andrew_Waite on Wed Oct 17, 2018 11:52 pm, edited 20 times in total.

User avatar
AndyF
Posts: 1270
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Wed Oct 17, 2018 12:13 pm

Andrew_Waite wrote:
Wed Oct 17, 2018 12:37 am
Please find below code to draw the Mandelbrot Set, the Tricorn Fractal and the Burning Ship Fractal in MODE 1.

All three take many hours to draw on a BBC Micro (The Mandelbot Set takes 19h20min), so I have added a line of code so that these programs can also be run at much higher speed (only a few seconds) on a PC with Richard Russell's BBC BASIC for Windows. The resolution of the BB4W versions can also be greatly improved by changing both 'STEP 4's to 'STEP 1".

The Mandelbrot Set.

The Tricorn Fractal.

The Burning Ship Fractal.

The Mandelbrot Set / Nice detail.
I decided to place these four (as I'm unsure what the last of the five pieces of code you have is?) onto a .ssd for quick convenience. Did not bother with a menu etc. Hope that's OK. :) They are excellent! =D>

MANDLE = The Mandelbrot Set.

TRICORN = The Tricorn Fractal.

BRNSHIP = The Burning Ship Fractal.

MD-NICE = The Mandelbrot Set / Nice detail.

Mandlebrot_Tricon_BurningShip.ssd
(3.25 KiB) Downloaded 21 times
Last edited by AndyF on Wed Oct 17, 2018 12:13 pm, edited 1 time in total.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

Soruk
Posts: 413
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Soruk » Wed Oct 17, 2018 3:52 pm

Andrew_Waite wrote:
Wed Oct 17, 2018 12:37 am
Please find below code to draw the Mandelbrot Set, the Tricorn Fractal and the Burning Ship Fractal in MODE 1.

All three take many hours to draw on a BBC Micro (The Mandelbot Set takes 19h20min), so I have added a line of code so that these programs can also be run at much higher speed (only a few seconds) on a PC with Richard Russell's BBC BASIC for Windows. The resolution of the BB4W versions can also be greatly improved by changing both 'STEP 4's to 'STEP 1".

The Mandelbrot Set.

The Tricorn Fractal.

The Burning Ship Fractal.

The Mandelbrot Set / Nice detail.
Nice.
Tweaks for RISC OS and Matrix Brandy: Use STEP 2 instead of STEP 4 and run in Mode 19.

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Wed Oct 17, 2018 11:13 pm

This program will draw part of the Mandelbrot Set, and then use palette switching to cycle through a set of psychedelic colours.

Code: Select all


   10 MODE 1:VDU 29,640;512;
   20 zoom=100000
   30 FOR Y=-512 TO 512 STEP 4
   40 FOR X=-640 TO 640 STEP 4
   50 i=0
   60 zx=0
   70 zy=0
   80 cx=(X/zoom)-1.4455
   90 cy=Y/zoom
  100 REPEAT
  110 xt=zx*zy
  120 zx=(zx*zx)-(zy*zy)+cx
  130 zy=(2*xt)+cy
  140 i=i+1
  150 UNTIL (i=100) OR (((zx*zx)+(zy*zy))>=4)
  160 GCOL 0,i:PLOT 69,X,Y
  170 NEXT
  180 NEXT
  190 :
  200 A%=0
  210 REPEAT
  220 FOR N%=0TO3:VDU19,N%,(N%+A%)MOD4+2;0;:NEXT
  230 FOR M%=0TO500:NEXT
  240 A%=A%+1
  250 UNTIL FALSE

Last edited by Andrew_Waite on Thu Oct 18, 2018 1:05 am, edited 3 times in total.

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Wed Oct 17, 2018 11:57 pm

AndyF wrote:
Wed Oct 17, 2018 12:13 pm
Hope that's OK.
Sure!

I made some changes to the code for the first three fractals so that 'zoom' works properly.
Last edited by Andrew_Waite on Thu Oct 18, 2018 12:42 am, edited 3 times in total.

Soruk
Posts: 413
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Soruk » Tue Oct 23, 2018 10:50 pm

I made a few tweaks to the Mandelbrot, making it run at 1280x720, 256 colours - with a few optimisations (rather than calculating -Y to +Y, just doing 0 to Y, then plotting at +Y and -Y, and only actually plotting the point if (i MOD 64) <> 0 - that way I was able to calculate about 5850 frames in just over a day in Matrix Brandy. I then stitched them together into a video, here --> https://www.youtube.com/watch?v=zGsO6Kz94fs

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Sat Oct 27, 2018 3:28 am

This program will see a single large Jet Set Willy character walking across a Mode7 screen. The program takes about 25s to initialise.

Code: Select all


    5 REM This program requires a BBC Micro or emulator such as BeebEm
   10 MODE0:MODE7:HIMEM=&2FFF:VDU23,1,0;0;0;0;
   20 :
   30 FOR B%=0 TO 19
   40 C%=&3000+(B%*&400)
   50 IF B% MOD 4=0 RESTORE 290
   60 FOR N%=0 TO 15
   70 READ A$
   80 FOR M%=0 TO 7
   90 IF MID$(A$,M%+1,1)="1" ?(C%+(N%*40)+160+(((B%DIV4)*8)+M%)MOD40)=255
  100 NEXT:NEXT:NEXT
  110 :
  120 FOR B%=0 TO 19
  130 C%=&3000+(B%*&400)
  140 IF B% MOD 4=0 RESTORE 990
  150 FOR N%=0 TO 15
  160 READ A$
  170 FOR M%=0 TO 7
  180 IF MID$(A$,M%+1,1)="1" ?(C%+(N%*40)+160+(((B%DIV4)*8)+M%+8)MOD40)=255
  190 NEXT:NEXT:NEXT
  200 :
  210 REPEAT
  220 FOR S%=&3000 TO &7C00 STEP &400
  230 OSCLI("FX19")
  240 VDU23;12,((S%DIV256)-&74)EOR&20;0;0;0:VDU23;13,0;0;0;0
  250 FOR DELAY=0TO250:NEXT
  260 NEXT
  270 UNTIL FALSE
  280 :
  290 DATA"00111100"
  300 DATA"00111100"
  310 DATA"01111110"
  320 DATA"00110100"
  330 DATA"00111110"
  340 DATA"00111100"
  350 DATA"00011000"
  360 DATA"00111100"
  370 DATA"01111110"
  380 DATA"01111110"
  390 DATA"11110111"
  400 DATA"11111011"
  410 DATA"00111100"
  420 DATA"01110110"
  430 DATA"01101110"
  440 DATA"01110111"
  450 :
  460 DATA"00001111"
  470 DATA"00001111"
  480 DATA"00011111"
  490 DATA"00001101"
  500 DATA"00001111"
  510 DATA"00001111"
  520 DATA"00000110"
  530 DATA"00001111"
  540 DATA"00011011"
  550 DATA"00011011"
  560 DATA"00011011"
  570 DATA"00011101"
  580 DATA"00001111"
  590 DATA"00000110"
  600 DATA"00000110"
  610 DATA"00000111"
  620 :
  630 DATA"00000011"
  640 DATA"00000011"
  650 DATA"00000111"
  660 DATA"00000011"
  670 DATA"00000011"
  680 DATA"00000011"
  690 DATA"00000001"
  700 DATA"00000011"
  710 DATA"00000111"
  720 DATA"00000111"
  730 DATA"00001111"
  740 DATA"00001111"
  750 DATA"00000011"
  760 DATA"00000111"
  770 DATA"00000110"
  780 DATA"00000111"
  790 :
  800 DATA"00000000"
  810 DATA"00000000"
  820 DATA"00000001"
  830 DATA"00000000"
  840 DATA"00000000"
  850 DATA"00000000"
  860 DATA"00000000"
  870 DATA"00000000"
  880 DATA"00000001"
  890 DATA"00000011"
  900 DATA"00000111"
  910 DATA"00000110"
  920 DATA"00000000"
  930 DATA"00000001"
  940 DATA"00000011"
  950 DATA"00000011"
  960 :
  970 :
  980 :
  990 DATA"00000000"
 1000 DATA"00000000"
 1010 DATA"00000000"
 1020 DATA"00000000"
 1030 DATA"00000000"
 1040 DATA"00000000"
 1050 DATA"00000000"
 1060 DATA"00000000"
 1070 DATA"00000000"
 1080 DATA"00000000"
 1090 DATA"00000000"
 1100 DATA"00000000"
 1110 DATA"00000000"
 1120 DATA"00000000"
 1130 DATA"00000000"
 1140 DATA"00000000"
 1150 :
 1160 DATA"00000000"
 1170 DATA"00000000"
 1180 DATA"10000000"
 1190 DATA"00000000"
 1200 DATA"10000000"
 1210 DATA"00000000"
 1220 DATA"00000000"
 1230 DATA"00000000"
 1240 DATA"10000000"
 1250 DATA"10000000"
 1260 DATA"10000000"
 1270 DATA"10000000"
 1280 DATA"00000000"
 1290 DATA"00000000"
 1300 DATA"00000000"
 1310 DATA"00000000"
 1320 :
 1330 DATA"11000000"
 1340 DATA"11000000"
 1350 DATA"11100000"
 1360 DATA"01000000"
 1370 DATA"11100000"
 1380 DATA"11000000"
 1390 DATA"10000000"
 1400 DATA"11000000"
 1410 DATA"11100000"
 1420 DATA"11100000"
 1430 DATA"01110000"
 1440 DATA"10110000"
 1450 DATA"11000000"
 1460 DATA"01100000"
 1470 DATA"11100000"
 1480 DATA"01110000"
 1490 :
 1500 DATA"11110000"
 1510 DATA"11110000"
 1520 DATA"11111000"
 1530 DATA"11010000"
 1540 DATA"11111000"
 1550 DATA"11110000"
 1560 DATA"01100000"
 1570 DATA"11110000"
 1580 DATA"11111000"
 1590 DATA"11111100"
 1600 DATA"11111110"
 1610 DATA"11110110"
 1620 DATA"11111000"
 1630 DATA"11011010"
 1640 DATA"00001110"
 1650 DATA"10001100"
 1660 :
 
Last edited by Andrew_Waite on Sat Oct 27, 2018 3:12 pm, edited 7 times in total.

User avatar
AndyF
Posts: 1270
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Sat Oct 27, 2018 8:02 am

This program will see a single large Jet Set Willy character walking across a Mode7 screen.
That's excellent!
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
FourthStone
Posts: 779
Joined: Thu Nov 17, 2016 2:29 am
Location: Brisbane, Australia
Contact:

Re: Any short type-ins for unattended Beebs?

Post by FourthStone » Sat Oct 27, 2018 8:33 am

Andrew_Waite wrote:
Sat Oct 27, 2018 3:28 am
This program will see a single large Jet Set Willy character walking across a Mode7 screen. The program takes about 25s to initialise.
This is really cool! Would be interesting to see a version with the smaller mode 7 blocks.

User avatar
bakoulis
Posts: 316
Joined: Wed Feb 08, 2012 9:45 pm
Location: Athens, Greece
Contact:

Re: Any short type-ins for unattended Beebs?

Post by bakoulis » Sat Oct 27, 2018 12:03 pm

AndyF wrote:
Sat Oct 27, 2018 8:02 am
This program will see a single large Jet Set Willy character walking across a Mode7 screen.
That's excellent!
Don't works for me.
In Brandy gives a blank screen and in BBCSDL gives a blank screen and a window message: "no room".
#-o
Last edited by bakoulis on Sat Oct 27, 2018 12:04 pm, edited 2 times in total.
2xElectron, 3xBBC B, BBC Master.
2xAcorn A310, A420/1, 2xA3000, 2xA3010, A3020, A4000, A5000.
2xRISC PC, Acorn Pocket Book, Acorn Pocket Book II.

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Sat Oct 27, 2018 3:22 pm

AndyF wrote:
Sat Oct 27, 2018 8:02 am
That's excellent!
Thank you!

I like AndyF's idea of making an animated Technician Ted. Does anyone know of a sprite sheet for the Spectrum version of the game? Technician Ted seems to cycle through more than 4 frames when he walks.

FourthStone : The Jet Set Willy sprite lives in a 16x16 pixel frame, but the same code could be used to animate characters at a higher resolution with Mode7 low res. graphics.

bakoulis : Sorry, the program works on a BBC Micro or emulator like BeebEm, and will not work in Brandy or BBCSDL.
Last edited by Andrew_Waite on Sat Oct 27, 2018 3:43 pm, edited 3 times in total.

User avatar
AndyF
Posts: 1270
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Sat Oct 27, 2018 3:46 pm

Andrew_Waite wrote:
Sat Oct 27, 2018 3:22 pm
Thank you!

I like AndyF's idea of making an animated Technician Ted. Does anyone know of a sprite sheet for the Spectrum version of the game? Technician Ted seems to cycle through more than 4 frames when he walks.
In the TechTed game he has 8 per direction ( ! ) however I used his sprite in a few JSW based games (you may of seen I see you joined, thank you!)

Here are the original 'TechTed' game ones with a grid around them to help erm 'pixelify' them if required:

EDIT... They stretched this post too much so I removed them and placed them in a sensible .zip instead, 8 per direction. Do not appear to have him facing the other way but that's easily done if needed:

ted_sprites.zip
(8.24 KiB) Downloaded 23 times
And now the four we used in JSW/MM based games, these were enough:
ted_16_16.png
I had a bit of trouble (as Frank Spencer might of said) doing that to get them in a sensible grid format, hopefully if you're only going to use 4 each way that's enough, they are 16x16 anyway.

Hope that helps! :D
Last edited by AndyF on Sat Oct 27, 2018 3:56 pm, edited 3 times in total.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
BigEd
Posts: 2565
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sat Oct 27, 2018 8:37 pm

(I was at The National Museum for Computing today, and because it turns out "unattended beebs" returns this page as top result, was readily able to help the attendant to enjoy these contributed short type-ins. Which is a bit of a paradox.)

Andrew_Waite
Posts: 161
Joined: Tue Aug 30, 2016 2:58 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Andrew_Waite » Sun Oct 28, 2018 1:42 am

AndyF wrote:
Sat Oct 27, 2018 3:46 pm
In the TechTed game he has 8 per direction ( ! )
Thank you - what a great resource these bitmaps are.

I think I have gotten a correct Technician Ted walking across a Mode7 screen in the code below.

Ted advances forward by one pixel per game cycle, where as Willy advances by two. So unlike Willy, Ted only has time to walk half way across a 40 column screen before my code exhausts the Beeb's memory. To get around this limitation I added a second Ted to give the effect of Teds continuously walking across the screen.

Unfortunately the length of the code is now pushing the 'short type-in' title of this thread !

The program now takes about 50s to initialise.

Code: Select all


    5 REM This program requires a BBC Micro or emulator such as BeebEm
   10 MODE0:MODE7:HIMEM=&2FFF:VDU23,1,0;0;0;0;
   20 :
   30 FOR B%=0 TO 39
   40 C%=&3000+((B%MOD20)*&400)
   50 IF B% MOD 8=0 RESTORE 360
   60 FOR N%=0 TO 15
   70 READ A$
   80 FOR M%=0 TO 7
   90 IF MID$(A$,M%+1,1)="0" GOTO 130
  100 F%=C%+(N%*40)+160
  110 G%=M%+((B%DIV8)*8)
  120 ?(F%+(G%MOD40))=255
  130 NEXT:NEXT:NEXT
  140 :
  150 FOR B%=0 TO 39
  160 C%=&3000+((B%MOD20)*&400)
  170 IF B% MOD 8=0 RESTORE 1740
  180 FOR N%=0 TO 15
  190 READ A$
  200 FOR M%=0 TO 7
  210 IF MID$(A$,M%+1,1)="0" GOTO 250
  220 F%=C%+(N%*40)+160
  230 G%=M%+((B%DIV8)*8)+8
  240 ?(F%+(G%MOD40))=255
  250 NEXT:NEXT:NEXT
  260 :
  270 REPEAT
  280 FOR S%=&3000 TO &7C00 STEP &400
  290 OSCLI("FX19")
  300 VDU23;12,((S%DIV256)-&74)EOR&20;0;0;0:VDU23;13,0;0;0;0
  310 FOR DELAY=0TO120:NEXT
  320 NEXT
  330 UNTIL FALSE
  340 :
  350 :
  360 DATA"00011100"
  370 DATA"00111010"
  380 DATA"00111100"
  390 DATA"00011100"
  400 DATA"00011000"
  410 DATA"00100100"
  420 DATA"01000111"
  430 DATA"01001001"
  440 DATA"10000010"
  450 DATA"01001110"
  460 DATA"01111110"
  470 DATA"01111110"
  480 DATA"01111110"
  490 DATA"11100110"
  500 DATA"01000110"
  510 DATA"00000111"
  520 :
  530 DATA"00001110"
  540 DATA"00011101"
  550 DATA"00011110"
  560 DATA"00001110"
  570 DATA"00001100"
  580 DATA"00010010"
  590 DATA"00100111"
  600 DATA"01001111"
  610 DATA"01001111"
  620 DATA"00100111"
  630 DATA"00110111"
  640 DATA"00111111"
  650 DATA"00111111"
  660 DATA"01100110"
  670 DATA"00110110"
  680 DATA"00000111"
  690 :
  700 DATA"00000111"
  710 DATA"00001110"
  720 DATA"00001111"
  730 DATA"00000111"
  740 DATA"00000110"
  750 DATA"00001001"
  760 DATA"00011001"
  770 DATA"00010011"
  780 DATA"00010001"
  790 DATA"00010001"
  800 DATA"00011100"
  810 DATA"00011111"
  820 DATA"00011111"
  830 DATA"00000110"
  840 DATA"00000110"
  850 DATA"00000111"
  860 :
  870 DATA"00000011"
  880 DATA"00000111"
  890 DATA"00000111"
  900 DATA"00000011"
  910 DATA"00000011"
  920 DATA"00000100"
  930 DATA"00001100"
  940 DATA"00001100"
  950 DATA"00001100"
  960 DATA"00001110"
  970 DATA"00001111"
  980 DATA"00001111"
  990 DATA"00001111"
 1000 DATA"00000111"
 1010 DATA"00000110"
 1020 DATA"00000111"
 1030 :
 1040 DATA"00000001"
 1050 DATA"00000011"
 1060 DATA"00000011"
 1070 DATA"00000001"
 1080 DATA"00000001"
 1090 DATA"00000010"
 1100 DATA"00000110"
 1110 DATA"00000110"
 1120 DATA"00000111"
 1130 DATA"00000111"
 1140 DATA"00000111"
 1150 DATA"00000111"
 1160 DATA"00000111"
 1170 DATA"00000011"
 1180 DATA"00000110"
 1190 DATA"00000111"
 1200 :
 1210 DATA"00000000"
 1220 DATA"00000001"
 1230 DATA"00000001"
 1240 DATA"00000000"
 1250 DATA"00000000"
 1260 DATA"00000001"
 1270 DATA"00000011"
 1280 DATA"00000111"
 1290 DATA"00000011"
 1300 DATA"00000011"
 1310 DATA"00000011"
 1320 DATA"00000011"
 1330 DATA"00000011"
 1340 DATA"00000011"
 1350 DATA"00000110"
 1360 DATA"00000111"
 1370 :
 1380 DATA"00000000"
 1390 DATA"00000000"
 1400 DATA"00000000"
 1410 DATA"00000000"
 1420 DATA"00000000"
 1430 DATA"00000000"
 1440 DATA"00000001"
 1450 DATA"00000011"
 1460 DATA"00000101"
 1470 DATA"00000011"
 1480 DATA"00000001"
 1490 DATA"00000001"
 1500 DATA"00000001"
 1510 DATA"00000011"
 1520 DATA"00000110"
 1530 DATA"00000011"
 1540 :
 1550 DATA"00000000"
 1560 DATA"00000000"
 1570 DATA"00000000"
 1580 DATA"00000000"
 1590 DATA"00000000"
 1600 DATA"00000000"
 1610 DATA"00000000"
 1620 DATA"00000001"
 1630 DATA"00000001"
 1640 DATA"00000000"
 1650 DATA"00000000"
 1660 DATA"00000000"
 1670 DATA"00000000"
 1680 DATA"00000011"
 1690 DATA"00000011"
 1700 DATA"00000001"
 1710 :
 1720 :
 1730 :
 1740 DATA"00000000"
 1750 DATA"00000000"
 1760 DATA"00000000"
 1770 DATA"00000000"
 1780 DATA"00000000"
 1790 DATA"00000000"
 1800 DATA"00000000"
 1810 DATA"00000000"
 1820 DATA"00000000"
 1830 DATA"00000000"
 1840 DATA"00000000"
 1850 DATA"00000000"
 1860 DATA"00000000"
 1870 DATA"00000000"
 1880 DATA"00000000"
 1890 DATA"00000000"
 1900 :
 1910 DATA"00000000"
 1920 DATA"00000000"
 1930 DATA"00000000"
 1940 DATA"00000000"
 1950 DATA"00000000"
 1960 DATA"00000000"
 1970 DATA"00000000"
 1980 DATA"00000000"
 1990 DATA"00000000"
 2000 DATA"10000000"
 2010 DATA"10000000"
 2020 DATA"00000000"
 2030 DATA"00000000"
 2040 DATA"00000000"
 2050 DATA"00000000"
 2060 DATA"00000000"
 2070 :
 2080 DATA"00000000"
 2090 DATA"10000000"
 2100 DATA"00000000"
 2110 DATA"00000000"
 2120 DATA"00000000"
 2130 DATA"00000000"
 2140 DATA"10000000"
 2150 DATA"10000000"
 2160 DATA"10000000"
 2170 DATA"10000000"
 2180 DATA"10000000"
 2190 DATA"10000000"
 2200 DATA"10000000"
 2210 DATA"00000000"
 2220 DATA"00000000"
 2230 DATA"00000000"
 2240 :
 2250 DATA"10000000"
 2260 DATA"01000000"
 2270 DATA"10000000"
 2280 DATA"10000000"
 2290 DATA"00000000"
 2300 DATA"10000000"
 2310 DATA"01000000"
 2320 DATA"01000000"
 2330 DATA"01000000"
 2340 DATA"00000000"
 2350 DATA"11000000"
 2360 DATA"11000000"
 2370 DATA"11000000"
 2380 DATA"10000000"
 2390 DATA"01000000"
 2400 DATA"00000000"
 2410 :
 2420 DATA"11000000"
 2430 DATA"10100000"
 2440 DATA"11000000"
 2450 DATA"11000000"
 2460 DATA"10000000"
 2470 DATA"01000000"
 2480 DATA"01100000"
 2490 DATA"00110000"
 2500 DATA"00010000"
 2510 DATA"11100000"
 2520 DATA"11100000"
 2530 DATA"11100000"
 2540 DATA"11100000"
 2550 DATA"01110000"
 2560 DATA"01100000"
 2570 DATA"00000000"
 2580 :
 2590 DATA"11100000"
 2600 DATA"11010000"
 2610 DATA"11100000"
 2620 DATA"11100000"
 2630 DATA"11000000"
 2640 DATA"00100000"
 2650 DATA"00010000"
 2660 DATA"10001000"
 2670 DATA"11001000"
 2680 DATA"11110000"
 2690 DATA"11110000"
 2700 DATA"11110000"
 2710 DATA"11110000"
 2720 DATA"00111000"
 2730 DATA"00000000"
 2740 DATA"00000000"
 2750 :
 2760 DATA"01110000"
 2770 DATA"11101000"
 2780 DATA"11110000"
 2790 DATA"01110000"
 2800 DATA"01100000"
 2810 DATA"10010000"
 2820 DATA"10001000"
 2830 DATA"11000100"
 2840 DATA"11100010"
 2850 DATA"11111110"
 2860 DATA"11111000"
 2870 DATA"11111000"
 2880 DATA"11111000"
 2890 DATA"10011000"
 2900 DATA"00001110"
 2910 DATA"00000100"
 2920 :
 2930 DATA"00111000"
 2940 DATA"01110100"
 2950 DATA"01111000"
 2960 DATA"00111000"
 2970 DATA"00110000"
 2980 DATA"01001000"
 2990 DATA"11001100"
 3000 DATA"11000011"
 3010 DATA"11100001"
 3020 DATA"11111110"
 3030 DATA"11111100"
 3040 DATA"11111100"
 3050 DATA"11111100"
 3060 DATA"11001100"
 3070 DATA"00000111"
 3080 DATA"00000110"
 3090 :

Last edited by Andrew_Waite on Sun Oct 28, 2018 2:46 am, edited 14 times in total.

User avatar
AndyF
Posts: 1270
Joined: Sat Feb 23, 2008 10:16 pm
Location: Derby
Contact:

Re: Any short type-ins for unattended Beebs?

Post by AndyF » Sun Oct 28, 2018 8:46 am

Andrew_Waite wrote:
Sun Oct 28, 2018 1:42 am
Thank you - what a great resource these bitmaps are.
You're very welcome. =D> I supplied the 'gridded' view purposely to attempt to make it easier. I do sometimes use this view if I want to 'borrow' sprites and have to manually add them, although slightly long winded it does mean you end up with them correct and not a mess. :oops:
Andrew_Waite wrote:
Sun Oct 28, 2018 1:42 am
Unfortunately the length of the code is now pushing the 'short type-in' title of this thread !
It's good, thank you! Regarding the title, well I suppose most are doing a copy/paste exercise with them now, I certainly am. Although I do remember 'back then' typing in seemingly endless listings from the magazines, not for the Acorn platform (did not have one) but the principle is the same I guess...
Last edited by AndyF on Sun Oct 28, 2018 8:49 am, edited 1 time in total.
Andy

* NEW * The Jetset Willy and Manic Miner community :)

Adventure games ported across to the BBC (in progress) as soon as I can find some time!

User avatar
BigEd
Posts: 2565
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Any short type-ins for unattended Beebs?

Post by BigEd » Sun Oct 28, 2018 10:01 am

Just found a collection of type-ins for various Basics (but not BBC Basic) so if anyone fancies translating them (also possibly from German) have at it:
http://www.computerarchaeologie.de/bere ... zu-band-1/

Probably from the German-language retrocomputing history book "RESUME"
http://www.computermuseum-oldenburg.de/RESUME.html

Edit: more in this excerpt including a 25-line Lunar Lander.
http://www.computerarchaeologie.de/wp-c ... eprobe.pdf
Last edited by BigEd on Sun Oct 28, 2018 10:03 am, edited 1 time in total.

User avatar
timmy
Posts: 164
Joined: Thu Apr 27, 2006 12:19 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by timmy » Wed Oct 31, 2018 4:07 pm

Andrew_Waite wrote:
Sat Oct 27, 2018 3:28 am
This program will see a single large Jet Set Willy character walking across a Mode7 screen. The program takes about 25s to initialise.
Can't get too much mode 7 Willy! :-)


Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Commie_User » Wed Nov 07, 2018 8:30 pm

Andrew_Waite wrote:
Sat Oct 27, 2018 3:28 am
This program will see a single large Jet Set Willy character walking across a Mode7 screen. The program takes about 25s to initialise.

No room at line 10.

Poor BBC BASIC For Windows by RT Russell!

Nice prog though. Nice for the background!

Commie_User
Posts: 1309
Joined: Wed Jan 27, 2016 12:50 am
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Commie_User » Thu Nov 08, 2018 4:33 pm

BigEd wrote:
Fri Aug 24, 2018 8:05 am
This page collects simple fractals - any of these likely to fall to a one-liner, or a ten-liner type-in?

Image

I really hope there's an Atari 2600 cartridge of these fractals!
Last edited by Commie_User on Thu Nov 08, 2018 4:34 pm, edited 1 time in total.

Soruk
Posts: 413
Joined: Mon Jul 09, 2018 10:31 am
Location: Basingstoke, Hampshire
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Soruk » Mon Nov 19, 2018 7:37 am

bakoulis wrote:
Sat Oct 27, 2018 12:03 pm
AndyF wrote:
Sat Oct 27, 2018 8:02 am
This program will see a single large Jet Set Willy character walking across a Mode7 screen.
That's excellent!
Don't works for me.
In Brandy gives a blank screen and in BBCSDL gives a blank screen and a window message: "no room".
#-o
This demo seems to work by shifting the base of screen memory to achieve the animation. Matrix Brandy does not support screen memory access (like RISC OS appears not to), with the limited exception of MODE 7 access at &FFFF7C00-&FFFF7FFF, and then the implementation is different. Baseline Brandy doesn't support MODE 7.

thearttrooper
Posts: 15
Joined: Fri Dec 09, 2011 9:56 am
Contact:

Re: Any short type-ins for unattended Beebs?

Post by thearttrooper » Thu Nov 22, 2018 9:02 pm

Here's my short type-in:

Code: Select all

10MODE2
20REPEAT
30GCOL0,RND(7)
40PLOT85,RND(1280),RND(1024)
50UNTIL FALSE


Diminished
Posts: 161
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Diminished » Fri Mar 29, 2019 8:49 am

I came up with this quite by accident when I was about 11 or something:

10 MODE 5
20 FOR X=1 TO 1280 STEP 8
30 FOR Y=1 TO 1024 STEP 4
40 GCOL 0,(X*X)/Y
50 PLOT 69,X,Y
60 NEXT:NEXT

The results might surprise you.

User avatar
Lardo Boffin
Posts: 1612
Joined: Thu Aug 06, 2015 6:47 am
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Lardo Boffin » Fri Mar 29, 2019 9:14 am

Nice image. :D
Atom, issue 5
BBC model B 32k issue 4, 16k sideways RAM, Watford 12 ROM board, Acorn 6502 coproc
BBC model B 32k issue 7, turboMMC, Opus Challenger 3 512k, Pi 3 coproc
USA Model B
BBC Master, Datacentre + HDD, pi co-proc, econet, NULA

Diminished
Posts: 161
Joined: Fri Dec 08, 2017 9:47 pm
Contact:

Re: Any short type-ins for unattended Beebs?

Post by Diminished » Fri Mar 29, 2019 9:37 am

I still don't quite understand how it works -- I guess the banding effect just comes from floating point -> integer rounding.

Post Reply