From: sparky4 Date: Wed, 28 Oct 2015 04:10:35 +0000 (-0500) Subject: wwww X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=58374e61c1d73c2151fd67adcb570f8d95c6e45e;p=16.git wwww --- diff --git a/16.exe b/16.exe index 55ee7f7c..0927fe1f 100755 Binary files a/16.exe and b/16.exe differ diff --git a/bakapi.exe b/bakapi.exe index 8a860a99..466745c8 100755 Binary files a/bakapi.exe and b/bakapi.exe differ diff --git a/exmmtest.exe b/exmmtest.exe index df6852a7..9c5f0558 100755 Binary files a/exmmtest.exe and b/exmmtest.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index 075cab20..49039750 100755 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/maptest.exe b/maptest.exe index 46ae0232..76efbe59 100755 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index 4afbc334..c1a30ac5 100755 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/palettel.exe b/palettel.exe index ad9fc26f..9dc86ef6 100755 Binary files a/palettel.exe and b/palettel.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index fcd37c80..01b317fe 100755 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/pcxtest2.exe b/pcxtest2.exe index c8dbaa5c..4e01e76c 100755 Binary files a/pcxtest2.exe and b/pcxtest2.exe differ diff --git a/planrpcx.exe b/planrpcx.exe index a030050d..8a996516 100755 Binary files a/planrpcx.exe and b/planrpcx.exe differ diff --git a/scroll.exe b/scroll.exe index c8f6cb5d..48acb928 100755 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 5cec70c9..e77d5c1b 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -395,6 +395,7 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { } //TODO! ADD CLIPPING!! +//memory management needs to be added //void //modexDrawBmpRegion (page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp) void modexDrawPBufRegion (page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *p, boolean sprite) @@ -438,7 +439,8 @@ void modexDrawPBufRegion (page_t *page, int x, int y, int rx, int ry, int rw, in // _nfree(buff); } -/*void +/*temp*/ +void DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite) { int plane; @@ -478,7 +480,7 @@ DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite) y=py; } // _nfree(buff); -}*/ +} void oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite) @@ -574,100 +576,17 @@ modexDrawBmpRegion(page_t *page, int x, int y, } } -void -modexDrawPlanarBuf(page_t *page, int x, int y, planar_buf_t *bmp) { - /* TODO - adapt from test code */ - int plane; - for(plane=0; plane < 4; plane++) - { - //fack - } -} - - void modexDrawSprite(page_t *page, int x, int y, bitmap_t *bmp) { /* draw the whole sprite */ modexDrawSpriteRegion(page, x, y, 0, 0, bmp->width, bmp->height, bmp); } -/*void -modexDrawSpriteRegion(page_t *page, int x, int y, - int rx, int ry, int rw, int rh, bitmap_t *bmp) { - word poffset = (word)page->data + y*(page->width/4) + x/4; - byte *data = bmp->data;//+bmp->offset; - word bmpOffset = (word) data + ry * bmp->width + rx; - word width = rw; - word height = rh; - byte plane = 1 << ((byte) x & 0x03); - word scanCount = width/4 + (width%4 ? 1 :0); - word nextPageRow = page->width/4 - scanCount; - word nextBmpRow = (word) bmp->width - width; - word rowCounter; - byte planeCounter = 4; - - __asm { - MOV AX, SCREEN_SEG ; go to the VGA memory - MOV ES, AX - - MOV DX, SC_INDEX ; point at the map mask register - MOV AL, MAP_MASK ; - OUT DX, AL ; - - PLANE_LOOP: - MOV DX, SC_DATA ; select the current plane - MOV AL, plane ; - OUT DX, AL ; - - ;-- begin plane painting - MOV AX, height ; start the row counter - MOV rowCounter, AX ; - MOV DI, poffset ; go to the first pixel - MOV SI, bmpOffset ; go to the bmp pixel - ROW_LOOP: - MOV CX, width ; count the columns - SCAN_LOOP: - LODSB - DEC SI - CMP AL, 0 - JNE DRAW_PIXEL ; draw non-zero pixels - - INC DI ; skip the transparent pixel - ADD SI, 1 - JMP NEXT_PIXEL - DRAW_PIXEL: - MOVSB ; copy the pixel - NEXT_PIXEL: - SUB CX, 3 ; we skip the next 3 - ADD SI, 3 ; skip the bmp pixels - LOOP SCAN_LOOP ; finish the scan - - MOV AX, nextPageRow - ADD DI, AX ; go to the next row on screen - MOV AX, nextBmpRow - ADD SI, AX ; go to the next row on bmp - - DEC rowCounter - JNZ ROW_LOOP ; do all the rows - ;-- end plane painting - - MOV AL, plane ; advance to the next plane - SHL AL, 1 ; - AND AL, 0x0f ; mask the plane properly - MOV plane, AL ; store the plane - - INC bmpOffset ; start bmp at the right spot - - DEC planeCounter - JNZ PLANE_LOOP ; do all 4 planes - } -}//backup!*/ - void modexDrawSpriteRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp) { word poffset = (word)page->data + y*(page->width/4) + x/4; - byte huge *data = bmp->data;//+bmp->offset; + byte *data = bmp->data;//+bmp->offset; word bmpOffset = (word) data + ry * bmp->width + rx; word width = rw; word height = rh; diff --git a/src/lib/modex16.h b/src/lib/modex16.h index a0211213..5b0d82b0 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -71,7 +71,7 @@ void modexPanPage(page_t *page, int dx, int dy); void modexSelectPlane(byte plane); void modexClearRegion(page_t *page, int x, int y, int w, int h, byte color); void modexDrawPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *p, boolean sprite); -void modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite); +void modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite); /*temp*/ void oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite); void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp); void modexDrawBmpRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp); diff --git a/test.exe b/test.exe index 509de694..18b670ef 100755 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 9d9fa280..7bb49f12 100755 Binary files a/test2.exe and b/test2.exe differ