Give the users tips how to fix the 1503030 error when they encounter it in the Wii U Menu

This commit is contained in:
Maschell 2023-07-31 22:01:32 +02:00
parent 7bce37d243
commit 579f70de86
6 changed files with 39 additions and 5 deletions

View File

@ -5,5 +5,6 @@ COPY --from=ghcr.io/wiiu-env/librpxloader:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libsdutils:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libwuhbutils:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libcontentredirection:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libnotifications:20230621 /artifacts $DEVKITPRO
WORKDIR project

View File

@ -51,7 +51,7 @@ CXXFLAGS += -DDEBUG -DVERBOSE_DEBUG -g
CFLAGS += -DDEBUG -DVERBOSE_DEBUG -g
endif
LIBS := -lwups -lwut -lwuhbutils -lcontentredirection -lrpxloader -lsdutils
LIBS := -lwups -lwut -lwuhbutils -lcontentredirection -lrpxloader -lsdutils -lnotifications
#-------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level

View File

@ -13,6 +13,7 @@ This plugin allows you to boot homebrew directly from your Wii U Menu.
4. Requires the [WUHBUtilsModule](https://github.com/wiiu-env/WUHBUtilsModule) in `sd:/wiiu/environments/[ENVIRONMENT]/modules`.
5. Requires the [ContentRedirectionModule](https://github.com/wiiu-env/ContentRedirectionModule) in `sd:/wiiu/environments/[ENVIRONMENT]/modules`.
6. Requires the [SDHotSwapModule](https://github.com/wiiu-env/SDHotSwapModule) in `sd:/wiiu/environments/[ENVIRONMENT]/modules`.
7. Requires the [NotificationModule](https://github.com/wiiu-env/NotificationModule) in `sd:/wiiu/environments/[ENVIRONMENT]/modules`.
## Usage

View File

@ -7,6 +7,7 @@
#include <functional>
#include <nn/act.h>
#include <nn/save.h>
#include <notifications/notifications.h>
#include <string>
#include <utils/StringTools.h>
#include <utils/logger.h>
@ -186,6 +187,31 @@ DECL_FUNCTION(int32_t, SAVEInit) {
return res;
}
DECL_FUNCTION(FSError, FSGetLastErrorCodeForViewer, FSClient *client) {
auto res = real_FSGetLastErrorCodeForViewer(client);
if (!gInWiiUMenu) {
return res;
}
if ((uint32_t) res == 1503030) {
// If we encounter error 1503030 when running the Wii U Menu we probably hit a Wii U Menu save related issue
// Either the sd card is write locked or the save on the sd card it corrupted. Let the user now about this..
std::string deleteHint = string_format("If not write locked, delete \"sd:" HOMEBREW_ON_MENU_PLUGIN_DATA_PATH_BASE "/%s/save/common/BaristaIconDataBase.dat\".", gSerialId.c_str());
std::string deleteHint2 = string_format("If deleting this file doesn't fix the error code, delete this directory: \"sd:" HOMEBREW_ON_MENU_PLUGIN_DATA_PATH_BASE "/%s\".", gSerialId.c_str());
NotificationModuleHandle handle;
NotificationModule_AddDynamicNotification("Caution: This resets the order of application on the Wii U Menu when using Aroma.", &handle);
NotificationModule_AddDynamicNotification(deleteHint2.c_str(), &handle);
NotificationModule_AddDynamicNotification("", &handle);
NotificationModule_AddDynamicNotification(deleteHint.c_str(), &handle);
NotificationModule_AddDynamicNotification("", &handle);
NotificationModule_AddDynamicNotification("", &handle);
NotificationModule_AddDynamicNotification("The SD card appears to be write-locked or the Wii U Menu save on the SD card is corrupted. Check the SD card write lock.", &handle);
}
return res;
}
WUPS_MUST_REPLACE(SAVEInit, WUPS_LOADER_LIBRARY_NN_SAVE, SAVEInit);
WUPS_MUST_REPLACE(LoadConsoleAccount__Q2_2nn3actFUc13ACTLoadOptionPCcb, WUPS_LOADER_LIBRARY_NN_ACT, LoadConsoleAccount__Q2_2nn3actFUc13ACTLoadOptionPCcb);
WUPS_MUST_REPLACE_FOR_PROCESS(FSGetLastErrorCodeForViewer, WUPS_LOADER_LIBRARY_COREINIT, FSGetLastErrorCodeForViewer, WUPS_FP_TARGET_PROCESS_WII_U_MENU);
WUPS_MUST_REPLACE(SAVEGetSharedSaveDataPath, WUPS_LOADER_LIBRARY_NN_SAVE, SAVEGetSharedSaveDataPath);

View File

@ -2,6 +2,7 @@
extern bool gInWiiUMenu;
#define HOMEBREW_ON_MENU_PLUGIN_DATA_PATH "/vol/external01/wiiu/homebrew_on_menu_plugin"
#define HOMEBREW_ON_MENU_PLUGIN_DATA_PATH_BASE "/wiiu/homebrew_on_menu_plugin"
#define HOMEBREW_ON_MENU_PLUGIN_DATA_PATH "/vol/external01" HOMEBREW_ON_MENU_PLUGIN_DATA_PATH_BASE
void SaveRedirectionCleanUp();

View File

@ -4,7 +4,6 @@
#include "bootLogoTex_tga.h"
#include "bootMovie_h264.h"
#include "fs/CFile.hpp"
#include "fs/FSUtils.h"
#include "fs/FileReader.h"
#include "fs/FileReaderWUHB.h"
#include "globals.h"
@ -18,7 +17,6 @@
#include <coreinit/filesystem.h>
#include <coreinit/mcp.h>
#include <coreinit/memory.h>
#include <coreinit/mutex.h>
#include <coreinit/systeminfo.h>
#include <coreinit/title.h>
#include <cstring>
@ -27,8 +25,8 @@
#include <fs/DirList.h>
#include <malloc.h>
#include <map>
#include <mutex>
#include <nn/acp.h>
#include <notifications/notifications.h>
#include <optional>
#include <rpxloader/rpxloader.h>
#include <sdutils/sdutils.h>
@ -124,6 +122,13 @@ INITIALIZE_PLUGIN() {
OSFatal("Homebrew on Menu Plugin: Failed to init RPXLoader.");
}
// Use libnotifications.
NotificationModuleStatus error4;
if ((error4 = NotificationModule_InitLibrary()) != NOTIFICATION_MODULE_RESULT_SUCCESS) {
DEBUG_FUNCTION_LINE_ERR("Homebrew on Menu Plugin: Failed to init NotificationModule. Error %s [%d]", NotificationModule_GetStatusStr(error4), error4);
OSFatal("Homebrew on Menu Plugin: Failed to init NotificationModule.");
}
// Open storage to read values
WUPSStorageError storageRes = WUPS_OpenStorage();
if (storageRes != WUPS_STORAGE_ERROR_SUCCESS) {