]> 4ch.mooo.com Git - 16.git/blobdiff - 16/dos_gfx.cpp
modified: 16/DOS_GFX.EXE
[16.git] / 16 / dos_gfx.cpp
index 40c0a24df0436767564f16af03fe9f093560b9e9..57ec6b5b3c7da11ea4c9f5f2114ff8285a485f80 100644 (file)
@@ -5,11 +5,11 @@
 \r
 int old_mode;\r
 //color \82Ä\82·\82Æ\r
-int gq = LGQ;\r
+short gq = LGQ;\r
+\r
 //\82Ä\82·\82Æ\r
-int q = 0;\r
-int bakax = 0, bakay = 0;\r
-cord xx = rand()&0%320, yy = rand()&0%240, sx = 0, sy = 0;\r
+short bakax = 0, bakay = 0;\r
+syte xx = rand()&0%SW, yy = rand()&0%SH, sx = 0, sy = 0;\r
 byte coor;\r
 \r
 byte *vga = (byte *) MK_FP(0xA000, 0);\r
@@ -25,7 +25,7 @@ byte *vga = (byte *) MK_FP(0xA000, 0);
 // setvideo() - This function Manages the video modes                                    //\r
 //                                                                         //\r
 /////////////////////////////////////////////////////////////////////////////\r
-void setvideo(/*byte mode, */int vq){\r
+void setvideo(/*byte mode, */short vq){\r
                union REGS in, out;\r
 \r
                if(!vq){ // deinit the video\r
@@ -36,7 +36,7 @@ void setvideo(/*byte mode, */int vq){
                                in.h.al = old_mode;\r
                                int86(0x10, &in, &out);\r
 \r
-               }else if(vq == 1){ // init the video\r
+               }else if(vq==1){ // init the video\r
                                // get old video mode\r
                                in.h.ah = 0xf;\r
                                int86(0x10, &in, &out);\r
@@ -65,7 +65,7 @@ void cls(byte color, byte *Where){
 }\r
 \r
 //color \82Ä\82·\82Æ\r
-int colortest(){\r
+short colortest(){\r
                if(gq < NUM_COLORS){\r
                                cls(gq, vga);\r
                                gq++;\r
@@ -74,7 +74,7 @@ int colortest(){
 }\r
 \r
 //color \82Ä\82·\82Æ\r
-int colorz(){\r
+short colorz(){\r
                if(gq < HGQ){\r
 //----           cls(gq, vaddr);\r
                                cls(gq, vga);\r
@@ -84,7 +84,7 @@ int colorz(){
 }\r
 \r
 //slow spectrum down\r
-void ssd(int svq){\r
+void ssd(short svq){\r
                if(sy < SH+1){\r
                                if(sx < SW+1){\r
                                                //plotpixel(xx, yy, coor, vga);\r
@@ -102,9 +102,9 @@ void ssd(int svq){
 }\r
 \r
 /*-----------ding-------------*/\r
-int ding(int q){\r
+short ding(int q){\r
 \r
-               int d3y;\r
+               short d3y;\r
 \r
 //++++  if(q <= 4 && q!=2 && gq == BONK-1) coor = rand()%HGQ;\r
                if((q == 2\r
@@ -119,7 +119,7 @@ int ding(int q){
                                }\r
                }\r
 \r
-               if(q==8){ colorz(); return gq; }else\r
+               if(q==8){ colorz(); return gq; mxOutText(SW/2, SH/2, "\83o\83J\83s"); }else\r
                if(q==10){ ssd(q); /*printf("%d\n", coor);*/ }else\r
                if(q==5){ colortest(); return gq; }else\r
                if(q==11){ colorz(); delay(100); return gq; }\r
@@ -138,17 +138,17 @@ int ding(int q){
                }\r
                if((q<5 && gq<BONK) || (q==16 && gq<BONK)){ // the number variable make the colors more noticable\r
                                if(q==1){\r
-                                               if(xx==SW){bakax=0;}\r
+                                               if(xx==VW){bakax=0;}\r
                                                if(xx==0){bakax=1;}\r
-                                               if(yy==SH){bakay=0;}\r
+                                               if(yy==VH){bakay=0;}\r
                                                if(yy==0){bakay=1;}\r
                                }else if(q==3){\r
-                                               if(xx!=SW||yy!=SH){\r
+                                               if(xx!=VW||yy!=VH){\r
                                                                if(xx==0){bakax=1;bakay=-1;d3y=1;}\r
                                                                if(yy==0){bakax=1;bakay=0;d3y=1;}\r
-                                                               if(xx==SW){bakax=-1;bakay=-1;d3y=1;}\r
-                                                               if(yy==SH){bakax=1;bakay=0;d3y=1;}\r
-                                               }else if(xx==SW&&yy==SH) xx=yy=0;\r
+                                                               if(xx==VW){bakax=-1;bakay=-1;d3y=1;}\r
+                                                               if(yy==VH){bakax=1;bakay=0;d3y=1;}\r
+                                               }else if(xx==VW&&yy==VH) xx=yy=0;\r
                                }\r
                                if(q==3){\r
                                                if(d3y){\r
@@ -208,7 +208,7 @@ int ding(int q){
 //interesting effects\r
                                if(q==16)\r
                                {\r
-                               int tx=0,ty=0;\r
+                               short tx=0,ty=0;\r
                                tx+=xx+16;\r
                                ty+=yy+16;\r
                                mxPutPixel(tx, ty, coor);\r
@@ -225,8 +225,7 @@ int ding(int q){
                                if(q==2||q==4||q==16){ bakax = rand()%3; bakay = rand()%3; }  //random 3 switch\r
                                gq++;\r
 //if(xx<0||xx>320||yy<0||yy>(SH*3))\r
-//       printf("%d %d %d %d %d %d\n", xx, yy, coor, bakax, bakay, getPixel_X(xx,yy));\r
-//       printf("%d\n", getPixel_X(xx,yy));\r
+//       printf("%d %d %d %d %d\n", xx, yy, coor, bakax, bakay);\r
                }else gq = LGQ;\r
                return gq;\r
 }\r
@@ -244,12 +243,11 @@ int ding(int q){
 \r
 int main(void)\r
                {\r
-               int key,d,xpos,ypos,xdir,ydir;
+               short key,d,xpos,ypos,xdir,ydir;\r
                int ch=0x0;\r
-               //short int temp;\r
                // main variables\r
-               d=1; // switch variable\r
-               key=4; // default screensaver number\r
+               d=4; // switch variable\r
+               key=3; // default screensaver number\r
                xpos=0;\r
                ypos=0;\r
                xdir=1;\r
@@ -270,9 +268,9 @@ int main(void)
                                                setvideo(1);\r
                                }\r
                }*/ // else off\r
-               while(1){ // conditions of screen saver
+               while(1){ // conditions of screen saver\r
                while(!kbhit()){\r
-                       ding(key);
+                       ding(key);\r
                }\r
                //end of screen savers\r
                //doTest();\r
@@ -295,14 +293,14 @@ int main(void)
                        {\r
                                mxPutPixel(0, y, 15);\r
                                mxPutPixel(VW-1, y, 15);\r
-                       }
+                       }\r
                        \r
                getch();\r
-               //mxFillBox(xx, yy, QUADWH, QUADWH, 1, 16);
-               //mxFillBox(xx, yy, QUADWH, QUADWH, 2, 16);
-               //mxFillBox(xx, yy, QUADWH, QUADWH, 3, 16);
+               //mxFillBox(xx, yy, QUADWH, QUADWH, 1, 16);\r
+               //mxFillBox(xx, yy, QUADWH, QUADWH, 2, 16);\r
+               //mxFillBox(xx, yy, QUADWH, QUADWH, 3, 16);\r
                //mxFillBox(xx, yy, QUADWH, QUADWH, 4, 16);\r
-               mxSetTextColor(16, OP_TRANS);\r
+               mxSetTextColor(8, OP_TRANS);\r
                                mxOutText(56, SH-40, "CRAZY!!!!]");\r
                                mxOutText(64, SH-32, "CRAZY!!!!]");\r
                                mxOutText(64, SH-24, "____  CRAZY!!!!]");\r
@@ -318,18 +316,18 @@ int main(void)
                                //mxOutText(64, SH-40, "CRAZY!!!!");\r
                                //mxOutText(64, SH-32, "CRAZY!!!!");\r
                                //mxOutText(64, SH-24, "  _  CRAZY!!!!");\r
-                               //mxOutText(64, SH-16, "  _    _  CRAZY!!!!");
+                               //mxOutText(64, SH-16, "  _    _  CRAZY!!!!");\r
                                mxPan(xpos,ypos);\r
-                               for(int o = 0; o<TILEWH; o++){
+                               for(short o = 0; o<TILEWH; o++){\r
                                        xpos+=xdir;\r
-                                       ypos+=ydir;
-                                       //mxWaitRetrace();
+                                       ypos+=ydir;\r
+                                       //mxWaitRetrace();\r
                                }\r
                                if( (xpos>(VW-SW-1))  || (xpos<1)){xdir=-xdir;}\r
                                if( (ypos>(VH-SH-1)) || (ypos<1)){ydir=-ydir;} // { Hit a boundry, change\r
                        //    direction! }\r
-                       }
-                       ch=getch();
+                       }\r
+                       ch=getch();\r
                        if(ch==0x71)break; // 'q'\r
                        if(ch==0x1b)break; // 'ESC'\r
                }\r