-/* 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
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;
//modexDrawBmp(VGA, 0, 0, &bmp, 0); //____
//getch(); //____
- VGAmodeX(1);
+ VGAmodeX(1, &gvar);
modexShowPage(&screen);
// screen savers
}
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
screen = modexDefaultPage();
screen.width += (TILEWH*2);
screen.height += (TILEWH*2);
- VGAmodeX(1);
+ VGAmodeX(1, &gvar);
modexShowPage(&screen);
}
}
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");
}
\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
// 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
// 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