How do I implement a 'double buffer' for my sprites in graphics mode in assembly?

358 views Asked by At

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

1

There are 1 answers

0
Dirk Wolfgang Glomp On

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).