]> 4ch.mooo.com Git - 16.git/commitdiff
wwww johncampbell it is much easier to see the issue in test.exe now /home/sparky4 ^^
authorsparky4 <sparky4@cock.li>
Fri, 6 May 2016 19:02:30 +0000 (14:02 -0500)
committersparky4 <sparky4@cock.li>
Fri, 6 May 2016 19:02:30 +0000 (14:02 -0500)
src/lib/scroll16.c
src/test.c

index 1bfae60162cb59ba28aacacd4760fa1181627ccb..dbf6666cb03400fa209334743d565dbae6ab3b27 100755 (executable)
@@ -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)
                                {
index 89f1d0ff1fceef502ca45379d3807d257e0df822..c0f1680fb341c460fff4b34b06e3383308d00f7a 100755 (executable)
@@ -74,7 +74,8 @@ void main(int argc, char *argv[])
        modexPalBlack();\r
 \r
        IN_Startup();\r
-       IN_Default(0,&player,ctrl_Joystick);\r
+       IN_Default(0,&player,ctrl_Keyboard1);\r
+       IN_initplayer(&player, 0);\r
 \r
        textInit();\r
        VGAmodeX(bakapee, 1, &gvar);\r
@@ -82,11 +83,13 @@ void main(int argc, char *argv[])
 \r
        /* set up the page, but with 16 pixels on all borders in offscreen mem */\r
        modexHiganbanaPageSetup(&gvar.video);\r
-       for(i=0;i<gvar.video.num_of_pages-2;i++)\r
+       for(i=0;i<gvar.video.num_of_pages;i++)\r
        {\r
                mv[i].page = &gvar.video.page[i];\r
                mv[i].video = &gvar.video;\r
                mv[i].pan       = &pan;\r
+               mv[i].tx        = 0;\r
+               mv[i].ty        = 0;\r
        }\r
 //     gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
 //     gvar.video.page[1] = modexNextPage(&gvar.video.page[0]);\r
@@ -106,33 +109,35 @@ void main(int argc, char *argv[])
        /* fade in */\r
        modexFadeOn(1, pal2);\r
 \r
-       i=0,k=0,j=0,pan.pn=1;\r
+       i=0,k=0,j=0,pan.pn=0;\r
        startclk = *clockw;\r
        while(!IN_KeyDown(sc_Escape))\r
        {\r
                IN_ReadControl(0,&player);\r
-               if(i<5){\r
+               panpagemanual(mv, player, 0);\r
+\r
+               /*if(i<5){\r
                switch (k)\r
                {\r
                        case 0:\r
                                pee:\r
-                               /* go right */\r
+                               // go right\r
                                gvar.video.page[pan.pn].dx++;\r
                                if(i==5){ if(j>=31){ i++; j=0; goto baka; }else j++; }else\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 1:\r
-                               /* go left */\r
+                               // go left\r
                                gvar.video.page[pan.pn].dx--;\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 2:\r
-                               /* go up */\r
+                               // go up\r
                                gvar.video.page[pan.pn].dy++;\r
                                if(j>=32){ k++; j=0; }else j++;\r
                        break;\r
                        case 3:\r
-                               /* go down */\r
+                               // go down\r
                                gvar.video.page[pan.pn].dy--;\r
                                if(j>=32){ k=0; j=0; i++; }else j++;\r
                        break;\r
@@ -143,15 +148,14 @@ void main(int argc, char *argv[])
                        if(i==5) goto pee;\r
                        baka:\r
                        i++;\r
-                       modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45);\r
+                       modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width-32, 16, 45);*/\r
                        if(IN_KeyDown(6)) modexClearRegion(&gvar.video.page[1], 0, gvar.video.page[0].height/2, gvar.video.page[0].width, 16, 45);\r
                        if(IN_KeyDown(4+1)){\r
                                modexClearRegion(&gvar.video.page[1], 16, 16, gvar.video.page[1].sw, gvar.video.page[1].sh, 128);\r
                                modexClearRegion(&gvar.video.page[1], 32, 32, gvar.video.page[1].sw-32, gvar.video.page[1].sh-32, 42);\r
                                modexClearRegion(&gvar.video.page[1], 48, 48, gvar.video.page[1].sw-64, gvar.video.page[1].sh-64, 128);\r
                        }\r
-                       panpagemanual(mv, player, 0);\r
-               }\r
+               //}\r
                if(IN_KeyDown(2)) pan.pn=0;\r
                if(IN_KeyDown(3)) pan.pn=1;\r
                //if(IN_KeyDown(6)) modexClearRegion(&gvar.video.page[1], 0, 0, gvar.video.page[0].sw-64, gvar.video.page[0].sh-16, 45);\r
@@ -175,6 +179,7 @@ void main(int argc, char *argv[])
                printf(" size=%ld", gvar.video.page[i].pagesize);\r
                printf("\n");\r
        }\r
+       printf("tx=%d   ", mv[pan.pn].tx); printf("ty=%d        ", mv[pan.pn].ty); printf("player.d=%d\n", player[0].d);\r
        IN_Shutdown();\r
        modexPalBlack();\r
        modexFadeOn(1, pal);\r