#177242 - SchmendrickSchmuck - Fri Feb 17, 2012 12:41 am
In my DS homebrew, I want to scroll a bg using the hardware scroll function. My code inside the while loop is like below:
As stated, in the drawing code bgSetScroll is called, as well as some bg modifications. I need these modifications and scroll to be applied in the same frame. However, placing the bgUpdate() call at any of the 'X' positions causes problems.
By 'jumpy screen' I mean that the background (type BgType_Bmp8, BgSize_B8_256x256) is partially displayed twice vertically, and gets worse when modifying the contents of the bg:
[Images not permitted - Click here to view it]
In case of the 'one frame too late', the bg modifications are made, but the bg isn't scrolled until the next frame, causing them to be out of sync and makes the whole thing jittery when scrolling. The 'jumpy screen' isn't here though.
Obviously I can't call it anywhere above the Draw code since then for sure it won't update until the next frame.
Thanks!
_________________
http://DSLiero.DennisvanZwieten.com - Liero for NDS!
Code: |
{ Update code }
{ Draw code } // <- contains bgSetScroll // X jumpy screen glFlush(0); // X jumpy screen swiWaitForVBlank(); // X one frame too late |
As stated, in the drawing code bgSetScroll is called, as well as some bg modifications. I need these modifications and scroll to be applied in the same frame. However, placing the bgUpdate() call at any of the 'X' positions causes problems.
By 'jumpy screen' I mean that the background (type BgType_Bmp8, BgSize_B8_256x256) is partially displayed twice vertically, and gets worse when modifying the contents of the bg:
[Images not permitted - Click here to view it]
In case of the 'one frame too late', the bg modifications are made, but the bg isn't scrolled until the next frame, causing them to be out of sync and makes the whole thing jittery when scrolling. The 'jumpy screen' isn't here though.
Obviously I can't call it anywhere above the Draw code since then for sure it won't update until the next frame.
Thanks!
_________________
http://DSLiero.DennisvanZwieten.com - Liero for NDS!