Acorn Arcade forums: Programming: Screen bank switching and VSync
|
Screen bank switching and VSync |
|
Alan B (08:22 10/10/2005) tribbles (08:50 10/10/2005)
|
|
Alan Buckley |
Message #86424, posted by Alan B at 08:22, 10/10/2005 |
AA refugee
Posts: 8
|
I seem to have become confused about screen banking and waiting for VSync. The code I used to use waited for the VSync and then swapped the screens on the principle that the screen would be swapped during the retrace. This now seems to give a lot of flicker on my Iyonix. Searching on Google groups seemed to imply I should be doing it the other way around as the screen memory pointers are swapped on the refresh (I think). There also seems to be a cache involved on RISC OS 4. Can anyone give me the definative code to use that will work correctly for all versions of RISC OS from 3.5 onwards? |
|
[ Log in to reply ] |
|
Jason Tribbeck |
Message #86425, posted by tribbles at 08:50, 10/10/2005, in reply to message #86424 |
Captain Helix
Posts: 929
|
I always used to get confused by this. Using OS_Byte 112/113 or OS_Word 22 (or is it 21?) sets the display for the /next/ vsync, so you should do it before doing the OS_Byte 19. I do this on ArcCommand and Equinox (as well as some other things). Not sure about the cache - although I have had a problem where it appears as though the write buffer when faced with two writes to the same word writes them in the wrong order. I say appears to - it's certainly the effect I'm seeing. I haven't isolated that problem yet (and it only seems to affect one person, or if I'm in debug mode [no screen bank switching]), so if anyone else has an idea, I'd be interested too!
[Edited by tribbles at 09:51, 10/10/2005] |
|
[ Log in to reply ] |
|
|
Acorn Arcade forums: Programming: Screen bank switching and VSync |