Merge pull request #1 from wheremyfoodat/master

Not Ignoring this PR I fucked up something on my Github GUI
This commit is contained in:
Sky 2023-07-03 13:05:46 -07:00 committed by GitHub
commit 0f66527cbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 147 additions and 72 deletions

View file

@ -30,24 +30,31 @@ using s32 = std::int32_t;
using s64 = std::int64_t;
namespace Helpers {
[[noreturn]] static void panic(const char* fmt, ...) {
std::va_list args;
va_start(args, fmt);
// Unconditional panic, unlike panicDev which does not panic on user builds
template <class... Args>
[[noreturn]] static void panic(const char* fmt, Args&&... args) {
std::cout << termcolor::on_red << "[FATAL] ";
std::vprintf(fmt, args);
std::printf(fmt, args...);
std::cout << termcolor::reset << "\n";
va_end(args);
exit(1);
}
#ifdef PANDA3DS_LIMITED_PANICS
template <class... Args>
static void panicDev(const char* fmt, Args&&... args) {}
#else
template <class... Args>
[[noreturn]] static void panicDev(const char* fmt, Args&&... args) {
panic(fmt, args...);
}
#endif
static void warn(const char* fmt, ...) {
std::va_list args;
va_start(args, fmt);
template <class... Args>
static void warn(const char* fmt, Args&&... args) {
std::cout << termcolor::on_red << "[Warning] ";
std::vprintf(fmt, args);
std::printf(fmt, args...);
std::cout << termcolor::reset << "\n";
va_end(args);
}
static constexpr bool buildingInDebugMode() {
@ -57,6 +64,13 @@ namespace Helpers {
return true;
}
static constexpr bool isUserBuild() {
#ifdef PANDA3DS_USER_BUILD
return true;
#endif
return false;
}
static void debug_printf(const char* fmt, ...) {
if constexpr (buildingInDebugMode()) {
std::va_list args;

View file

@ -63,6 +63,8 @@ class HIDService {
MAKE_LOG_FUNCTION(log, hidLogger)
// Service commands
void disableAccelerometer(u32 messagePointer);
void disableGyroscopeLow(u32 messagePointer);
void enableAccelerometer(u32 messagePointer);
void enableGyroscopeLow(u32 messagePointer);
void getGyroscopeLowCalibrateParam(u32 messagePointer);