From 1cc75f46d15728fed75f53a2243c9ad4c8234511 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 27 Oct 2015 18:29:00 -0500 Subject: [PATCH] going to work on this soon --- src/lib/modex16.c | 34 ++++++---------------------------- src/lib/modex16.h | 5 ++--- src/planrpcx.c | 2 +- 3 files changed, 9 insertions(+), 32 deletions(-) diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 97b26de3..9b47253e 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -395,8 +395,9 @@ 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) +//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) { int plane; int px, py, i; @@ -420,7 +421,7 @@ modexDrawPBufregion(page_t *page, int x, int y, int sx, int sy, int fx, int fy p // } // } for(plane=0; plane < 4; plane++) { - i=0; + i=(rx/4)+((rx/4)*ry); modexSelectPlane(PLANE(plane+x)); for(; y < py+p->height; y++) { //for(px=0; px < p->width; px++) { @@ -437,7 +438,7 @@ modexDrawPBufregion(page_t *page, int x, int y, int sx, int sy, int fx, int fy p // _nfree(buff); } -void +/*void DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite) { int plane; @@ -477,7 +478,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) @@ -500,29 +501,6 @@ 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) -{ - byte plane; - word px, py; - word offset=0; - - - /* TODO Make this fast. It's SLOOOOOOW */ - for(plane=0; plane < 4; plane++) { - modexSelectPlane(PLANE(plane+x)); - for(px = plane; px < bmp->width; px+=4) { - offset=px; - for(py=0; pyheight; py++) { - if(!sprite || bmp->data[offset]) - //modexputPixel(page, x+px, y+py, bmp->data[offset]); - vgamem[PAGE_OFFSET(x+px, y+py)] = bmp->data[offset]; - offset+=bmp->width; - } - } - } -} - void modexDrawBmp(page_t *page, int x, int y, bitmap_t *bmp) { /* draw the region (the entire freakin bitmap) */ diff --git a/src/lib/modex16.h b/src/lib/modex16.h index 44df9810..a0211213 100755 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -70,10 +70,9 @@ 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 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 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); 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); void modexDrawPlanarBuf(page_t *page, int x, int y, planar_buf_t *bmp); diff --git a/src/planrpcx.c b/src/planrpcx.c index 94b08bdb..9792a024 100755 --- a/src/planrpcx.c +++ b/src/planrpcx.c @@ -83,7 +83,7 @@ baka = 1; // t2 = (*clockw-start)/18.2; start = *clockw; for(i=0; i<100 ;i++) { - DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); + //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); } t2 = (*clockw-start) /18.2; while(!kbhit()) -- 2.39.5