X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2F16.c;h=d78b1f37bd12dc1b6fa7f71fb11a732ffa957476;hb=579be865a2f1d2a84d5295506f3e8ea9815d11af;hp=6ad5334f03d1566a7554375400166e9ee337a7e0;hpb=658eba1768f70e0ce6cb01bb817709c1caf91834;p=proj16%2F16.git diff --git a/src/16.c b/src/16.c index 6ad5334f..d78b1f37 100755 --- a/src/16.c +++ b/src/16.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover + * Copyright (C) 2012-2020 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -22,78 +22,38 @@ #include "src/16.h" -global_game_variables_t gvar; -engi_stat_t engi_stat; -const char *cpus; -byte *dpal, *gpal; -player_t player[MaxPlayers]; - void main(int argc, char *argv[]) { - // DOSLIB: check our environment - probe_dos(); - - // DOSLIB: what CPU are we using? - // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS. - // So this code by itself shouldn't care too much what CPU it's running on. Except that other - // parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for - // the CPU to carry out tasks. --J.C. - cpu_probe(); - - // DOSLIB: check for VGA - if (!probe_vga()) { - printf("VGA probe failed\n"); - return; - } - // hardware must be VGA or higher! - if (!(vga_state.vga_flags & VGA_IS_VGA)) { - printf("This program requires VGA or higher graphics hardware\n"); - return; - } - - if (_DEBUG_INIT() == 0) { -#ifdef DEBUGSERIAL - printf("WARNING: Failed to initialize DEBUG output\n"); -#endif - } - _DEBUG("Serial debug output started\n"); // NTS: All serial output must end messages with newline, or DOSBox-X will not emit text to log - _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); - - engi_stat = ENGI_RUN; - textInit(); + static global_game_variables_t gvar; + Startup16(&gvar);//initgame equ /* save the palette */ - dpal = modexNewPal(); - modexPalSave(dpal); - modexFadeOff(4, dpal); - gpal = modexNewPal(); - modexPalSave(gpal); - modexSavePalFile("data/g.pal", gpal); + modexPalSave(gvar.video.dpal); + modexFadeOff(4, gvar.video.dpal); + modexPalSave(gvar.video.palette); + modexSavePalFile("data/g.pal", gvar.video.palette); VGAmodeX(1, 1, &gvar); // modexPalBlack(); //so player will not see loadings~ - IN_Startup(); - IN_Default(0,&player,ctrl_Joystick); + IN_Default(0,&gvar.player[0],ctrl_Joystick, &gvar); //modexprint(&screen, 32, 32, 1, 2, 0, "a", 1); - start_timer(&gvar); - while(ENGI_EXIT != engi_stat) + while(1) { - IN_ReadControl(0,&player); - if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT; + IN_ReadControl(&gvar.player[0], &gvar); + if(gvar.in.inst->Keyboard[sc_Escape]) break; shinku(&gvar); _DEBUGF("Serial debug output printf test %u %u %u\n",1U,2U,3U); } - 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; - } + Shutdown16(&gvar); VGAmodeX(0, 1, &gvar); printf("Project 16 16.exe. This is supposed to be the actual finished game executable!\n"); printf("version %s\n", VERSION); - printf("detected CPU type: %s\n", cpus); - IN_Shutdown(); - modexFadeOn(4, dpal); + WCPU_cpufpumesg(); + modexFadeOn(4, gvar.video.dpal); +// InitGame ();//to be defined in 16_tail + +//++++ DemoLoop();//to be defined in 16_tail + +//++++ Quit(&gvar, "Demo loop exited???"); + }