]> 4ch.mooo.com Git - 16.git/commitdiff
vgamodex uses gvar now!
authorsparky4 <sparky4@cock.li>
Mon, 10 Aug 2015 13:19:52 +0000 (08:19 -0500)
committersparky4 <sparky4@cock.li>
Mon, 10 Aug 2015 13:19:52 +0000 (08:19 -0500)
modified:   16.exe
modified:   bakapi.exe
modified:   fontgfx.exe
modified:   maptest.exe
modified:   palettec.exe
modified:   pcxtest.exe
modified:   scroll.exe
modified:   src/16.c
modified:   src/bakapi.c
modified:   src/lib/modex16.c
modified:   src/lib/modex16.h
modified:   src/scroll.c
modified:   test.exe
modified:   test2.exe

14 files changed:
16.exe
bakapi.exe
fontgfx.exe
maptest.exe
palettec.exe
pcxtest.exe
scroll.exe
src/16.c
src/bakapi.c
src/lib/modex16.c
src/lib/modex16.h
src/scroll.c
test.exe
test2.exe

diff --git a/16.exe b/16.exe
index 3d3f27977d3fd336b2bbb07502dcc9bc46899663..6d788db894061098f228028fa12c04de8854b021 100644 (file)
Binary files a/16.exe and b/16.exe differ
index 4975fc13e23fe2852d37c4d0cd6da1ec6ce9951f..93baab5af57d9bcd90685a84856e055bd0b1cccb 100644 (file)
Binary files a/bakapi.exe and b/bakapi.exe differ
index cd80b9da77b33b0c6276cc7d883bd32e9bb57d28..743023fc2a114901d661e85636e01653dd0cf9c6 100644 (file)
Binary files a/fontgfx.exe and b/fontgfx.exe differ
index 6d95e77e771cbd10f2b7ee67031b73afd4e1ce86..63d69315ca939ca6c0cc6cf8ed3b3997ba7af2b0 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index 4576367883ffe4b0f9aca69a2b0cf21dd61dd0a5..a57a113c7d6be36a1b998fe2e437fac533b31fe4 100644 (file)
Binary files a/palettec.exe and b/palettec.exe differ
index d39c22f06dcd211c321b02cffc829b2864e72dee..cfe2a3e80d5d0084c65447b618df6000edffbc39 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 2279ac22bc704844d24c95c37af0a4e682d343a6..3140778f7ee5a67c3c186a862a9d45b53db1bc28 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 0f230198e8ca3b776ef2f32a326b9da07134996e..fac98bf97290465e1dbcf6e814c38c9db4fc8f9a 100644 (file)
--- a/src/16.c
+++ b/src/16.c
@@ -1,64 +1,65 @@
-/* Project 16 Source Code~
- * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
- *
- * This file is part of Project 16.
- *
- * Project 16 is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Project 16 is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>, or
- * write to the Free Software Foundation, Inc., 51 Franklin Street,
- * Fifth Floor, Boston, MA 02110-1301 USA.
- *
- */
-
-#include "src/16.h"
-
-void
+/* Project 16 Source Code~\r
+ * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669\r
+ *\r
+ * This file is part of Project 16.\r
+ *\r
+ * Project 16 is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * Project 16 is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>, or\r
+ * write to the Free Software Foundation, Inc., 51 Franklin Street,\r
+ * Fifth Floor, Boston, MA 02110-1301 USA.\r
+ *\r
+ */\r
+\r
+#include "src/16.h"\r
+\r
+void\r
 main(int argc, char *argv[])\r
-{
-       engi_stat_t engi_stat;
-       const char *cpus;
-       byte *dpal, *gpal;
-       player_t player[MaxPlayers];
-
-       engi_stat = ENGI_RUN;
-
-       /* save the palette */
-       dpal = modexNewPal();
-       modexPalSave(dpal);
-       modexFadeOff(4, dpal);
-       //printf("pal load\n");
-       //gpal = modexNewPal();
-       /*modexPalSave(gpal);
-       modexSavePalFile("data/g.pal", gpal);*/
-       printf("wwww loop wwww\n");
-       VGAmodeX(1);
-       modexPalBlack();        //so player will not see loadings~
-       IN_Startup();
-       IN_Default(0,&player,ctrl_Joystick);
-       while(ENGI_EXIT != engi_stat)
-       {
-               IN_ReadControl(0,&player);
-               if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT;
-       }
-       switch(detectcpu())
-       {
-               case 0: cpus = "8086/8088 or 186/88"; break;
-               case 1: cpus = "286"; break;
-               case 2: cpus = "386 or newer"; break;
-               default: cpus = "internal error"; break;
-       }
-       printf("detected CPU type: %s\n", cpus);
-       VGAmodeX(0);
-       IN_Shutdown();
-       modexFadeOn(4, dpal);
-}
+{\r
+       global_game_variables_t gvar;\r
+       engi_stat_t engi_stat;\r
+       const char *cpus;\r
+       byte *dpal, *gpal;\r
+       player_t player[MaxPlayers];\r
+\r
+       engi_stat = ENGI_RUN;\r
+\r
+       /* save the palette */\r
+       dpal = modexNewPal();\r
+       modexPalSave(dpal);\r
+       modexFadeOff(4, dpal);\r
+       //printf("pal load\n");\r
+       //gpal = modexNewPal();\r
+       /*modexPalSave(gpal);\r
+       modexSavePalFile("data/g.pal", gpal);*/\r
+       printf("wwww loop wwww\n");\r
+       VGAmodeX(1, &gvar);\r
+       modexPalBlack();        //so player will not see loadings~\r
+       IN_Startup();\r
+       IN_Default(0,&player,ctrl_Joystick);\r
+       while(ENGI_EXIT != engi_stat)\r
+       {\r
+               IN_ReadControl(0,&player);\r
+               if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT;\r
+       }\r
+       switch(detectcpu())\r
+       {\r
+               case 0: cpus = "8086/8088 or 186/88"; break;\r
+               case 1: cpus = "286"; break;\r
+               case 2: cpus = "386 or newer"; break;\r
+               default: cpus = "internal error"; break;\r
+       }\r
+       printf("detected CPU type: %s\n", cpus);\r
+       VGAmodeX(0, &gvar);\r
+       IN_Shutdown();\r
+       modexFadeOn(4, dpal);\r
+}\r
index 5ce95526e37321ef576f90dd308e5f8da9a9f6f6..42b9b222d8f14a25fc65dd0b2798a62f7214cf94 100644 (file)
@@ -28,6 +28,7 @@
 void
 main(int argc, char *argv[])
 {
+       global_game_variables_t gvar;
        static bakapee_t bakapee;
        page_t screen;
        word key,d,xpos,ypos,xdir,ydir;
@@ -58,7 +59,7 @@ main(int argc, char *argv[])
        //modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
        //getch(); //____
 
-       VGAmodeX(1);
+       VGAmodeX(1, &gvar);
        modexShowPage(&screen);
 
 // screen savers
@@ -71,7 +72,7 @@ main(int argc, char *argv[])
                }
                else
                {
-                       VGAmodeX(0);
+                       VGAmodeX(0, &gvar);
                        //modexLeave();
                        // user imput switch
                        printf("Enter 1, 2, 3, 4, or 6 to run a screensaver, or enter 0 to quit.\n", getch());  // prompt the user
@@ -81,7 +82,7 @@ main(int argc, char *argv[])
                                screen = modexDefaultPage();
                                screen.width += (TILEWH*2);
                                screen.height += (TILEWH*2);
-                               VGAmodeX(1);
+                               VGAmodeX(1, &gvar);
                                modexShowPage(&screen);
                        }
                }
@@ -159,7 +160,7 @@ main(int argc, char *argv[])
        if(ch==0x71)break; // 'q'
        if(ch==0x1b)break; // 'ESC'
        }
-//     VGAmodeX(0);
+//     VGAmodeX(0, &gvar);
 #endif
        printf("bakapi ver. 1.04.13.04\nis made by sparky4\81i\81\86\83Ö\81\85\81j feel free to use it ^^\nLicence: GPL v3\n");
 }
index b1e6d51f79ef370366d443ed08c7330a6a048226..02fc24062c5d8760fe21a995a2b2c89a68f31b0d 100644 (file)
@@ -29,14 +29,14 @@ byte far* VGA=(byte far*) 0xA0000000;   /* this points to video memory. */
 \r
 static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette);\r
 static byte tmppal[PAL_SIZE];\r
-int old_mode;\r
+//int old_mode;\r
 \r
 /////////////////////////////////////////////////////////////////////////////\r
 //                                                                                                                                                                                                                                             //\r
 // setvideo() - This function Manages the video modes                                                                                          //\r
 //                                                                                                                                                                                                                                             //\r
 /////////////////////////////////////////////////////////////////////////////\r
-void VGAmodeX(sword vq)\r
+void VGAmodeX(sword vq, global_game_variables_t *gv)\r
 {\r
        union REGS in, out;\r
 \r
@@ -45,7 +45,7 @@ void VGAmodeX(sword vq)
                // change to the video mode we were in before we switched to mode 13h\r
                modexLeave();\r
                in.h.ah = 0x00;\r
-               in.h.al = old_mode;\r
+               in.h.al = gv->old_mode;\r
                int86(0x10, &in, &out);\r
 \r
        }\r
@@ -54,7 +54,7 @@ void VGAmodeX(sword vq)
                // get old video mode\r
                in.h.ah = 0xf;\r
                int86(0x10, &in, &out);\r
-               old_mode = out.h.al;\r
+               gv->old_mode = out.h.al;\r
                // enter mode\r
                modexEnter();\r
        }\r
index 4426f7337feee16e9b8944b6a3c706bdfa7a97e6..01e687c700d7c5487c8ddb0d0ddbb5135770447b 100644 (file)
@@ -55,7 +55,7 @@ typedef union
 
 /* -============================ Functions =============================- */
 /* mode switching, page, and plane functions */
-void VGAmodeX(sword vq);
+void VGAmodeX(sword vq, global_game_variables_t *gv);
 void modexEnter();
 void modexLeave();
 page_t modexDefaultPage();
index ab6bedd4052d367124e49965932832cdae43beab..d65782d11641bc32044e06ec523ba528bea702fb 100644 (file)
@@ -102,7 +102,7 @@ void main()
 #endif
 
        textInit();
-       VGAmodeX(1);
+       VGAmodeX(1, &gvar);
 #ifdef FADE
        modexPalBlack();        //reset the palette~
 #endif
@@ -341,7 +341,7 @@ void main()
        //TSR
        if(IN_KeyDown(87))      //f11
        {
-               VGAmodeX(0);
+               VGAmodeX(0, &gvar);
                IN_Shutdown();
                __asm
                {
@@ -362,7 +362,7 @@ void main()
        modexSavePalFile("data/g.pal", gpal);
        modexFadeOff(4, gpal);
 #endif
-       VGAmodeX(0);
+       VGAmodeX(0, &gvar);
        IN_Shutdown();
        printf("Project 16 scroll.exe. This is just a test file!\n");
        printf("tx: %d\n", bg->tx);
@@ -386,7 +386,7 @@ void main()
 //     printf("player[0].info.x: %d", player[0].info.xaxis); printf("          player[0].info.y: %d\n", player[0].info.yaxis);
 //     printf("player[0].info.tx: %d", player[0].info.x); printf("             player[0].info.ty: %d\n", player[0].info.y);
        //printf("map.width=%d  map.height=%d   map.data[0]=%d\n", bg->map->width, bg->map->height, bg->map->data[0]);
-       
+
        switch(detectcpu())
        {
                case 0: cpus = "8086/8088 or 186/88"; break;
index e14a2a4441743fd28bced6beb5ede83436f73c42..ce3ff90472404344390709866808697b1d8f7123 100644 (file)
Binary files a/test.exe and b/test.exe differ
index 618ccf2c43f8e2f070ffc0b516a8a7d45db15874..e760d0c946b58926003378e98e7124a955d027cd 100644 (file)
Binary files a/test2.exe and b/test2.exe differ