]> 4ch.mooo.com Git - 16.git/blobdiff - src/pcxtest2.c
cleaned up the repo from debugging watcom2 ^^
[16.git] / src / pcxtest2.c
index 3b83c53dfff92ee8fa67e72233f06381a2f4d04d..aea2eb9a542bfecb1ca81e07808547083a5f0472 100755 (executable)
@@ -62,12 +62,33 @@ void main() {
        int plane;\r
        float t1, t2;\r
 \r
+       // DOSLIB: check our environment\r
+       probe_dos();\r
+\r
+       // DOSLIB: what CPU are we using?\r
+       // NTS: I can see from the makefile Sparky4 intends this to run on 8088 by the -0 switch in CFLAGS.\r
+       //      So this code by itself shouldn't care too much what CPU it's running on. Except that other\r
+       //      parts of this project (DOSLIB itself) rely on CPU detection to know what is appropriate for\r
+       //      the CPU to carry out tasks. --J.C.\r
+       cpu_probe();\r
+\r
+       // DOSLIB: check for VGA\r
+       if (!probe_vga()) {\r
+               printf("VGA probe failed\n");\r
+               return;\r
+       }\r
+       // hardware must be VGA or higher!\r
+       if (!(vga_state.vga_flags & VGA_IS_VGA)) {\r
+               printf("This program requires VGA or higher graphics hardware\n");\r
+               return;\r
+       }\r
+\r
 //0000 bmp = bitmapLoadPcx("data/koishi~~.pcx");\r
-//     bmp = bitmapLoadPcx("data/chikyuu.pcx");\r
-       bmp = bitmapLoadPcx("data/koishi^^.pcx");\r
+       bmp = bitmapLoadPcx("data/chikyuu.pcx");\r
+//     bmp = bitmapLoadPcx("data/koishi^^.pcx");\r
 //     bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx");\r
        p = planar_buf_from_bitmap(&bmp);\r
-       VGAmodeX(1, &gvar);\r
+       VGAmodeX(1, 1, &gvar);\r
        gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]);\r
        gvar.video.page[0].sw+=32;\r
        gvar.video.page[0].sh+=32;\r
@@ -121,7 +142,7 @@ void main() {
        {\r
                //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0);\r
        }\r
-       VGAmodeX(0, &gvar);\r
+       VGAmodeX(0, 1, &gvar);\r
        /*printf("\nmain=%Fp\n\n", &i);\r
        printf("bmp.data=%Fp\n", bmp.data);\r
        printf("*bmp.data=%Fp\n", *(bmp.data));\r