]> 4ch.mooo.com Git - 16.git/blobdiff - src/scroll.c
same dos/cpu/vga probe for scroll.c
[16.git] / src / scroll.c
index 46713b3ab3f73b7a891955158867dd9eb121425c..0c37c8c43f8a112902e171e216254e0f7a6fbdeb 100755 (executable)
@@ -1,5 +1,5 @@
 /* Project 16 Source Code~
- * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669
+ * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123
  *
  * This file is part of Project 16.
  *
@@ -21,7 +21,7 @@
  */
 
 #include "src/lib/scroll16.h"
-#include "src/lib/timer.h"
+#include "src/lib/16_timer.h"
 #include "src/lib/wcpu/wcpu.h"
 
 //#define FADE
@@ -64,25 +64,44 @@ void main(int argc, char *argv[])
        if(argv[1]) bakapee = atoi(argv[1]);
        else bakapee = 1;
 
-       testcontrolnoisy=1;
-       gfxtest=1;
+       // 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;
+       }
+
+       testcontrolnoisy=0;
 
        player[0].persist_aniframe=0;
        player[0].speed=4;
        //player[0].data = &pp;
 
-       printf("starting timer\n");
+       printf("starting timer  ");
        start_timer(&gvar);
        printf("ok\n");
-       //extern struct inconfig inpu;
 
 //     atexit(qclean());
 
        /* create the map */
-       fprintf(stderr, "testing map load~\n");
+       fprintf(stderr, "testing map load~      ");
        loadmap("data/test.map", &map);
        chkmap(&map, 0);
-       printf("chkmap ok\n");
+       printf("chkmap ok       ");
        fprintf(stderr, "yay map loaded~~\n");
        mv[0].map = ↦
        mv[1].map = ↦
@@ -99,7 +118,7 @@ void main(int argc, char *argv[])
 
        /* create the planar buffer */
 ////++++       (player[0].data) = *planar_buf_from_bitmap(&p);
-       printf("load pee!!\n");
+       printf("load pee!!      ");
        pp = planar_buf_from_bitmap(&p);
        printf("done!\n");
 
@@ -119,7 +138,7 @@ void main(int argc, char *argv[])
 #endif
 
        textInit();
-       VGAmodeX(bakapee, &gvar);
+       VGAmodeX(bakapee, 1, &gvar);
 //     printf("%dx%d\n", gvar.video.page[0].sw, gvar.video.page[0].sh);
 #ifdef FADE
        modexPalBlack();        //reset the palette~
@@ -369,7 +388,7 @@ void main(int argc, char *argv[])
        //TSR
        if(IN_KeyDown(87))      //f11
        {
-               VGAmodeX(0, &gvar);
+               VGAmodeX(0, 0, &gvar);
                IN_Shutdown();
                __asm
                {
@@ -412,7 +431,7 @@ void main(int argc, char *argv[])
        modexSavePalFile("data/g.pal", gpal);
        modexFadeOff(4, gpal);
 #endif
-       VGAmodeX(0, &gvar);
+       VGAmodeX(0, 1, &gvar);
 #endif
        IN_Shutdown();
        printf("Project 16 scroll.exe. This is just a test file!\n");