mirror of
https://github.com/AntonioND/nitro-engine.git
synced 2025-06-19 00:55:38 -04:00
library: Add synchronization to NE initialization
This should fix issues in dual 3D mode where the output of each screen was switched at boot, and it changes after a framerate drop (like when loading assets).
This commit is contained in:
parent
5cd0909b5c
commit
166cf29986
@ -220,6 +220,13 @@ cleanup:
|
|||||||
|
|
||||||
static void ne_init_registers(void)
|
static void ne_init_registers(void)
|
||||||
{
|
{
|
||||||
|
// This function is usually called when the program boots. We don't know
|
||||||
|
// which time in the frame exactly. In order to make the behaviour
|
||||||
|
// consistent across emulators and hardware, it is required to synchronize
|
||||||
|
// to the LCD refresh here.
|
||||||
|
|
||||||
|
swiWaitForVBlank();
|
||||||
|
|
||||||
// Power all 3D and 2D. Hide 3D screen during init
|
// Power all 3D and 2D. Hide 3D screen during init
|
||||||
powerOn(POWER_ALL);
|
powerOn(POWER_ALL);
|
||||||
|
|
||||||
@ -282,6 +289,14 @@ static void ne_init_registers(void)
|
|||||||
MATRIX_CONTROL = GL_MODELVIEW;
|
MATRIX_CONTROL = GL_MODELVIEW;
|
||||||
MATRIX_IDENTITY = 0;
|
MATRIX_IDENTITY = 0;
|
||||||
|
|
||||||
|
// Make sure that this function is left always at the same time regardless
|
||||||
|
// of whether it runs on hardware or emulators (which can be more or less
|
||||||
|
// accurate). If not, the output of the screens in dual 3D mode may be
|
||||||
|
// switched initially (and change once there is a framerate drop when
|
||||||
|
// loading assets, for example).
|
||||||
|
|
||||||
|
swiWaitForVBlank();
|
||||||
|
|
||||||
// Ready!!
|
// Ready!!
|
||||||
|
|
||||||
videoSetMode(MODE_0_3D);
|
videoSetMode(MODE_0_3D);
|
||||||
|
Loading…
Reference in New Issue
Block a user