diff --git a/examples/app_launch/source/main.c b/examples/app_launch/source/main.c index d45b4ac..73cecb6 100644 --- a/examples/app_launch/source/main.c +++ b/examples/app_launch/source/main.c @@ -6,10 +6,7 @@ int main() { - srvInit(); // Needed - aptInit(); // Needed gfxInitDefault(); // Init graphic stuff - hidInit(NULL); // For input (buttons, touchscreen...) // 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(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/audio/mic/source/main.c b/examples/audio/mic/source/main.c index f54823f..2726a75 100644 --- a/examples/audio/mic/source/main.c +++ b/examples/audio/mic/source/main.c @@ -13,11 +13,8 @@ int main() u8 control=0x40; u32 audio_initialized = 0; - srvInit(); - aptInit(); gfxInitDefault(); - hidInit(NULL); - + if(CSND_initialize(NULL)==0)audio_initialized = 1; sharedmem = (u32*)memalign(0x1000, sharedmem_size); @@ -85,10 +82,7 @@ int main() free(sharedmem); linearFree(audiobuf); - hidExit(); gfxExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/gpu/source/main.c b/examples/gpu/source/main.c index 887e249..3662ccd 100644 --- a/examples/gpu/source/main.c +++ b/examples/gpu/source/main.c @@ -114,13 +114,13 @@ const vertex_s modelVboData[]= //stolen from staplebutt void GPU_SetDummyTexEnv(u8 num) { - GPU_SetTexEnv(num, - GPU_TEVSOURCES(GPU_PREVIOUS, 0, 0), - GPU_TEVSOURCES(GPU_PREVIOUS, 0, 0), - GPU_TEVOPERANDS(0,0,0), - GPU_TEVOPERANDS(0,0,0), - GPU_REPLACE, - GPU_REPLACE, + GPU_SetTexEnv(num, + GPU_TEVSOURCES(GPU_PREVIOUS, 0, 0), + GPU_TEVSOURCES(GPU_PREVIOUS, 0, 0), + GPU_TEVOPERANDS(0,0,0), + GPU_TEVOPERANDS(0,0,0), + GPU_REPLACE, + GPU_REPLACE, 0xFFFFFFFF); } @@ -128,31 +128,31 @@ void GPU_SetDummyTexEnv(u8 num) void renderFrame() { GPU_SetViewport((u32*)osConvertVirtToPhys((u32)gpuDOut),(u32*)osConvertVirtToPhys((u32)gpuOut),0,0,240*2,400); - + GPU_DepthRange(-1.0f, 0.0f); GPU_SetFaceCulling(GPU_CULL_BACK_CCW); GPU_SetStencilTest(false, GPU_ALWAYS, 0x00, 0xFF, 0x00); GPU_SetStencilOp(GPU_KEEP, GPU_KEEP, GPU_KEEP); GPU_SetBlendingColor(0,0,0,0); GPU_SetDepthTestAndWriteMask(true, GPU_GREATER, GPU_WRITE_ALL); - - GPUCMD_AddSingleParam(0x00010062, 0); + + GPUCMD_AddSingleParam(0x00010062, 0); GPUCMD_AddSingleParam(0x000F0118, 0); - + //setup shader SHDR_UseProgram(shader, 0); - + GPU_SetAlphaBlending(GPU_BLEND_ADD, GPU_BLEND_ADD, GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA); GPU_SetAlphaTest(false, GPU_ALWAYS, 0x00); - + GPU_SetTextureEnable(GPU_TEXUNIT0); - - GPU_SetTexEnv(0, - GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR), + + GPU_SetTexEnv(0, GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR), - GPU_TEVOPERANDS(0,0,0), - GPU_TEVOPERANDS(0,0,0), - GPU_MODULATE, GPU_MODULATE, + GPU_TEVSOURCES(GPU_TEXTURE0, GPU_PRIMARY_COLOR, GPU_PRIMARY_COLOR), + GPU_TEVOPERANDS(0,0,0), + GPU_TEVOPERANDS(0,0,0), + GPU_MODULATE, GPU_MODULATE, 0xFFFFFFFF); GPU_SetDummyTexEnv(1); GPU_SetDummyTexEnv(2); @@ -189,11 +189,8 @@ void renderFrame() int main(int argc, char** argv) { - //setup services - srvInit(); - aptInit(); + gfxInitDefault(); - hidInit(NULL); //initialize GPU GPU_Init(NULL); @@ -321,9 +318,6 @@ int main(int argc, char** argv) } gsExit(); - hidExit(); gfxExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/graphics/printing/hello-world/source/main.c b/examples/graphics/printing/hello-world/source/main.c index 6dd0a43..c131d20 100644 --- a/examples/graphics/printing/hello-world/source/main.c +++ b/examples/graphics/printing/hello-world/source/main.c @@ -17,16 +17,12 @@ int main(int argc, char **argv) { - // Initialize services - srvInit(); - aptInit(); 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 consoleInit(GFX_TOP, NULL); - //Move the cursor to row 15 and column 19 and then prints "Hello World!" + //Move the cursor to row 15 and column 19 and then prints "Hello World!" //To move the cursor you have tu print "\x1b[r;cH", where r and c are respectively //the row and column where you want your cursor to move //The top screen has 30 rows and 50 columns @@ -54,10 +50,6 @@ int main(int argc, char **argv) gspWaitForVBlank(); } - // Exit services gfxExit(); - hidExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/http/source/main.c b/examples/http/source/main.c index c51c44b..ed7b867 100644 --- a/examples/http/source/main.c +++ b/examples/http/source/main.c @@ -87,10 +87,6 @@ int main() Result ret=0; httpcContext context; - // Initialize services - srvInit(); - aptInit(); - hidInit(NULL); gfxInitDefault(); //gfxSet3D(true); // uncomment if using stereoscopic 3D httpcInit(); @@ -123,9 +119,6 @@ int main() // Exit services httpcExit(); gfxExit(); - hidExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/libapplet_launch/source/main.c b/examples/libapplet_launch/source/main.c index f7bc215..0e03373 100644 --- a/examples/libapplet_launch/source/main.c +++ b/examples/libapplet_launch/source/main.c @@ -4,10 +4,6 @@ int main() { u32 val, i; - // Initialize services - srvInit(); - aptInit(); - hidInit(NULL); gfxInitDefault(); //gfxSet3D(true); // uncomment if using stereoscopic 3D @@ -42,9 +38,6 @@ int main() // Exit services gfxExit(); - hidExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/mvd/source/main.c b/examples/mvd/source/main.c index af8be2d..7e8aec4 100644 --- a/examples/mvd/source/main.c +++ b/examples/mvd/source/main.c @@ -106,13 +106,7 @@ void draw_startup() int main() { - // Initialize services - srvInit(); - aptInit(); - hidInit(NULL); gfxInitDefault(); - fsInit(); - sdmcInit(); //gfxSet3D(true); // uncomment if using stereoscopic 3D memset(logstring, 0, 256); @@ -143,13 +137,7 @@ int main() if(inaddr)linearFree(inaddr); if(outaddr)linearFree(outaddr); - // Exit services - sdmcExit(); - fsExit(); gfxExit(); - hidExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/qtm/source/main.c b/examples/qtm/source/main.c index 7a8bfd6..252e352 100644 --- a/examples/qtm/source/main.c +++ b/examples/qtm/source/main.c @@ -11,10 +11,6 @@ int main() qtmHeadtrackingInfo qtminfo; u32 colors[4] = {0x0000FF, 0x00FF00, 0xFF0000, 0xFFFFFF}; - // Initialize services - srvInit(); - aptInit(); - hidInit(NULL); gfxInitDefault(); //gfxSet3D(true); // uncomment if using stereoscopic 3D @@ -84,9 +80,6 @@ int main() // Exit services qtmExit(); gfxExit(); - hidExit(); - aptExit(); - srvExit(); return 0; } diff --git a/examples/templates/application/source/main.c b/examples/templates/application/source/main.c index d55fbe9..633c7ff 100644 --- a/examples/templates/application/source/main.c +++ b/examples/templates/application/source/main.c @@ -4,10 +4,6 @@ int main() { - // Initialize services - srvInit(); - aptInit(); - hidInit(NULL); gfxInitDefault(); //gfxSet3D(true); // uncomment if using stereoscopic 3D @@ -36,10 +32,6 @@ int main() gfxSwapBuffers(); } - // Exit services gfxExit(); - hidExit(); - aptExit(); - srvExit(); return 0; }