#63580 - melw - Wed Dec 14, 2005 2:50 pm
I've been lately fiddling with some simple tile layout game tests and got everything otherwise working nicely but got some performance and flickering problems. More precicely here's what I have currently:
- Using VRAM_A with MODE_FB0 for main display, other one is blank / for console debug output only
- in main() loop there's currently just scanKeys() ... not much anything done to key input
- on IRQ_VBLANK the screen is drawn to framebuffer, first with 32x32 pixel tiles (8 by 6 tiles) as a background, then various sized game objects on top of it.
Whereas the background looks solid all the time, the game objects are flickering - most at the top of the screen, least in the bottom of the screen. The screen refresh rate seems to be close to 30fps, so I believe this has something to do with drawing being just too slow / taking more time than it should.
I take some kind of double buffering would be solve this - but taking a look at existing examples I couldn't quite figure out what's the optimal screen modes and method for doing this.
Any ideas and guidance is appreciated. Thanks.
- Using VRAM_A with MODE_FB0 for main display, other one is blank / for console debug output only
- in main() loop there's currently just scanKeys() ... not much anything done to key input
- on IRQ_VBLANK the screen is drawn to framebuffer, first with 32x32 pixel tiles (8 by 6 tiles) as a background, then various sized game objects on top of it.
Whereas the background looks solid all the time, the game objects are flickering - most at the top of the screen, least in the bottom of the screen. The screen refresh rate seems to be close to 30fps, so I believe this has something to do with drawing being just too slow / taking more time than it should.
I take some kind of double buffering would be solve this - but taking a look at existing examples I couldn't quite figure out what's the optimal screen modes and method for doing this.
Any ideas and guidance is appreciated. Thanks.