* * Simple test of grlib interface * * SLJ 1/2/05 * ubyte dev@$ba int x1,y1,x2,y2 ubyte r ubyte color float x,y ; ; Move ZP temp stack above grlib vars ; SetZPTemp $11 ; ; Load graphics library ; load "grlib.r.o",dev,$c000 ; ; Initialize, etc. ; InitGr() ; ; Test 1: grid o dots ; GrOn(16) for x1=0:319 step 5 for y1=0:199 step 5 GrPlotAbs(x1,y1) next next waitchar ; ; Test 2: sine wave ; GrOn(16) x1=0 for x=0:60 step .1 y1 = 100+50.0*sin(x) GrPlotAbs(x1,y1) x1=x1+1 next waitchar ; ; Test 3: Moire pattern ; (alternately draw and erase lines) ; GrOn(16) color=0 for x1=0:319 GrSetColor(color) GrLine(72,55,x1,0) GrLine(72,55,319-x1,199) color = color biteor 1 ;draw/erase next for y1=0:199 GrSetColor(color) GrLine(72,55,319,y1) GrLine(72,55,0,199-y1) color = color biteor 1 ;draw/erase next waitchar ; ; Test 4: Circles! ; gron(16) r = 5 for x=0:3.14*2 step .3 x1 = 160+60*cos(x) y1 = 100+60*sin(2*x) GrCircle(x1,y1,r) r=r+8 next waitchar done put 'grlib.ext.s'