X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fdos%2Fgfx.c;h=90085ec6a686650e7b65971781b394fcdf0ed020;hb=1ee73f3c18d424d7f1f0f36aa1f3ca06337a9d9c;hp=0a8a00cf5f728b11ee6ece380f136bf10949aaef;hpb=86ea36402d2ba296db0950d85e18c50f7ee7006b;p=retroray diff --git a/src/dos/gfx.c b/src/dos/gfx.c index 0a8a00c..90085ec 100644 --- a/src/dos/gfx.c +++ b/src/dos/gfx.c @@ -22,12 +22,8 @@ void (*blit_frame)(void*, int); -extern int dblsize; - static void blit_frame_lfb(void *pixels, int vsync); static void blit_frame_banked(void *pixels, int vsync); -static void blit_frame_lfb_2x(void *pixels, int vsync); -static void blit_frame_banked_2x(void *pixels, int vsync); static uint32_t calc_mask(int sz, int pos); static void enable_wrcomb(uint32_t addr, int len); @@ -238,7 +234,7 @@ void *set_video_mode(int idx, int nbuf) vpgaddr[1] = 0; } - blit_frame = dblsize ? blit_frame_lfb_2x : blit_frame_lfb; + blit_frame = blit_frame_lfb; /* only attempt to set up write combining if the CPU we're running on * supports memory type range registers, and we're running on ring 0 @@ -267,7 +263,7 @@ void *set_video_mode(int idx, int nbuf) vpgaddr[0] = VMEM_PTR; vpgaddr[1] = 0; - blit_frame = dblsize ? blit_frame_banked_2x : blit_frame_banked; + blit_frame = blit_frame_banked; /* calculate window granularity shift */ vm->win_gran_shift = 0; @@ -285,12 +281,14 @@ void *set_video_mode(int idx, int nbuf) } /* allocate main memory framebuffer */ + /* 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(); return 0; } + */ fflush(stdout); return vpgaddr[0]; @@ -326,10 +324,8 @@ void *page_flip(int vsync) static void blit_frame_lfb(void *pixels, int vsync) { - demo_post_draw(pixels); - if(vsync) wait_vsync(); - memcpy64(vpgaddr[frontidx], pixels, pgsize >> 3); + memcpy(vpgaddr[frontidx], pixels, pgsize); } static void blit_frame_banked(void *pixels, int vsync) @@ -337,40 +333,6 @@ static void blit_frame_banked(void *pixels, int vsync) int sz, offs, pending; unsigned char *pptr = pixels; - demo_post_draw(pixels); - - if(vsync) wait_vsync(); - - /* assume initial window offset at 0 */ - offs = 0; - pending = pgsize; - while(pending > 0) { - sz = pending > 65536 ? 65536 : pending; - /*memcpy64(VMEM_PTR, pptr, sz >> 3);*/ - memcpy(VMEM_PTR, pptr, sz); - pptr += sz; - pending -= sz; - offs += curmode->win_64k_step; - vbe_setwin(0, offs); - } - vbe_setwin(0, 0); -} - -static void blit_frame_lfb_2x(void *pixels, int vsync) -{ - demo_post_draw(pixels); - - if(vsync) wait_vsync(); - memcpy64(vpgaddr[frontidx], pixels, pgsize >> 3); -} - -static void blit_frame_banked_2x(void *pixels, int vsync) -{ - int sz, offs, pending; - unsigned char *pptr = pixels; - - demo_post_draw(pixels); - if(vsync) wait_vsync(); /* assume initial window offset at 0 */ @@ -378,7 +340,6 @@ static void blit_frame_banked_2x(void *pixels, int vsync) pending = pgsize; while(pending > 0) { sz = pending > 65536 ? 65536 : pending; - /*memcpy64(VMEM_PTR, pptr, sz >> 3);*/ memcpy(VMEM_PTR, pptr, sz); pptr += sz; pending -= sz;