X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16%2F16render.c;h=b70c7f19cdae73dbb29ccb53d7c0b9d6faf0c984;hb=84aee10629e5f04d34de5e4997e305cd2fd746cf;hp=89ba13dcd153e03375c64b27c692314ca2907d5c;hpb=b0905fc2339b98330b0891bcc153b8aea07784b4;p=16.git diff --git a/src/lib/modex16/16render.c b/src/lib/modex16/16render.c index 89ba13dc..b70c7f19 100755 --- a/src/lib/modex16/16render.c +++ b/src/lib/modex16/16render.c @@ -97,12 +97,13 @@ modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite) for(; y < py+p->height; y++) { //for(px=0; px < p->width; px++) { //printf("%02X ", (int) p->plane[plane][i++]); -// _fmemcpy(buff, &(p->plane[plane][i+=p->pwidth]), p->pwidth); -// printf("buff %u==%s\n", y, *buff); -// _fmemcpy(page->data + (((page->width/4) * (y+page->dy)) + ((x+page->dx) / 4)), buff, p->pwidth); +// _fmemcpy(buff, &(p->plane[plane][i+=p->pwidth]), p->pwidth); +// printf("buff %u==%s\n", y, *buff); +// _fmemcpy(page->data + (((page->width/4) * (y+page->dy)) + ((x+page->dx) / 4)), buff, p->pwidth); _fmemcpy(page->data + (((page->width/4) * y) + (x / 4)), &(p->plane[plane][i+=p->pwidth]), p->pwidth); //} } +//getch(); x=px; y=py; } @@ -287,10 +288,10 @@ void modexDrawBmpPBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp) { word poffset = (word) page->data + y*(page->width/4) + x/4; - byte *data = *bmp->plane;//+bmp->offset; + byte *data = bmp->plane[0]; word bmpOffset = (word) data + ry * bmp->width + rx; - word width = rw/4; - word height = rh/4; + 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; @@ -319,7 +320,17 @@ modexDrawBmpPBufRegion(page_t *page, int x, int y, ROW_LOOP: MOV CX, width ; count the columns SCAN_LOOP: + + + + + + + + + MOVSB ; copy the pixel + SUB CX, 3 ; we skip the next 3 ADD SI, 3 ; skip the bmp pixels LOOP SCAN_LOOP ; finish the scan @@ -332,6 +343,7 @@ modexDrawBmpPBufRegion(page_t *page, int x, int y, 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 @@ -354,10 +366,10 @@ void modexDrawSpritePBufRegion(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *bmp) { word poffset = (word)page->data + y*(page->width/4) + x/4; - byte *data = *bmp->plane;//+bmp->offset; + byte *data = bmp->plane[0]; word bmpOffset = (word) data + ry * bmp->width + rx; - word width = rw/4; - word height = rh/4; + 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;