]> 4ch.mooo.com Git - 16.git/commitdiff
bakapi.exe wwww
authorsparky4 <sparky4@cock.li>
Thu, 7 Apr 2016 21:35:24 +0000 (16:35 -0500)
committersparky4 <sparky4@cock.li>
Thu, 7 Apr 2016 21:35:24 +0000 (16:35 -0500)
src/.bakapi.c.kate-swp [new file with mode: 0755]
src/bakapi.c
src/inputest.c
src/lib/modex16.h

diff --git a/src/.bakapi.c.kate-swp b/src/.bakapi.c.kate-swp
new file mode 100755 (executable)
index 0000000..f5398a7
Binary files /dev/null and b/src/.bakapi.c.kate-swp differ
index 8ea80d87ea6f3dd7cdb3730f1973dd831c95148e..6d04e5470eba75baabc399d6e44b9099e8d51218 100755 (executable)
@@ -36,6 +36,8 @@ main(int argc, char *argvar[])
 {
        char *a;
        int i;
+       word panq=1, pand=0;
+       boolean panswitch=0;
 
        // allow changing default mode from command line
        for (i=1;i < argc;) {
@@ -123,18 +125,75 @@ main(int argc, char *argvar[])
 #ifdef BOINK
        while(d>0)      // on!
        {
+               int c;
                /* run screensaver routine until keyboard input */
                while (key > 0) {
                        if (kbhit()) {
-                               getch(); // eat keyboard input
-                               break;
+                               if(!panswitch)
+                               {
+                                       getch(); // eat keyboard input
+                                       break;
+                               }else c=getch();
                        }
 
-                       ding(&gvar.video.page[0], &bakapee, key);
+                       if(!panswitch)  ding(&gvar.video.page[0], &bakapee, key);
+                       else                    ding(&gvar.video.page[0], &bakapee, 2);
+                       if(panswitch!=0)
+                       {
+                               //right movement
+                               if((c==0x4d && pand == 0) || pand == 2)
+                               {
+                                       if(pand == 0){ pand = 2; }
+                                       if(panq<=(TILEWH/(4)))
+                                       {
+                                               gvar.video.page[0].dx++;
+                                               modexShowPage(&gvar.video.page[0]);
+                                               panq++;
+                                       } else { panq = 1; pand = 0; }
+                               }
+                               //left movement
+                               if((c==0x4b && pand == 0) || pand == 4)
+                               {
+                                       if(pand == 0){ pand = 4; }
+                                       if(panq<=(TILEWH/(4)))
+                                       {
+                                               gvar.video.page[0].dx--;
+                                               modexShowPage(&gvar.video.page[0]);
+                                               panq++;
+                                       } else { panq = 1; pand = 0; }
+                               }
+                               //down movement
+                               if((c==0x50 && pand == 0) || pand == 3)
+                               {
+                                       if(pand == 0){ pand = 3; }
+                                       if(panq<=(TILEWH/(4)))
+                                       {
+                                               gvar.video.page[0].dy++;
+                                               modexShowPage(&gvar.video.page[0]);
+                                               panq++;
+                                       } else { panq = 1; pand = 0; }
+                               }
+                               //up movement
+                               if((c==0x48 && pand == 0) || pand == 1)
+                               {
+                                       if(pand == 0){ pand = 1; }
+                                       if(panq<=(TILEWH/(4)))
+                                       {
+                                               gvar.video.page[0].dy--;
+                                               modexShowPage(&gvar.video.page[0]);
+                                               panq++;
+                                       } else { panq = 1; pand = 0; }
+                               }
+                               if(c==0x71 || c==0xb1 || c=='p')
+                               {
+                                       //getch(); // eat keyboard input
+                                       panswitch=0;
+                                       break; // 'q' or 'ESC' or 'p'
+                               }
+                       }
                }
 
                {
-                       int c;
 
                // this code is written around modex16 which so far is a better fit than using DOSLIB vga directly, so leave MXLIB code in.
                // we'll integrate DOSLIB vga into that part of the code instead for less disruption. -- J.C.
@@ -143,6 +202,17 @@ main(int argc, char *argvar[])
                        //fprintf(stderr, "xx=%d        yy=%d   tile=%d\n", bakapee.xx, bakapee.yy, bakapee.tile);
                        printf("Tiled mode is ");
                        switch (bakapee.tile)
+                       {
+                               case 0:
+                                       printf("off.    ");
+                               break;
+                               case 1:
+                                       printf("on.     ");
+                               break;
+                       }
+                       //printf("\n");
+                       printf("Pan mode is ");
+                       switch (panswitch)
                        {
                                case 0:
                                        printf("off.\n");
@@ -152,13 +222,25 @@ main(int argc, char *argvar[])
                                break;
                        }
                        printf("Enter 1, 2, 3, 4, 5, 6, 8, or 9 to run a screensaver, or enter 0 to quit.\n");
-
+pee:
                        c = getch();
                        switch (c) {
                                case 27: /* Escape key */
                                case '0':
                                        d=0;
                                        break;
+                               case 'p': // test pan
+                               switch (panswitch)
+                               {
+                                       case 0:
+                                               panswitch=1;
+                                       break;
+                                       case 1:
+                                               panswitch=0;
+                                       break;
+                               }
+                               goto pee;
+                               break;
                                case 'b': // test tile change
                                        switch (bakapee.tile)
                                        {
@@ -196,8 +278,6 @@ main(int argc, char *argvar[])
                }
        }
 #else // !defined(BOINK)
-word panq=1, pand=0;
-boolean panswitch=0;
 // FIXME: Does not compile. Do you want to remove this?
 // TODO: This is a testing sextion for textrendering and panning for project 16 --sparky4
        while(1)
@@ -218,119 +298,13 @@ boolean panswitch=0;
 
        ding(&gvar.video.page[0], &bakapee, key);
        modexPanPage(&gvar.video.page[0], xpos, ypos);
-               //right movement
-       if((IN_KeyDown(77) && !IN_KeyDown(75) && pand == 0) || pand == 2)
-       {
-               if(pand == 0){ pand = 2; }
-                       if(panq<=(TILEWH/(4)))
-                       {
-                               switch(panpagenum)
-                               {
-                                       case 0:
-                                               //bg
-                                               bg->page->dx++;
-                                               modexShowPage(bg->page);
-                                       break;
-                                       case 1:
-                                               //spri
-                                               spri->page->dx++;
-                                               modexShowPage(spri->page);
-                                       break;
-                                       case 2:
-                                               //fg
-                                               mask->page->dx++;
-                                               modexShowPage(mask->page);
-                                       break;
-                               }
-                               panq++;
-                       } else { panq = 1; pand = 0; }
-       }
-       //left movement
-       if((IN_KeyDown(75) && !IN_KeyDown(77) && pand == 0) || pand == 4)
-       {
-               if(pand == 0){ pand = 4; }
-                       if(panq<=(TILEWH/(4)))
-                       {
-                               switch(panpagenum)
-                               {
-                                       case 0:
-                                               //bg
-                                               bg->page->dx--;
-                                               modexShowPage(bg->page);
-                                       break;
-                                       case 1:
-                                               //spri
-                                               spri->page->dx--;
-                                               modexShowPage(spri->page);
-                                       break;
-                                       case 2:
-                                               //fg
-                                               mask->page->dx--;
-                                               modexShowPage(mask->page);
-                                       break;
-                               }
-                               panq++;
-                       } else { panq = 1; pand = 0; }
-       }
-       //down movement
-       if((IN_KeyDown(72) && !IN_KeyDown(80) && pand == 0) || pand == 3)
-       {
-               if(pand == 0){ pand = 3; }
-                       if(panq<=(TILEWH/(4)))
-                       {
-                               switch(panpagenum)
-                               {
-                                       case 0:
-                                               //bg
-                                               bg->page->dy--;
-                                               modexShowPage(bg->page);
-                                       break;
-                                       case 1:
-                                               //spri
-                                               spri->page->dy--;
-                                               modexShowPage(spri->page);
-                                       break;
-                                       case 2:
-                                               //fg
-                                               mask->page->dy--;
-                                               modexShowPage(mask->page);
-                                       break;
-                               }
-                               panq++;
-                       } else { panq = 1; pand = 0; }
-       }
-       //up movement
-       if((IN_KeyDown(80) && !IN_KeyDown(72) && pand == 0) || pand == 1)
-       {
-               if(pand == 0){ pand = 1; }
-                       if(panq<=(TILEWH/(4)))
-                       {
-                               switch(panpagenum)
-                               {
-                                       case 0:
-                                               //bg
-                                               bg->page->dy++;
-                                               modexShowPage(bg->page);
-                                       break;
-                                       case 1:
-                                               //spri
-                                               spri->page->dy++;
-                                               modexShowPage(spri->page);
-                                       break;
-                                       case 2:
-                                               //fg
-                                               mask->page->dy++;
-                                               modexShowPage(mask->page);
-                                       break;
-                               }
-                               panq++;
-                       } else { panq = 1; pand = 0; }
-       }
+       c = getch();
+
 //     xpos+=xdir;
 //     ypos+=ydir;
 //     if( (xpos>(VW-gvar.video.page[0].width-1))  || (xpos<1)){xdir=-xdir;}
 //     if( (ypos>(BH-gvar.video.page[0].height-1)) || (ypos<1)){ydir=-ydir;}
-       ch=getch();
+//     ch=getch();
        if(ch==0x71)break; // 'q'
        if(ch==0x1b)break; // 'ESC'
        }
index edd86d62c7cbc968126892393132fdbfdb066733..199dc90b2c152d9f5e94e7e52da2bc07c04bf7c5 100755 (executable)
@@ -30,9 +30,9 @@ main(int argc, char *argv[])
        global_game_variables_t gvar;\r
        player_t player[MaxPlayers];\r
        //extern struct inconfig inpu;\r
-       testkeyin=0;\r
-       testcontrolnoisy=1;\r
-       testctrltype=1;\r
+       testkeyin=1;\r
+       testcontrolnoisy=0;\r
+       testctrltype=0;\r
        IN_Startup();\r
        IN_Default(0,&player,ctrl_Joystick1);\r
        //while(!IN_KeyDown(sc_Escape))\r
index 8e0ff6a1e07465f77f8c73990962a5b93303915d..94a69ad59a38cefabb9fb0b8b6c5c7fd25f16116 100755 (executable)
@@ -42,9 +42,6 @@
 #include <hw/vga/vga.h>
 #include <hw/vga/vrl.h>
 
-//TODO dos lib vga implementation ^^
-//#define DOSLIBVGA
-
 static struct pcxHeader {
        byte id;
        byte version;