Closed NessieHax closed 2 years ago
mic_status_t
is the exact name found in a (debug)symbol should i change that too ?
no i havent i just REd it out of games that have debug symbols
libcafe seems to be copy pasted straight from the official SDK, so probably not really a good source of information from a legal standpoint
lol fr 😳
Ah, I see. Too bad. Originally I planned to do a PR for camera.h
My first approach to get camera.h was to disassemble an app with Ghidra, but then I found libcafe...
@Fangal-Airbag already REd most of camera.rpl
Do you have a working mic.h example? I was not able to get it running... MICInit()
returns error code -85
Do you have a working mic.h example? I was not able to get it running...
MICInit()
returns error code -85
i do have code that i used for testing it its not pretty or anything but gets the job done
#include <whb/proc.h>
#include <whb/log.h>
#include <whb/log_udp.h>
#include <whb/gfx.h>
#include <mic/mic.h>
#include <string.h>
#define SHUTDOWN_AND_EXIT() \
WHBGfxShutdown(); \
WHBProcShutdown(); \
WHBLogUdpDeinit(); \
return -1
static uint8_t s_audioBuffer[0xA000];
static MICWorkMem s_setup = {
0x2000,
s_audioBuffer
};
int main(int argc, char **argv)
{
WHBLogUdpInit();
WHBProcInit();
WHBGfxInit();
MICError mic_err;
MICHandle mic_handle = MICInit(MIC_INSTANCE_0, 0, &s_setup, &mic_err);
if (mic_err != MIC_ERROR_OK)
{
WHBLogPrintf("Failed to initialize mic (%d)", mic_err);
SHUTDOWN_AND_EXIT();
}
mic_err = MICOpen(mic_handle);
if (mic_err != MIC_ERROR_OK)
{
WHBLogPrintf("Failed to open mic (%d)", mic_err);
SHUTDOWN_AND_EXIT();
}
WHBLogPrint("Entering Draw Loop");
while (WHBProcIsRunning())
{
WHBGfxBeginRender();
WHBGfxBeginRenderDRC();
WHBGfxClearColor(0.3f, 0.0f, 0.175f, 0.25f);
WHBGfxFinishRenderDRC();
WHBGfxFinishRender();
}
mic_err = MICClose(mic_handle);
if (mic_err != MIC_ERROR_OK)
{
WHBLogPrintf("Failed to close mic (%d)", mic_err);
SHUTDOWN_AND_EXIT();
}
mic_err = MICUninit(mic_handle);
if (mic_err != MIC_ERROR_OK)
{
WHBLogPrintf("Failed to uninit mic (%d)", mic_err);
SHUTDOWN_AND_EXIT();
}
WHBLogPrintf("Exiting...");
WHBGfxShutdown();
WHBProcShutdown();
WHBLogUdpDeinit();
return 0;
}
@NessieHax Thank you! It works!
@exjam i updated the code style :)
Thanks! Pushed as 8fdfd12d6c02106717fe3d090595968194587825
Please rename the types from snake_case to PascalCase to keep consistency with the rest of the project.