1 #include "lib\modex16.h"
\r
5 //#include <iostream.h>
7 word far* clock= (word far*) 0x046C; /* 18.2hz clock */
\r
15 short bakax = 0, bakay = 0;
\r
16 sword xx = 0, yy = 0, sx = 0, sy = 0;
\r
19 //byte *vga = (byte *) MK_FP(0xA000, 0);
22 * Comment out the following #define if you don't want the testing main()
\r
29 int mult=(QUADWH)/2;
\r
32 for(int paly=0; paly<palq; paly+=mult){
\r
33 for(int palx=0; palx<palq; palx+=mult){
\r
34 //mxFillBox((SCREEN_WIDTH-palq)+palx+32, paly+32, TILEWH, TILEWH, palcol, OP_SET);
35 modexClearRegion(page_t *page, (SCREEN_WIDTH-palq)+palx+32, paly+32, TILEWH, TILEWH, palcol);
\r
41 /////////////////////////////////////////////////////////////////////////////
\r
43 // cls() - This clears the screen to the specified color, on the VGA or on //
\r
44 // the Virtual screen. //
\r
46 /////////////////////////////////////////////////////////////////////////////
\r
47 void cls(byte color, byte *Where){
\r
48 _fmemset(Where, color, VW*(VH*2));
\r
53 if(gq < NUM_COLORS){
\r
63 //---- cls(gq, vaddr);
\r
70 //slow spectrum down
\r
71 void ssd(short svq){
\r
72 if(sy < SCREEN_HEIGHT+1){
\r
73 if(sx < SCREEN_WIDTH+1){
\r
74 //plotpixel(xx, yy, coor, vga);
\r
75 //ppf(sx, sy, coor, vga);
\r
76 //mxPutPixel(sx, sy, coor);
77 modexClearRegion(page_t *page, sx, sy, 1, 1, coor);
78 //printf("%d %d %d %d¥n", sx, sy, svq, coor);
\r
81 if(sx == SCREEN_WIDTH){
\r
83 if(svq == 7) coor++;
\r
84 if(sy == SCREEN_HEIGHT && svq == 8) coor = rand()%NUM_COLORS;
\r
89 /*-----------ding-------------*/
\r
92 page=modexDefaultPage();
\r
93 page2 = modexNextPage(&page);
\r
98 //++++ if(q <= 4 && q!=2 && gq == BONK-1) coor = rand()%HGQ;
\r
103 if(coor < HGQ && coor < LGQ) coor = LGQ;
\r
107 bakax = rand()%3; bakay = rand()%3;
\r
111 // if(q==8){ colorz(); return gq; /*mxOutText(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, "bakapi");*/ }else
\r
112 // if(q==10){ ssd(q); /*printf("%d¥n", coor);*/ }else
\r
113 // if(q==5){ colortest(); return gq; }else
\r
114 // if(q==11){ colorz(); delay(100); return gq; }
\r
116 coor = rand()%NUM_COLORS;
\r
124 if(q == 9){ ssd(q); coor++; }
\r
128 if((q<5 && gq<BONK) || (q==16 && gq<BONK)){ // the number variable make the colors more noticable
\r
130 if(xx==VW){bakax=0;}
\r
131 if(xx==0){bakax=1;}
\r
132 if(yy==VH){bakay=0;}
\r
133 if(yy==0){bakay=1;}
\r
135 if(xx!=VW||yy!=VH){
\r
136 if(xx==0){bakax=1;bakay=-1;d3y=1;}
\r
137 if(yy==0){bakax=1;bakay=0;d3y=1;}
\r
138 if(xx==VW){bakax=-1;bakay=-1;d3y=1;}
\r
139 if(yy==VH){bakax=1;bakay=0;d3y=1;}
\r
140 }else if(xx==VW&&yy==VH) xx=yy=0;
\r
204 if(xx<0) xx=(VW-TILEWH);
\r
205 if(yy<0) yy=(VH-TILEWH);
\r
206 if(xx>(VW-TILEWH)) xx=0;
\r
207 if(yy>(VH-TILEWH)/*+(TILEWH*BUFFMX)*/) yy=0;
\r
216 //interesting effects
\r
222 //mxPutPixel(tx, ty, coor);
223 modexClearRegion(page_t *page, tx, ty, 1, 1, coor);
224 //printf("%d %d %d %d %d %d¥n", xx, yy, tx, ty, TILEWH);
\r
229 //mxFillBox(xx, yy, TILEWH, TILEWH, coor, OP_SET);
230 modexClearRegion(page_t *page, xx, yy, TILEWH, TILEWH, coor);
\r
232 //mxPutPixel(xx, yy, coor);
233 modexClearRegion(page_t *page, xx, yy, 1, 1, coor);
\r
239 //mxFillBox((rand()*TILEWH)%VW, (rand()*TILEWH)%(VH), TILEWH, TILEWH, 0, OP_SET);
240 modexClearRegion(page_t *page, (rand()*TILEWH)%VW, (rand()*TILEWH)%(VH), TILEWH, TILEWH, 0);
\r
242 //mxPutPixel(rand()%VW, rand()%(VH), 0);
243 modexClearRegion(page_t *page, rand()%VW, rand()%(VH), 1, 1, 0);
\r
245 if(q==16) //mxPutPixel(rand()%VW, rand()%(VH), 0);
246 modexClearRegion(page_t *page, rand()%VW, rand()%(VH), 1, 1, 0);
\r
247 if(q==2||q==4||q==16){ bakax = rand()%3; bakay = rand()%3; } //random 3 switch
\r
249 //if(xx<0||xx>320||yy<0||yy>(SCREEN_HEIGHT*3))
\r
250 // printf("%d %d %d %d %d¥n", xx, yy, coor, bakax, bakay);
\r
259 //page_t page, page2;
\r
261 byte *pal, *pal2=NULL;
\r
263 /* load pcx file */
\r
264 bmp = modexLoadPcx("ed.pcx");
\r
266 /* load our palette */
\r
267 modexLoadPalFile("gfx.pal", &pal2);
\r
269 /* save the palette */
\r
270 pal = modexNewPal();
\r
272 modexFadeOff(1, pal);
\r
278 /* set up the page, but with 16 pixels on all borders in offscreen mem */
\r
279 page=modexDefaultPage();
\r
280 page2 = modexNextPage(&page);
\r
285 /* fill the page with one color, but with a black border */
\r
286 modexShowPage(&page2);
\r
287 modexClearRegion(&page, 16, 16, SCREEN_WIDTH, SCREEN_HEIGHT, 128);
\r
288 modexClearRegion(&page, 32, 32, SCREEN_WIDTH-32, SCREEN_HEIGHT-32, 42);
\r
289 modexClearRegion(&page, 48, 48, SCREEN_WIDTH-64, SCREEN_HEIGHT-64, 128);
\r
290 modexShowPage(&page);
\r
292 modexDrawSprite(&page, 20, 20, &bmp);
\r
293 //modexDrawBmp(&page, xb, yb, &bmp);
\r
296 modexFadeOn(1, pal2);
\r
300 //for(i=0; i<5; i++) {
\r
301 while (!kbhit()){ /* Wait for a keystroke */
\r
303 for(j=0; j<32; j++) {
\r
305 modexShowPage(&page);
\r
308 for(j=0; j<32; j++) {
\r
310 modexShowPage(&page);
\r
313 for(j=0; j<32; j++) {
\r
315 modexShowPage(&page);
\r
319 for(j=0; j<32; j++) {
\r
321 modexShowPage(&page);
\r
325 (void) getch(); /* Clear the keyboard buffer */
\r
328 /* fade back to text mode */
\r
329 modexFadeOff(1, pal2);
\r
333 modexFadeOn(1, pal);
\r