From: sparky4 Date: Mon, 10 Aug 2015 13:19:52 +0000 (-0500) Subject: vgamodex uses gvar now! X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=ffd855e814f3aa4f300915ffca12be6f5763e608;p=proj16%2F16.git vgamodex uses gvar now! 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 --- diff --git a/16.exe b/16.exe index 3d3f2797..6d788db8 100644 Binary files a/16.exe and b/16.exe differ diff --git a/bakapi.exe b/bakapi.exe index 4975fc13..93baab5a 100644 Binary files a/bakapi.exe and b/bakapi.exe differ diff --git a/fontgfx.exe b/fontgfx.exe index cd80b9da..743023fc 100644 Binary files a/fontgfx.exe and b/fontgfx.exe differ diff --git a/maptest.exe b/maptest.exe index 6d95e77e..63d69315 100644 Binary files a/maptest.exe and b/maptest.exe differ diff --git a/palettec.exe b/palettec.exe index 45763678..a57a113c 100644 Binary files a/palettec.exe and b/palettec.exe differ diff --git a/pcxtest.exe b/pcxtest.exe index d39c22f0..cfe2a3e8 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.exe b/scroll.exe index 2279ac22..3140778f 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/16.c b/src/16.c index 0f230198..fac98bf9 100644 --- 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 , 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~ + * 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 , or + * write to the Free Software Foundation, Inc., 51 Franklin Street, + * Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include "src/16.h" + +void main(int argc, char *argv[]) -{ - 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); -} +{ + global_game_variables_t gvar; + 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, &gvar); + 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, &gvar); + IN_Shutdown(); + modexFadeOn(4, dpal); +} diff --git a/src/bakapi.c b/src/bakapi.c index 5ce95526..42b9b222 100644 --- a/src/bakapi.c +++ b/src/bakapi.c @@ -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i†ƒÖ…j feel free to use it ^^\nLicence: GPL v3\n"); } diff --git a/src/lib/modex16.c b/src/lib/modex16.c index b1e6d51f..02fc2406 100644 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -29,14 +29,14 @@ byte far* VGA=(byte far*) 0xA0000000; /* this points to video memory. */ static void fadePalette(sbyte fade, sbyte start, word iter, byte *palette); static byte tmppal[PAL_SIZE]; -int old_mode; +//int old_mode; ///////////////////////////////////////////////////////////////////////////// // // // setvideo() - This function Manages the video modes // // // ///////////////////////////////////////////////////////////////////////////// -void VGAmodeX(sword vq) +void VGAmodeX(sword vq, global_game_variables_t *gv) { union REGS in, out; @@ -45,7 +45,7 @@ void VGAmodeX(sword vq) // change to the video mode we were in before we switched to mode 13h modexLeave(); in.h.ah = 0x00; - in.h.al = old_mode; + in.h.al = gv->old_mode; int86(0x10, &in, &out); } @@ -54,7 +54,7 @@ void VGAmodeX(sword vq) // get old video mode in.h.ah = 0xf; int86(0x10, &in, &out); - old_mode = out.h.al; + gv->old_mode = out.h.al; // enter mode modexEnter(); } diff --git a/src/lib/modex16.h b/src/lib/modex16.h index 4426f733..01e687c7 100644 --- a/src/lib/modex16.h +++ b/src/lib/modex16.h @@ -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(); diff --git a/src/scroll.c b/src/scroll.c index ab6bedd4..d65782d1 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -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; diff --git a/test.exe b/test.exe index e14a2a44..ce3ff904 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 618ccf2c..e760d0c9 100644 Binary files a/test2.exe and b/test2.exe differ