forgot about the non-zero base of the conventional memory selector in CWSDPMI...
[retrobench] / src / dos / main.c
index 761dd56..aeb18ba 100644 (file)
@@ -17,16 +17,16 @@ int main(int argc, char **argv)
        int num_frames = 0;
        void *vmem;
 
+#ifdef __DJGPP__
+       __djgpp_nearptr_enable();
+#endif
+
        read_config("rbench.cfg");
 
        if(parse_args(argc, argv) == -1) {
                return 1;
        }
 
-#ifdef __DJGPP__
-       __djgpp_nearptr_enable();
-#endif
-
        init_logger("rbench.log");
 
        if(init_video() == -1) {
@@ -67,21 +67,25 @@ int main(int argc, char **argv)
 end:
        set_text_mode();
        cleanup_video();
+       stop_logger();
 
        if(num_frames) {
+               printf("%d frames in %d msec\n", num_frames, time_msec);
                printf("avg framerate: %.1f fps\n", (10000 * num_frames / time_msec) / 10.0f);
        }
        return 0;
 }
 
-int resizefb(int x, int y, int bpp)
+int resizefb(int x, int y, int bpp, int pitch)
 {
+       printf("resizefb %dx%d %dbpp (pitch: %d)\n", x, y, bpp, pitch);
+
        free(framebuf);
 
        fb_width = x;
        fb_height = y;
        fb_bpp = bpp;
-       fb_pitch = x * bpp / 8;
+       fb_pitch = pitch;
 
        if(!(framebuf = malloc(fb_pitch * fb_height))) {
                fprintf(stderr, "failed to allocate %dx%d (%dbpp) framebuffer\n",