2022-02-14 19:35:01 +01:00
|
|
|
#include "utils/utils.h"
|
2022-03-12 21:21:21 +01:00
|
|
|
#include <content_redirection/redirection.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-03-12 21:21:21 +01:00
|
|
|
#define WUHB_ROMFS_NAME "wuhbrom"
|
|
|
|
#define WUHB_ROMFS_PATH WUHB_ROMFS_NAME ":"
|
|
|
|
#define WUHB_ROMFS_CONTENT_PATH WUHB_ROMFS_PATH "/content"
|
|
|
|
|
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
|
|
|
|
2022-03-12 21:21:21 +01:00
|
|
|
typedef struct ContentRedirectionInformation_t {
|
2021-02-19 20:32:44 +01:00
|
|
|
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 struct ContentReplacementInfo_t {
|
|
|
|
BundleMountInformation bundleMountInformation;
|
2022-03-12 21:21:21 +01:00
|
|
|
char replacementPath[0x280];
|
2021-04-05 19:54:50 +02:00
|
|
|
} ContentReplacementInfo;
|
|
|
|
|
2022-03-12 21:21:21 +01:00
|
|
|
typedef struct ContentReplacementWithFallback_t {
|
|
|
|
char replacementPath[0x280];
|
|
|
|
} ContentReplacementWithFallback;
|
|
|
|
|
2021-04-05 19:54:50 +02:00
|
|
|
typedef struct RPXLoader_ReplacementInformation_t {
|
|
|
|
RPXReplacementInfo rpxReplacementInfo;
|
|
|
|
ContentReplacementInfo contentReplacementInfo;
|
2022-03-12 21:21:21 +01:00
|
|
|
ContentReplacementWithFallback contentReplacementWithFallbackInfo;
|
2021-02-19 20:32:44 +01:00
|
|
|
} RPXLoader_ReplacementInformation;
|
|
|
|
|
2021-09-30 14:25:17 +02:00
|
|
|
extern RPXLoader_ReplacementInformation gReplacementInfo;
|
2022-03-12 21:21:21 +01:00
|
|
|
|
|
|
|
extern CRLayerHandle contentLayerHandle;
|
|
|
|
extern CRLayerHandle saveLayerHandle;
|