From b6b0bffba1968bc405ae6dea1a271811700cf03b Mon Sep 17 00:00:00 2001 From: sparky4 Date: Fri, 6 May 2016 14:02:30 -0500 Subject: [PATCH] wwww johncampbell it is much easier to see the issue in test.exe now /home/sparky4 ^^ --- src/lib/scroll16.c | 8 ++++---- src/test.c | 27 ++++++++++++++++----------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 1bfae601..dbf6666c 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -216,7 +216,7 @@ void panpagemanual(map_view_t *pip, player_t *player, word pn) { //right movement case 3: - if(pip[pip[0].pan->pn].tx >= -1 && pip[pip[0].pan->pn].tx+pip[pip[0].pan->pn].page->tw < pip[pip[0].pan->pn].page->tilesw+1) + if(pip[pip[0].pan->pn].tx >= 0 && pip[pip[0].pan->pn].tx+pip[pip[0].pan->pn].page->tw < pip[pip[0].pan->pn].page->tilesw) { if(player[pn].q<=player[pn].spt) { @@ -229,7 +229,7 @@ void panpagemanual(map_view_t *pip, player_t *player, word pn) //left movement case 1: - if(pip[pip[0].pan->pn].tx > -1 && pip[pip[0].pan->pn].tx+pip[pip[0].pan->pn].page->tilesw <= pip[pip[0].pan->pn].page->tilesw+1) + if(pip[pip[0].pan->pn].tx > 0 && pip[pip[0].pan->pn].tx+pip[pip[0].pan->pn].page->tw <= pip[pip[0].pan->pn].page->tilesw) { if(player[pn].q<=player[pn].spt) { @@ -242,7 +242,7 @@ void panpagemanual(map_view_t *pip, player_t *player, word pn) //down movement case 4: - if(pip[pip[0].pan->pn].ty >= -1 && pip[pip[0].pan->pn].ty+pip[pip[0].pan->pn].page->tilesh < pip[pip[0].pan->pn].page->tilesh+1) + if(pip[pip[0].pan->pn].ty >= 0 && pip[pip[0].pan->pn].ty+pip[pip[0].pan->pn].page->th < pip[pip[0].pan->pn].page->tilesh) { if(player[pn].q<=player[pn].spt) { @@ -255,7 +255,7 @@ void panpagemanual(map_view_t *pip, player_t *player, word pn) //up movement case 0: - if(pip[pip[0].pan->pn].ty > -1 && pip[pip[0].pan->pn].ty+pip[pip[0].pan->pn].page->tilesh <= pip[pip[0].pan->pn].page->tilesh+1) + if(pip[pip[0].pan->pn].ty > 0 && pip[pip[0].pan->pn].ty+pip[pip[0].pan->pn].page->th <= pip[pip[0].pan->pn].page->tilesh) { if(player[pn].q<=player[pn].spt) { diff --git a/src/test.c b/src/test.c index 89f1d0ff..c0f1680f 100755 --- a/src/test.c +++ b/src/test.c @@ -74,7 +74,8 @@ void main(int argc, char *argv[]) modexPalBlack(); IN_Startup(); - IN_Default(0,&player,ctrl_Joystick); + IN_Default(0,&player,ctrl_Keyboard1); + IN_initplayer(&player, 0); textInit(); VGAmodeX(bakapee, 1, &gvar); @@ -82,11 +83,13 @@ void main(int argc, char *argv[]) /* set up the page, but with 16 pixels on all borders in offscreen mem */ modexHiganbanaPageSetup(&gvar.video); - for(i=0;i=31){ i++; j=0; goto baka; }else j++; }else if(j>=32){ k++; j=0; }else j++; break; case 1: - /* go left */ + // go left gvar.video.page[pan.pn].dx--; if(j>=32){ k++; j=0; }else j++; break; case 2: - /* go up */ + // go up gvar.video.page[pan.pn].dy++; if(j>=32){ k++; j=0; }else j++; break; case 3: - /* go down */ + // go down gvar.video.page[pan.pn].dy--; if(j>=32){ k=0; j=0; i++; }else j++; break; @@ -143,15 +148,14 @@ void main(int argc, char *argv[]) if(i==5) goto pee; baka: i++; - modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45); + modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45);*/ if(IN_KeyDown(6)) modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width, 16, 45); if(IN_KeyDown(4+1)){ modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 128); modexClearRegion(&gvar.video.page[1], 32, 32, gvar.video.page[1].sw-32, gvar.video.page[1].sh-32, 42); modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 128); } - panpagemanual(mv, player, 0); - } + //} if(IN_KeyDown(2)) pan.pn=0; if(IN_KeyDown(3)) pan.pn=1; //if(IN_KeyDown(6)) modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[0].sw-64, gvar.video.page[0].sh-16, 45); @@ -175,6 +179,7 @@ void main(int argc, char *argv[]) printf(" size=%ld", gvar.video.page[i].pagesize); printf("\n"); } + printf("tx=%d ", mv[pan.pn].tx); printf("ty=%d ", mv[pan.pn].ty); printf("player.d=%d\n", player[0].d); IN_Shutdown(); modexPalBlack(); modexFadeOn(1, pal); -- 2.39.5