Line 4:
Line 4:
Here is the video detect code from the DevKitPro Wii example.
Here is the video detect code from the DevKitPro Wii example.
<source lang="c">
<source lang="c">
+
#include <gccore.h>
+
static GXRModeObj *rmode = NULL;
+
// ...
rmode = VIDEO_GetPreferredMode(NULL);
rmode = VIDEO_GetPreferredMode(NULL);
VIDEO_Configure(rmode);
VIDEO_Configure(rmode);
Line 14:
Line 17:
// Just call the exit() function to go back to the loader
// Just call the exit() function to go back to the loader
// Returning from main also works, since that calls exit for you
// Returning from main also works, since that calls exit for you
−
exit(0);
+
#include <unistd.h>
+
// ...
+
exit(0);
</source>
</source>
Line 23:
Line 28:
Use:
Use:
<source lang="c">
<source lang="c">
+
#include <gccore.h>
+
// ...
SYS_ResetSystem(SYS_RESTART,0,0);
SYS_ResetSystem(SYS_RESTART,0,0);
</source>
</source>
Line 33:
Line 40:
*If someone does the same thing in a more efficient way (i.e. faster and/or in less code), accept it and learn from it.
*If someone does the same thing in a more efficient way (i.e. faster and/or in less code), accept it and learn from it.
−
{{Languages|Developer_Tips}}
+
{{Languages}}