From 06f7aeb7c4e38c2d700b1ae7411aa5edfb39c217 Mon Sep 17 00:00:00 2001 From: fincs Date: Sun, 6 Sep 2015 18:22:12 +0200 Subject: [PATCH] Fix examples --- examples/app_launch/source/main.c | 4 ++-- examples/graphics/gpu/geoshader/source/gpu.c | 7 ++++--- examples/graphics/gpu/simple_tri/source/gpu.c | 7 ++++--- examples/graphics/gpu/textured_cube/source/gpu.c | 7 ++++--- examples/mvd/source/main.c | 4 ++-- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/examples/app_launch/source/main.c b/examples/app_launch/source/main.c index 73cecb6..6838e5c 100644 --- a/examples/app_launch/source/main.c +++ b/examples/app_launch/source/main.c @@ -29,9 +29,9 @@ int main() // Open an APT session so we can talk to the APT service aptOpenSession(); // Prepare for the app launch - APT_PrepareToDoAppJump(NULL, 0, 0x0004001000022400LL, 0); // *EUR* camera app title ID + APT_PrepareToDoAppJump(0, 0x0004001000022400LL, 0); // *EUR* camera app title ID // Tell APT to trigger the app launch and set the status of this app to exit - APT_DoAppJump(NULL, 0x300 /* size of buf0 */, 0x20 /* size of buf1 */, buf0, buf1); + APT_DoAppJump(0x300 /* size of buf0 */, 0x20 /* size of buf1 */, buf0, buf1); // Close the APT session because we don't need APT anymore aptCloseSession(); } diff --git a/examples/graphics/gpu/geoshader/source/gpu.c b/examples/graphics/gpu/geoshader/source/gpu.c index abb8cdd..60761fc 100644 --- a/examples/graphics/gpu/geoshader/source/gpu.c +++ b/examples/graphics/gpu/geoshader/source/gpu.c @@ -27,7 +27,7 @@ void gpuExit(void) void gpuClearBuffers(u32 clearColor) { - GX_SetMemoryFill(NULL, + GX_SetMemoryFill( colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, depthBuf, 0, &depthBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH); gspWaitForPSC0(); // Wait for the fill to complete @@ -67,11 +67,12 @@ void gpuFrameEnd(void) // Finish rendering GPU_FinishDrawing(); GPUCMD_Finalize(); - GPUCMD_FlushAndRun(NULL); + GPUCMD_FlushAndRun(); gspWaitForP3D(); // Wait for the rendering to complete // Transfer the GPU output to the framebuffer - GX_SetDisplayTransfer(NULL, colorBuf, GX_BUFFER_DIM(240, 400), + GX_SetDisplayTransfer( + colorBuf, GX_BUFFER_DIM(240, 400), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400), DISPLAY_TRANSFER_FLAGS); gspWaitForPPF(); // Wait for the transfer to complete diff --git a/examples/graphics/gpu/simple_tri/source/gpu.c b/examples/graphics/gpu/simple_tri/source/gpu.c index abb8cdd..60761fc 100644 --- a/examples/graphics/gpu/simple_tri/source/gpu.c +++ b/examples/graphics/gpu/simple_tri/source/gpu.c @@ -27,7 +27,7 @@ void gpuExit(void) void gpuClearBuffers(u32 clearColor) { - GX_SetMemoryFill(NULL, + GX_SetMemoryFill( colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, depthBuf, 0, &depthBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH); gspWaitForPSC0(); // Wait for the fill to complete @@ -67,11 +67,12 @@ void gpuFrameEnd(void) // Finish rendering GPU_FinishDrawing(); GPUCMD_Finalize(); - GPUCMD_FlushAndRun(NULL); + GPUCMD_FlushAndRun(); gspWaitForP3D(); // Wait for the rendering to complete // Transfer the GPU output to the framebuffer - GX_SetDisplayTransfer(NULL, colorBuf, GX_BUFFER_DIM(240, 400), + GX_SetDisplayTransfer( + colorBuf, GX_BUFFER_DIM(240, 400), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400), DISPLAY_TRANSFER_FLAGS); gspWaitForPPF(); // Wait for the transfer to complete diff --git a/examples/graphics/gpu/textured_cube/source/gpu.c b/examples/graphics/gpu/textured_cube/source/gpu.c index abb8cdd..60761fc 100644 --- a/examples/graphics/gpu/textured_cube/source/gpu.c +++ b/examples/graphics/gpu/textured_cube/source/gpu.c @@ -27,7 +27,7 @@ void gpuExit(void) void gpuClearBuffers(u32 clearColor) { - GX_SetMemoryFill(NULL, + GX_SetMemoryFill( colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, depthBuf, 0, &depthBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH); gspWaitForPSC0(); // Wait for the fill to complete @@ -67,11 +67,12 @@ void gpuFrameEnd(void) // Finish rendering GPU_FinishDrawing(); GPUCMD_Finalize(); - GPUCMD_FlushAndRun(NULL); + GPUCMD_FlushAndRun(); gspWaitForP3D(); // Wait for the rendering to complete // Transfer the GPU output to the framebuffer - GX_SetDisplayTransfer(NULL, colorBuf, GX_BUFFER_DIM(240, 400), + GX_SetDisplayTransfer( + colorBuf, GX_BUFFER_DIM(240, 400), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400), DISPLAY_TRANSFER_FLAGS); gspWaitForPPF(); // Wait for the transfer to complete diff --git a/examples/mvd/source/main.c b/examples/mvd/source/main.c index 7e8aec4..4ffef04 100644 --- a/examples/mvd/source/main.c +++ b/examples/mvd/source/main.c @@ -58,7 +58,7 @@ void draw_startup() } memset(gfxtopadr, 0, 0x46500); - GSPGPU_FlushDataCache(NULL, inaddr, 0x46500); + GSPGPU_FlushDataCache(inaddr, 0x46500); printstring("mvd example\n"); @@ -79,7 +79,7 @@ void draw_startup() svcSleepThread(1000000000);//Not sure how to determine when frame processing finishes. - GSPGPU_InvalidateDataCache(NULL, outaddr, 0x100000); + GSPGPU_InvalidateDataCache(outaddr, 0x100000); f = fopen("sdmc:/mvd_outdata.bin", "w"); if(f)