2022-02-14 19:35:01 +01:00
|
|
|
#include "utils/utils.h"
|
2021-09-30 14:25:17 +02:00
|
|
|
#include <coreinit/filesystem.h>
|
2022-02-04 16:35:35 +01:00
|
|
|
#include <coreinit/mutex.h>
|
|
|
|
#include <wums.h>
|
2022-02-14 19:35:01 +01:00
|
|
|
#include <wut.h>
|
2021-01-01 01:39:28 +01:00
|
|
|
|
2022-02-14 19:35:01 +01:00
|
|
|
typedef struct WUT_PACKED MetaInformation_t {
|
2021-01-17 13:57:57 +01:00
|
|
|
char shortname[64];
|
|
|
|
char longname[64];
|
|
|
|
char author[64];
|
2021-02-19 20:32:44 +01:00
|
|
|
} MetaInformation;
|
2022-02-14 19:35:01 +01:00
|
|
|
WUT_CHECK_SIZE(MetaInformation_t, 0xC0);
|
2021-01-17 13:57:57 +01:00
|
|
|
|
2021-02-19 20:32:44 +01:00
|
|
|
typedef struct BundleMountInformation_t {
|
|
|
|
bool isMounted;
|
2021-04-05 19:54:50 +02:00
|
|
|
char toMountPath[255];
|
|
|
|
char mountedPath[255];
|
2021-02-19 20:32:44 +01:00
|
|
|
} BundleMountInformation;
|
2021-01-17 13:57:57 +01:00
|
|
|
|
2022-02-14 19:35:01 +01:00
|
|
|
#define ICON_SIZE 65580
|
|
|
|
|
|
|
|
typedef struct WUT_PACKED RPXReplacementInfo_t {
|
2021-04-13 20:14:50 +02:00
|
|
|
bool willRPXBeReplaced;
|
2021-02-19 20:32:44 +01:00
|
|
|
bool isRPXReplaced;
|
|
|
|
MetaInformation metaInformation;
|
2022-02-14 19:35:01 +01:00
|
|
|
WUT_UNKNOWN_BYTES(0x3E);
|
|
|
|
char iconCache[ROUNDUP(ICON_SIZE, 0x040)];
|
2021-04-05 19:54:50 +02:00
|
|
|
} RPXReplacementInfo;
|
2022-02-14 19:35:01 +01:00
|
|
|
// make sure the iconCache is aligned to 0x40
|
|
|
|
WUT_CHECK_OFFSET(RPXReplacementInfo, 0x100, iconCache);
|
|
|
|
|
2021-04-05 19:54:50 +02:00
|
|
|
|
|
|
|
typedef enum ContentRedirect_Mode {
|
|
|
|
CONTENTREDIRECT_NONE,
|
|
|
|
CONTENTREDIRECT_FROM_WUHB_BUNDLE,
|
|
|
|
CONTENTREDIRECT_FROM_PATH,
|
|
|
|
} ContentRedirect_Mode;
|
|
|
|
|
|
|
|
typedef struct ContentReplacementInfo_t {
|
|
|
|
ContentRedirect_Mode mode;
|
|
|
|
|
|
|
|
BundleMountInformation bundleMountInformation;
|
|
|
|
|
|
|
|
char workingDir[255];
|
|
|
|
|
|
|
|
char replacementPath[255];
|
|
|
|
|
|
|
|
bool replaceSave;
|
|
|
|
|
2021-02-19 20:32:44 +01:00
|
|
|
char savePath[255];
|
2021-04-05 19:54:50 +02:00
|
|
|
|
|
|
|
bool fallbackOnError;
|
|
|
|
} ContentReplacementInfo;
|
|
|
|
|
|
|
|
typedef struct RPXLoader_ReplacementInformation_t {
|
|
|
|
RPXReplacementInfo rpxReplacementInfo;
|
|
|
|
ContentReplacementInfo contentReplacementInfo;
|
2021-02-19 20:32:44 +01:00
|
|
|
} RPXLoader_ReplacementInformation;
|
|
|
|
|
2021-04-05 19:54:50 +02:00
|
|
|
|
2021-09-30 14:25:17 +02:00
|
|
|
extern RPXLoader_ReplacementInformation gReplacementInfo;
|
2022-01-26 23:20:21 +01:00
|
|
|
extern FSClient *gFSClient;
|
|
|
|
extern FSCmdBlock *gFSCmd;
|