X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpcxtest.c;h=99e2669ee01641da7e963f546713ea71f4e7a2de;hb=155e8430aaa0e92f567b6e43d666539d09965f64;hp=7a8c3389c21e4caf37cb6e0d44a1f5dcc7c01442;hpb=c39d09723a7375861ff2d46efc946cfee56b1c7a;p=16.git diff --git a/src/pcxtest.c b/src/pcxtest.c index 7a8c3389..99e2669e 100755 --- a/src/pcxtest.c +++ b/src/pcxtest.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. * @@ -29,31 +29,6 @@ global_game_variables_t gvar; -/* -void -DrawPBuf(page_t *page, int x, int y, planar_buf_t *p, byte sprite) -{ - byte plane; - word px, py; - word offset; - - // TODO Make this fast. It's SLOOOOOOW - for(plane=0; plane < 4; plane++) { - modexSelectPlane(PLANE(plane+x)); - for(px = plane; px < p->width; px+=4) { - offset=px; - for(py=0; pyheight/2; py++) { - SELECT_ALL_PLANES(); - if(!sprite || p->plane[offset]) - page->data = p->plane; - //offset+=p->width; - //offset++; - } - } - } -} -*/ - void main() { bitmap_t bmp; planar_buf_t *p; @@ -62,12 +37,33 @@ void main() { 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); - VGAmodeX(1, &gvar); + VGAmodeX(1, 1, &gvar); gvar.video.page[0]=modexDefaultPage(&gvar.video.page[0]); /* fix up the palette and everything */ @@ -114,7 +110,7 @@ void main() { { //DrawPBuf(&gvar.video.page[0], 0, 0, p, 0); } - VGAmodeX(0, &gvar); + VGAmodeX(0, 1, &gvar); /*printf("\nmain=%Fp\n\n", &i); printf("bmp.data=%Fp\n", bmp.data); printf("*bmp.data=%Fp\n", *(bmp.data));