'  Thermo Cop;
'  ===========
'
'  An RGB Plasma Demo coded by Shockwave (C) 2002.
'  This isn't really a full demo, the effect is too slow
'  To release as a full demo, but it may bring back a few
'  Memories for those of us that had an Amiga so I've
'  Released it :o)
'
'  You can alter the render quality by changing the "res"
'  variable, I shudder to think how slow this will run on
'  the Emulator though. ;o) It's slow enough on the PS2.
'
'  I'm releasing far too much non 50fps stuff these days.
'  grumble, moan, whinge.. etc.
'  Greets to all those who know me. ;o)
'
'oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
'                      Set Things Up;
'oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
'                         Gfx Mode;
'---------------------------------------------------------
    open window 640,512
    res=20  rem   < Change this variable for diff. quality
'                Background On Both Buffers;
'---------------------------------------------------------
    for a=1 to 2
     setdrawbuf dw
     dw=1-dw
     setdispbuf dw
b=0
for x=0 to 640 step 20
for y=0 to 512 step 20
 setrgb 1,b,y/5,(x+y)/12
 fill rect x,y to x+19,y+19
b=b+.05
next y
next x
     setrgb 1,25,35,45
     fill rect 97,42 to 542,467

     setrgb 1,255,255,255
     rect 97,42 to 542,467
setrgb 1,255,255,255
text 320,20,"SHOCKWAVE PRESENTS THE RGB PLASMA DEMO","cc"
text 320,502,"WWW.YABASIC.CO.UK   WWW.PS2-YABASIC.CO.UK","cc"

setrgb 1,255,155,155
text 321,21,"SHOCKWAVE PRESENTS THE RGB PLASMA DEMO","cc"
text 321,503,"WWW.YABASIC.CO.UK   WWW.PS2-YABASIC.CO.UK","cc"

setrgb 1,155,55,55
text 322,22,"SHOCKWAVE PRESENTS THE RGB PLASMA DEMO","cc"
text 322,504,"WWW.YABASIC.CO.UK   WWW.PS2-YABASIC.CO.UK","cc"

setrgb 1,55,0,0
text 323,23,"SHOCKWAVE PRESENTS THE RGB PLASMA DEMO","cc"
text 323,505,"WWW.YABASIC.CO.UK   WWW.PS2-YABASIC.CO.UK","cc"

next a
'---------------------------------------------------------
dim cs(7200)
for a=1 to 7200
 c=190+160*sin(a*pi/180)
 cs(a)=c
next a
'oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
'                        Main Loop;
'oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
 repeat
'                     Double Buffering;
'---------------------------------------------------------
setdrawbuf dw
dw=1-dw
setdispbuf dw
'                    Jump to Plasma Sub;
'---------------------------------------------------------
gosub plasma
until (1=2)
'oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
'                 Draw The Plasma Display;
'oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo
label plasma
'                   Colour Table Offsets;
'---------------------------------------------------------
mm=mm+.01
q=30+30*sin(mm)
rs=int(360+350*sin(mm))
gs=int(720+710*cos(mm))
bs=int(1440+1430*cos(mm/3))
'                 Draw The Rectangles :o)
'---------------------------------------------------------
for x=100 to 520 step res
cn=cn+1
   w=q+q*sin(x*.01)
for y=45 to 445 step res
   setrgb 1,cs(y+rs+w),cs(x+gs+w),cs(bs+x+y+w)

   fill rect x,y to x+res,y+res
next y
next x
return



