From e3f94546d96d1227c49fd5c76139bf05f67244ea Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 3 Feb 2017 15:43:27 -0600 Subject: [PATCH] fixed wwww now i need to work on map system stuff wwwwwwwwwwwwwww i am also going to work on that fps location stuff --- ZCROLL.L16 | 23 ----------------------- src/lib/16_enti.c | 2 +- src/lib/16_spri.c | 1 + src/lib/16_tail.h | 1 - src/lib/16_vl.c | 13 +++++++++++-- src/lib/16_vl.h | 1 + src/lib/scroll16.c | 43 ++++++++++++++++++++++++++----------------- 7 files changed, 40 insertions(+), 44 deletions(-) delete mode 100755 ZCROLL.L16 diff --git a/ZCROLL.L16 b/ZCROLL.L16 deleted file mode 100755 index 5bd0bdd3..00000000 --- a/ZCROLL.L16 +++ /dev/null @@ -1,23 +0,0 @@ - -Project 16 zcroll.exe. This is just a test file! -version Feb 3 2017 13:00:59 -[0]txy: 0x0 [1]txy: 0x0 - -player vars: - xy: 160x128 txy: 10x8 triggxy: 10x9 value: 0 - hp: 4 q: 1 info.dir: 2 d: 2 dire: 30 pdir: 0 - delay=0 - -VL_PrintmodexmemInfo: - Virtual Screen: 352x272 Tile: 22x17=((Virtual Screen)/16) - Screen: 320x240 Tile: 20x15=((Screen)/16) - Free Video Memory: 767 - page [0]=(a000:0000) size=23936 w=352 h=272 sw=320 sh=240 pi=1408 - [1]=(a000:5d80) size=23936 w=352 h=272 sw=320 sh=240 pi=1408 - [2]=(a000:bb00) size=8448 w=352 h=96 sw=352 sh=96 pi=1408 - [3]=(a000:dc00) size=8448 w=352 h=96 sw=352 sh=96 pi=1408 -gvar.video: - r=0 bgps=1 - -detected CPU type: 80386 or newer -detected FPU type: 80387 diff --git a/src/lib/16_enti.c b/src/lib/16_enti.c index 45f54722..cc419796 100755 --- a/src/lib/16_enti.c +++ b/src/lib/16_enti.c @@ -73,7 +73,7 @@ void EN_initplayer(player_t *player, word pn, video_t *video) player[pn].enti.spri->y = player[0].enti.y-16; player[pn].walktype=0; player[pn].enti.dire=30; - vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew; + vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew;//skewing bug video->sprifilei = set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire); animate_spri(&player[pn].enti, video); diff --git a/src/lib/16_spri.c b/src/lib/16_spri.c index 9474db20..5029636e 100755 --- a/src/lib/16_spri.c +++ b/src/lib/16_spri.c @@ -215,4 +215,5 @@ void animate_spri(entity_t *enti, video_t *video) vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = video->page[0].stridew; vga_state.vga_graphics_ram = video->omemptr; + video->dorender=1; } diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h index b250e155..f200f059 100755 --- a/src/lib/16_tail.h +++ b/src/lib/16_tail.h @@ -47,7 +47,6 @@ if(IN_KeyDown(sc_T)){ gvar.video.rss=!gvar.video.rss; IN_UserInput(1,1); } \ if(IN_KeyDown(sc_P)){ modexpdump(&gvar.video.page[0]); IN_UserInput(1,1); } -//VL_ShowPage(page_t *page, boolean vsync, boolean sr) #define PANKEYFUN \ PANKEYFUNZC \ FUNCTIONKEYDRAWJUNK diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 169bbf8c..ab9a143b 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -1118,7 +1118,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons word s, o, w; word x_draw = x; //word addr = (word) romFontsData.l; - word addrq = (page->width/4) * y + (x / 4) + ((word)page->data); + word addrq = (page->stridew) * y + (x / 4) + ((word)page->data); word addrr = addrq; byte c; @@ -1134,7 +1134,7 @@ void modexprint(page_t *page, word x, word y, word t, word col, word bgcol, cons { x = x_draw; romFontsData.chw = 0; - addrq += (page->width / 4) * 8; + addrq += (page->stridew) * 8; addrr = addrq; y += 8; continue; @@ -1343,6 +1343,15 @@ modexWaitBorder_start() } +void +modexWaitBorder_end() +{ + while(!(inp(INPUT_STATUS_1) & 8)) { + // spin + } + +} + // // printings of video memory information // diff --git a/src/lib/16_vl.h b/src/lib/16_vl.h index d2d75fb7..de5c8576 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -174,6 +174,7 @@ void modexcls(page_t *page, byte color, byte *Where); void VL_PatternDraw(video_t *video, word pn, boolean sw, boolean allsw); void modexWaitBorder(); void modexWaitBorder_start(); +void modexWaitBorder_end(); void VL_PrintmodexmemInfo(video_t *v); #endif diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 948c9f8a..a353ccd8 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -348,7 +348,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) // else // if(mv[0].video->bgps) // modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height); - mv[0].video->dorender=1; + //mv[0].video->dorender=1;//ScrollRight } @@ -370,7 +370,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid) // else // if(mv[0].video->bgps) // modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[0].map->tiles->tileWidth, mv[0].page->height); - mv[0].video->dorender=1; + //mv[0].video->dorender=1;//ScrollLeft } @@ -392,7 +392,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) // else // if(mv[0].video->bgps) // modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight); - mv[0].video->dorender=1; + //mv[0].video->dorender=1;//ScrollUp } @@ -414,7 +414,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) // else // if(mv[0].video->bgps) // modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[0].page->width, mv[0].map->tiles->tileHeight); - mv[0].video->dorender=1; + //mv[0].video->dorender=1;//ScrollDown } void ZC_mapScroll(map_view_t *mv, player_t *player, word pn) @@ -449,7 +449,7 @@ void ZC_mapScroll(map_view_t *mv, player_t *player, word pn) if(b) mapScrollUp(mv, player, (1), pn); break; } - mv[0].video->dorender=1; + //mv[0].video->dorender=1;//ZC_mapScroll } //=========================================================================== @@ -699,20 +699,22 @@ void shinku(global_game_variables_t *gv) // This fixes *** Null pointer assignment detected error message in ZCROLL.EXE on exit. sprintf(global_temp_status_text, "%.0f fps", (double)gv->kurokku.tiku/ticktock(gv)); modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, global_temp_status_text); +//0000printf("dx=%u dy=%u\n", gv->video.page[/*!*/(gv->video.p)].dx, gv->video.page[/*!*/(gv->video.p)].dy); gv->kurokku.tiku=0; }else //copy dat sheet gv->kurokku.tiku++; switch(gv->kurokku.fpscap) { - case 0: + case 0: //turn this off if XT //modexprint(&(gv->video.page[0]), x, y+8, type, col, bgcol, "sanic!"); gv->kurokku.frames_per_second=1; break; case 1: - //turn this off if XT - modexWaitBorder_start(); + //modexWaitBorder(); + //modexWaitBorder_start(); //vga_wait_for_vsync(); + vga_wait_for_vsync_end(); gv->kurokku.frames_per_second=60; break; } @@ -781,23 +783,30 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn) break; } player[pn].enti.dire+=dd; - if((player[pn].enti.q==1 && player[pn].enti.pred != player[pn].enti.d) || !dd) + //setting xy position + player[pn].enti.spri->x = x; + player[pn].enti.spri->y = y; + + if((player[pn].enti.q==1 && player[pn].enti.pred != player[pn].enti.d) || !dd)//when dir changed OR when player change face direction { //0000printf(" q=%u pred=%u d=%u dd=%u\n", player[pn].enti.q, player[pn].enti.pred, player[pn].enti.d, dd); set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire); //pip->video->sprifilei = set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire); if(pip->video->sprifilei == -1){ printf("ERROR! %u\n", player[pn].enti.dire); return; } player[pn].enti.pred = player[pn].enti.d; + if(!dd)//changed direction while NOT moving! + { + modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 40); + animate_spri(&player[pn].enti, pip[0].video); + } } - //setting xy position - player[pn].enti.spri->x = x; - player[pn].enti.spri->y = y; - - if(pip[0].video->bgps) + if(pip[0].video->bgps && dd)//if moving wwww + { modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 40); - //draw sprite - animate_spri(&player[pn].enti, pip[0].video); + + //draw sprite + animate_spri(&player[pn].enti, pip[0].video); + } //0000if(player[pn].enti.q<4) delay(200); - pip[0].video->dorender = 1; } /* -- 2.39.2