Compare commits

...

10 Commits
v0.3.3 ... main

Author SHA1 Message Date
Maschell
5239704327 Update Dockerfile 2024-05-05 16:36:17 +02:00
Maschell
176b1c06c4 Bump version 2024-04-25 16:58:07 +02:00
Maschell
2fb721d6d5 Update github actions 2024-04-25 16:58:07 +02:00
Maschell
a0913ed652 Update Dockerfile 2024-04-25 16:58:07 +02:00
dependabot[bot]
b6d28a891f Bump actions/checkout from 3 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-25 16:58:07 +02:00
Maschell
9eed09d8bf Update libromfs version in Dockerfile 2024-04-25 16:58:07 +02:00
Maschell
bafc8b69bf Update .gitignore to ignore zip files 2024-04-25 16:58:07 +02:00
Maschell
a31646fbfe Implement RL_GetPathOfSaveRedirection 2024-04-25 16:58:07 +02:00
Maschell
77c7db4ed9 Stop stroring global variables in data section 2024-04-25 16:58:07 +02:00
Maschell
626704d06f Create dependabot.yml 2023-07-23 10:26:17 +02:00
9 changed files with 53 additions and 22 deletions

10
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

View File

@ -9,7 +9,7 @@ jobs:
clang-format: clang-format:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: clang-format - name: clang-format
run: | run: |
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./src docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./src
@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: create version.h - name: create version.h
run: | run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA") git_hash=$(git rev-parse --short "$GITHUB_SHA")
@ -48,7 +48,7 @@ jobs:
- name: zip artifact - name: zip artifact
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wms run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip *.wms
- name: Create Release - name: Create Release
uses: "softprops/action-gh-release@v1" uses: "softprops/action-gh-release@v2"
with: with:
tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }} tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
draft: false draft: false

View File

@ -6,7 +6,7 @@ jobs:
clang-format: clang-format:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: clang-format - name: clang-format
run: | run: |
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./src docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./src
@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: build binary with logging - name: build binary with logging
run: | run: |
docker build . -t builder docker build . -t builder
@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- name: create version.h - name: create version.h
run: | run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}") git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")

1
.gitignore vendored
View File

@ -8,3 +8,4 @@ build/
cmake-build-debug/ cmake-build-debug/
CMakeLists.txt CMakeLists.txt
*.wms *.wms
*.zip

View File

@ -1,11 +1,11 @@
FROM ghcr.io/wiiu-env/devkitppc:20230621 FROM ghcr.io/wiiu-env/devkitppc:20240505
COPY --from=ghcr.io/wiiu-env/librpxloader:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/librpxloader:20240425 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libfunctionpatcher:20230621 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20230719 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/wiiumodulesystem:20240424 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libwuhbutils: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/libcontentredirection:20240424 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libromfs_wiiu:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libromfs_wiiu:20240505 /artifacts $DEVKITPRO
COPY --from=ghcr.io/wiiu-env/libmocha:20230621 /artifacts $DEVKITPRO COPY --from=ghcr.io/wiiu-env/libmocha:20231127 /artifacts $DEVKITPRO
WORKDIR project WORKDIR project

View File

@ -382,7 +382,7 @@ RPXLoaderStatus RL_GetVersion(RPXLoaderVersion *outVersion) {
if (!outVersion) { if (!outVersion) {
return RPX_LOADER_RESULT_INVALID_ARGUMENT; return RPX_LOADER_RESULT_INVALID_ARGUMENT;
} }
*outVersion = 2; *outVersion = 3;
return RPX_LOADER_RESULT_SUCCESS; return RPX_LOADER_RESULT_SUCCESS;
} }
@ -398,6 +398,18 @@ RPXLoaderStatus RL_GetPathOfRunningExecutable(char *outBuffer, uint32_t outSize)
return RPX_LOADER_RESULT_NOT_AVAILABLE; return RPX_LOADER_RESULT_NOT_AVAILABLE;
} }
RPXLoaderStatus RL_GetPathOfSaveRedirection(char *outBuffer, uint32_t outSize) {
if (outBuffer == nullptr || outSize == 0) {
return RPX_LOADER_RESULT_INVALID_ARGUMENT;
}
if (saveLayerHandle != 0 && !gActiveSaveRedirectionPath.empty()) {
strncpy(outBuffer, gActiveSaveRedirectionPath.c_str(), outSize - 1);
return RPX_LOADER_RESULT_SUCCESS;
}
return RPX_LOADER_RESULT_NOT_AVAILABLE;
}
WUMS_EXPORT_FUNCTION(RL_PrepareLaunchFromSD); WUMS_EXPORT_FUNCTION(RL_PrepareLaunchFromSD);
WUMS_EXPORT_FUNCTION(RL_LaunchPreparedHomebrew); WUMS_EXPORT_FUNCTION(RL_LaunchPreparedHomebrew);
WUMS_EXPORT_FUNCTION(RL_LaunchHomebrew); WUMS_EXPORT_FUNCTION(RL_LaunchHomebrew);
@ -407,3 +419,4 @@ WUMS_EXPORT_FUNCTION(RL_EnableContentRedirection);
WUMS_EXPORT_FUNCTION(RL_DisableContentRedirection); WUMS_EXPORT_FUNCTION(RL_DisableContentRedirection);
WUMS_EXPORT_FUNCTION(RL_UnmountCurrentRunningBundle); WUMS_EXPORT_FUNCTION(RL_UnmountCurrentRunningBundle);
WUMS_EXPORT_FUNCTION(RL_GetPathOfRunningExecutable); WUMS_EXPORT_FUNCTION(RL_GetPathOfRunningExecutable);
WUMS_EXPORT_FUNCTION(RL_GetPathOfSaveRedirection);

View File

@ -1,5 +1,6 @@
#include "globals.h" #include "globals.h"
RPXLoader_ReplacementInformation gReplacementInfo __attribute__((section(".data"))); RPXLoader_ReplacementInformation gReplacementInfo = {};
CRLayerHandle contentLayerHandle __attribute__((section(".data"))) = 0; CRLayerHandle contentLayerHandle = 0;
CRLayerHandle saveLayerHandle __attribute__((section(".data"))) = 0; CRLayerHandle saveLayerHandle = 0;
std::string gActiveSaveRedirectionPath;

View File

@ -54,3 +54,4 @@ extern RPXLoader_ReplacementInformation gReplacementInfo;
extern CRLayerHandle contentLayerHandle; extern CRLayerHandle contentLayerHandle;
extern CRLayerHandle saveLayerHandle; extern CRLayerHandle saveLayerHandle;
extern std::string gActiveSaveRedirectionPath;

View File

@ -16,7 +16,7 @@
#include <wuhb_utils/utils.h> #include <wuhb_utils/utils.h>
#include <wums.h> #include <wums.h>
#define VERSION "v0.3.3" #define VERSION "v0.3.4"
WUMS_MODULE_EXPORT_NAME("homebrew_rpx_loader"); WUMS_MODULE_EXPORT_NAME("homebrew_rpx_loader");
WUMS_USE_WUT_DEVOPTAB(); WUMS_USE_WUT_DEVOPTAB();
@ -91,6 +91,8 @@ WUMS_APPLICATION_STARTS() {
gReplacementInfo.lastFileLoaded[0] = '\0'; gReplacementInfo.lastFileLoaded[0] = '\0';
} }
gActiveSaveRedirectionPath.clear();
if (_SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_HEALTH_AND_SAFETY) == OSGetTitleID() && if (_SYSGetSystemApplicationTitleId(SYSTEM_APP_ID_HEALTH_AND_SAFETY) == OSGetTitleID() &&
strlen(gReplacementInfo.contentReplacementInfo.bundleMountInformation.toMountPath) > 0) { strlen(gReplacementInfo.contentReplacementInfo.bundleMountInformation.toMountPath) > 0) {
uint32_t currentHash = StringTools::hash(gReplacementInfo.contentReplacementInfo.bundleMountInformation.toMountPath); uint32_t currentHash = StringTools::hash(gReplacementInfo.contentReplacementInfo.bundleMountInformation.toMountPath);
@ -100,10 +102,11 @@ WUMS_APPLICATION_STARTS() {
nn::act::PersistentId persistentId = nn::act::GetPersistentId(); nn::act::PersistentId persistentId = nn::act::GetPersistentId();
nn::act::Finalize(); nn::act::Finalize();
std::string basePath = string_format("fs:/vol/external01/wiiu/apps/save/%08X", currentHash); std::string relativePath = string_format("wiiu/apps/save/%08X", currentHash);
if (!shortNameSanitized.empty()) { if (!shortNameSanitized.empty()) {
basePath += string_format(" (%s)", shortNameSanitized.c_str()); relativePath += string_format(" (%s)", shortNameSanitized.c_str());
} }
std::string basePath = "fs:/vol/external01/" + relativePath;
std::string common = basePath + "/common"; std::string common = basePath + "/common";
std::string user = basePath + string_format("/%08X", 0x80000000 | persistentId); std::string user = basePath + string_format("/%08X", 0x80000000 | persistentId);
@ -145,6 +148,8 @@ WUMS_APPLICATION_STARTS() {
gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted = true; gReplacementInfo.contentReplacementInfo.bundleMountInformation.isMounted = true;
gReplacementInfo.contentReplacementInfo.bundleMountInformation.toMountPath[0] = '\0'; gReplacementInfo.contentReplacementInfo.bundleMountInformation.toMountPath[0] = '\0';
gActiveSaveRedirectionPath = relativePath;
OSMemoryBarrier(); OSMemoryBarrier();
return; return;
} else { } else {