From 51b40bfb7f114e300c6739f98292bc7c5fe6c2d9 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Tue, 28 Jun 2016 09:34:02 -0500 Subject: [PATCH] gvar.video.page[1].pattern_ofs added wwwwwwwww --- 0.l16 | 1 + exmm0.exe | Bin 72415 -> 72415 bytes src/0.c | 9 +++++---- src/lib/modex16.c | 3 +++ src/lib/scroll16.c | 8 ++++++++ src/lib/typdefst.h | 1 + 6 files changed, 18 insertions(+), 4 deletions(-) create mode 100755 0.l16 diff --git a/0.l16 b/0.l16 new file mode 100755 index 00000000..cd0a3e5b --- /dev/null +++ b/0.l16 @@ -0,0 +1 @@ +23936 40960 diff --git a/exmm0.exe b/exmm0.exe index 407f6a0e52dadf46f0d76716ed4e53fc05ac58f8..175efde281b00433707754a7fa4e5812b77c4fc2 100755 GIT binary patch delta 43 zcmV+`0M!5AwFKX_1dv@5PD$1^*gVT&6*U3rrvM4I0RXp=aEAmrIx{nY`?dQ4> 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; diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 900914e1..9ae5246e 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -197,6 +197,7 @@ modexDefaultPage(page_t *p) page.tilesh=page.height/TILEWH; page.tilemidposscreenx = page.tw/2; page.tilemidposscreeny = (page.th/2)+1; + page.pattern_ofs=0; page.stridew=page.width/4; page.pagesize = (word)(page.stridew)*page.height; page.pi=page.width*4; @@ -224,6 +225,7 @@ modexNextPage(page_t *p) { result.tilesw = p->tilesw; result.tilesh = p->tilesh; result.stridew=p->stridew; + result.pattern_ofs = 0x10000UL - p->pagesize; result.pagesize = p->pagesize; result.pi=result.width*4; result.id = p->id+1; @@ -248,6 +250,7 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.th = result.sh/TILEWH; result.tilesw=result.width/TILEWH; result.tilesh=result.height/TILEWH; + result.pattern_ofs=0x10000UL - (p->pattern_ofs+p->pagesize); result.id = p->id+1; result.stridew=p->sw/4;//result.width/4; result.pagesize = (word)(result.stridew)*result.height; diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 07da327c..dcb8911c 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -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; } } diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index da79ebc8..cbbe4712 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -82,6 +82,7 @@ typedef struct { sword tilemidposscreeny; /* middle tile position */ sword tileplayerposscreenx; /* player position on screen */ sword tileplayerposscreeny; /* player position on screen */ + uint16_t pattern_ofs; /* doslib vga patter offset www */ word stridew; /*width/4*/ word pagesize; /* page size */ word pi; /* incremention page by this much to preserve location */ -- 2.39.5