0

I have searched Google for hours on how to prevent flickering while continuously drawing, erasing, and redrawing sprites I'm gonna use for my game. Many of the sites I see tell me to use a double buffer without even telling me how to. -_- Can someone please teach me how to implement a double buffer in masm32 assembly? Your answers will be greatly appreciated!

EDIT: BTW, I'm using int 10h, ah = 13h

  • Have you considered using technologies from this century? – 500 - Internal Server Error Dec 01 '14 at 02:26
  • I'm only using masm32's assembly because it's a requirement for a course. –  Dec 01 '14 at 02:32
  • 1
    I should probably have had a smiley in there :) However, generally, double-buffering applies when you are actually the one buffering the output, not when you use a BIOS function to do it. – 500 - Internal Server Error Dec 01 '14 at 02:45
  • I thought you were serious with that statement. Haha. Going back, I don't understand you last statement. Can you elaborate further? –  Dec 01 '14 at 02:51
  • [This webpage](https://courses.engr.illinois.edu/ece390/books/labmanual/graphics-mode13h.html) might help you. That page explains how to use a copy to "flip buffers". [This page](http://www.brackeen.com/vga/unchain.html) is more complicated but explains how yoh can do real page flipping without copies using some undocumented features. – JS1 Dec 01 '14 at 05:57
  • @JS1, I can't seem to implement the first link you have given. –  Dec 02 '14 at 09:22

1 Answers1

0

For to use a Bios function we need the 16 bit real mode, or the V86 mode. But not the 32 bit protected mode. For to use a buffering we can draw the output into a buffer in the ram and if we are done with it we can wait for the vertical blanking interval of the cathode-ray and then we can copy the buffer to the screen.

Another way for videomodes that uses the linear frambuffer is to use a buffer within the video ram and to adjust the disply start address to the buffer also with waiting for the vertical blanking interval. This can be done with using the VESA VBE Bios. More details about the VBE functions can be found into the public and costfree document "vbe3.pdf" from vesa.org(need register/login).