8#include "WutPlatform.h"
10#include <sysapp/launch.h>
11#include <proc_ui/procui.h>
21 this->threadDriver->init();
24 this->videoDriver->init(
config.canvasWidth,
config.canvasHeight);
27 this->audioDriver->init();
30 this->inputDriver->init();
33 this->fileSystemDriver->init();
36 this->logger =
new Logger();
38 this->logger->registerBackend(LOGGER_UDP,
new WutLoggerUdp());
40 this->logger->registerBackend(LOGGER_FILE,
new LoggerFile());
43 static const int deviceCandidates[] = { DEVICE_SD };
45 const char * mountPath = FindFirstMountedPath(this->fileSystemDriver, deviceCandidates, 1);
47 if(mountPath[0] !=
'\0') {
49 snprintf(logConfig.
filePath,
sizeof(logConfig.
filePath),
"%sdebug.log", mountPath);
51 this->logger->init(logConfig);
65 fileSystemDriver->shutdown();
66 delete fileSystemDriver;
67 fileSystemDriver =
nullptr;
72 inputDriver->shutdown();
74 inputDriver =
nullptr;
79 audioDriver->shutdown();
81 audioDriver =
nullptr;
86 videoDriver->shutdown();
88 videoDriver =
nullptr;
93 threadDriver->shutdown();
95 threadDriver =
nullptr;
108 if(ProcUIIsRunning()) {
114 const int timeoutMs = 2000;
115 for (
int waited = 0; WHBProcIsRunning() && waited < timeoutMs; waited++) {
129 if (status == Status::Exiting)
133 if (!WHBProcIsRunning())
135 status = Status::Exiting;
140 if (!ProcUIInForeground())
142 status = Status::Paused;
146 status = Status::Running;
149 return SystemEvent::None;
Log backend that appends to a file through the platform's devoptab path.
Central fan-out dispatcher.
Wii U AudioDriver: AX (sndcore2), 16 fixed AXVoice slots for one-shots plus a dedicated stereo stream...
SD: a plain WHBMountSdCard() FSA mount, done once in init().
Log backend writing to the console debug output via OSReport.
Non-blocking UDP log backend over nsysnet sockets.
Log backend writing to a USB serial adapter (requires the optional usbserial module).
Wii U ThreadDriver, built on coreinit's OSThread/OSMutex/OSCondition.
Wii U VideoDriver: GX2 + libwhb's WHBGfx* helpers.
SystemEvent
A hardware/OS-level system event a Platform can report.
@ ShutdownRequested
Power button pressed (console or, on Wii, a Wiimote) - or, on Wii U, the OS asking the app to exit.
Full runtime configuration for the Logger.
char filePath[1024]
Path of the log file for the file backend. Each platform's init() points this at debug....