]> 4ch.mooo.com Git - 16.git/commitdiff
gvar.video.page[1].pattern_ofs added wwwwwwwww
authorsparky4 <sparky4@cock.li>
Tue, 28 Jun 2016 14:34:02 +0000 (09:34 -0500)
committersparky4 <sparky4@cock.li>
Tue, 28 Jun 2016 14:34:02 +0000 (09:34 -0500)
0.l16 [new file with mode: 0755]
exmm0.exe
src/0.c
src/lib/modex16.c
src/lib/scroll16.c
src/lib/typdefst.h

diff --git a/0.l16 b/0.l16
new file mode 100755 (executable)
index 0000000..cd0a3e5
--- /dev/null
+++ b/0.l16
@@ -0,0 +1 @@
+23936  40960\r
index 407f6a0e52dadf46f0d76716ed4e53fc05ac58f8..175efde281b00433707754a7fa4e5812b77c4fc2 100755 (executable)
Binary files a/exmm0.exe and b/exmm0.exe differ
diff --git a/src/0.c b/src/0.c
index 02b1b520859082a31e66fd967a527b01928d8708..5e50c2fcb2627066ebd468910f771b1cac568921 100755 (executable)
--- a/src/0.c
+++ b/src/0.c
@@ -104,7 +104,7 @@ int main(int argc,char **argv) {
         * this time, we render the distinctive pattern to another offscreen location and just copy.
         * note this version is much faster too! */
        {
-               const unsigned int pattern_ofs = 0x10000UL - gvar.video.page[0].pagesize;//(gvar.video.page[0].stridew * gvar.video.page[0].height);
+               //const unsigned int pattern_ofs = 0x10000UL - gvar.video.page[0].pagesize;//(gvar.video.page[0].stridew * gvar.video.page[0].height);
                unsigned int i,j,o,o2;
                int x,y,rx,ry,w,h;
                unsigned int overdraw = 1;      // how many pixels to "overdraw" so that moving sprites with edge pixels don't leave streaks.
@@ -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) + pattern_ofs;
+                       o = (i >> 2) + gvar.video.page[1].pattern_ofs;
                        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 = pattern_ofs + (ry * gvar.video.page[0].stridew) + (rx >> 2); // source offscreen
+                       o = gvar.video.page[1].pattern_ofs + (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();
@@ -278,7 +278,8 @@ int main(int argc,char **argv) {
                        if (dh < 40) dh_step = 1;
                }
        }
-
+//uint16_t
+       printf("%u      %u\n", (gvar.video.page[1].data), 0x10000UL - gvar.video.page[0].pagesize);
        VGAmodeX(0, 1, &gvar);
        free(vrl_lineoffs);
        buffer = NULL;
index 900914e12119670da94e1de2a5afc1fbecbdacb8..9ae5246edcbe5f1fa893839da9e40071e1f5e9cb 100755 (executable)
@@ -197,6 +197,7 @@ 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
@@ -224,6 +225,7 @@ 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
@@ -248,6 +250,7 @@ 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 07da327cc810a4cf5ad4ee482372a048b9d906f0..dcb8911c08b3e87897a467fb21baf632daa431b0 100755 (executable)
@@ -374,6 +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;
        }
 
@@ -403,6 +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;
        }
 
@@ -432,6 +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;
        }
 
@@ -460,6 +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;
        }
 
@@ -489,6 +493,7 @@ 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;
        }
 }
@@ -506,6 +511,7 @@ 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;
        }
 }
@@ -523,6 +529,7 @@ 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;
        }
 }
@@ -540,6 +547,7 @@ 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 da79ebc8b63b74a0416b8fa298633b64b907bbf1..cbbe471292229557a05e8e6570b5ee885501700e 100755 (executable)
@@ -82,6 +82,7 @@ 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