remove unneeded boilerplate from examples

This commit is contained in:
Dave Murphy 2015-01-09 08:14:01 +00:00
parent a2ce1e13ca
commit 678b89e9b2
9 changed files with 22 additions and 90 deletions

View File

@ -6,10 +6,7 @@
int main() int main()
{ {
srvInit(); // Needed
aptInit(); // Needed
gfxInitDefault(); // Init graphic stuff gfxInitDefault(); // Init graphic stuff
hidInit(NULL); // For input (buttons, touchscreen...)
// We need these 2 buffers for APT_DoAppJump() later. They can be smaller too // We need these 2 buffers for APT_DoAppJump() later. They can be smaller too
@ -46,11 +43,7 @@ int main()
} }
// Deinit everything before the app process get's terminated
hidExit();
gfxExit(); gfxExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -13,10 +13,7 @@ int main()
u8 control=0x40; u8 control=0x40;
u32 audio_initialized = 0; u32 audio_initialized = 0;
srvInit();
aptInit();
gfxInitDefault(); gfxInitDefault();
hidInit(NULL);
if(CSND_initialize(NULL)==0)audio_initialized = 1; if(CSND_initialize(NULL)==0)audio_initialized = 1;
@ -85,10 +82,7 @@ int main()
free(sharedmem); free(sharedmem);
linearFree(audiobuf); linearFree(audiobuf);
hidExit();
gfxExit(); gfxExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -189,11 +189,8 @@ void renderFrame()
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
//setup services
srvInit();
aptInit();
gfxInitDefault(); gfxInitDefault();
hidInit(NULL);
//initialize GPU //initialize GPU
GPU_Init(NULL); GPU_Init(NULL);
@ -321,9 +318,6 @@ int main(int argc, char** argv)
} }
gsExit(); gsExit();
hidExit();
gfxExit(); gfxExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -17,11 +17,7 @@
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
// Initialize services
srvInit();
aptInit();
gfxInitDefault(); gfxInitDefault();
hidInit(NULL);
//Initialize console on top screen. Using NULL as the second argument tells the console library to use the internal console structure as current one //Initialize console on top screen. Using NULL as the second argument tells the console library to use the internal console structure as current one
consoleInit(GFX_TOP, NULL); consoleInit(GFX_TOP, NULL);
@ -54,10 +50,6 @@ int main(int argc, char **argv)
gspWaitForVBlank(); gspWaitForVBlank();
} }
// Exit services
gfxExit(); gfxExit();
hidExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -87,10 +87,6 @@ int main()
Result ret=0; Result ret=0;
httpcContext context; httpcContext context;
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInitDefault(); gfxInitDefault();
//gfxSet3D(true); // uncomment if using stereoscopic 3D //gfxSet3D(true); // uncomment if using stereoscopic 3D
httpcInit(); httpcInit();
@ -123,9 +119,6 @@ int main()
// Exit services // Exit services
httpcExit(); httpcExit();
gfxExit(); gfxExit();
hidExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -4,10 +4,6 @@ int main()
{ {
u32 val, i; u32 val, i;
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInitDefault(); gfxInitDefault();
//gfxSet3D(true); // uncomment if using stereoscopic 3D //gfxSet3D(true); // uncomment if using stereoscopic 3D
@ -42,9 +38,6 @@ int main()
// Exit services // Exit services
gfxExit(); gfxExit();
hidExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -106,13 +106,7 @@ void draw_startup()
int main() int main()
{ {
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInitDefault(); gfxInitDefault();
fsInit();
sdmcInit();
//gfxSet3D(true); // uncomment if using stereoscopic 3D //gfxSet3D(true); // uncomment if using stereoscopic 3D
memset(logstring, 0, 256); memset(logstring, 0, 256);
@ -143,13 +137,7 @@ int main()
if(inaddr)linearFree(inaddr); if(inaddr)linearFree(inaddr);
if(outaddr)linearFree(outaddr); if(outaddr)linearFree(outaddr);
// Exit services
sdmcExit();
fsExit();
gfxExit(); gfxExit();
hidExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -11,10 +11,6 @@ int main()
qtmHeadtrackingInfo qtminfo; qtmHeadtrackingInfo qtminfo;
u32 colors[4] = {0x0000FF, 0x00FF00, 0xFF0000, 0xFFFFFF}; u32 colors[4] = {0x0000FF, 0x00FF00, 0xFF0000, 0xFFFFFF};
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInitDefault(); gfxInitDefault();
//gfxSet3D(true); // uncomment if using stereoscopic 3D //gfxSet3D(true); // uncomment if using stereoscopic 3D
@ -84,9 +80,6 @@ int main()
// Exit services // Exit services
qtmExit(); qtmExit();
gfxExit(); gfxExit();
hidExit();
aptExit();
srvExit();
return 0; return 0;
} }

View File

@ -4,10 +4,6 @@
int main() int main()
{ {
// Initialize services
srvInit();
aptInit();
hidInit(NULL);
gfxInitDefault(); gfxInitDefault();
//gfxSet3D(true); // uncomment if using stereoscopic 3D //gfxSet3D(true); // uncomment if using stereoscopic 3D
@ -36,10 +32,6 @@ int main()
gfxSwapBuffers(); gfxSwapBuffers();
} }
// Exit services
gfxExit(); gfxExit();
hidExit();
aptExit();
srvExit();
return 0; return 0;
} }