]> 4ch.mooo.com Git - 16.git/commitdiff
made a new function modexMVSetup() and made scroller use dx and dy on page[0].dx...
authorsparky4 <sparky4@cock.li>
Tue, 10 Jan 2017 18:32:15 +0000 (12:32 -0600)
committersparky4 <sparky4@cock.li>
Tue, 10 Jan 2017 18:32:15 +0000 (12:32 -0600)
fontgfx.exe
maptest.exe
pcxtest.exe
src/lib/.16_vl.c.kate-swp [new file with mode: 0755]
src/lib/16_tdef.h
src/lib/16render.c
src/lib/scroll16.c
test.exe [new file with mode: 0755]

index 64936bb0dc0634714d23913ca20620dd4c115f04..eb0e3f8969aa1c2967b9a2d31dda1766dc074e7a 100755 (executable)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 19c50991213bb84f4200c0a58e682f942fb6027a..83410a9277dfb3cafe81146b207a6fa2ba201126 100755 (executable)
Binary files a/maptest.exe and b/maptest.exe differ
index f1a5d635f4e87c9fd1715f9fb5b0b0e845e3d708..3627f91625fac273fa59eaf47f256212a703b8e7 100755 (executable)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
diff --git a/src/lib/.16_vl.c.kate-swp b/src/lib/.16_vl.c.kate-swp
new file mode 100755 (executable)
index 0000000..b908d86
Binary files /dev/null and b/src/lib/.16_vl.c.kate-swp differ
index 101ad4754f50dbd0a2e2dc8b8eb92fabfbf23c61..fc9ccbea4add59a8cd476f9cdd0b28e95fcb6eb6 100755 (executable)
@@ -90,7 +90,7 @@ typedef struct {
 } map_t;\r
 \r
 typedef struct {\r
-       /*nibble*/word id;      /* the Identification number of the page~ For layering~ */\r
+       nibble/*word*/ id;      /* the Identification number of the page~ For layering~ */\r
        byte far* data; /* the data for the page */\r
        word dx;                /* col we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the left size */\r
        word dy;                /* row we are viewing on virtual screen (on page[0]) */ /* off screen buffer on the top size */\r
index 4118f17ee09718ad579e8f1f4b3f037fbb2c5604..1a8f81f6fd13af2f05922c3295bc6b7ecb6b3cab 100755 (executable)
@@ -33,8 +33,8 @@ void modexDrawPBufRegion      (page_t *page, int x, int y, int rx, int ry, int rw, in
 {\r
        word plane;\r
        int i;\r
-       const int px=x+page->dx;\r
-       const int py=y+page->dy;\r
+       const int px=x+page[0].dx;\r
+       const int py=y+page[0].dy;\r
        const int prw = rw/4;\r
        int prh;\r
 \r
@@ -72,8 +72,8 @@ modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite)
        sword plane;\r
        int i;\r
 //     byte near *buff;\r
-       const int px=x+page->dx;\r
-       const int py=y+page->dy;\r
+       const int px=x+page[0].dx;\r
+       const int py=y+page[0].dy;\r
        x=px;\r
        y=py;\r
 //     buff = _nmalloc(p->pwidth+1);\r
@@ -100,7 +100,7 @@ modexDrawPBuf(page_t *page, int x, int y, planar_buf_t *p, boolean sprite)
                                //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+page->dy)) + ((x+page->dx) / 4)), buff, p->pwidth);\r
+//                             _fmemcpy(page->data + (((page->width/4) * (y+page[0].dy)) + ((x+page[0].dx) / 4)), buff, p->pwidth);\r
                                _fmemcpy(page->data + (((page->width/4) * y) + (x / 4)), &(p->plane[plane][i+=p->pwidth]), p->pwidth);\r
                        //}\r
                }\r
index 7f4ff16d57934b9325926c6f4d31bb4c244f8a41..f338372bd674786231c196ef9724e85da99e89f3 100755 (executable)
@@ -224,7 +224,7 @@ void panPageManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dx+=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -237,7 +237,7 @@ void panPageManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dx-=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -250,7 +250,7 @@ void panPageManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dy+=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -263,7 +263,7 @@ void panPageManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dy-=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -284,7 +284,7 @@ void panVmemManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dx+=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -297,7 +297,7 @@ void panVmemManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dx-=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -310,7 +310,7 @@ void panVmemManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dy+=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -323,7 +323,7 @@ void panVmemManual(map_view_t *pip, player_t *player, word pn)
                        {\r
                                if(player[pn].q<=player[pn].spt)\r
                                {\r
-                                       pip[pip[0].pan->pn].page[0].dy-=4;\r
+                                       pip[pip[0].pan->pn].page->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
@@ -338,7 +338,7 @@ void panVmemManual(map_view_t *pip, player_t *player, word pn)
 */\r
 void modexMVSetup(map_view_t *mv, map_t *map, pan_t *pan, global_game_variables_t *gv)\r
 {\r
-       byte i;\r
+       nibble i;\r
        // 1st page\r
        mv[0].page = &gv->video.page[0];\r
        mv[0].map = map;\r
@@ -446,24 +446,24 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
        word x;//, y;  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv[id].page[0].dx += player[plid].speed;\r
+       mv[id].page->dx += player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dx >= mv[id].dxThresh )\r
+       if(mv[id].page->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[0].dx = mv[id].map->tiles->tileWidth;\r
+       mv[id].page->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[0].dx);\r
+                       mapDrawCol(&mv[0], mv[0].tx + mv[0].page->tw, mv[0].ty-1, x, player, mv->page->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
@@ -476,24 +476,24 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
        word x;//,y;  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
-       mv[id].page[0].dx -= player[plid].speed;\r
+       mv[id].page->dx -= player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dx == 0)\r
+       if(mv[id].page->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[0].dx = mv[id].map->tiles->tileWidth;\r
+       mv[id].page->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[0].dx);\r
+                       mapDrawCol(&mv[0], mv[0].tx - 1, mv[0].ty-1, x, player, mv->page->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
@@ -506,24 +506,24 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
        word y;//x,  /* coordinate for drawing */\r
 \r
        /* decrement the pixel position and update the page */\r
-       mv[id].page[0].dy -= player[plid].speed;\r
+       mv[id].page->dy -= player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dy == 0 )\r
+       if(mv[id].page->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[0].dy = mv[id].map->tiles->tileHeight;\r
+       mv[id].page->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[0].dy);\r
+                       mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty-1, y, player, mv->page->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
@@ -535,24 +535,24 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
        word y;//x,  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv[id].page[0].dy += player[plid].speed;\r
+       mv[id].page->dy += player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dy >= mv[id].dyThresh )\r
+       if(mv[id].page->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[0].dy = mv[id].map->tiles->tileHeight;\r
+       mv[id].page->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[0].dy);\r
+                       mapDrawRow(&mv[0], mv[0].tx - 1, mv[0].ty+mv[0].page->th, y, player, mv->page->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
@@ -564,68 +564,68 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 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[0].dx += player[plid].speed;\r
+       mv[id].page->dx += player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dx >= mv[0].dxThresh )\r
+       if(mv[id].page->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[0].dx = mv[0].map->tiles->tileWidth;\r
+               mv[id].page->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[0].dx -= player[plid].speed;\r
+       mv[id].page->dx -= player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dx == 0)\r
+       if(mv[id].page->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[0].dx = mv[0].map->tiles->tileWidth;\r
+               mv[id].page->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[0].dy -= player[plid].speed;\r
+       mv[id].page->dy -= player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dy == 0)\r
+       if(mv[id].page->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[0].dy = mv[0].map->tiles->tileWidth;\r
+               mv[id].page->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[0].dy += player[plid].speed;\r
+       mv[id].page->dy += player[plid].speed;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv[id].page[0].dy >= mv[0].dxThresh )\r
+       if(mv[id].page->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[0].dy = mv[0].map->tiles->tileWidth;\r
+               mv[id].page->dy = mv[0].map->tiles->tileWidth;\r
        }\r
 }\r
 \r
@@ -713,8 +713,8 @@ void mapinitmapview(map_view_t *mv, int tx, int ty)
        /* set up the coordinates */\r
        mv[0].tx = mv[1].tx = tx;\r
        mv[0].ty = mv[1].ty = ty;\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
+       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
 \r
        /* set up the thresholds */\r
        mv[0].dxThresh = mv[1].dxThresh = mv[2].dxThresh = mv[3].dxThresh = mv->map->tiles->tileWidth * 2;\r
diff --git a/test.exe b/test.exe
new file mode 100755 (executable)
index 0000000..06592e5
Binary files /dev/null and b/test.exe differ