Fix examples

This commit is contained in:
fincs 2015-09-06 18:22:12 +02:00
parent 0d7a7f4d7d
commit 06f7aeb7c4
5 changed files with 16 additions and 13 deletions

View File

@ -29,9 +29,9 @@ int main()
// Open an APT session so we can talk to the APT service // Open an APT session so we can talk to the APT service
aptOpenSession(); aptOpenSession();
// Prepare for the app launch // 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 // 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 // Close the APT session because we don't need APT anymore
aptCloseSession(); aptCloseSession();
} }

View File

@ -27,7 +27,7 @@ void gpuExit(void)
void gpuClearBuffers(u32 clearColor) void gpuClearBuffers(u32 clearColor)
{ {
GX_SetMemoryFill(NULL, GX_SetMemoryFill(
colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
depthBuf, 0, &depthBuf[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 gspWaitForPSC0(); // Wait for the fill to complete
@ -67,11 +67,12 @@ void gpuFrameEnd(void)
// Finish rendering // Finish rendering
GPU_FinishDrawing(); GPU_FinishDrawing();
GPUCMD_Finalize(); GPUCMD_Finalize();
GPUCMD_FlushAndRun(NULL); GPUCMD_FlushAndRun();
gspWaitForP3D(); // Wait for the rendering to complete gspWaitForP3D(); // Wait for the rendering to complete
// Transfer the GPU output to the framebuffer // 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), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
DISPLAY_TRANSFER_FLAGS); DISPLAY_TRANSFER_FLAGS);
gspWaitForPPF(); // Wait for the transfer to complete gspWaitForPPF(); // Wait for the transfer to complete

View File

@ -27,7 +27,7 @@ void gpuExit(void)
void gpuClearBuffers(u32 clearColor) void gpuClearBuffers(u32 clearColor)
{ {
GX_SetMemoryFill(NULL, GX_SetMemoryFill(
colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
depthBuf, 0, &depthBuf[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 gspWaitForPSC0(); // Wait for the fill to complete
@ -67,11 +67,12 @@ void gpuFrameEnd(void)
// Finish rendering // Finish rendering
GPU_FinishDrawing(); GPU_FinishDrawing();
GPUCMD_Finalize(); GPUCMD_Finalize();
GPUCMD_FlushAndRun(NULL); GPUCMD_FlushAndRun();
gspWaitForP3D(); // Wait for the rendering to complete gspWaitForP3D(); // Wait for the rendering to complete
// Transfer the GPU output to the framebuffer // 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), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
DISPLAY_TRANSFER_FLAGS); DISPLAY_TRANSFER_FLAGS);
gspWaitForPPF(); // Wait for the transfer to complete gspWaitForPPF(); // Wait for the transfer to complete

View File

@ -27,7 +27,7 @@ void gpuExit(void)
void gpuClearBuffers(u32 clearColor) void gpuClearBuffers(u32 clearColor)
{ {
GX_SetMemoryFill(NULL, GX_SetMemoryFill(
colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH, colorBuf, clearColor, &colorBuf[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
depthBuf, 0, &depthBuf[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 gspWaitForPSC0(); // Wait for the fill to complete
@ -67,11 +67,12 @@ void gpuFrameEnd(void)
// Finish rendering // Finish rendering
GPU_FinishDrawing(); GPU_FinishDrawing();
GPUCMD_Finalize(); GPUCMD_Finalize();
GPUCMD_FlushAndRun(NULL); GPUCMD_FlushAndRun();
gspWaitForP3D(); // Wait for the rendering to complete gspWaitForP3D(); // Wait for the rendering to complete
// Transfer the GPU output to the framebuffer // 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), (u32*)gfxGetFramebuffer(GFX_TOP, GFX_LEFT, NULL, NULL), GX_BUFFER_DIM(240, 400),
DISPLAY_TRANSFER_FLAGS); DISPLAY_TRANSFER_FLAGS);
gspWaitForPPF(); // Wait for the transfer to complete gspWaitForPPF(); // Wait for the transfer to complete

View File

@ -58,7 +58,7 @@ void draw_startup()
} }
memset(gfxtopadr, 0, 0x46500); memset(gfxtopadr, 0, 0x46500);
GSPGPU_FlushDataCache(NULL, inaddr, 0x46500); GSPGPU_FlushDataCache(inaddr, 0x46500);
printstring("mvd example\n"); printstring("mvd example\n");
@ -79,7 +79,7 @@ void draw_startup()
svcSleepThread(1000000000);//Not sure how to determine when frame processing finishes. 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"); f = fopen("sdmc:/mvd_outdata.bin", "w");
if(f) if(f)