page_t result;\r
\r
result.data = p->data + (p->pagesize);\r
- result.dx = 0;\r
- result.dy = 0;\r
+ result.dx = p->dx; // not used anymore we use page[0].dx\r
+ result.dy = p->dy; // not used anymore we use page[0].dy\r
result.sw = p->sw;\r
result.sh = p->sh;\r
result.width = p->width;\r
page_t result;\r
\r
result.data = p->data + (p->pagesize); /* compute the offset */\r
- result.dx = 0;\r
- result.dy = 0;\r
+ result.dx = 0; // not used anymore we use page[0].dx\r
+ result.dy = 0; // not used anymore we use page[0].dy\r
result.sw = x;\r
result.sh = y;\r
result.width = x;\r
video->r=1;\r
\r
//setup the buffersize\r
- video->page[0].dy=video->page[0].dx=\r
- video->page[1].dx=video->page[1].dy=TILEWH; // 1 tile size buffer\r
+ video->page[0].dy=video->page[0].dx=TILEWH;\r
+ /* video->page[1].dx=video->page[1].dy=TILEWH; // 1 tile size buffer\r
video->page[2].dx=video->page[2].dy=\r
- video->page[3].dx=video->page[3].dy=0; // cache pages are buffer wwww\r
+ video->page[3].dx=video->page[3].dy=0; */// cache pages are buffer wwww\r
}\r
\r
//\r
\r
/* calculate offset */\r
offset = (word) page->data;\r
- offset += page->dy * (page->width >> 2 );\r
- offset += page->dx >> 2;\r
+ offset += page[0].dy * (page->width >> 2 );\r
+ offset += page[0].dx >> 2;\r
\r
/* calculate crtcOffset according to virtual width */\r
crtcOffset = page->width >> 3;\r
\r
/* do PEL panning here */\r
outp(AC_INDEX, 0x33);\r
- outp(AC_INDEX, (page->dx & 0x03) << 1);\r
+ outp(AC_INDEX, (page[0].dx & 0x03) << 1);\r
}\r
\r
//\r
\r
/* calculate offset */\r
offset = (word) page->data;\r
- offset += page->dy * (page->width >> 2 );\r
- offset += page->dx >> 2;\r
+ offset += page[0].dy * (page->width >> 2 );\r
+ offset += page[0].dx >> 2;\r
\r
/* calculate crtcOffset according to virtual width */\r
crtcOffset = page->sw >> 3;\r
\r
/* do PEL panning here */\r
outp(AC_INDEX, 0x33);\r
- outp(AC_INDEX, (page->dx & 0x03) << 1);\r
+ outp(AC_INDEX, (page[0].dx & 0x03) << 1);\r
}\r
\r
void\r
\r
/* calculate offset */\r
offset = (word) page->data;\r
- offset += page->dy * (page->width >> 2 );\r
- offset += page->dx >> 2;\r
+ offset += page[0].dy * (page->width >> 2 );\r
+ offset += page[0].dx >> 2;\r
\r
/* calculate crtcOffset according to virtual width */\r
crtcOffset = page->width >> 3;\r
\r
/* do PEL panning here */\r
outp(AC_INDEX, 0x33);\r
- outp(AC_INDEX, (page->dx & 0x03) << 1);\r
+ outp(AC_INDEX, (page[0].dx & 0x03) << 1);\r
}\r
\r
void\r
modexPanPage(page_t *page, int dx, int dy) {\r
- page->dx = dx;\r
- page->dy = dy;\r
+ page[0].dx = dx;\r
+ page[0].dy = dy;\r
}\r
\r
void\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dx+=4;\r
+ pip[pip[0].pan->pn].page[0].dx+=4;\r
modexShowPage(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].tx++; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dx-=4;\r
+ pip[pip[0].pan->pn].page[0].dx-=4;\r
modexShowPage(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].tx--; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dy+=4;\r
+ pip[pip[0].pan->pn].page[0].dy+=4;\r
modexShowPage(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].ty++; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dy-=4;\r
+ pip[pip[0].pan->pn].page[0].dy-=4;\r
modexShowPage(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].ty--; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dx+=4;\r
+ pip[pip[0].pan->pn].page[0].dx+=4;\r
modexShowPageVsync(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].tx++; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dx-=4;\r
+ pip[pip[0].pan->pn].page[0].dx-=4;\r
modexShowPageVsync(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].tx--; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dy+=4;\r
+ pip[pip[0].pan->pn].page[0].dy+=4;\r
modexShowPageVsync(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].ty++; }\r
{\r
if(player[pn].q<=player[pn].spt)\r
{\r
- pip[pip[0].pan->pn].page->dy-=4;\r
+ pip[pip[0].pan->pn].page[0].dy-=4;\r
modexShowPageVsync(pip[pip[0].pan->pn].page);\r
player[pn].q++;\r
} else { player[pn].q = 1; player[pn].d = 2; pip[pip[0].pan->pn].ty--; }\r
*/\r
void modexMVSetup(map_view_t *mv, map_t *map, pan_t *pan, global_game_variables_t *gv)\r
{\r
- word i;\r
+ byte i;\r
// 1st page\r
mv[0].page = &gv->video.page[0];\r
mv[0].map = map;\r
word x;//, y; /* coordinate for drawing */\r
\r
/* increment the pixel position and update the page */\r
- mv[id].page->dx += player[plid].speed;\r
+ mv[id].page[0].dx += player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dx >= mv[id].dxThresh )\r
+ if(mv[id].page[0].dx >= mv[id].dxThresh )\r
{\r
/* go forward one tile */\r
mv[id].tx++;\r
/* Snap the origin forward */\r
mv[id].page->data += 4;\r
\r
- mv[id].page->dx = mv[id].map->tiles->tileWidth;\r
+ mv[id].page[0].dx = mv[id].map->tiles->tileWidth;\r
}\r
\r
/* draw the next column */\r
x= mv[0].page->sw + mv[id].map->tiles->tileWidth;\r
if(player[plid].q%4)\r
if(id==0)\r
- mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page->dx);\r
+ mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page[0].dx);\r
else\r
if(!pageflipflop && !pageploop)\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->th+2));\r
word x;//,y; /* coordinate for drawing */\r
\r
/* decrement the pixel position and update the page */\r
- mv[id].page->dx -= player[plid].speed;\r
+ mv[id].page[0].dx -= player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dx == 0)\r
+ if(mv[id].page[0].dx == 0)\r
{\r
/* go backward one tile */\r
mv[id].tx--;\r
/* Snap the origin backward */\r
mv[id].page->data -= 4;\r
\r
- mv[id].page->dx = mv[id].map->tiles->tileWidth;\r
+ mv[id].page[0].dx = mv[id].map->tiles->tileWidth;\r
}\r
\r
/* draw the next column */\r
x= 0;\r
if(player[plid].q%4)\r
if(id==0)\r
- mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page->dx);\r
+ mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page[0].dx);\r
else\r
if(!pageflipflop && !pageploop)\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->th+2));\r
word y;//x, /* coordinate for drawing */\r
\r
/* decrement the pixel position and update the page */\r
- mv[id].page->dy -= player[plid].speed;\r
+ mv[id].page[0].dy -= player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dy == 0 )\r
+ if(mv[id].page[0].dy == 0 )\r
{\r
/* go down one tile */\r
mv[id].ty--;\r
/* Snap the origin downward */\r
mv[id].page->data -= mv[id].page->pi;\r
\r
- mv[id].page->dy = mv[id].map->tiles->tileHeight;\r
+ mv[id].page[0].dy = mv[id].map->tiles->tileHeight;\r
}\r
\r
/* draw the next row */\r
y= 0;\r
if(player[plid].q%3)\r
if(id==0)\r
- mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page->dy);\r
+ mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page[0].dy);\r
else\r
if(!pageflipflop && !pageploop)\r
modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tw+2), mv[id].map->tiles->tileHeight);\r
word y;//x, /* coordinate for drawing */\r
\r
/* increment the pixel position and update the page */\r
- mv[id].page->dy += player[plid].speed;\r
+ mv[id].page[0].dy += player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dy >= mv[id].dyThresh )\r
+ if(mv[id].page[0].dy >= mv[id].dyThresh )\r
{\r
/* go down one tile */\r
mv[id].ty++;\r
/* Snap the origin downward */\r
mv[id].page->data += mv[id].page->pi;\r
\r
- mv[id].page->dy = mv[id].map->tiles->tileHeight;\r
+ mv[id].page[0].dy = mv[id].map->tiles->tileHeight;\r
}\r
\r
/* draw the next row */\r
y= mv[0].page->sh + mv[id].map->tiles->tileHeight;\r
if(player[plid].q%3)\r
if(id==0)\r
- mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page->dy);\r
+ mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page[0].dy);\r
else\r
if(!pageflipflop && !pageploop)\r
modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*(mv[0].page->tw+2), mv[id].map->tiles->tileHeight);\r
void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* increment the pixel position and update the page */\r
- mv[id].page->dx += player[plid].speed;\r
+ mv[id].page[0].dx += player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dx >= mv[0].dxThresh )\r
+ if(mv[id].page[0].dx >= mv[0].dxThresh )\r
{\r
// vga_setup_wm1_block_copy();\r
// _fmemmove(mv[id].page->data+4, mv[id].page->data, mv[id].page->pagesize);\r
// vga_restore_rm0wm0();\r
/* Snap the origin forward */\r
mv[id].page->data += 4;\r
- mv[id].page->dx = mv[0].map->tiles->tileWidth;\r
+ mv[id].page[0].dx = mv[0].map->tiles->tileWidth;\r
}\r
}\r
\r
void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* decrement the pixel position and update the page */\r
- mv[id].page->dx -= player[plid].speed;\r
+ mv[id].page[0].dx -= player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dx == 0)\r
+ if(mv[id].page[0].dx == 0)\r
{\r
// vga_setup_wm1_block_copy();\r
// _fmemmove(mv[id].page->data-4, mv[id].page->data, mv[id].page->pagesize);\r
// vga_restore_rm0wm0();\r
/* Snap the origin backward */\r
mv[id].page->data -= 4;\r
- mv[id].page->dx = mv[0].map->tiles->tileWidth;\r
+ mv[id].page[0].dx = mv[0].map->tiles->tileWidth;\r
}\r
}\r
\r
void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* decrement the pixel position and update the page */\r
- mv[id].page->dy -= player[plid].speed;\r
+ mv[id].page[0].dy -= player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dy == 0)\r
+ if(mv[id].page[0].dy == 0)\r
{\r
// vga_setup_wm1_block_copy();\r
// _fmemmove(mv[id].page->data-mv[id].page->pi, mv[id].page->data, mv[id].page->pagesize);\r
// vga_restore_rm0wm0();\r
/* Snap the origin backward */\r
mv[id].page->data -= mv[id].page->pi;\r
- mv[id].page->dy = mv[0].map->tiles->tileWidth;\r
+ mv[id].page[0].dy = mv[0].map->tiles->tileWidth;\r
}\r
}\r
\r
void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)\r
{\r
/* increment the pixel position and update the page */\r
- mv[id].page->dy += player[plid].speed;\r
+ mv[id].page[0].dy += player[plid].speed;\r
\r
/* check to see if this changes the tile */\r
- if(mv[id].page->dy >= mv[0].dxThresh )\r
+ if(mv[id].page[0].dy >= mv[0].dxThresh )\r
{\r
// vga_setup_wm1_block_copy();\r
// _fmemmove(mv[id].page->data+mv[id].page->pi, mv[id].page->data, mv[id].page->pagesize);\r
// vga_restore_rm0wm0();\r
/* Snap the origin forward */\r
mv[id].page->data += mv[id].page->pi;\r
- mv[id].page->dy = mv[0].map->tiles->tileWidth;\r
+ mv[id].page[0].dy = mv[0].map->tiles->tileWidth;\r
}\r
}\r
\r
/* set up the coordinates */\r
mv[0].tx = mv[1].tx = tx;\r
mv[0].ty = mv[1].ty = ty;\r
- mv[0].page->dx = mv[1].page->dx = mv[2].page->dx = mv[3].page->dx = mv->map->tiles->tileWidth;\r
- mv[0].page->dy = mv[1].page->dy = mv[2].page->dy = mv[3].page->dy = mv->map->tiles->tileHeight;\r
+ mv[0].page[0].dx = mv[1].page[0].dx = mv[2].page[0].dx = mv[3].page[0].dx = mv->map->tiles->tileWidth;\r
+ mv[0].page[0].dy = mv[1].page[0].dy = mv[2].page[0].dy = mv[3].page[0].dy = mv->map->tiles->tileHeight;\r
\r
/* set up the thresholds */\r
mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileWidth * 2;\r