#34874 - blinky465 - Thu Jan 27, 2005 5:05 pm
I'm almost done with my iso game which uses tiled backgrounds for the floor tiles (Scott's suggestion in the iso games topic) and a linked list of sprites for the on-screen characters. I'm using VisualHAM for creating tiled backgrounds and sprites.
When I come to clear the screen, I loop through my linked list finding the corresponding sprites and I delete each one (freeing up resources as I go) and then remove the two tiled backgrounds.
As the tiled backgrounds are removed, there's a definite "chequering" effect as one is removed, then the other. I would like to avoid this.
So I created a "curtain" effect by using the DMAClearScreen function suggested on an earlier post:
So now I call this clear function using DMAClearScreen(0);
my screen goes black instantly and then I tidy up the sprites etc.
But the screen never returns from black!
The screen is recreated and the game continues (since after a little while, my main character dies and I get taken back to the menu screen) so I wondered if there was something I was missing:
a call to the function is indeed copying just a big black square directly into the video ram buffer - but any drawing functions after this don't seem to have an effect.
Do I need to do anything before setting background tiles and drawing more sprites?
When I come to clear the screen, I loop through my linked list finding the corresponding sprites and I delete each one (freeing up resources as I go) and then remove the two tiled backgrounds.
As the tiled backgrounds are removed, there's a definite "chequering" effect as one is removed, then the other. I would like to avoid this.
So I created a "curtain" effect by using the DMAClearScreen function suggested on an earlier post:
Code: |
void DMAClearScreen(u16 color) { ham_VBAText("clearing screen"); REG_DM3SAD = (u32) & color; REG_DM3DAD = 0x06000000; //Destination Address (REG_DM3CNT_L) = (160 * 240); (REG_DM3CNT_H) = 0x9100; } |
So now I call this clear function using DMAClearScreen(0);
my screen goes black instantly and then I tidy up the sprites etc.
But the screen never returns from black!
The screen is recreated and the game continues (since after a little while, my main character dies and I get taken back to the menu screen) so I wondered if there was something I was missing:
a call to the function is indeed copying just a big black square directly into the video ram buffer - but any drawing functions after this don't seem to have an effect.
Do I need to do anything before setting background tiles and drawing more sprites?