X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2F16.c;h=380c3359bf7d681dfeeb3e92a4fa1a43088903c0;hb=9fae6d1ef0ebd44690958e072f400edde9262208;hp=c9cd55d50093386cec31ab277ae6312ec10fba52;hpb=5e61851e7bb3c2e579db3e83c502dc51803799f4;p=16.git diff --git a/src/16.c b/src/16.c index c9cd55d5..380c3359 100755 --- a/src/16.c +++ b/src/16.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669 + * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 * * This file is part of Project 16. * @@ -32,28 +32,58 @@ 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 + //screen = modexDefaultPage(); engi_stat = ENGI_RUN; - //textInit(); + textInit(); /* save the palette */ dpal = modexNewPal(); modexPalSave(dpal); - modexFadeOff(4, 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~ +//0000 printf("wwww loop wwww\n"); + VGAmodeX(1, 1, &gvar); +// modexPalBlack(); //so player will not see loadings~ IN_Startup(); IN_Default(0,&player,ctrl_Joystick); - //modexprint(&screen, 32, 32, 1, 2, 0, "a"); + //modexprint(&screen, 32, 32, 1, 2, 0, "a", 1); + start_timer(&gvar); while(ENGI_EXIT != engi_stat) { IN_ReadControl(0,&player); if(IN_KeyDown(sc_Escape)) engi_stat = ENGI_EXIT; + shinku(&gvar); } switch(detectcpu()) { @@ -62,10 +92,10 @@ main(int argc, char *argv[]) case 2: cpus = "386 or newer"; break; default: cpus = "internal error"; break; } - VGAmodeX(0, &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); +// modexFadeOn(4, dpal); }