X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=16%2Fdos_gfx.cpp;h=836382c80d4e324ceb5dee1ae36b6458455f6a9a;hb=426483a16b69f3d14aad1d9811c74af9976eddf2;hp=76ab683a93eba88210376c083c514c50a6e18522;hpb=3526f4364a2af89e5a7b651517c8f051e2419d0f;p=16.git diff --git a/16/dos_gfx.cpp b/16/dos_gfx.cpp index 76ab683a..836382c8 100644 --- a/16/dos_gfx.cpp +++ b/16/dos_gfx.cpp @@ -6,20 +6,20 @@ * * Simple graphics library to accompany the article * - * INTRODUCTION TO MODE X. + * INTRODUCTION TO MODE X. * * This library provides the basic functions for initializing and using * unchained (planar) 256-color VGA modes. Currently supported are: * - * - 320x200 - * - 320x240 + * - 320x200 + * - 320x240 * * Functions are provided for: * - * - initializing one of the available modes - * - setting the start address of the VGA refresh data - * - setting active and visible display pages - * - writing and reading a single pixel to/from video memory + * - initializing one of the available modes + * - setting the start address of the VGA refresh data + * - setting active and visible display pages + * - writing and reading a single pixel to/from video memory * * The library is provided as a demonstration only, and is not claimed * to be particularly efficient or suited for any purpose. It has only @@ -32,10 +32,12 @@ * Thanks go out to various helpful netters who spotted the 0xE7 bug * in the set320x240x256() function! * - * modified by sparky4 so it can be compiled in open watcom ^^ + * Modified by sparky4 so it can be compiled in open watcom ^^ */ + + /* * We 'require' a large data model simply to get rid of explicit 'far' * pointers and compiler specific '_fmemset()' functions and the likes. @@ -54,7 +56,8 @@ //code from old library! /*src\lib\*/ -#include "dos_gfx.h" +#include "dos_gfx.h" +#include "lib\x\modex.h" int old_mode; //color ‚Ä‚·‚Æ @@ -74,10 +77,10 @@ byte coor; /* * Define the port addresses of some VGA registers. */ -#define CRTC_ADDR 0x3d4 /* Base port of the CRT Controller (color) */ +#define CRTC_ADDR 0x3d4 /* Base port of the CRT Controller (color) */ -#define SEQU_ADDR 0x3c4 /* Base port of the Sequencer */ -#define GRAC_ADDR 0x3ce /* Base port of the Graphics Controller */ +#define SEQU_ADDR 0x3c4 /* Base port of the Sequencer */ +#define GRAC_ADDR 0x3ce /* Base port of the Graphics Controller */ /* @@ -103,56 +106,56 @@ unsigned actStart, visStart; /* * set320x200x256_X() - * sets mode 13h, then turns it into an unchained (planar), 4-page - * 320x200x256 mode. + * sets mode 13h, then turns it into an unchained (planar), 4-page + * 320x200x256 mode. */ void set320x200x256_X(void) - { - union REGS r; - - /* Set VGA BIOS mode 13h: */ - r.x.ax = 0x0013; - int86(0x10, &r, &r); - - /* Turn off the Chain-4 bit (bit 3 at index 4, port 0x3c4): */ - outpw(SEQU_ADDR, 0x0604); - - /* Turn off word mode, by setting the Mode Control register - of the CRT Controller (index 0x17, port 0x3d4): */ - outpw(CRTC_ADDR, 0xE317); - - /* Turn off doubleword mode, by setting the Underline Location - register (index 0x14, port 0x3d4): */ - outpw(CRTC_ADDR, 0x0014); - - /* Clear entire video memory, by selecting all four planes, then - writing 0 to entire segment. */ - outpw(SEQU_ADDR, 0x0F02); - memset(vga+1, 0, 0xffff); /* stupid size_t exactly 1 too small */ - vga[0] = 0; - - /* Update the global variables to reflect dimensions of this - mode. This is needed by most future drawing operations. */ - width = 320; - height = 200; - - /* Each byte addresses four pixels, so the width of a scan line - in *bytes* is one fourth of the number of pixels on a line. */ - widthBytes = width / 4; - - /* By default we want screen refreshing and drawing operations - to be based at offset 0 in the video segment. */ - actStart = visStart = 0; - } + { + union REGS r; + + /* Set VGA BIOS mode 13h: */ + r.x.ax = 0x0013; + int86(0x10, &r, &r); + + /* Turn off the Chain-4 bit (bit 3 at index 4, port 0x3c4): */ + outpw(SEQU_ADDR, 0x0604); + + /* Turn off word mode, by setting the Mode Control register + of the CRT Controller (index 0x17, port 0x3d4): */ + outpw(CRTC_ADDR, 0xE317); + + /* Turn off doubleword mode, by setting the Underline Location + register (index 0x14, port 0x3d4): */ + outpw(CRTC_ADDR, 0x0014); + + /* Clear entire video memory, by selecting all four planes, then + writing 0 to entire segment. */ + outpw(SEQU_ADDR, 0x0F02); + memset(vga+1, 0, 0xffff); /* stupid size_t exactly 1 too small */ + vga[0] = 0; + + /* Update the global variables to reflect dimensions of this + mode. This is needed by most future drawing operations. */ + width = 320; + height = 200; + + /* Each byte addresses four pixels, so the width of a scan line + in *bytes* is one fourth of the number of pixels on a line. */ + widthBytes = width / 4; + + /* By default we want screen refreshing and drawing operations + to be based at offset 0 in the video segment. */ + actStart = visStart = 0; + } /* * setActiveStart() tells our graphics operations which address in video * memory should be considered the top left corner. */ void setActiveStart(unsigned offset) - { - actStart = offset; - } + { + actStart = offset; + } /* * setVisibleStart() tells the VGA from which byte to fetch the first @@ -163,13 +166,13 @@ void setActiveStart(unsigned offset) * set, but before the low byte is set, which produces a bad flicker. */ void setVisibleStart(unsigned offset) - { - visStart = offset; - outpw(CRTC_ADDR, 0x0C); /* set high byte */ - outpw(CRTC_ADDR+1, visStart >> 8); - outpw(CRTC_ADDR, 0x0D); /* set low byte */ - outpw(CRTC_ADDR+1, visStart & 0xff); - } + { + visStart = offset; + outpw(CRTC_ADDR, 0x0C); /* set high byte */ + outpw(CRTC_ADDR+1, visStart >> 8); + outpw(CRTC_ADDR, 0x0D); /* set low byte */ + outpw(CRTC_ADDR+1, visStart & 0xff); + } /* * setXXXPage() sets the specified page by multiplying the page number @@ -178,71 +181,105 @@ void setVisibleStart(unsigned offset) * function. The first page is number 0. */ void setActivePage(int page) - { - setActiveStart(page * widthBytes * height); - } + { + setActiveStart(page * widthBytes * height); + } void setVisiblePage(int page) - { - setVisibleStart(page * widthBytes * height); - } + { + setVisibleStart(page * widthBytes * height); + } void putPixel_X(int x, int y, byte color) - { - /* Each address accesses four neighboring pixels, so set - Write Plane Enable according to which pixel we want - to modify. The plane is determined by the two least - significant bits of the x-coordinate: */ - outp(0x3c4, 0x02); - outp(0x3c5, 0x01 << (x & 3)); - - /* The offset of the pixel into the video segment is - offset = (width * y + x) / 4, and write the given - color to the plane we selected above. Heed the active - page start selection. */ - vga[(unsigned)(widthBytes * y) + (x / 4) + actStart] = color; + { + /* Each address accesses four neighboring pixels, so set + Write Plane Enable according to which pixel we want + to modify. The plane is determined by the two least + significant bits of the x-coordinate: */ + outp(0x3c4, 0x02); + outp(0x3c5, 0x01 << (x & 3)); + + /* The offset of the pixel into the video segment is + offset = (width * y + x) / 4, and write the given + color to the plane we selected above. Heed the active + page start selection. */ + vga[(unsigned)(widthBytes * y) + (x / 4) + actStart] = color; - } + } byte getPixel_X(int x, int y) - { - /* Select the plane from which we must read the pixel color: */ - outpw(GRAC_ADDR, 0x04); - outpw(GRAC_ADDR+1, x & 3); + { + /* Select the plane from which we must read the pixel color: */ + outpw(GRAC_ADDR, 0x04); + outpw(GRAC_ADDR+1, x & 3); - return vga[(unsigned)(widthBytes * y) + (x / 4) + actStart]; + return vga[(unsigned)(widthBytes * y) + (x / 4) + actStart]; - } + } void set320x240x256_X(void) - { - /* Set the unchained version of mode 13h: */ - set320x200x256_X(); - - /* Modify the vertical sync polarity bits in the Misc. Output - Register to achieve square aspect ratio: */ - outp(0x3C2, 0xE3); - - /* Modify the vertical timing registers to reflect the increased - vertical resolution, and to center the image as good as - possible: */ - outpw(0x3D4, 0x2C11); /* turn off write protect */ - outpw(0x3D4, 0x0D06); /* vertical total */ - outpw(0x3D4, 0x3E07); /* overflow register */ - outpw(0x3D4, 0xEA10); /* vertical retrace start */ - outpw(0x3D4, 0xAC11); /* vertical retrace end AND wr.prot */ - outpw(0x3D4, 0xDF12); /* vertical display enable end */ - outpw(0x3D4, 0xE715); /* start vertical blanking */ - outpw(0x3D4, 0x0616); /* end vertical blanking */ - - /* Update mode info, so future operations are aware of the - resolution */ - height = 240; + { + /* Set the unchained version of mode 13h: */ + set320x200x256_X(); + + /* Modify the vertical sync polarity bits in the Misc. Output + Register to achieve square aspect ratio: */ + outp(0x3C2, 0xE3); + + /* Modify the vertical timing registers to reflect the increased + vertical resolution, and to center the image as good as + possible: */ + outpw(0x3D4, 0x2C11); /* turn off write protect */ + outpw(0x3D4, 0x0D06); /* vertical total */ + outpw(0x3D4, 0x3E07); /* overflow register */ + outpw(0x3D4, 0xEA10); /* vertical retrace start */ + outpw(0x3D4, 0xAC11); /* vertical retrace end AND wr.prot */ + outpw(0x3D4, 0xDF12); /* vertical display enable end */ + outpw(0x3D4, 0xE715); /* start vertical blanking */ + outpw(0x3D4, 0x0616); /* end vertical blanking */ + + /* Update mode info, so future operations are aware of the + resolution */ + height = 240; - } + } /*-----------XXXX-------------*/ +/*tile*/ +void putColorBox_X(int x, int y, int w, int h, byte color) { + outp(0x3c4, 0x02); + + int curx, cury; + unsigned drawptr; + for (curx=x; curx<(x+w); curx++) { + outp(0x3c5, 0x01 << (curx & 3)); + drawptr = (unsigned)(widthBytes * y) + (curx / 4) + actStart; + for (cury=0; cury= (200 * 80) THEN OFFSET = 0 + DRAW TO ROW 200 + SET VGA OFFSET = OFFSET + DRAW TO ROW -1 (was row 0 before scroll) +END WHILE*//* +void scrolly(){ + int OFFSET = 0 + WHILE NOT FINISHED DO + OFFSET = OFFSET + 80 + IF OFFSET >= (240 * 80) THEN OFFSET = 0 + RAW TO ROW 240 + SET VGA OFFSET = OFFSET + DRAW TO ROW -1 (was row 0 before scroll) + } +} +*/ //--------------------------------------------------- // // Use the bios to get the address of the 8x8 font @@ -253,224 +290,256 @@ void set320x240x256_X(void) int far * getFont() { - union REGPACK rg; - int seg; - int off; - memset(&rg, 0, sizeof(rg)); - - rg.w.ax = 0x1130; - rg.h.bh = 0x03; - intr(0x10, &rg); - seg = rg.w.es; - off = rg.w.bp; - - - return (int far *)MK_FP(seg, off); + union REGPACK rg; + int seg; + int off; + memset(&rg, 0, sizeof(rg)); + + rg.w.ax = 0x1130; + rg.h.bh = 0x03; + intr(0x10, &rg); + seg = rg.w.es; + off = rg.w.bp; + + + return (int far *)MK_FP(seg, off); } void drawChar(int x, int y, int color, byte c) { - int i, j; - int mask; - int far *font = getFont() + (c * 8); - - for (i = 0; i < 8; i++) - { - mask = *font; - for (j = 0; j < 8; j++) + int i, j; + int mask; + int far *font = getFont() + (c * 8); + + for (i = 0; i < 8; i++) { - if (mask & 0x80) - { - //pixel(x + j, y + i, color); - putPixel_X(x + j, y + i, color); - } - mask <<= 1; + mask = *font; + for (j = 0; j < 8; j++) + { + if (mask & 0x80) + { + //pixel(x + j, y + i, color); + putPixel_X(x + j, y + i, color); + } + mask <<= 1; + } + font++; } - font++; - } } void drawText(int x, int y, int color, byte string) { - while (string) - { - drawChar(x, y, color, string); - x += 8; - string++; - } + while (string) + { + drawChar(x, y, color, string); + x += 8; + string++; + } } ///////////////////////////////////////////////////////////////////////////// // // -// setvideo() - This function Manages the video modes // +// setvideo() - This function Manages the video modes // // // ///////////////////////////////////////////////////////////////////////////// void setvideo(/*byte mode, */int vq){ - union REGS in, out; - - if(!vq){ // deinit the video - // change to the video mode we were in before we switched to mode 13h - in.h.ah = 0x00; - in.h.al = old_mode; - int86(0x10, &in, &out); - - }else if(vq == 1){ // init the video - // get old video mode - in.h.ah = 0xf; - int86(0x10, &in, &out); - old_mode = out.h.al; - - // enter mode - set320x240x256_X(); - } + union REGS in, out; + + if(!vq){ // deinit the video + // change to the video mode we were in before we switched to mode 13h + in.h.ah = 0x00; + in.h.al = old_mode; + int86(0x10, &in, &out); + + }else if(vq == 1){ // init the video + // get old video mode + in.h.ah = 0xf; + int86(0x10, &in, &out); + old_mode = out.h.al; + + // enter mode + set320x240x256_X(); + } } ///////////////////////////////////////////////////////////////////////////// -// // +// // // cls() - This clears the screen to the specified color, on the VGA or on // -// the Virtual screen. // -// // +// the Virtual screen. // +// // ///////////////////////////////////////////////////////////////////////////// void cls(byte color, byte *Where){ - _fmemset(Where, color, width*height); + _fmemset(Where, color, width*(height*17)); } //color ‚Ä‚·‚Æ int colortest(){ - if(gq < NUM_COLORS){ - cls(gq, vga); - gq++; - }else gq = 0; - return gq; + if(gq < NUM_COLORS){ + cls(gq, vga); + gq++; + }else gq = 0; + return gq; } //color ‚Ä‚·‚Æ int colorz(){ - if(gq < HGQ){ -//---- cls(gq, vaddr); - cls(gq, vga); - gq++; - }else gq = LGQ; - return gq; + if(gq < HGQ){ +//---- cls(gq, vaddr); + cls(gq, vga); + gq++; + }else gq = LGQ; + return gq; } //slow spectrum down void ssd(int svq){ - if(sy < height+1){ - if(sx < width+1){ - //plotpixel(xx, yy, coor, vga); - //ppf(sx, sy, coor, vga); - putPixel_X(sx, sy, coor); - //printf("%d %d %d %d\n", sx, sy, svq, coor); - sx++; - }else sx = 0; - if(sx == width){ - sy++; - if(svq == 7) coor++; - if(sy == height && svq == 8) coor = rand()%NUM_COLORS; - } - }else sy = 0; + if(sy < height+1){ + if(sx < width+1){ + //plotpixel(xx, yy, coor, vga); + //ppf(sx, sy, coor, vga); + putPixel_X(sx, sy, coor); + //printf("%d %d %d %d\n", sx, sy, svq, coor); + sx++; + }else sx = 0; + if(sx == width){ + sy++; + if(svq == 7) coor++; + if(sy == height && svq == 8) coor = rand()%NUM_COLORS; + } + }else sy = 0; } /*-----------ding-------------*/ int ding(int q){ - setActivePage(0); - setVisiblePage(0); - int d3y; - -//++++ if(q <= 4 && q!=2 && gq == BONK-1) coor = rand()%HGQ; - if((q == 2 - ||q==4 - ) && gq == BONK-1){ - if(coor < HGQ && coor < LGQ) coor = LGQ; - if(coor < HGQ-1){ - coor++; - }else{ coor = LGQ; - bakax = rand()%3; bakay = rand()%3; + setActivePage(0); + setVisiblePage(0); + int d3y; + +//++++ if(q <= 4 && q!=2 && gq == BONK-1) coor = rand()%HGQ; + if((q == 2 + ||q==4 + ||q==16 + ) && gq == BONK-1){ + if(coor < HGQ && coor < LGQ) coor = LGQ; + if(coor < HGQ){ + coor++; + }else{ coor = LGQ; + bakax = rand()%3; bakay = rand()%3; + } } - } - if(q == 5){ colortest(); return gq; } - if(q == 10){ colorz(); return gq; } - if(q == 11){ colorz(); delay(100); return gq; } - if(q == 8){ ssd(q); /*printf("%d\n", coor);*/ } - if(q == 6){ - coor = rand()%NUM_COLORS; -//---- cls(coor, vaddr); - cls(coor, vga); - //updatevbuff(); - } + if(q == 8){ colorz(); return gq; }else + if(q == 10){ ssd(q); /*printf("%d\n", coor);*/ }else + if(q == 5){ colortest(); return gq; }else + if(q == 11){ colorz(); delay(100); return gq; } + if(q == 6){ + coor = rand()%NUM_COLORS; +//---- cls(coor, vaddr); + cls(coor, vga); + //updatevbuff(); + } - if(q == 7 || q== 9){ - if(gq < HGQ){ - if(q == 7) ssd(q); - if(q == 9){ ssd(q); coor++; } - gq++; - }else gq = LGQ; - } - if(q<5 && gq0){ - yy++; - d3y--; + if((q<5 && gq0){ - xx++; - } - }else{ - if(!bakax){ - xx--; - }else if(bakax>1){ - xx++; - } - if(!bakay){ - yy--; - }else if(bakay>1){ - yy++; - } - } - // fixer - /*if(xx<0) xx=width; - if(yy<0) yy=height; - if(xx>width) xx=0; - if(yy>height) yy=0;*/ - - // plot the pixel -//---- ppf(xx, yy, coor, vga); - putPixel_X(xx, yy, coor); -//---- if(q==2) ppf(rand()%, rand()%height, 0, vga); - if(q==2) putPixel_X(rand()%width, rand()%height, 0); - if(q==2||q==4){ bakax = rand()%3; bakay = rand()%3; } - gq++; + if(q==3){ + if(d3y){ + if(bakay<0){ + yy--; + d3y--; + }else + if(bakay>0){ + yy++; + d3y--; + } + } + if(bakax<0){ + xx--; + }else + if(bakax>0){ + xx++; + } + }else{ + if(q==16) + { + if(!bakax){ + xx--;//=TILEWH; + }else if(bakax>0){ + xx++;//=TILEWH; + } + if(!bakay){ + yy--;//=TILEWH; + }else if(bakay>0){ + yy++;//=TILEWH; + } + }else{ + if(!bakax){ + xx-=TILEWH; + }else if(bakax>1){ + xx+=TILEWH; + } + if(!bakay){ + yy-=TILEWH; + }else if(bakay>1){ + yy+=TILEWH; + } + } + } + // fixer + //if(q!=16){ + if(xx<0) xx=width; + if(yy<0) yy=height; + if(xx>width) xx=0; + if(yy>height) yy=0; + //} + +//interesting effects + if(q==16) + { + int tx=0,ty=0; + tx+=xx+16; + ty+=yy+16; + putPixel_X(tx, ty, coor); + //drawrect(tx, ty, tx+TILEWH, ty+TILEWH, coor); + //printf("%d %d %d %d %d %d\n", xx, yy, tx, ty, TILEWH); + + // plot the pixel +//---- ppf(xx, yy, coor, vga); + }else if(xx>=0 && xx=0 && yy320||yy<0||yy>240) -// printf("%d %d %d %d %d %d\n", xx, yy, coor, bakax, bakay, getPixel_X(xx,yy)); -// printf("%d\n", getPixel_X(xx,yy)); +// printf("%d %d %d %d %d %d\n", xx, yy, coor, bakax, bakay, getPixel_X(xx,yy)); +// printf("%d\n", getPixel_X(xx,yy)); //0000 -// drawText(0, 0, 15, getPixel_X(xx,yy)); - }else gq = LGQ; - return gq; +// drawText(0, 0, 15, getPixel_X(xx,yy)); + }else gq = LGQ; + return gq; } @@ -485,103 +554,103 @@ int ding(int q){ #include void doTest(void) - { - int p, x, y, pages; + { + int p, x, y, pages; - /* This is the way to calculate the number of pages available. */ - pages = 65536L/(widthBytes*height); // apparently this takes the A000 address + /* This is the way to calculate the number of pages available. */ + pages = 65536L/(widthBytes*height); // apparently this takes the A000 address - printf("%d\n", pages); - - for (p = 0; p <= pages; ++p) - { - setActivePage(p); + printf("%d\n", pages); - /* On each page draw a single colored border, and dump the palette - onto a small square about the middle of the page. */ - - //{ - for (x = 0; x <= width; ++x) + for (p = 0; p <= pages; ++p) { - putPixel_X(x, 0, p+1); - if(p!=pages) putPixel_X(x, height-1, p+1); - else putPixel_X(x, 99-1, p+1); + setActivePage(p); + + /* On each page draw a single colored border, and dump the palette + onto a small square about the middle of the page. */ + + //{ + for (x = 0; x <= width; ++x) + { + putPixel_X(x, 0, p+1); + if(p!=pages) putPixel_X(x, height-1, p+1); + else putPixel_X(x, 99-1, p+1); + } + + for (y = 0; y <= height; ++y) + { + putPixel_X(0, y, p+1); + if(p!=pages) putPixel_X(width-1, y, p+1); + else putPixel_X(width-1, y, p+1); + } + + for (x = 0; x < 16; ++x) + for (y = 0; y < 16; ++y) + putPixel_X(x+(p+2)*16, y+(p+2)*16, x + y*16); + //} + + drawText(0, 0, 15, p); + } - for (y = 0; y <= height; ++y) + /* Each pages will now contain a different image. Let the user cycle + through all the pages by pressing a key. */ + for (p = 0; p <= pages; ++p) { - putPixel_X(0, y, p+1); - if(p!=pages) putPixel_X(width-1, y, p+1); - else putPixel_X(width-1, y, p+1); + setVisiblePage(p); + //drawText(0, 240, 15, "bakapi"); + getch(); } - for (x = 0; x < 16; ++x) - for (y = 0; y < 16; ++y) - putPixel_X(x+(p+2)*16, y+(p+2)*16, x + y*16); - //} - - drawText(0, 0, 15, p); - } - /* Each pages will now contain a different image. Let the user cycle - through all the pages by pressing a key. */ - for (p = 0; p <= pages; ++p) - { - setVisiblePage(p); - //drawText(0, 240, 15, "bakapi"); - getch(); - } - - } - /* * Library test (program) entry point. */ int main(void) - { - int key,d; - // main variables - d=1; // switch variable - key=4; // default screensaver number -// puts("First, have a look at the 320x200 mode. I will draw some rubbish"); -// puts("on all of the four pages, then let you cycle through them by"); -// puts("hitting a key on each page."); -// puts("Press a key when ready..."); -// getch(); - -// doTest(); - -// puts("Then, check out Mode X, 320x240 with 3 (and a half) pages."); -// puts("Press a key when ready..."); -// getch(); - - setvideo(1); + { + int key,d; + // main variables + d=1; // switch variable + key=4; // default screensaver number +// puts("First, have a look at the 320x200 mode. I will draw some rubbish"); +// puts("on all of the four pages, then let you cycle through them by"); +// puts("hitting a key on each page."); +// puts("Press a key when ready..."); +// getch(); + +// doTest(); + +// puts("Then, check out Mode X, 320x240 with 3 (and a half) pages."); +// puts("Press a key when ready..."); +// getch(); + + setvideo(1); // screen savers /*while(d!=0){ // on! - if(!kbhit()){ // conditions of screen saver - ding(key); - }else{ - setvideo(0); - // user imput switch - printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 5 to quit.\n", getch()); // prompt the user - scanf("%d", &key); - //if(key==3){xx=yy=0;} // crazy screen saver wwww - if(key==5) d=0; - setvideo(1); + if(!kbhit()){ // conditions of screen saver + ding(key); + }else{ + setvideo(0); + // user imput switch + printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 5 to quit.\n", getch()); // prompt the user + scanf("%d", &key); + //if(key==3){xx=yy=0;} // crazy screen saver wwww + if(key==5) d=0; + setvideo(1); + } + }*/ // else off + while(!kbhit()){ // conditions of screen saver + ding(4); + } + //end of screen savers + doTest(); + setvideo(0); + puts("Where to next? It's your move! wwww"); + printf("bakapi ver. 1.04.09.01\nis made by sparky4i†ƒÖ…j feel free to use it ^^\nLicence: GPL v2\n"); + return 0; } - }*/ // else off - while(!kbhit()){ // conditions of screen saver - ding(4); - } - //end of screen savers - doTest(); - setvideo(0); - puts("Where to next? It's your move! wwww"); - printf("bakapi ver. 1.04.09a\nis made by sparky4i†ƒÖ…j feel free to use it ^^\nLicence: GPL v2\n"); - return 0; - } #endif