stop appending repeat keys to the input buffer
[retroray] / src / dos / main.c
index e7aae2c..e3242f1 100644 (file)
@@ -21,6 +21,7 @@ along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #include <ctype.h>
 #include <time.h>
 #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;