From 4c93b9b72696e6399ef39480ed3eff470b9c8249 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Mon, 11 Aug 2025 05:37:42 -0400 Subject: [PATCH] actually calling the function is helpful :pf: --- source/main.c | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/source/main.c b/source/main.c index 7f8aeb1..9fd9612 100644 --- a/source/main.c +++ b/source/main.c @@ -57,31 +57,31 @@ void flushBuffs(u8 *buf) { void takePicture(u8 *buf) { u32 bufSize; - CAMU_GetMaxBytes(&bufSize, WIDTH, HEIGHT); - CAMU_SetTransferBytes(PORT_BOTH, bufSize, WIDTH, HEIGHT); + printf("CAMU_GetMaxBytes: 0x%08X\n", (unsigned int) CAMU_GetMaxBytes(&bufSize, WIDTH, HEIGHT)); + printf("CAMU_SetTransferBytes: 0x%08X\n", (unsigned int) CAMU_SetTransferBytes(PORT_BOTH, bufSize, WIDTH, HEIGHT)); - CAMU_Activate(SELECT_OUT1_OUT2); + printf("CAMU_Activate: 0x%08X\n", (unsigned int) CAMU_Activate(SELECT_OUT1_OUT2)); Handle camReceiveEvent = 0; Handle camReceiveEvent2 = 0; - CAMU_ClearBuffer(PORT_BOTH); - CAMU_SynchronizeVsyncTiming(SELECT_OUT1, SELECT_OUT2); + printf("CAMU_ClearBuffer: 0x%08X\n", (unsigned int) CAMU_ClearBuffer(PORT_BOTH)); + printf("CAMU_SynchronizeVsyncTiming: 0x%08X\n", (unsigned int) CAMU_SynchronizeVsyncTiming(SELECT_OUT1, SELECT_OUT2)); - CAMU_StartCapture(PORT_BOTH); + printf("CAMU_StartCapture: 0x%08X\n", (unsigned int) CAMU_StartCapture(PORT_BOTH)); - CAMU_SetReceiving(&camReceiveEvent, buf, PORT_CAM1, SCREENSIZE, (s16) bufSize); - CAMU_SetReceiving(&camReceiveEvent2, buf + SCREENSIZE, PORT_CAM2, SCREENSIZE, (s16) bufSize); - svcWaitSynchronization(camReceiveEvent, WAIT_TIMEOUT); - svcWaitSynchronization(camReceiveEvent2, WAIT_TIMEOUT); - CAMU_PlayShutterSound(SHUTTER_SOUND_TYPE_NORMAL); + printf("CAMU_SetReceiving: 0x%08X\n", (unsigned int) CAMU_SetReceiving(&camReceiveEvent, buf, PORT_CAM1, SCREENSIZE, (s16) bufSize)); + printf("CAMU_SetReceiving: 0x%08X\n", (unsigned int) CAMU_SetReceiving(&camReceiveEvent2, buf + SCREENSIZE, PORT_CAM2, SCREENSIZE, (s16) bufSize)); + printf("svcWaitSynchronization: 0x%08X\n", (unsigned int) svcWaitSynchronization(camReceiveEvent, WAIT_TIMEOUT)); + printf("svcWaitSynchronization: 0x%08X\n", (unsigned int) svcWaitSynchronization(camReceiveEvent2, WAIT_TIMEOUT)); + printf("CAMU_PlayShutterSound: 0x%08X\n", (unsigned int) CAMU_PlayShutterSound(SHUTTER_SOUND_TYPE_NORMAL)); - CAMU_StopCapture(PORT_BOTH); + printf("CAMU_StopCapture: 0x%08X\n", (unsigned int) CAMU_StopCapture(PORT_BOTH)); svcCloseHandle(camReceiveEvent); svcCloseHandle(camReceiveEvent2); - CAMU_Activate(SELECT_NONE); + printf("CAMU_Activate: 0x%08X\n", (unsigned int) CAMU_Activate(SELECT_NONE)); } void getColor(void *fb, int row, int col) { @@ -98,7 +98,7 @@ int main(int argc, char* argv[]) u8 *buf = malloc(BUFSIZE); gfxInitDefault(); - consoleInit(GFX_TOP, NULL); + consoleInit(GFX_BOTTOM, NULL); camInit(); @@ -114,25 +114,24 @@ int main(int argc, char* argv[]) CAMU_SetTrimming(PORT_CAM2, false); //printf("CAMU_SetTrimmingParamsCenter: 0x%08X\n", (unsigned int) CAMU_SetTrimmingParamsCenter(PORT_CAM1, 512, 240, 512, 384)); - printf("Hello, world!\n"); // Main loop while (aptMainLoop()) { + hidScanInput(); gspWaitForVBlank(); gfxSwapBuffers(); - hidScanInput(); // Your code goes here u32 kDown = hidKeysDown(); if (kDown & KEY_START) { printf("start presed\n"); + takePicture(buf); flushBuffs(buf); gfxFlushBuffers(); gspWaitForVBlank(); gfxSwapBuffers(); - clearScreen(); // break; // break in order to return to hbmenu }