From 5e004b57253df9e7572e5f0705c353f559ca0875 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 3 Feb 2017 10:32:04 -0600 Subject: [PATCH] just pushing before i use ZC_mapscroll --- MEMINFO.16W | 0 ZCROLL.L16 | 22 ++++ src/exmmtest.c | 1 + src/lib/16_tail.c | 3 +- src/lib/16_tail.h | 1 + src/lib/16_vl.c | 9 ++ src/lib/16_vl.h | 1 + src/lib/doslib | 2 +- src/lib/scroll16.c | 254 +++++++++++++-------------------------------- src/lib/scroll16.h | 34 +++--- src/zcroll.c | 3 +- 11 files changed, 129 insertions(+), 201 deletions(-) create mode 100755 MEMINFO.16W create mode 100755 ZCROLL.L16 diff --git a/MEMINFO.16W b/MEMINFO.16W new file mode 100755 index 00000000..e69de29b diff --git a/ZCROLL.L16 b/ZCROLL.L16 new file mode 100755 index 00000000..2713cd79 --- /dev/null +++ b/ZCROLL.L16 @@ -0,0 +1,22 @@ + +Project 16 zcroll.exe. This is just a test file! +version Feb 3 2017 10:20:45 +[0]txy: 0x0 [1]txy: 0x0 + +player vars: + xy: 160x128 txy: 20x8 triggxy: 21x8 value: 1 + hp: 4 q: 1 info.dir: 2 d: 2 pdir: 3 + delay=1 + +VL_PrintmodexmemInfo: + Virtual Screen: 352x272 Tile: 22x17=((Virtual Screen)/16) + Screen: 320x240 Tile: 20x15=((Screen)/16) + Free Video Memory: 767 + page [0]=(a000:0028) size=23936 w=352 h=272 sw=320 sh=240 pi=1408 + [1]=(a000:5da8) size=23936 w=352 h=272 sw=320 sh=240 pi=1408 + [2]=(a000:bb28) size=8448 w=352 h=96 sw=352 sh=96 pi=1408 + [3]=(a000:dc28) size=8448 w=352 h=96 sw=352 sh=96 pi=1408 +gvar.video.r=0 gvar.video.bgps=1 + +detected CPU type: 80386 or newer +detected FPU type: 80387 diff --git a/src/exmmtest.c b/src/exmmtest.c index 25436f81..c5e9b5ce 100755 --- a/src/exmmtest.c +++ b/src/exmmtest.c @@ -38,6 +38,7 @@ #define FILEREAD //#define EXMMVERBOSE +void VGAmodeX(sword vq, boolean cmem, global_game_variables_t *gv){} #define PRINTBB { printf("&main()= %Fp\n", argv[0]);printf("bigbuffer= %Fp\n", bigbuffer);printf("&bigbuffer= %Fp\n", &bigbuffer);printf("bigbuffer= %04x\n", bigbuffer);printf("&bigbuffer= %04x\n", &bigbuffer); } #ifdef __WATCOMC__ diff --git a/src/lib/16_tail.c b/src/lib/16_tail.c index 4e8c2d10..463055a1 100755 --- a/src/lib/16_tail.c +++ b/src/lib/16_tail.c @@ -109,6 +109,7 @@ void Shutdown16(global_game_variables_t *gvar) #endif CA_Shutdown(gvar); MM_Shutdown(gvar); + VGAmodeX(0, 1, gvar); } @@ -346,7 +347,7 @@ void Quit (global_game_variables_t *gvar, char *error) if (error && *error) { - movedata((unsigned)screen,7,0xb800,0,7*160); + //movedata((unsigned)screen,7,0xb800,0,7*160); gotoxy (10,4); fprintf(stderr, "%s\n", error); gotoxy (1,8); diff --git a/src/lib/16_tail.h b/src/lib/16_tail.h index ac300b18..b250e155 100755 --- a/src/lib/16_tail.h +++ b/src/lib/16_tail.h @@ -29,6 +29,7 @@ #include "src/lib/16_mm.h" #include "src/lib/16_ca.h" #include "src/lib/16_in.h" +#include "src/lib/16_vl.h" #include "src/lib/testpatt.h" #define FUNCTIONKEYFUNCTIONS \ diff --git a/src/lib/16_vl.c b/src/lib/16_vl.c index 56b60684..63b3611a 100755 --- a/src/lib/16_vl.c +++ b/src/lib/16_vl.c @@ -1334,6 +1334,15 @@ modexWaitBorder() { } } +void +modexWaitBorder_start() +{ + 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 41e03762..d2d75fb7 100755 --- a/src/lib/16_vl.h +++ b/src/lib/16_vl.h @@ -173,6 +173,7 @@ void modexpdump(page_t *pee); 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 VL_PrintmodexmemInfo(video_t *v); #endif diff --git a/src/lib/doslib b/src/lib/doslib index df3936df..4dacdfcb 160000 --- a/src/lib/doslib +++ b/src/lib/doslib @@ -1 +1 @@ -Subproject commit df3936dfd8af45cf82c04bce8c40485e0cabe700 +Subproject commit 4dacdfcbe26c301fc4a368c58254c20b07f3a839 diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index c11f49bf..45f4709a 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -25,6 +25,22 @@ #include "src/lib/scroll16.h" //#define INC_PER_FRAME if(player[pn].enti.q&1) player[pn].enti.persist_aniframe++; if(player[pn].enti.persist_aniframe>4) player[pn].enti.persist_aniframe = 1; +#define ZC_WALKR ScrollRight(pip, player, 3, pn); \ + ScrollRight(pip, player, 2, pn); \ + mapScrollRight(pip, player, (0), pn); \ +if(pip[0].video->bgps) mapScrollRight(pip, player, (1), pn); +#define ZC_WALKL ScrollLeft(pip, player, 3, pn); \ + ScrollLeft(pip, player, 2, pn); \ + mapScrollLeft(pip, player, (0), pn); \ +if(pip[0].video->bgps) mapScrollLeft(pip, player, (1), pn); +#define ZC_WALKD ScrollDown(pip, player, 3, pn); \ + ScrollDown(pip, player, 2, pn); \ + mapScrollDown(pip, player, (0), pn); \ +if(pip[0].video->bgps) mapScrollDown(pip, player, (1), pn); +#define ZC_WALKU ScrollUp(pip, player, 3, pn); \ + ScrollUp(pip, player, 2, pn); \ + mapScrollUp(pip, player, (0), pn); \ +if(pip[0].video->bgps) mapScrollUp(pip, player, (1), pn); void ZC_walk(map_view_t *pip, player_t *player, word pn) { @@ -42,12 +58,8 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=2; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; - ANIMATESPRIFUN(pip, player, pn, 2); - ScrollRight(pip, player, 3, pn); - ScrollRight(pip, player, 2, pn); - mapScrollRight(pip, player, (0), pn); - if(pip[0].video->bgps) mapScrollRight(pip, player, (1), pn); + ZC_animatePlayer(pip, player, pn, 2); + ZC_WALKR player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; } @@ -57,16 +69,15 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=1; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; player[pn].enti.x+=(player[pn].enti.speed); - ANIMATESPRIFUN(pip, player, pn, 1); + ZC_animatePlayer(pip, player, pn, 1); player[pn].enti.q++; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx++; } } else { player[pn].walktype=0; - ANIMATESPRIFUN(pip, player, pn, 0); + ZC_animatePlayer(pip, player, pn, 0); player[pn].enti.d = 2; } player[pn].enti.triggerx = player[pn].enti.tx+1; @@ -80,12 +91,8 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=2; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; - ANIMATESPRIFUN(pip, player, pn, 2); - ScrollLeft(pip, player, 3, pn); - ScrollLeft(pip, player, 2, pn); - mapScrollLeft(pip, player, (0), pn); - if(pip[0].video->bgps) mapScrollLeft(pip, player, (1), pn); + ZC_animatePlayer(pip, player, pn, 2); + ZC_WALKL player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; } @@ -95,16 +102,15 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=1; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; player[pn].enti.x-=(player[pn].enti.speed); - ANIMATESPRIFUN(pip, player, pn, 1); + ZC_animatePlayer(pip, player, pn, 1); player[pn].enti.q++; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.tx--; } } else { player[pn].walktype=0; - ANIMATESPRIFUN(pip, player, pn, 0); + ZC_animatePlayer(pip, player, pn, 0); player[pn].enti.d = 2; } player[pn].enti.triggerx = player[pn].enti.tx-1; @@ -118,12 +124,8 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=2; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; - ANIMATESPRIFUN(pip, player, pn, 2); - ScrollDown(pip, player, 3, pn); - ScrollDown(pip, player, 2, pn); - mapScrollDown(pip, player, (0), pn); - if(pip[0].video->bgps) mapScrollDown(pip, player, (1), pn); + ZC_animatePlayer(pip, player, pn, 2); + ZC_WALKD player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; } @@ -133,16 +135,15 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=1; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; player[pn].enti.y+=(player[pn].enti.speed); - ANIMATESPRIFUN(pip, player, pn, 1); + ZC_animatePlayer(pip, player, pn, 1); player[pn].enti.q++; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty++; } } else { player[pn].walktype=0; - ANIMATESPRIFUN(pip, player, pn, 0); + ZC_animatePlayer(pip, player, pn, 0); player[pn].enti.d = 2; } player[pn].enti.triggerx = player[pn].enti.tx; @@ -156,12 +157,8 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=2; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; - ANIMATESPRIFUN(pip, player, pn, 2); - ScrollUp(pip, player, 3, pn); - ScrollUp(pip, player, 2, pn); - mapScrollUp(pip, player, (0), pn); - if(pip[0].video->bgps) mapScrollUp(pip, player, (1), pn); + ZC_animatePlayer(pip, player, pn, 2); + ZC_WALKU player[pn].enti.q++; //0000pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; } @@ -171,16 +168,15 @@ void ZC_walk(map_view_t *pip, player_t *player, word pn) player[pn].walktype=1; if(player[pn].enti.q<=player[pn].enti.spt) { - //INC_PER_FRAME; player[pn].enti.y-=(player[pn].enti.speed); - ANIMATESPRIFUN(pip, player, pn, 1); + ZC_animatePlayer(pip, player, pn, 1); player[pn].enti.q++; } else { player[pn].enti.q = 1; player[pn].enti.d = 2; player[pn].enti.ty--; } } else { player[pn].walktype=0; - ANIMATESPRIFUN(pip, player, pn, 0); + ZC_animatePlayer(pip, player, pn, 0); player[pn].enti.d = 2; } player[pn].enti.triggerx = player[pn].enti.tx; @@ -347,6 +343,8 @@ initMap(map_t *map) { } } +//===========================================================================// + void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid) { @@ -406,7 +404,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid) if(player[plid].enti.q==4) #endif // if(id==0) - mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty-1, y, player, DRAWCOLNUM); + mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty-1, y, player, DRAWROWNUM); // 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); @@ -428,14 +426,48 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid) if(player[plid].enti.q==4) #endif // if(id==0) - mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWCOLNUM); + mapDrawRow(&mv[id], mv[0].tx - 1, mv[0].ty+mv[0].page->ti.th, y, player, DRAWROWNUM); // 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->r=1; } - +void ZC_mapScroll(map_view_t *mv, player_t *player, word pn) +{ + word b = mv[0].video->bgps; + switch(player[pn].enti.d) + { + case 2://none + break; + case 3://right + ScrollRight(mv, player, 3, pn); + ScrollRight(mv, player, 2, pn); + mapScrollRight(mv, player, (0), pn); + if(b) mapScrollRight(mv, player, (1), pn); + break; + case 4://left + ScrollLeft(mv, player, 3, pn); + ScrollLeft(mv, player, 2, pn); + mapScrollLeft(mv, player, (0), pn); + if(b) mapScrollLeft(mv, player, (1), pn); + break; + case 1://down + ScrollDown(mv, player, 3, pn); + ScrollDown(mv, player, 2, pn); + mapScrollDown(mv, player, (0), pn); + if(b) mapScrollDown(mv, player, (1), pn); + break; + case 0://up + ScrollUp(mv, player, 3, pn); + ScrollUp(mv, player, 2, pn); + mapScrollUp(mv, player, (0), pn); + if(b) mapScrollUp(mv, player, (1), pn); + break; + } + printf("player[pn].enti.d=%u\n", player[pn].enti.d); + mv->video->r=1; +} //=========================================================================== //TODO: put player in starting position of assigned spot on map @@ -661,17 +693,7 @@ void shinku(global_game_variables_t *gv) { word x = (0) + gv->video.page[/*!*/(gv->video.p)].dx; // follow the screen word y = (0) + gv->video.page[/*!*/(gv->video.p)].dy; // follow the screen - word col = 2, bgcol = 1, type = 1;//w = 64, h = 8, //col7bgcol0 - //byte o,o2,i; - //modexCopyPageRegion(pip[1].page, pip[2].page, 16, 16, 16, 16, (14*8)+4, 8+4); - /* block copy to visible RAM from offscreen */ -// vga_setup_wm1_block_copy(); -// modexCopyPageRegion(&(gv->video.page[gv->video->sfip]), &(gv->video.page[!gv->video->sfip]), x, y, x+w, 0, w, h); -// o = *(gv->video.page[2].data); // source offscreen -// o2 = *(gv->video.page[gv->video->sfip].data)+(y * vga_state.vga_stride) + (x >> 2); // dest visible (original stride) -// for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += vga_state.vga_stride) 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(); + word col = 2, bgcol = 1, type = 1;//w = 64, h = 8, if(elapsed_timer(gv) >= (1.0 / gv->kurokku.frames_per_second)) { // NTS: For some bizarre reason, gv->pee is not initialized, but the pointer is not NULL even @@ -682,29 +704,20 @@ 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)); - //modexClearRegion(&(gv->video.page[gv->video->sfip]), x, y, w, h, 45); modexprint(&(gv->video.page[/*!*/(gv->video.p)]), x, y, type, col, bgcol, global_temp_status_text); gv->kurokku.tiku=0; - /* block copy to visible RAM from offscreen */ -// vga_setup_wm1_block_copy(); -// o = *(gv->video.page[gv->video->sfip].data); // source offscreen -// o2 = *(gv->video.page[2].data)+(y * vga_state.vga_stride) + (x >> 2); // dest visible (original stride) -// for (i=0;i < h;i++,o += vga_state.vga_draw_stride,o2 += vga_state.vga_stride) vga_wm1_mem_block_copy(o2,o,w >> 2); -// modexCopyPageRegion(&(gv->video.page[gv->video->sfip]), &(gv->video.page[!gv->video->sfip]), x, y, x, 0, w, h); - /* must restore Write Mode 0/Read Mode 0 for this code to continue drawing normally */ -// vga_restore_rm0wm0(); }else //copy dat sheet gv->kurokku.tiku++; switch(gv->kurokku.fpscap) { case 0: - //modexprint(&(gv->video.page[gv->video->sfip]), x, y+8, type, col, bgcol, "sanic!"); + 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(); + modexWaitBorder_start(); //vga_wait_for_vsync(); gv->kurokku.frames_per_second=60; break; @@ -725,121 +738,6 @@ void shinku(global_game_variables_t *gv) } } -void near ZC_drawframe(map_view_t *pip, entity_t *enti, sword x, sword y) -{ - switch(pip[0].video->rss) - { - case 0: - animate_spri(enti, pip->video); - break; - case 1: - animate_spri(enti, pip->video); - break; -// case 2: -// modexClearRegion(&(pip[0].page[0]), x, y, 16, 32, player[pn].enti.dire); -// break; - } -} - -#ifdef SPRITE -#define FRAME1 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 48, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME2 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME3 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 0, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); -#define FRAME4 modexDrawSpriteRegion(pip[/*!*/(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32, PLAYERBMPDATAPTR); -#else -#define FRAME1 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 2+player[pn].enti.dire); -#define FRAME2 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire); -#define FRAME3 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, player[pn].enti.dire); -#define FRAME4 modexClearRegion(pip[/*!*/(pip->video->p)].page, x, y, 16, 32, 1+player[pn].enti.dire); -#endif - -void animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch) -{ - sword x = player[pn].enti.x; - sword y = player[pn].enti.y; - sword bx = x+16; //buffer's x - sword by = y+16; //buffer's y - sword qq; //scroll offset - word ls = 0;//player[pn].enti.persist_aniframe; - player[pn].enti.dire=32; //direction - - switch(scrollswitch) - { - case 0: - qq = 0; - break; - default: - qq = ((player[pn].enti.q)*(player[pn].enti.speed)); - break; - } - //x-=4; - y-=pip[0].map->tiles->tileHeight; - switch (player[pn].enti.d) - { - case 0: - //up - player[pn].enti.dire*=player[pn].enti.d; - y-=qq; - by-=4; - break; - case 3: - // right - player[pn].enti.dire*=(player[pn].enti.d-2); - x+=qq; - bx+=4; - break; - case 2: - break; - case 4: - //down - player[pn].enti.dire*=(player[pn].enti.d-2); - y+=qq; - by+=4; - break; - case 1: - //left - player[pn].enti.dire*=(player[pn].enti.d+2); - x-=qq; - bx-=4; - break; - } - -// if(!pageflipflop) modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 36); -// else{ -// //copy old bg to page0 -// //modexCopyPageRegion(pip[3].page, pip[0].page, bx, by, 0, 0, 20, 36); -// //update buffer -// //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 20, 36); -// } -//modexCopyPageRegion(page_t *dest, page_t *src, word sx, word sy, word dx, word dy, word width, word height); - //modexCopyPageRegion(pip[3].page, pip[!(pip->video->p)].page, x-4, y-4, 0, 128, 28, 36); - /*modexCopyPageRegion(pip[pip->video->p].page, - pip[!(pip->video->p)].page, x-4, y-4, x-4, y-4, 28, 36);*/ -// else modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40); - switch(ls) - { - case 1: - FRAME1 - break; - case 2: - FRAME2 - break; - case 3: - FRAME3 - break; - case 4: - FRAME4 - break; - } -// if(2>ls && ls>=1) { FRAME1 }else -// if(3>ls && ls>=2) { FRAME2 }else -// if(4>ls && ls>=3) { FRAME3 }else -// if(5>ls && ls>=4) { FRAME4 } - //modexCopyPageRegion(pip[0].page, pip[3].page, 0, 0, x, y, 24, 32); - //printf("x=%d y=%d bx=%d by=%d\n", x, y, bx, by); - pip->video->r=1; -} - void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch) { sword x = player[pn].enti.x; @@ -903,7 +801,7 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr if(pip[0].video->bgps) modexCopyPageRegion(pip[0].page, pip[1].page, x-4, y-4, x-4, y-4, 28, 40); //draw sprite - ZC_drawframe(pip, &player[pn].enti, x, y); + animate_spri(&player[pn].enti, pip->video); //0000if(player[pn].enti.q<2) delay(200); pip->video->r=1; } @@ -996,6 +894,4 @@ void mapScroll(map_view_t *mv, player_t *player) default: break; } - - mv->video->r=1; } diff --git a/src/lib/scroll16.h b/src/lib/scroll16.h index bed922b1..c789cc1a 100755 --- a/src/lib/scroll16.h +++ b/src/lib/scroll16.h @@ -44,8 +44,6 @@ #define SPRITE //#define TILERENDER -#define ANIMATESPRIFUN ZC_animatePlayer - #define PLAYERBMPDATAVAR player[pn].data #define PLAYERBMPDATA *PLAYERBMPDATAVAR #define PLAYERBMPDATAPTR PLAYERBMPDATAVAR @@ -57,7 +55,7 @@ //row and colum drawing routines #define FULLRCREND #define DRAWCOLNUM mv->page[id].dx -#define DRAWROLNUM mv->page[id].dy +#define DRAWROWNUM mv->page[id].dy //#define DRAWCOLNUM player[plid].enti.q //#define DRAWROLNUM player[plid].enti.q @@ -72,15 +70,15 @@ //not used now printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); //printf("mv[%u].tx: %d", gvar.video.panp, mv[gvar.video.panp].tx); printf(" mv[%u].ty: %d ", gvar.video.panp, mv[gvar.video.panp].ty); //printf("gvar.kurokku: "); printf("%.0f ", clock()); printf("tiku=%lu ", gvar.kurokku.tiku); printf("t=%.0f ", gvar.kurokku.t); printf("ticktock()=%f ", ticktock(&gvar)); printf("%.0f fps", (double)gvar.kurokku.tiku/ticktock(&gvar)); -//printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]); +//printf("map.width=%d map.height=%d map.data[0]=%d\n", mv[1].map->width, mv[1].map->height, mv[1].map->data[0]); //printf("pageflipflop=%u", pageflipflop); //printf("&global_temp_status_text = %Fp\n", &global_temp_status_text); //printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); //printf(" aniframe=%u", player[0].enti.persist_aniframe); -#define SCROLLEXITMESG printf("[0]txy: %dx%d ", mv[0].tx, mv[0].ty); printf("[1]txy: %dx%d", mv[1].tx, mv[1].ty);\ +#define SCROLLEXITMESG printf("[0]txy: %dx%d ", mv[1].tx, mv[1].ty); printf("[1]txy: %dx%d", mv[1].tx, mv[1].ty);\ printf("\n\n");\ printf("player vars:\n");\ - printf(" xy: %dx%d", player[0].enti.x, player[0].enti.y); printf(" txy: %dx%d", player[0].enti.tx, player[0].enti.ty); printf(" triggxy: %dx%d", player[0].enti.triggerx, player[0].enti.triggery); printf(" value: %d\n", mv[0].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))]);\ + printf(" xy: %dx%d", player[0].enti.x, player[0].enti.y); printf(" txy: %dx%d", player[0].enti.tx, player[0].enti.ty); printf(" triggxy: %dx%d", player[0].enti.triggerx, player[0].enti.triggery); printf(" value: %d\n", mv[1].map->data[(player[0].enti.triggerx-1)+(map.width*(player[0].enti.triggery-1))]);\ printf(" hp: %d", (player[0].enti.hp)); printf(" q: %d", player[0].enti.q); printf(" info.dir: %d", player[0].info.dir); printf(" d: %d ", player[0].enti.d);\ printf(" pdir: %d\n", player[0].pdir); printf(" delay=%u", player[0].enti.spri->delay);\ printf("\n\n");\ @@ -97,7 +95,6 @@ extern char global_temp_status_text[512]; //map_t allocMap(int w, int h); void initMap(map_t *map); void ZC_walk(map_view_t *pip, player_t *player, word pn); -//void oldwalk(map_view_t *pip, player_t *player, word pn); void ZC_panPageManual(map_view_t *pip, player_t *player, word pn); void ZC_MVSetup(map_view_t *pip, map_t *map, global_game_variables_t *gv); void ZC_MVInit(map_view_t *pip, int tx, int ty); @@ -106,6 +103,16 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid); void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid); +void ZC_mapScroll(map_view_t *mv, player_t *player, word pn); +void ZC_playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn); +sword chkmap(map_t *map, word q); +void mapGoTo(map_view_t *mv, int tx, int ty); +void ZC_mapinitMV(map_view_t *mv, int tx, int ty); +void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); +void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset); +void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset); +void mapDrawWRow(map_view_t *mv, int tx, int ty, word y); +void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); inline void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid) { /* increment the pixel position and update the page */ @@ -174,19 +181,10 @@ inline void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid } } -void ZC_playerXYpos(int x, int y, player_t *player, map_view_t *pip, nibble pn); -sword chkmap(map_t *map, word q); -void mapGoTo(map_view_t *mv, int tx, int ty); -void ZC_mapinitMV(map_view_t *mv, int tx, int ty); -void near mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); -void near mapDrawRow(map_view_t *mv, int tx, int ty, word y, player_t *player, word poopoffset); -void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset); -void mapDrawWRow(map_view_t *mv, int tx, int ty, word y); -void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); //void qclean(); +//sync void shinku(global_game_variables_t *gv); -void near ZC_drawframe(map_view_t *pip, entity_t *enti, sword x, sword y); -void animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch); +//animate the sprite void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scrollswitch); // Move an entity around. Should actually be in 16_entity diff --git a/src/zcroll.c b/src/zcroll.c index 72b6fcea..582920ce 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -212,7 +212,7 @@ void main(int argc, char *argv[]) #endif if(IN_KeyDown(sc_R)){ modexPalOverscan(rand()%56); } //r - if((player[0].enti.q==1) && !(player[0].enti.x%TILEWH==0 && player[0].enti.y%TILEWH==0)) break; //incase things go out of sync! + if((player[0].enti.q==1) && !(player[0].enti.x%TILEWH==0 && player[0].enti.y%TILEWH==0)) Quit(&gvar, "PLAYER OFF THE RAILS!");//break; //incase things go out of sync! } /* fade back to text mode */ @@ -222,7 +222,6 @@ void main(int argc, char *argv[]) modexSavePalFile("data/g.pal", gpal); modexFadeOff(4, gpal); #endif - VGAmodeX(0, 1, &gvar); Shutdown16(&gvar); printf("\nProject 16 zcroll.exe. This is just a test file!\n"); printf("version %s\n", VERSION); -- 2.39.2