From f291cad89310b96d0f5e877ea1dab0fd01e1fa44 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 4 Sep 2022 00:02:35 +0200 Subject: [PATCH] Use the latest lib versions --- Dockerfile | 8 ++++---- src/main.cpp | 18 +++++++++--------- src/utils/logger.h | 2 ++ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index ef0f9ed..dc8696b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ FROM wiiuenv/devkitppc:20220806 COPY --from=wiiuenv/wiiupluginsystem:20220826 /artifacts $DEVKITPRO -COPY --from=wiiuenv/librpxloader:20220825 /artifacts $DEVKITPRO -COPY --from=wiiuenv/libsdutils:20220724 /artifacts $DEVKITPRO -COPY --from=wiiuenv/libwuhbutils:20220724 /artifacts $DEVKITPRO -COPY --from=wiiuenv/libcontentredirection:20220724 /artifacts $DEVKITPRO +COPY --from=wiiuenv/librpxloader:20220903 /artifacts $DEVKITPRO +COPY --from=wiiuenv/libsdutils:20220903 /artifacts $DEVKITPRO +COPY --from=wiiuenv/libwuhbutils:20220903 /artifacts $DEVKITPRO +COPY --from=wiiuenv/libcontentredirection:20220903 /artifacts $DEVKITPRO WORKDIR project \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp index 959d5d4..13f0cda 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,22 +70,22 @@ INITIALIZE_PLUGIN() { // Use libwuhbutils. WUHBUtilsStatus error; - if ((error = WUHBUtils_Init()) != WUHB_UTILS_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init WUHBUtils. Error %d", error); + if ((error = WUHBUtils_InitLibrary()) != WUHB_UTILS_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init WUHBUtils. Error %s [%d]", WUHBUtils_GetStatusStr(error), error); OSFatal("Homebrew on Menu Plugin: Failed to init WUHBUtils."); } // Use libcontentredirection. ContentRedirectionStatus error2; - if ((error2 = ContentRedirection_Init()) != CONTENT_REDIRECTION_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init ContentRedirection. Error %d", error2); + if ((error2 = ContentRedirection_InitLibrary()) != CONTENT_REDIRECTION_RESULT_SUCCESS) { + DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init ContentRedirection. Error %s [%d]", ContentRedirection_GetStatusStr(error2), error2); OSFatal("Homebrew on Menu Plugin: Failed to init ContentRedirection."); } // Use librpxloader. RPXLoaderStatus error3; if ((error3 = RPXLoader_InitLibrary()) != RPX_LOADER_RESULT_SUCCESS) { - DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init RPXLoader. Error %d", error3); + DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init RPXLoader. Error %s [%d]", RPXLoader_GetStatusStr(error3), error3); OSFatal("Homebrew on Menu Plugin: Failed to init RPXLoader."); } @@ -128,6 +128,7 @@ void hideHomebrewChanged(ConfigItemBoolean *item, bool newValue) { WUPS_GET_CONFIG() { // We open the storage so we can persist the configuration the user did. WUPSStorageError storageRes; + DEBUG_FUNCTION_LINE_ERR("In WUPS_GET_CONFIG"); if ((storageRes = WUPS_OpenStorage()) != WUPS_STORAGE_ERROR_SUCCESS) { DEBUG_FUNCTION_LINE_ERR("Failed to open storage %s (%d)", WUPS_GetStorageStatusStr(storageRes), storageRes); return 0; @@ -196,8 +197,7 @@ ON_APPLICATION_START() { OSGetTitleID() == 0x0005001010040200L) { // Wii U Menu EUR gInWiiUMenu = true; - if (SDUtils_Init() >= 0) { - DEBUG_FUNCTION_LINE("SDUtils_Init done"); + if (SDUtils_InitLibrary() == SDUTILS_RESULT_SUCCESS) { sSDUtilsInitDone = true; sTitleRebooting = false; if (SDUtils_AddAttachHandler(SDAttachedHandler) != SDUTILS_RESULT_SUCCESS) { @@ -210,7 +210,7 @@ ON_APPLICATION_START() { DEBUG_FUNCTION_LINE_ERR("IsSdCardMounted failed"); } } else { - DEBUG_FUNCTION_LINE_ERR("Failed to init SDUtils. Make sure to have the SDHotSwapModule loaded!"); + DEBUG_FUNCTION_LINE_WARN("Failed to init SDUtils. Make sure to have the SDHotSwapModule loaded!"); } } else { gInWiiUMenu = false; @@ -229,7 +229,7 @@ ON_APPLICATION_ENDS() { if (sSDUtilsInitDone) { SDUtils_RemoveAttachHandler(SDAttachedHandler); SDUtils_RemoveCleanUpHandlesHandler(SDCleanUpHandlesHandler); - SDUtils_DeInit(); + SDUtils_DeInitLibrary(); sSDUtilsInitDone = false; } sSDIsMounted = false; diff --git a/src/utils/logger.h b/src/utils/logger.h index c617b5f..928ddb5 100644 --- a/src/utils/logger.h +++ b/src/utils/logger.h @@ -35,6 +35,7 @@ extern "C" { #define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) LOG(WHBLogWritef, FMT, ##ARGS) #define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX(WHBLogPrintf, "##ERROR## ", "", FMT, ##ARGS) +#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX(WHBLogPrintf, "##WARN ## ", "", FMT, ##ARGS) #else @@ -45,6 +46,7 @@ extern "C" { #define DEBUG_FUNCTION_LINE_WRITE(FMT, ARGS...) while (0) #define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) LOG_EX(OSReport, "##ERROR## ", "\n", FMT, ##ARGS) +#define DEBUG_FUNCTION_LINE_WARN(FMT, ARGS...) LOG_EX(OSReport, "##WARN ## ", "\n", FMT, ##ARGS) #endif