From: sparky4 Date: Tue, 6 May 2014 00:53:17 +0000 (-0500) Subject: modified: 16/DOS_GFX.EXE X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=0b2d9832f450b45ba75103670ea4ef9e32828101;p=16.git modified: 16/DOS_GFX.EXE modified: 16/Project 16.bfproject modified: 16/dos_gfx.cpp modified: 16/dos_gfx.h --- diff --git a/16/DOS_GFX.EXE b/16/DOS_GFX.EXE index fb077d12..6d51a853 100644 Binary files a/16/DOS_GFX.EXE and b/16/DOS_GFX.EXE differ diff --git a/16/Project 16.bfproject b/16/Project 16.bfproject index 3410d4ff..b84f90b0 100644 --- a/16/Project 16.bfproject +++ b/16/Project 16.bfproject @@ -1,22 +1,22 @@ c2e.convert_special: 0 e2c.convert_num: 0 -openfiles: /dos/z/16/16/dos_gfx.cpp:8341:8024:0: -openfiles: /dos/z/16/16/dos_gfx.h:941:208:0: -openfiles: /dos/z/16/16/dos_kb.c:759:642:0: -openfiles: /dos/z/16/16/dos_kb.h:179:0:0: -openfiles: /dos/z/16/16/lib_com.cpp:164:0:0: +openfiles: /dos/z/16/16/dos_gfx.cpp:0:0:1: +openfiles: /dos/z/16/16/dos_gfx.h:0:0:0: +openfiles: /dos/z/16/16/dos_kb.c:0:0:0: +openfiles: /dos/z/16/16/dos_kb.h:0:0:0: +openfiles: /dos/z/16/16/lib_com.cpp:0:0:0: openfiles: /dos/z/16/16/lib_com.h:0:0:0: openfiles: /dos/z/16/16/16.txt:0:0:0: -openfiles: /dos/z/16/16/project16.txt:1755:1676:0: +openfiles: /dos/z/16/16/project16.txt:0:0:0: openfiles: /dos/z/4x4_16/sauce/jstick.h:0:0:0: -openfiles: /dos/z/4x4_16/sauce/keydrv.h:0:601:0: -openfiles: /dos/z/4x4_16/sauce/sprite.h:590:35:0: -openfiles: /dos/z/4x4_16/sauce/tile.h:327:173:0: +openfiles: /dos/z/4x4_16/sauce/keydrv.h:0:0:0: +openfiles: /dos/z/4x4_16/sauce/sprite.h:0:0:0: +openfiles: /dos/z/4x4_16/sauce/tile.h:0:0:0: openfiles: /dos/z/4x4_16/sauce/vgabuff.h:0:0:0: openfiles: /dos/z/4x4_16/sauce/vgautils.h:0:0:0: openfiles: /dos/z/4x4_16/sauce/keydrv.c:0:0:0: openfiles: /dos/z/4x4_16/sauce/sprite.c:0:0:0: -openfiles: /dos/z/4x4_16/sauce/tile.c:304:55:1: +openfiles: /dos/z/4x4_16/sauce/tile.c:0:0:0: openfiles: /dos/z/4x4_16/sauce/vgabuff.c:0:0:0: openfiles: /dos/z/4x4_16/sauce/vgautils.c:0:0:0: snr_recursion_level: 0 @@ -105,7 +105,7 @@ searchlist: rect`- searchlist: fill_plane( searchlist: fmemset searchlist: se -searchlist: +searchlist: searchlist: rect searchlist: fmem searchlist: vga diff --git a/16/dos_gfx.cpp b/16/dos_gfx.cpp index e5e4c6ed..e3ab1efa 100644 --- a/16/dos_gfx.cpp +++ b/16/dos_gfx.cpp @@ -245,68 +245,20 @@ void set320x240x256_X(void) /*tile*/ -// This is Bresenham's Line Drawing Algorithm -void drawline(int x1, int y1, int x2, int y2, char col) -{ - int d, x, y, ax, ay, sx, sy, dx, dy; - - dx = x2-x1; - ax = ABS(dx) << 1; - sx = SGN(dx); - dy = y2-y1; - ay = ABS(dy) << 1; - sy = SGN(dy); - - x = x1; - y = y1; - if( ax > ay ) - { - d = ay - (ax >> 1); - while( x != x2 ) - { - putPixel_X( x, y, col ); - if( d >= 0 ) - { - y += sy; - d -= ax; - } - x += sx; - d += ay; - } - } - else - { - d = ax - (ay >> 1); - while( y != y2 ) - { - putPixel_X( x, y, col ); - if( d >= 0 ) - { - x += sx; - d -= ay; - } - y += sy; - d += ax; - } - } - return; -} - -void drawrect(int x1, int y1, int x2, int y2, char color) -{ - drawline(x1,y1,x2,y1,color); - drawline(x1,y2,x2,y2,color); - drawline(x1,y1,x1,y2,color); - drawline(x2,y1,x2,y2+1,color); - /*byte far *p; - - p=vga+y1*width+x1; // make p point to the start of the line - while((y2-y1)) // repeat for entire line height - { - _fmemset(vga, color, x2-x1); // set one line - p+=width; // move down one row - }*/ -} +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