- vbe_swap(fbidx ? pgsize : 0, vsync ? VBE_SWAP_VBLANK : VBE_SWAP_NOW);
- fbidx = (fbidx + 1) & 1;
+ vbe_swap(backidx ? pgsize : 0, vsync ? VBE_SWAP_VBLANK : VBE_SWAP_NOW);
+ frontidx = backidx;
+ backidx = (backidx + 1) & 1;
+
+ return vpgaddr[backidx];
+}
+
+
+static void blit_frame_lfb(void *pixels, int vsync)
+{
+ if(vsync) wait_vsync();
+ memcpy(vpgaddr[frontidx], pixels, pgsize);
+}
+
+static void blit_frame_banked(void *pixels, int vsync)
+{
+ int i, sz, offs;
+ unsigned int pending;
+ unsigned char *pptr = pixels;
+
+ if(vsync) wait_vsync();
+
+ /* assume initial window offset at 0 */
+ offs = 0;
+ pending = pgsize;
+ while(pending > 0) {
+ sz = pending > curmode->bank_size ? curmode->bank_size : pending;
+ memcpy((void*)0xa0000, pptr, sz);
+ pptr += sz;
+ pending -= sz;
+ vbe_setwin(0, ++offs);
+ }