//modexDrawBmpRegion (page_t *page, int x, int y, int rx, int ry, int rw, int rh, bitmap_t *bmp)\r
void modexDrawPBufRegion (page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *p, boolean sprite)\r
{\r
- sword plane;\r
+ word plane;\r
int i;\r
- const int px=x;//-page->dx;\r
- const int py=y;//-page->dy;\r
- #define PEEE ((rw)/4)-rx\r
- //-(rx/4)\r
- #define PEEEE ((p->pwidth)*(ry))\r
- //y=py;\r
- //x=px;\r
+ const int px=x+page->dx;\r
+ const int py=y+page->dy;\r
+ const int prw = rw/4;\r
+ rx+=1;\r
+ ry+=1;\r
+ #define PEEE rx-prw\r
+ #define PE (p->pwidth)\r
+ #define PEEEE (PE*(ry))\r
+ y=py;\r
+ x=px;\r
//printf("%d,%d p(%d,%d) r(%d,%d) rwh(%d,%d)\n", x, y, px, py, rx, ry, rw, rh);\r
for(plane=0; plane < 4; plane++) {\r
i=PEEE+PEEEE;\r
- //printf("PEEE=%d ", PEEE);\r
- //printf("PEEEE=%d ", PEEEE);\r
- //printf("i=%d\n", i);\r
- modexSelectPlane(PLANE(plane+x));\r
+ modexSelectPlane(PLANE(plane-1));\r
for(; y < py+rh; y++) {\r
//for(px=0; px < p->width; px++) {\r
//printf("%02X ", (int) p->plane[plane][i++]);\r
// _fmemcpy(buff, &(p->plane[plane][i+=p->pwidth]), p->pwidth);\r
// printf("buff %u==%s\n", y, *buff);\r
- _fmemcpy(page->data + (((page->width/4) * y) + (x / 4)), &(p->plane[plane][i+=p->pwidth]), (rw/4));\r
+ _fmemcpy(page->data + (((page->width/4) * (y)) + ((x) / 4)), &(p->plane[plane][i]), prw);\r
+ i+=PE;\r
//}\r
- //if(plane==3) IN_Ack();\r
}\r
- /*printf("y%d=%d ", plane, y);\r
- if(plane==3) printf("y%d=%d\n", plane, y);*/\r
x=px;\r
y=py;\r
}\r
void\r
modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite)\r
{\r
- int plane;\r
+ modexDrawPBufRegion (page, x, x, 0, 0, p->width, p->height, p, sprite);\r
+ /*\r
+ sword plane;\r
int i;\r
// byte near *buff;\r
const int px=x+page->dx;\r
x=px;\r
y=py;\r
}\r
-// _nfree(buff);\r
+// _nfree(buff);*/\r
}\r
\r
void\r
modexDrawPBuf (&gvar.video.page[0], 0, 0, &p, 0);\r
}\r
t3 = (*clockw-start) /18.2;\r
+getch();\r
for(i=0; i<100 ;i++) {\r
- //modexDrawPBufRegion (&gvar.video.page[0], 0, 0, 0+p.width, 0, p.width, p.height, &p, 0);\r
+ //(page_t *page, int x, int y, int rx, int ry, int rw, int rh, planar_buf_t *p, boolean sprite);\r
+ modexDrawPBufRegion (&gvar.video.page[0], p.width, 0, p.width-16, p.height-16, 16, 16, &p, 0);//(&gvar.video.page[0], 0, 0, 0+p.width, 0, p.width, p.height, &p, 0);\r
}\r
t4 = (*clockw-start) /18.2;\r
//++++ modexPalUpdate1(ptmp.palette);\r
//modexDrawBmpPBufRegion(&gvar.video.page[0], 64, 64, 48, 32, 24, 32, ptmp);\r
//modexDrawPBuf(&gvar.video.page[0], 64, 64, &ptmp, 0);\r
-getch();\r
while(!kbhit())\r
{\r
}\r