/* WRITTEN USING CODE WARRIOR 2 COPY WRITE PETER BLACK 30.3.1999 E MAIL ME peter.black@eidosnet.co.uk */ #include #include <__rts_info_t__.h> #include "padread.h" #define OT_LENGTH 1// set OT Length //////////////////////////////////////////////////////////////////////// //GLOBAL VARIABLES //OT GsOT WorldOT[2]; GsOT_TAG OTTags[2][1<0;a--) { ClearOT(); DrawOT(); } screen[0].x=128; screen[0].y=128; prog=1; while(prog==1) { ClearOT(); //twist twist+=((PadOneR1)-(PadOneR2))*100; if(twist<0)twist+=1474560; if(twist>1474560)twist-=0; if(PadOneTriangle==0) { twist++; } //scale if((PadOneL1)&&(scale<500)) { scale++; } if((PadOneL2)&&(scale>0)) { scale--; } //ADD COLOUR if(PadOneCircle==0) { line.x0=(rand()%20)+118; line.y0=(rand()%20)+118; line.x1=line.x0+1; line.y1=line.y0+1; line.r=(rand()%256); line.g=(rand()%256); line.b=(rand()%256); GsSortLine(&line,&WorldOT[ActiveBuff],0); } LoadSprite(&screen[0], (1<<25)|(1<<28)|(1<<30), 0,0, 256,256, 128,128, 0,0); if(PadOneSquare) { screen[b].rotate=491520; } else { screen[b].rotate=twist; } screen[b].scalex=4096+(scale/10); screen[b].scaley=4096+(scale/10); GsSortSprite(&screen[b],&WorldOT[ActiveBuff],0); while(PadOneCross) { //wait } DrawOTNotClear(); if(PadOneSelect) { prog=0; while(PadOneSelect) { //wait } } } } ///////////////////////////////////////////////// // LOAD SPRITE static void LoadSprite(GsSPRITE *sprite, u_long attribute, u_char u,u_char v, u_short w,u_short h, short mx,short my, int tpx,int tpy) { u_short tpage; tpage=GetTPage(2,0,tpx,tpy); sprite->attribute=attribute; //sprite->x=0; //sprite->y=0; sprite->w=w; sprite->h=h; sprite->tpage=tpage; sprite->u=u; sprite->v=v; sprite->cx=0; sprite->cy=0; sprite->r=128;//colour sprite->g=128;//colour sprite->b=128;//colour sprite->mx=mx; sprite->my=my; sprite->scalex=ONE; sprite->scaley=ONE; sprite->rotate=0; } //////////////////////////////////////////////////////////////// //CLEAR OT // static void ClearOT() { ActiveBuff=GsGetActiveBuff(); GsSetWorkBase((PACKET*)GpuPacketArea[ActiveBuff]); GsClearOt(0,0,&WorldOT[ActiveBuff]); } ///////////////////////////////////////////////////////////////// //DRAW OT SWAP DISPLAY BUFFERS ///HIGH RESOLUTION static void DrawOT() { DrawSync(0); VSync(0); //ResetGraph(1); GsSwapDispBuff(); GsSortClear(0,0,0,&WorldOT[ActiveBuff]); GsDrawOt(&WorldOT[ActiveBuff]); } void DrawOTNotClear() { DrawSync(0); VSync(0); //ResetGraph(1); GsSwapDispBuff(); //GsSortClear(0,0,0,&WorldOT[ActiveBuff]); GsDrawOt(&WorldOT[ActiveBuff]); }