gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Updating VRAM on VBLANK INTERRUPT

#2170 - D3z - Thu Jan 30, 2003 1:11 pm

I've coded a routine that copies tiles from ROM to VRAM using DMA3,
and updates the temp_OAM.
After updating VRAM, i can see for a little bit the copied tiles on the previous OAM.
After OAM is updated everithing is fine!

What's wrong ?
How can i avoid this little flicker caused by DMA3 copy ?

#2174 - imikeyi - Thu Jan 30, 2003 1:25 pm

Not quite sure I understand your question, but..
If you want a sprite from ROM to come up on screen, all you do is:
- set up oam
- use dma to copy from rom to address specified by the oam char number

You don't need to do anything else really.. this also applies to animation.
_________________
microkernel advance

#2175 - D3z - Thu Jan 30, 2003 1:50 pm

imikeyi wrote:
Not quite sure I understand your question, but..
If you want a sprite from ROM to come up on screen, all you do is:
- set up oam
- use dma to copy from rom to address specified by the oam char number

You don't need to do anything else really.. this also applies to animation.


I generate a big sprite composed by smaller ones.

- I get a spritemap (ex 12*10 blocks 8*8) and set up temp OAM.
- I copy blocks 8*8 to VRAM
- I update the OAM with the new one.

when sprites are so big, i see for a really little bit (a flash) the new blocks copied in VRAM using old OAM.
I think that the problem appens on the second point.

There's a way to block the display until updating is done ?

#2176 - gb_feedback - Thu Jan 30, 2003 2:31 pm

just a guess... are you telling the dma to go during vblank?

#2177 - D3z - Thu Jan 30, 2003 2:35 pm

gb_feedback wrote:
just a guess... are you telling the dma to go during vblank?

No, dma3 is started immediately.

#2178 - gb_feedback - Thu Jan 30, 2003 3:09 pm

that's what I mean - I seem to remember doing it during vblank myself - got to be worth a try