#4781 - BhaaL - Wed Apr 09, 2003 2:31 pm
In a tutorial on www.thepernproject.com the author (can't remember his name...) used a function to Flip between the FrontBuffer and the BackBuffer.
Here's the function:
Could anybody explain the "~" in the line "REG_DISPCNT &= ~BACKBUFFER;" to me?
_________________
Windows XP is the Answer...
How stupid was the Question?!
Here's the function:
Code: |
#define REG_DISPCNT 0x4000000
#define BACKBUFFER 0x10 #define FrontBuffer (u16*)0x6000000 #define BackBuffer (u16*)0x600A000 //start of back buffer in Mode 4 u16* VideoBuffer; //This is were we are currently drawing void Flip(void) { if(REG_DISPCNT & BACKBUFFER) //back buffer is the current buffer so we need to switch it to the font buffer { REG_DISPCNT &= ~BACKBUFFER; //flip active buffer to front buffer by clearing back buffer bit VideoBuffer = BackBuffer; //now we point our drawing buffer to the back buffer } else //front buffer is active so switch it to backbuffer { REG_DISPCNT |= BACKBUFFER; //flip active buffer to back buffer by setting back buffer bit VideoBuffer = FrontBuffer; //now we point our drawing buffer to the front buffer } } |
Could anybody explain the "~" in the line "REG_DISPCNT &= ~BACKBUFFER;" to me?
_________________
Windows XP is the Answer...
How stupid was the Question?!