From: sparky4 Date: Tue, 27 Oct 2015 15:46:09 +0000 (-0500) Subject: added next function X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=490586ef0c0a9e48017dc869f38a87d65691697c;p=16.git added next function --- diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 4edc4c79..97b26de3 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -394,6 +394,49 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { } } +//TODO! +void +modexDrawPBufregion(page_t *page, int x, int y, int sx, int sy, int fx, int fy planar_buf_t *p, boolean sprite) +{ + int plane; + int px, py, i; +// byte near *buff; + px=x; + py=y; +// buff = _nmalloc(p->pwidth+1); + // TODO Make this fast. It's SLOOOOOOW +// for(plane=0; plane < 4; plane++) { +// i=0; +// modexSelectPlane(PLANE(plane+x)); +// for(px = plane; px < p->width; px+=4) { +// offset=px; +// for(py=0; pyheight/2; py++) { +// //SELECT_ALL_PLANES(); +// if(!sprite || p->plane[offset]) +// page->data = &(p->plane[offset][i++]); +// offset+=p->width; +// offset++; +// } +// } +// } + for(plane=0; plane < 4; plane++) { + i=0; + modexSelectPlane(PLANE(plane+x)); + 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(page->data + (((page->width/4) * (y+page->dy)) + ((x+page->dx) / 4)), &(p->plane[plane][i+=p->pwidth]), p->pwidth); + //} + } + x=px; + y=py; + } +// _nfree(buff); +} + void DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite) { diff --git a/src/lib/modex16.h b/src/lib/modex16.h index c7a40b7a..44df9810 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -70,6 +70,7 @@ void modexShowPage(page_t *page); 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 sx, int sy, int fx, int fy planar_buf_t *p, boolean sprite); void DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite); void oldDrawBmp(byte far* page, int x, int y, bitmap_t *bmp, byte sprite); //void CDrawBmp(byte far* vgamem, page_t* page, int x, int y, bitmap_t *bmp, byte sprite);