X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fpcxtest2.c;h=167e1f6a46f955f2b8071112cec982b1ad1bad63;hb=5a54933b41f0bcd3653a5da5fc37cc72a08448a3;hp=059b448acf32a76906e700d6d206504e972695e9;hpb=c91b34cede872764dc0e899b5d2662a2e6622169;p=16.git diff --git a/src/pcxtest2.c b/src/pcxtest2.c index 059b448a..167e1f6a 100755 --- a/src/pcxtest2.c +++ b/src/pcxtest2.c @@ -1,5 +1,5 @@ /* Project 16 Source Code~ - * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 + * Copyright (C) 2012-2016 sparky4 & pngwen & andrius4669 & joncampbell123 & yakui-lover * * This file is part of Project 16. * @@ -25,7 +25,7 @@ #include #include "src/lib/modex16.h" #include "src/lib/bitmap.h" -#include "src/lib/planar.h" +//----#include "src/lib/planar.h" global_game_variables_t gvar; @@ -56,17 +56,38 @@ DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite) void main() { bitmap_t bmp; - planar_buf_t *p; +//---- planar_buf_t *p; int i; word start; int plane; float t1, t2; + // 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; + } + //0000 bmp = bitmapLoadPcx("data/koishi~~.pcx"); -// bmp = bitmapLoadPcx("data/chikyuu.pcx"); - bmp = bitmapLoadPcx("data/koishi^^.pcx"); + bmp = bitmapLoadPcx("data/chikyuu.pcx"); +// bmp = bitmapLoadPcx("data/koishi^^.pcx"); // bmp = bitmapLoadPcx("16/PCX_LIB/chikyuu.pcx"); - p = planar_buf_from_bitmap(&bmp); +//---- p = planar_buf_from_bitmap(&bmp); VGAmodeX(1, 1, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); gvar.video.page[0].sw+=32;