#30407 - mr_square - Wed Dec 01, 2004 12:09 am
Hi all. I'm currently looking at manipulating my background scroll values during the Hblank period to produce a typical wave'y effect (specifically I'm trying to make some water look as if it is flowing)
I've read up on some of the topics on here, but I'm still a bit confused about how to actually manipulate stuff during the hblank period. From what I can gather, REG_VCOUNT increases after each horizontal line, until it gets to 160, at which point its not drawing to the screen and you can manipulate everything freely.
I currently wait for a VSync using:
(I'm using the AAS audio mixer, which is the function being called there).
To calculate an Hblank would you just do something like
and then alter the scroll values depending on which hBlank you were on?
That seems a bit simple, so I'm sure it can't be right (it certainly doesn't do anything when I try it in my code). Also, I hear people saying you need to specifically enable hblank interrupts - how do you do this? I assumed it was all just automatically tied to REG_VCOUNT.
I've read up on some of the topics on here, but I'm still a bit confused about how to actually manipulate stuff during the hblank period. From what I can gather, REG_VCOUNT increases after each horizontal line, until it gets to 160, at which point its not drawing to the screen and you can manipulate everything freely.
I currently wait for a VSync using:
Code: |
while((volatile u16)REG_VCOUNT != 160) { AAS_DoWork(); } |
(I'm using the AAS audio mixer, which is the function being called there).
To calculate an Hblank would you just do something like
Code: |
while((volatile u16)REG_VCOUNT < 160) |
and then alter the scroll values depending on which hBlank you were on?
That seems a bit simple, so I'm sure it can't be right (it certainly doesn't do anything when I try it in my code). Also, I hear people saying you need to specifically enable hblank interrupts - how do you do this? I assumed it was all just automatically tied to REG_VCOUNT.