#10771 - Ruiner - Mon Sep 15, 2003 6:48 am
I have a few title screens at the beginning of my game giving credits where due. On the first flip it works and it doesn't on the second.
I'm guessing the reason this doesn't work is because its not actually switching the backbuffer pointer to whatever surface is actually in back. Can anyone verify this for me? Flip writes the backbuffer to the front no matter what REG_DISPCNT equals so I assumed I could just blast data to the back every time.
Also Im not entirely sure whats going on there. Should VideoBuffer = BackBuffer possibly be DMA'd or is that just swapping pointer addresses?
I'm guessing the reason this doesn't work is because its not actually switching the backbuffer pointer to whatever surface is actually in back. Can anyone verify this for me? Flip writes the backbuffer to the front no matter what REG_DISPCNT equals so I assumed I could just blast data to the back every time.
Code: |
void DMA3Copy(u16* _source, u16* _dest, u32 _wordCount, u32 _mode) { REG_DM3SAD = (u32)_source; REG_DM3DAD = (u32)_dest; REG_DM3CNT = _wordCount | _mode; } void Flip() { if (REG_DISPCNT & BACKBUFFER) { REG_DISPCNT &= ~BACKBUFFER; VideoBuffer = BackBuffer; } else { REG_DISPCNT |= BACKBUFFER; VideoBuffer = BackBuffer; } } void DisplaySplash(const u16* _palette, const u16* _data) { DMA3Copy(const_cast <u16*> (_palette), BGPaletteMem, 256, DMA_16NOW); DMA3Copy(const_cast <u16*> (_data), BackBuffer, 19200, DMA_16NOW); WaitForVblank(); Flip(); while(1) { key_refresh(); for(u16 i = 0; i < 10; i++) if(release[i]) return; } } |
Also Im not entirely sure whats going on there. Should VideoBuffer = BackBuffer possibly be DMA'd or is that just swapping pointer addresses?