]> 4ch.mooo.com Git - 16.git/commitdiff
gvar.video.page[1].pattern_ofs removed because it is just (0x10000UL - (uint16_t...
authorsparky4 <sparky4@cock.li>
Tue, 28 Jun 2016 14:46:42 +0000 (09:46 -0500)
committersparky4 <sparky4@cock.li>
Tue, 28 Jun 2016 14:46:42 +0000 (09:46 -0500)
0.l16
src/0.c
src/lib/modex16.c
src/lib/scroll16.c
src/lib/typdefst.h

diff --git a/0.l16 b/0.l16
index cd0a3e5b0022f3907f347b20962a290235e4ee6c..1057f7fa47c2ca89039cb97379f0d96f0f4b964c 100755 (executable)
--- a/0.l16
+++ b/0.l16
@@ -1 +1 @@
-23936  40960\r
+41600\r
diff --git a/src/0.c b/src/0.c
index 5e50c2fcb2627066ebd468910f771b1cac568921..31da3feb56a836f197bed0750fafa7db5f9c2c49 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -115,7 +115,7 @@ int main(int argc,char **argv) {
                //4     this dose the sprite? wwww
                /* fill pattern offset with a distinctive pattern */
                for (i=0;i < gvar.video.page[0].width;i++) {
-                       o = (i >> 2) + gvar.video.page[1].pattern_ofs;
+                       o = (i >> 2) + (0x10000UL - (uint16_t)gvar.video.page[1].data);
                        vga_write_sequencer(0x02/*map mask*/,1 << (i&3));
                        for (j=0;j < VMEMHEIGHT;j++,o += gvar.video.page[0].stridew)
                                vga_state.vga_graphics_ram[o] = (i^j)&15; // VRL samples put all colors in first 15!
@@ -146,7 +146,7 @@ int main(int argc,char **argv) {
                        /* block copy pattern to where we will draw the sprite */
                        vga_setup_wm1_block_copy();
                        o2 = gvar.video.page[0].pagesize;
-                       o = gvar.video.page[1].pattern_ofs + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen
+                       o = (0x10000UL - (uint16_t)gvar.video.page[1].data) + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen
                        for (i=0;i < h;i++,o += gvar.video.page[0].stridew,o2 += (w >> 2)) vga_wm1_mem_block_copy(o2,o,w >> 2);
                        /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */
                        vga_restore_rm0wm0();
@@ -279,7 +279,7 @@ int main(int argc,char **argv) {
                }
        }
 //uint16_t
-       printf("%u      %u\n", (gvar.video.page[1].data), 0x10000UL - gvar.video.page[0].pagesize);
+       printf("%u\n", (0x10000UL - (uint16_t)(gvar.video.page[1].data)));
        VGAmodeX(0, 1, &gvar);
        free(vrl_lineoffs);
        buffer = NULL;
index 9ae5246edcbe5f1fa893839da9e40071e1f5e9cb..900914e12119670da94e1de2a5afc1fbecbdacb8 100755 (executable)
@@ -197,7 +197,6 @@ modexDefaultPage(page_t *p)
        page.tilesh=page.height/TILEWH;\r
        page.tilemidposscreenx = page.tw/2;\r
        page.tilemidposscreeny = (page.th/2)+1;\r
-       page.pattern_ofs=0;\r
        page.stridew=page.width/4;\r
        page.pagesize = (word)(page.stridew)*page.height;\r
        page.pi=page.width*4;\r
@@ -225,7 +224,6 @@ modexNextPage(page_t *p) {
        result.tilesw = p->tilesw;\r
        result.tilesh = p->tilesh;\r
        result.stridew=p->stridew;\r
-       result.pattern_ofs = 0x10000UL - p->pagesize;\r
        result.pagesize = p->pagesize;\r
        result.pi=result.width*4;\r
        result.id = p->id+1;\r
@@ -250,7 +248,6 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        result.th = result.sh/TILEWH;\r
        result.tilesw=result.width/TILEWH;\r
        result.tilesh=result.height/TILEWH;\r
-       result.pattern_ofs=0x10000UL - (p->pattern_ofs+p->pagesize);\r
        result.id = p->id+1;\r
        result.stridew=p->sw/4;//result.width/4;\r
        result.pagesize = (word)(result.stridew)*result.height;\r
index dcb8911c08b3e87897a467fb21baf632daa431b0..eb83157e71866405efb4d4bb62b6c7d697556d74 100755 (executable)
@@ -374,7 +374,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].tx++;
        /* Snap the origin forward */
        mv[id].page->data += 4;
-       mv[id].page->pattern_ofs += 4;
+
        mv[id].page->dx = mv[id].map->tiles->tileWidth;
        }
 
@@ -404,7 +404,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].tx--;
        /* Snap the origin backward */
        mv[id].page->data -= 4;
-       mv[id].page->pattern_ofs -= 4;
+
        mv[id].page->dx = mv[id].map->tiles->tileWidth;
        }
 
@@ -434,7 +434,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].ty--;
        /* Snap the origin downward */
        mv[id].page->data -= mv[id].page->pi;
-       mv[id].page->pattern_ofs -= mv[id].page->pi;
+
        mv[id].page->dy = mv[id].map->tiles->tileHeight;
        }
 
@@ -463,7 +463,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
        mv[id].ty++;
        /* Snap the origin downward */
        mv[id].page->data += mv[id].page->pi;
-       mv[id].page->pattern_ofs += mv[id].page->pi;
+
        mv[id].page->dy = mv[id].map->tiles->tileHeight;
        }
 
@@ -493,7 +493,6 @@ void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 //             vga_restore_rm0wm0();
                /* Snap the origin forward */
                mv[id].page->data += 4;
-               mv[id].page->pattern_ofs += 4;
                mv[id].page->dx = mv[0].map->tiles->tileWidth;
        }
 }
@@ -511,7 +510,6 @@ void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 //             vga_restore_rm0wm0();
                /* Snap the origin backward */
                mv[id].page->data -= 4;
-               mv[id].page->pattern_ofs -=4;
                mv[id].page->dx = mv[0].map->tiles->tileWidth;
        }
 }
@@ -529,7 +527,6 @@ void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 //             vga_restore_rm0wm0();
                /* Snap the origin backward */
                mv[id].page->data -= mv[id].page->pi;
-               mv[id].page->pattern_ofs -= mv[id].page->pi;
                mv[id].page->dy = mv[0].map->tiles->tileWidth;
        }
 }
@@ -547,7 +544,6 @@ void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 //             vga_restore_rm0wm0();
                /* Snap the origin forward */
                mv[id].page->data += mv[id].page->pi;
-               mv[id].page->pattern_ofs += mv[id].page->pi;
                mv[id].page->dy = mv[0].map->tiles->tileWidth;
        }
 }
index cbbe471292229557a05e8e6570b5ee885501700e..da79ebc8b63b74a0416b8fa298633b64b907bbf1 100755 (executable)
@@ -82,7 +82,6 @@ typedef struct {
        sword tilemidposscreeny;        /* middle tile position */\r
        sword tileplayerposscreenx;     /* player position on screen */\r
        sword tileplayerposscreeny;     /* player position on screen */\r
-       uint16_t pattern_ofs;           /* doslib vga patter offset www */\r
        word stridew;                   /*width/4*/\r
        word pagesize;                  /* page size */\r
        word pi;                                /* incremention page by this much to preserve location */\r