X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdos%2Fmain.c;h=4dcca05b3226bc89b8590292fae6a3fd5d751dbc;hp=6d83027d039bdcc22650b88cfab7e999b177db4a;hb=c912e59b898fe1ac461a1468e4a2e1937de286d7;hpb=7deef4d5a20da09044bf7311c6ee274090cde5e6 diff --git a/src/dos/main.c b/src/dos/main.c index 6d83027..4dcca05 100644 --- a/src/dos/main.c +++ b/src/dos/main.c @@ -15,6 +15,7 @@ #include "cfgopt.h" #include "logger.h" #include "tinyfps.h" +#include "cdpmi.h" #undef NOKEYB @@ -31,7 +32,11 @@ static quat_t rot = {0, 0, 0, 1}; int main(int argc, char **argv) { - fbsize = fb_width * fb_height * fb_bpp / CHAR_BIT; +#ifdef __DJGPP__ + __djgpp_nearptr_enable(); +#endif + + fbsize = fb_width * fb_height * fb_bpp / 8; init_logger("demo.log"); @@ -46,12 +51,14 @@ int main(int argc, char **argv) set_mouse(fb_width / 2, fb_height / 2); } - if(!(fb_pixels = malloc(fbsize))) { + /* allocate a couple extra rows as a guard band, until we fucking fix the rasterizer */ + if(!(fb_pixels = malloc(fbsize + (fb_width * fb_bpp / 8) * 2))) { fprintf(stderr, "failed to allocate backbuffer\n"); return 1; } + fb_pixels += fb_width; - if(!(vmem = set_video_mode(fb_width, fb_height, fb_bpp))) { + if(!(vmem = set_video_mode(fb_width, fb_height, fb_bpp, 1))) { return 1; } @@ -117,11 +124,12 @@ void swap_buffers(void *pixels) pixels = fb_pixels; } + demo_post_draw(pixels); + /* just memcpy to the front buffer */ if(opt.vsync) { wait_vsync(); } - drawFps(pixels); memcpy(vmem, pixels, fbsize); }