dos fixes and vga modex
[dosdemo] / src / dos / gfx.c
index 1f9b727..29f6349 100644 (file)
@@ -229,7 +229,7 @@ void *set_video_mode(int idx, int nbuf)
        }
 
        /* allocate main memory framebuffer */
-       if(resizefb(vm->xsz, vm->ysz, vm->bpp) == -1) {
+       if(demo_resizefb(vm->xsz, vm->ysz, vm->bpp) == -1) {
                fprintf(stderr, "failed to allocate %dx%d (%d bpp) framebuffer\n", vm->xsz,
                                vm->ysz, vm->bpp);
                set_text_mode();
@@ -269,7 +269,8 @@ void *page_flip(int vsync)
 
 static void blit_frame_lfb(void *pixels, int vsync)
 {
-       if(show_fps) dbg_fps(pixels);
+       demo_post_draw(pixels);
+
        if(vsync) wait_vsync();
        memcpy64(vpgaddr[frontidx], pixels, pgsize >> 3);
 }
@@ -280,7 +281,7 @@ static void blit_frame_banked(void *pixels, int vsync)
        unsigned int pending;
        unsigned char *pptr = pixels;
 
-       if(show_fps) dbg_fps(pixels);
+       demo_post_draw(pixels);
 
        if(vsync) wait_vsync();
 
@@ -289,8 +290,7 @@ static void blit_frame_banked(void *pixels, int vsync)
        pending = pgsize;
        while(pending > 0) {
                sz = pending > curmode->bank_size ? curmode->bank_size : pending;
-               //memcpy64((void*)0xa0000, pptr, sz >> 3);
-               memcpy((void*)0xa0000, pptr, sz);
+               memcpy((void*)phys_to_virt(0xa0000), pptr, sz);
                pptr += sz;
                pending -= sz;
                vbe_setwin(0, ++offs);