Tech demo

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
Chuckie
Posts: 13
Joined: Thu Jun 20, 2019 1:21 pm
Contact:

Tech demo

Post by Chuckie » Tue Dec 03, 2019 5:48 am

I post here because this is where the true programmer reside

I found this demo https://www.youtube.com/watch?v=AiHyTJs ... tqikhZqo4M

i was wondering how it could be translated in to bbc basic particularly the graphiscs output. dont know about the sound but we know about beeb sid.

appreciate any comments

User avatar
leenew
Posts: 4193
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: Tech demo

Post by leenew » Tue Dec 03, 2019 4:03 pm

The beeb had "Colourspace" http://bbcmicro.co.uk/game.php?id=2317

Lee.

User avatar
BadProgram
Posts: 35
Joined: Thu Mar 22, 2018 12:56 pm
Contact:

Re: Tech demo

Post by BadProgram » Sat Dec 07, 2019 12:47 pm

There are examples of drawing iterative patterns in the old BEEBUG magazine. http://8bs.com/beebugmags.htm

Here are a few that might help, excuse me if i am way off course.

Image

Image

Image

julie_m
Posts: 227
Joined: Wed Jul 24, 2019 9:53 pm
Location: Derby, UK
Contact:

Re: Tech demo

Post by julie_m » Sat Dec 07, 2019 4:08 pm

See also the Acornsoft book / cassette /disc, "Creative Graphics" for some nice pictures..... Someone is bound to be around with a link soon .....

nicolagiacobbe
Posts: 9
Joined: Tue Jul 03, 2007 10:40 am
Location: italy
Contact:

Re: Tech demo

Post by nicolagiacobbe » Tue Jan 07, 2020 1:38 pm

I have put together a simpler copy of the demo in BBC basic.
It works in mode 5 and it just gives the look and feel of it, it should be tweaked to obtain a full blown demo but it could be an useful starting point.

Code: Select all

 10DIM XS%(64),YS%(64),XE%(64),YE%(64)
 20MODE 5
 30X0%=RND(1280)
 40Y0%=RND(1024)
 50X1%=RND(1280)
 60Y1%=RND(1024)
 70DX0%=4*(RND(16)-8):DY0%=4*(RND(16)-8)
 80DX1%=4*(RND(16)-8):DY1%=4*(RND(16)-8)
 90I%=0
100C%=1
110K%=64
120REPEAT
130J%=(I%+1)AND 63
140GCOL 0,0
150MOVE XS%(J%),YS%(J%)
160DRAW XE%(J%),YE%(J%)
170MOVE XS%(J%),1024-YS%(J%)
180DRAW XE%(J%),1024-YE%(J%)
190MOVE 1280-XS%(J%),YS%(J%)
200DRAW 1280-XE%(J%),YE%(J%)
210MOVE 1280-XS%(J%),1024-YS%(J%)
220DRAW 1280-XE%(J%),1024-YE%(J%)
230X0%=X0%+DX0%
240IF X0%<0 OR X0%>1280 THEN DX0%=-DX0%
250Y0%=Y0%+DY0%
260IF Y0%<0 OR Y0%>1024 THEN DY0%=-DY0%
270X1%=X1%+DX1%
280IF X1%<0 OR X1%>1280 THEN DX1%=-DX1%
290Y1%=Y1%+DY1%
300IF Y1%<0 OR Y1%>1024 THEN DY1%=-DY1%
310GCOL 0,C%
320MOVE X0%,Y0%
330DRAW X1%,Y1%
340MOVE X0%,1024-Y0%
350DRAW X1%,1024-Y1%
360MOVE 1280-X0%,Y0%
370DRAW 1280-X1%,Y1%
380MOVE 1280-X0%,1024-Y0%
390DRAW 1280-X1%,1024-Y1%
400XS%(I%)=X0%:YS%(I%)=Y0%
410XE%(I%)=X1%:YE%(I%)=Y1%
420I%=(I%+1)AND 63
430K%=K%-1
440IF K%=0 THEN K%=64:DX0%=4*(RND(16)-8):DY0%=4*(RND(16)-8):DX1%=4*(RND(16)-8):DY1%=4*(RND(16)-8):C%=C%+1:IF C%=4 THEN C%=1
450UNTIL FALSE
It you want to start changing it:
the number of lines drawn is a power of two to ease calculations, choose the power you want and DIM the number in line 10, then modify lines 130 and 420 to have the correct mask value (= chosen power of two - 1), the number of lines drawn before changing color is 64 and it is set at line 110 and 440, the colour cycling is 1,2,3,1.. set in line 440 also.

Post Reply

Return to “programming”