hocclk: reduce ram usage and add display undervolt

This commit is contained in:
souldbminersmwc
2026-04-06 15:57:10 -04:00
parent 8faaaa58d9
commit 521e3c22dd
11 changed files with 105 additions and 82 deletions

View File

@@ -30,28 +30,12 @@
#include <cstring>
namespace errors {
namespace {
const char* FormatMessage(const char* format, va_list args) {
size_t len = vsnprintf(NULL, 0, format, args) * sizeof(char);
char* buf = (char*)malloc(len + 1);
if (buf == NULL) {
return format;
}
vsnprintf(buf, len + 1, format, args);
return buf;
}
}
void ThrowException(const char* format, ...) {
va_list args;
va_start(args, format);
const char* msg = FormatMessage(format, args);
va_end(args);
fileUtils::LogLine(format, args);
throw std::runtime_error(msg);
va_end(args);
diagAbortWithResult(MAKERESULT(Module_Libnx, LibnxError_ShouldNotHappen));
// throw std::runtime_error(msg);
}
}