X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fmodex16.c;h=97b26de3c03b182f0ab1cab6ea9dcccf21f0d115;hb=490586ef0c0a9e48017dc869f38a87d65691697c;hp=7dd523a96f07bdf9b04eb7eff62823c1b962a15d;hpb=c97a7b2245f9f8ab913efcd2741a0b280e6baa83;p=16.git diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 7dd523a9..97b26de3 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -394,13 +394,55 @@ modexClearRegion(page_t *page, int x, int y, int w, int h, byte color) { } } +//TODO! void -DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite) +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) +{ + int plane; + int px, py, i; +// byte near *buff; px=x; py=y; // buff = _nmalloc(p->pwidth+1); @@ -1278,6 +1320,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons word addr = (word) l; word chw=0; byte c; + //byte near *bakapee; switch(t) { @@ -1330,9 +1373,14 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons DEC CX JNZ L1 } - + //bakapee = _nmalloc(sizeof(byte)*8); +//TODO: OPTIMIZE THIS!!!! for(i=0; idata + (((page->width/4) * (y+page->dy+i)) + ((x+page->dx+chw) / 4)), bakapee, 8);*/ j=1<<8; xp=0; while(j) @@ -1344,6 +1392,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons } chw += xp; } + //_nfree(bakapee); } void modexprintbig(page_t *page, word x, word y, word t, word col, word bgcol, const byte *str)