// render box bounds. y does not need modification, but x and width must be multiple of 4\r
if(!video->rss)\r
{\r
- if(!video->bgps)\r
- {\r
- if (x >= enti->overdraww) rx = (x - enti->overdraww) & (~3);\r
- else rx = -(video->page[0].dx);\r
- if (y >= enti->overdrawh) ry = (y - enti->overdrawh);\r
- else ry = -(video->page[0].dy);\r
- h = enti->spri->sprite_vrl_cont->vrl_header->height + enti->overdrawh + y - ry;\r
- w = (x + enti->spri->sprite_vrl_cont->vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
- if ((rx+w) > video->page[0].width) w = video->page[0].width-rx;\r
- if ((ry+h) > video->page[0].height) h = video->page[0].height-ry;\r
-\r
+ if (x >= enti->overdraww) rx = (x - enti->overdraww) & (~3);\r
+ else rx = -(video->page[0].dx);\r
+ if (y >= enti->overdrawh) ry = (y - enti->overdrawh);\r
+ else ry = -(video->page[0].dy);\r
+ h = enti->spri->sprite_vrl_cont->vrl_header->height + enti->overdrawh + y - ry;\r
+ w = (x + enti->spri->sprite_vrl_cont->vrl_header->width + (enti->overdraww*2) + 3 - rx) & (~3) - enti->overdraww;//round up\r
+ if ((rx+w) > video->page[0].width) w = video->page[0].width-rx;\r
+ if ((ry+h) > video->page[0].height) h = video->page[0].height-ry;\r
+\r
+ if(!video->bgps){\r
// block copy pattern to where we will draw the sprite\r
vga_setup_wm1_block_copy();\r
o2 = video->ofs.offscreen_ofs;\r
\r
// must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally\r
vga_restore_rm0wm0();\r
-\r
- // replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0)\r
- vga_state.vga_draw_stride = w >> 2;\r
- vga_state.vga_graphics_ram = omemptr + video->ofs.offscreen_ofs;\r
- }else{\r
- w=h=i=o=o2=0;\r
- modexCopyPageRegion(&video->page[2], &video->page[0], enti->x, enti->y, 0, 0, 24, 32);\r
}\r
+ // replace VGA stride with our own and mem ptr. then sprite rendering at this stage is just (0,0)\r
+ vga_state.vga_draw_stride = w >> 2;\r
+ vga_state.vga_graphics_ram = omemptr + video->ofs.offscreen_ofs;\r
}else{ rx=ry=w=h=0; vga_state.vga_graphics_ram = (VGA_RAM_PTR)video->page[0].data; }\r
vga_state.vga_draw_stride_limit = (video->page[0].width + 3 - x) >> 2;//round up\r
\r
#endif\r
if(!video->rss)\r
{\r
- if(!video->bgps)\r
- {\r
- // restore ptr\r
- vga_state.vga_graphics_ram = omemptr;\r
+ // restore ptr\r
+ vga_state.vga_graphics_ram = omemptr;\r
\r
+ if(!video->bgps){\r
// block copy to visible RAM from offscreen\r
vga_setup_wm1_block_copy();\r
o = video->ofs.offscreen_ofs; // source offscreen\r
for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += video->page[0].stridew) vga_wm1_mem_block_copy(o2,o,w >> 2);\r
// must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally\r
vga_restore_rm0wm0();\r
- }else{\r
- //modexCopyPageRegion(&video->page[0], &video->page[2], 0, 0, enti->x, enti->y, 24, 32);\r
}\r
}\r
// restore stride\r
ANIMATESPRIFUN(pip, player, pn, 2);\r
ScrollRight(pip, player, 3, pn);\r
ScrollRight(pip, player, 2, pn);\r
- mapScrollRight(pip, player, (pip[0].video->p), pn);\r
+ mapScrollRight(pip, player, (0), pn);\r
+ if(pip[0].video->bgps) mapScrollRight(pip, player, (1), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
} else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; }\r
ANIMATESPRIFUN(pip, player, pn, 2);\r
ScrollLeft(pip, player, 3, pn);\r
ScrollLeft(pip, player, 2, pn);\r
- mapScrollLeft(pip, player, (pip[0].video->p), pn);\r
+ mapScrollLeft(pip, player, (0), pn);\r
+ if(pip[0].video->bgps) mapScrollLeft(pip, player, (1), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
} else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; }\r
ANIMATESPRIFUN(pip, player, pn, 2);\r
ScrollDown(pip, player, 3, pn);\r
ScrollDown(pip, player, 2, pn);\r
- mapScrollDown(pip, player, (pip[0].video->p), pn);\r
+ mapScrollDown(pip, player, (0), pn);\r
+ if(pip[0].video->bgps) mapScrollDown(pip, player, (1), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
} else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; }\r
ANIMATESPRIFUN(pip, player, pn, 2);\r
ScrollUp(pip, player, 3, pn);\r
ScrollUp(pip, player, 2, pn);\r
- mapScrollUp(pip, player, (pip[0].video->p), pn);\r
+ mapScrollUp(pip, player, (0), pn);\r
+ if(pip[0].video->bgps) mapScrollUp(pip, player, (1), pn);\r
player[pn].enti.q++;\r
//0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;\r
} else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; }\r
ScrollRight(mv, player, id, plid);\r
\r
/* draw the next column */\r
- x= mv[0].page->sw + mv[id].map->tiles->tileWidth;\r
+ x= mv[0].page->sw + mv[0].map->tiles->tileWidth;\r
#ifndef FULLRCREND\r
if(player[plid].enti.q%4)\r
#else\r
if(player[plid].enti.q==4)\r
#endif\r
- if(id==0)\r
- mapDrawCol(&mv[0], mv[0].tx + mv[0].page->ti.tw, mv[0].ty-1, x, player, DRAWCOLNUM);\r
- else\r
- if(mv[0].video->bgps)\r
- modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->ti.th+2));\r
+// if(id==0)\r
+ mapDrawCol(&mv[id], mv[0].tx + mv[0].page->ti.tw, mv[0].ty-1, x, player, DRAWCOLNUM);\r
+// else\r
+// if(mv[0].video->bgps)\r
+// modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
mv[0].video->r=1;\r
}\r
\r
#else\r
if(player[plid].enti.q==4)\r
#endif\r
- if(id==0)\r
- mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, DRAWCOLNUM);\r
- else\r
- if(mv[0].video->bgps)\r
- modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*(mv[0].page->ti.th+2));\r
+// if(id==0)\r
+ mapDrawCol(&mv[id], mv[0].tx - 1, mv[0].ty-1, x, player, DRAWCOLNUM);\r
+// else\r
+// if(mv[0].video->bgps)\r
+// modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height);\r
mv[0].video->r=1;\r
}\r
\r
#else\r
if(player[plid].enti.q==4)\r
#endif\r
- if(id==0)\r
- mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, DRAWCOLNUM);\r
- else\r
- if(mv[0].video->bgps)\r
- modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->ti.tw+2), mv[id].map->tiles->tileHeight);\r
+// if(id==0)\r
+ mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty-1, y, player, DRAWCOLNUM);\r
+// else\r
+// if(mv[0].video->bgps)\r
+// modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
mv[0].video->r=1;\r
}\r
\r
ScrollDown(mv, player, id, plid);\r
\r
/* draw the next row */\r
- y= mv[0].page->sh + mv[id].map->tiles->tileHeight;\r
+ y= mv[0].page->sh + mv[0].map->tiles->tileHeight;\r
#ifndef FULLRCREND\r
if(player[plid].enti.q%3)\r
#else\r
if(player[plid].enti.q==4)\r
#endif\r
- if(id==0)\r
- mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWCOLNUM);\r
- else\r
- if(mv[0].video->bgps)\r
- modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->ti.tw+2), mv[id].map->tiles->tileHeight);\r
+// if(id==0)\r
+ mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWCOLNUM);\r
+// else\r
+// if(mv[0].video->bgps)\r
+// modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight);\r
mv[0].video->r=1;\r
}\r
\r
i=mv[0].ty * mv[0].map->width + mv[0].tx;\r
for(ty=mv[0].ty-1; py < mv[0].page->sh+mv->dyThresh && ty < mv[0].map->height; ty++, py+=mv[0].map->tiles->tileHeight) {\r
mapDrawWRow(&mv[0], tx-1, ty, py);\r
- i+=mv->map->width - tx;\r
+ i+=mv->map->width - tx;\r
}\r
- if(mv[0].video->bgps) modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height);\r
-// modexCopyPageRegion(mv[3].page, mv[0].page, 0/**/, 0/**/, 0, 0, 24, 32);\r
+ py=0;\r
+ i=mv[1].ty * mv[1].map->width + mv[1].tx;\r
+ for(ty=mv[1].ty-1; py < mv[1].page->sh+mv->dyThresh && ty < mv[1].map->height; ty++, py+=mv[1].map->tiles->tileHeight) {\r
+ mapDrawWRow(&mv[1], tx-1, ty, py);\r
+ i+=mv->map->width - tx;\r
+ }\r
+ //if(mv[0].video->bgps) modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[0].page->width, mv[0].page->height);\r
}\r
\r
void ZC_mapinitMV(map_view_t *mv, int tx, int ty)\r
//render!!\r
if(gv->video.r )\r
{//r=1\r
- if(gv->video.bgps )\r
- {//bgps=1\r
- /*modexCopyPageRegion(&(gv->video.page[\r
- ]), &(gv->video.page[(\r
- ]), 0, 0, 0, 0, gv->video.page[\r
- ].width, gv->video.page[\r
- ].height);*/\r
+ /*if(video->bgp s)\r
+ {\r
+ modexCopyPageRegion(&(gv->video.page[ ]), &(gv->video.page[ ]), 0, 0, 0, 0, gv->video.page[ ].width, gv->video.page[ ].height);\r
}else{\r
//modexCopyPageRegion(&video->page[0], &video->page[1], enti->x, enti->y, 0, 0, 24, 32);\r
- }\r
+ }*/\r
VL_ShowPage(&(gv->video.page[gv->video.sp]), gv->kurokku.fpscap, 0);\r
gv->video.r =!gv->video.r ;\r
//0000gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2;\r
break;\r
}\r
\r
- if(pip[0].video->bgps) modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 36);\r
+// if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36);\r
// else{\r
// //copy old bg to page0\r
// //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0, 20, 36);\r
player[pn].enti.spri->x = x;\r
player[pn].enti.spri->y = y;\r
\r
+ if(pip[0].video->bgps)\r
+ modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 40);\r
//draw sprite\r
ZC_drawframe(pip, &player[pn].enti, x, y);\r
//0000if(player[pn].enti.q<2) delay(200);\r