X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fdos%2Fmain.c;h=e3242f1135abe7748ee18251bc539cba7b8ba6e7;hb=HEAD;hp=e7aae2cafe2a0bc2d339a64ca52f673696653e0e;hpb=4a690a4a5268847c24e8edb08ba558a36bbd6d3c;p=retroray diff --git a/src/dos/main.c b/src/dos/main.c index e7aae2c..e3242f1 100644 --- a/src/dos/main.c +++ b/src/dos/main.c @@ -21,6 +21,7 @@ along with this program. If not, see . #include #include #include "app.h" +#include "timer.h" #include "keyb.h" #include "vidsys.h" #include "cdpmi.h" @@ -60,18 +61,21 @@ int main(int argc, char **argv) __djgpp_nearptr_enable(); #endif + if(!have_mouse()) { + fprintf(stderr, "No mouse detected. Make sure the mouse driver is installed\n"); + return 1; + } + init_logger(); if(read_cpuid(&cpuid) == 0) { print_cpuid(&cpuid); } + init_timer(0); kb_init(); - if(!have_mouse()) { - fprintf(stderr, "No mouse detected. Make sure the mouse driver is installed\n"); - return 1; - } + load_options(CFGFILE); if((env = getenv("RRLOG"))) { if(tolower(env[0]) == 'c' && tolower(env[1]) == 'o' && tolower(env[2]) == 'm' @@ -86,15 +90,15 @@ int main(int argc, char **argv) return 1; } - if((vmidx = vid_findmode(640, 480, 32)) == -1) { + if((vmidx = vid_findmode(opt.xres, opt.yres, opt.bpp)) == -1) { return 1; } if(!(vmem = vid_setmode(vmidx))) { return 1; } - win_width = 640; - win_height = 480; + win_width = opt.xres; + win_height = opt.yres; win_aspect = (float)win_width / (float)win_height; if(app_init() == -1) { @@ -159,11 +163,6 @@ break_evloop: return 0; } -long app_getmsec(void) -{ - return time(0) * 1000; /* TODO */ -} - void app_redisplay(int x, int y, int w, int h) { rtk_rect r;