mirror of
https://github.com/wiiu-env/wudd.git
synced 2025-04-20 09:51:21 +02:00
Compare commits
20 Commits
wudd-20220
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
04872a3e83 | ||
![]() |
498696953a | ||
![]() |
86815beb77 | ||
![]() |
c3dfb55869 | ||
![]() |
57f823a5de | ||
![]() |
0da71f9420 | ||
![]() |
60688c0663 | ||
![]() |
8a61dda7df | ||
![]() |
eab18ef051 | ||
![]() |
2b46671df6 | ||
![]() |
cda26ddfd4 | ||
![]() |
5462d030d5 | ||
![]() |
16496baa65 | ||
![]() |
359d2e1450 | ||
![]() |
84a32a5142 | ||
![]() |
bb559cb904 | ||
![]() |
6e3cea9b93 | ||
![]() |
6899987864 | ||
![]() |
f09f8f2b29 | ||
![]() |
c8a687950f |
10
.github/dependabot.yml
vendored
Normal file
10
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "docker"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
43
.github/workflows/ci.yml
vendored
43
.github/workflows/ci.yml
vendored
@ -7,17 +7,17 @@ on:
|
||||
|
||||
jobs:
|
||||
clang-format:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: clang-format
|
||||
run: |
|
||||
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source
|
||||
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source
|
||||
build-binary:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: clang-format
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: create version.h
|
||||
run: |
|
||||
git_hash=$(git rev-parse --short "$GITHUB_SHA")
|
||||
@ -33,13 +33,9 @@ jobs:
|
||||
with:
|
||||
name: wuhb-binary
|
||||
path: "*.wuhb"
|
||||
- uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: rpx-binary
|
||||
path: "*.rpx"
|
||||
deploy-binary:
|
||||
needs: build-binary
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Get environment variables
|
||||
id: get_repository_name
|
||||
@ -50,32 +46,15 @@ jobs:
|
||||
with:
|
||||
name: wuhb-binary
|
||||
path: wiiu/apps/wudd
|
||||
- uses: actions/download-artifact@master
|
||||
with:
|
||||
name: rpx-binary
|
||||
path: wiiu/apps/wudd
|
||||
- name: zip artifact
|
||||
run: zip -r ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip wiiu
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
uses: "softprops/action-gh-release@v1"
|
||||
with:
|
||||
tag_name: ${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
|
||||
release_name: Nightly-${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
|
||||
draft: false
|
||||
prerelease: true
|
||||
body: |
|
||||
Not a stable release:
|
||||
${{ github.event.head_commit.message }}
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
||||
asset_path: ./${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
|
||||
asset_name: ${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
|
||||
asset_content_type: application/zip
|
||||
generate_release_notes: true
|
||||
name: Nightly-${{ env.REPOSITORY_NAME }}-${{ env.DATETIME }}
|
||||
files: |
|
||||
./${{ env.REPOSITORY_NAME }}_${{ env.DATETIME }}.zip
|
16
.github/workflows/pr.yml
vendored
16
.github/workflows/pr.yml
vendored
@ -4,17 +4,17 @@ on: [pull_request]
|
||||
|
||||
jobs:
|
||||
clang-format:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: clang-format
|
||||
run: |
|
||||
docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source
|
||||
docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source
|
||||
check-build-with-logging:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: clang-format
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: build binary with logging
|
||||
run: |
|
||||
docker build . -t builder
|
||||
@ -22,10 +22,10 @@ jobs:
|
||||
docker run --rm -v ${PWD}:/project builder make clean
|
||||
docker run --rm -v ${PWD}:/project builder make DEBUG=1
|
||||
build-binary:
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-22.04
|
||||
needs: clang-format
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: create version.h
|
||||
run: |
|
||||
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
|
||||
@ -40,4 +40,4 @@ jobs:
|
||||
- uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: binary
|
||||
path: "*.rpx"
|
||||
path: "*.wuhb"
|
@ -1,6 +1,6 @@
|
||||
FROM wiiuenv/devkitppc:20220801
|
||||
FROM ghcr.io/wiiu-env/devkitppc:20230621
|
||||
|
||||
COPY --from=wiiuenv/libntfs:20220726 /artifacts $DEVKITPRO
|
||||
COPY --from=wiiuenv/libmocha:20220726 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/libntfs:20220726 /artifacts $DEVKITPRO
|
||||
COPY --from=ghcr.io/wiiu-env/libmocha:20220919 /artifacts $DEVKITPRO
|
||||
|
||||
WORKDIR project
|
||||
|
3
Makefile
3
Makefile
@ -52,6 +52,7 @@ SOURCES := source \
|
||||
|
||||
DATA := data
|
||||
INCLUDES := source
|
||||
ICON := data/icon.png
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
# options for code generation
|
||||
@ -164,7 +165,7 @@ endif
|
||||
all: $(BUILD)
|
||||
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
@$(shell [ ! -d $(BUILD) ] && mkdir -p $(BUILD))
|
||||
@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -9,6 +9,8 @@ Features:
|
||||
|
||||
Files will be dumped to `/wudump/[DISC-ID]/`. The disc id of a game can be found on the disc (e.g. WUP-P-ARDP for the EUR version of Super Mario 3D World). If WUDD fails to determine the disc id, "DISC" with a timestamp will be used instead.
|
||||
|
||||
If you want to create a partial dump (skipped sectors represented by 00 bytes) for discs with unreadable sectors, you can avoid the need to manually choose the skip sectors option on each error, by pressing Y at the error message to activate auto skip mode
|
||||
|
||||
## How to merge splitted files
|
||||
|
||||
When you dump a .wux or .wud to the SD card it gets splitted into 2 GiB parts (FAT32 limitation). To merge them you can use the `copy` cmd tool.
|
||||
@ -51,4 +53,4 @@ docker run -it --rm -v ${PWD}:/project wudd-builder make clean
|
||||
|
||||
## Format the code via docker
|
||||
|
||||
`docker run --rm -v ${PWD}:/src wiiuenv/clang-format:13.0.0-2 -r ./source -i`
|
||||
`docker run --rm -v ${PWD}:/src ghcr.io/wiiu-env/clang-format:13.0.0-2 -r ./source -i`
|
||||
|
BIN
data/icon.png
Normal file
BIN
data/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
@ -56,7 +56,7 @@ public:
|
||||
}
|
||||
|
||||
virtual void printHeader() {
|
||||
WiiUScreen::drawLine("WUDD - Wii U Disc Dumper v1.1.0" VERSION_EXTRA);
|
||||
WiiUScreen::drawLine("WUDD - Wii U Disc Dumper v1.2.2" VERSION_EXTRA);
|
||||
WiiUScreen::drawLine("==================");
|
||||
WiiUScreen::drawLine("");
|
||||
}
|
||||
@ -77,4 +77,4 @@ public:
|
||||
|
||||
int selectedOptionY = 0;
|
||||
int selectedOptionX = 0;
|
||||
};
|
||||
};
|
||||
|
@ -36,6 +36,10 @@ GMPartitionsDumperState::GMPartitionsDumperState(eDumpTarget pTargetDevice) : ta
|
||||
}
|
||||
|
||||
GMPartitionsDumperState::~GMPartitionsDumperState() {
|
||||
if (this->oddFd != -1) {
|
||||
FSAEx_RawCloseEx(gFSAClientHandle, this->oddFd);
|
||||
this->oddFd = -1;
|
||||
}
|
||||
free(this->sectorBuf);
|
||||
this->sectorBuf = nullptr;
|
||||
free(this->readBuffer);
|
||||
@ -178,7 +182,7 @@ ApplicationState::eSubState GMPartitionsDumperState::update(Input *input) {
|
||||
}
|
||||
|
||||
if (this->state == STATE_OPEN_ODD1) {
|
||||
auto ret = FSAEx_RawOpen(__wut_devoptab_fs_client, "/dev/odd01", &(this->oddFd));
|
||||
auto ret = FSAEx_RawOpenEx(gFSAClientHandle, "/dev/odd01", &(this->oddFd));
|
||||
if (ret >= 0) {
|
||||
if (this->sectorBuf == nullptr) {
|
||||
this->sectorBuf = (void *) memalign(0x100, this->sectorBufSize);
|
||||
@ -196,13 +200,13 @@ ApplicationState::eSubState GMPartitionsDumperState::update(Input *input) {
|
||||
return ApplicationState::SUBSTATE_RETURN;
|
||||
}
|
||||
} else if (this->state == STATE_READ_DISC_INFO) {
|
||||
if (FSAEx_RawRead(__wut_devoptab_fs_client, this->sectorBuf, READ_SECTOR_SIZE, 1, 0, this->oddFd) >= 0) {
|
||||
if (FSAEx_RawReadEx(gFSAClientHandle, this->sectorBuf, READ_SECTOR_SIZE, 1, 0, this->oddFd) >= 0) {
|
||||
this->discId[10] = '\0';
|
||||
memcpy(this->discId.data(), sectorBuf, 10);
|
||||
this->state = STATE_READ_DISC_INFO_DONE;
|
||||
return ApplicationState::SUBSTATE_RUNNING;
|
||||
}
|
||||
FSAEx_RawClose(__wut_devoptab_fs_client, this->oddFd);
|
||||
FSAEx_RawCloseEx(gFSAClientHandle, this->oddFd);
|
||||
this->oddFd = -1;
|
||||
|
||||
this->setError(ERROR_READ_FIRST_SECTOR);
|
||||
|
@ -81,7 +81,7 @@ bool DiscReader::readDecrypted(uint8_t *out_buffer, uint64_t clusterOffset, uint
|
||||
uint32_t blockNumber = (totalOffset / BLOCK_SIZE);
|
||||
uint32_t blockOffset = (totalOffset % BLOCK_SIZE);
|
||||
|
||||
readOffset = (blockNumber * BLOCK_SIZE);
|
||||
readOffset = ((uint64_t) blockNumber * BLOCK_SIZE);
|
||||
if (!useFixedIV) {
|
||||
memset(usedIV, 0, 16);
|
||||
uint64_t ivTemp = usedFileOffset >> 16;
|
||||
|
@ -31,13 +31,13 @@ DiscReaderDiscDrive::DiscReaderDiscDrive() : DiscReader() {
|
||||
return;
|
||||
}
|
||||
|
||||
auto ret = FSAEx_RawOpen(__wut_devoptab_fs_client, "/dev/odd01", &device_handle);
|
||||
auto ret = FSAEx_RawOpenEx(gFSAClientHandle, "/dev/odd01", &device_handle);
|
||||
if (ret < 0) {
|
||||
free(sector_buf);
|
||||
return;
|
||||
}
|
||||
|
||||
auto res = FSAEx_RawRead(__wut_devoptab_fs_client, sector_buf, READ_SECTOR_SIZE, 1, 3, device_handle);
|
||||
auto res = FSAEx_RawReadEx(gFSAClientHandle, sector_buf, READ_SECTOR_SIZE, 1, 3, device_handle);
|
||||
if (res >= 0) {
|
||||
if (((uint32_t *) sector_buf)[0] != WiiUDiscContentsHeader::MAGIC) {
|
||||
uint8_t iv[16];
|
||||
@ -75,7 +75,7 @@ DiscReaderDiscDrive::DiscReaderDiscDrive() : DiscReader() {
|
||||
}
|
||||
|
||||
bool DiscReaderDiscDrive::readEncryptedSector(uint8_t *buffer, uint32_t block_cnt, uint32_t block_offset) const {
|
||||
if (FSAEx_RawRead(__wut_devoptab_fs_client, buffer, READ_SECTOR_SIZE, block_cnt, block_offset, device_handle) < 0) {
|
||||
if (FSAEx_RawReadEx(gFSAClientHandle, buffer, READ_SECTOR_SIZE, block_cnt, block_offset, device_handle) < 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -87,7 +87,7 @@ bool DiscReaderDiscDrive::IsReady() {
|
||||
|
||||
DiscReaderDiscDrive::~DiscReaderDiscDrive() {
|
||||
if (device_handle != -1) {
|
||||
FSAEx_RawClose(__wut_devoptab_fs_client, device_handle);
|
||||
FSAEx_RawCloseEx(gFSAClientHandle, device_handle);
|
||||
device_handle = -1;
|
||||
}
|
||||
}
|
||||
@ -102,7 +102,7 @@ bool DiscReaderDiscDrive::readEncrypted(uint8_t *buf, uint64_t offset, uint32_t
|
||||
}
|
||||
uint32_t block_cnt = size >> 15;
|
||||
uint32_t offset_in_sectors = offset >> 15;
|
||||
if (FSAEx_RawRead(__wut_devoptab_fs_client, buf, 0x8000, block_cnt, offset_in_sectors, device_handle) < 0) {
|
||||
if (FSAEx_RawReadEx(gFSAClientHandle, buf, 0x8000, block_cnt, offset_in_sectors, device_handle) < 0) {
|
||||
DEBUG_FUNCTION_LINE_ERR("Failed to read from Disc");
|
||||
return false;
|
||||
}
|
||||
|
@ -28,5 +28,5 @@ public:
|
||||
~H3HashArray();
|
||||
|
||||
std::unique_ptr<uint8_t[]> data;
|
||||
uint8_t size;
|
||||
uint32_t size;
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ WUDDumperState::WUDDumperState(WUDDumperState::eDumpTargetFormat pTargetFormat,
|
||||
|
||||
WUDDumperState::~WUDDumperState() {
|
||||
if (this->oddFd >= 0) {
|
||||
FSAEx_RawClose(__wut_devoptab_fs_client, oddFd);
|
||||
FSAEx_RawCloseEx(gFSAClientHandle, oddFd);
|
||||
}
|
||||
free(sectorBuf);
|
||||
free(emptySector);
|
||||
@ -51,7 +51,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
}
|
||||
if (this->state == STATE_OPEN_ODD1) {
|
||||
if (this->currentSector > 0) {
|
||||
auto ret = FSAEx_RawOpen(__wut_devoptab_fs_client, "/dev/odd01", &(this->oddFd));
|
||||
auto ret = FSAEx_RawOpenEx(gFSAClientHandle, "/dev/odd01", &(this->oddFd));
|
||||
if (ret >= 0) {
|
||||
// continue!
|
||||
this->state = STATE_DUMP_DISC;
|
||||
@ -65,7 +65,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
this->state = STATE_PLEASE_INSERT_DISC;
|
||||
return ApplicationState::SUBSTATE_RUNNING;
|
||||
}
|
||||
auto ret = FSAEx_RawOpen(__wut_devoptab_fs_client, "/dev/odd01", &(this->oddFd));
|
||||
auto ret = FSAEx_RawOpenEx(gFSAClientHandle, "/dev/odd01", &(this->oddFd));
|
||||
if (ret >= 0) {
|
||||
if (this->sectorBuf == nullptr) {
|
||||
this->sectorBuf = (void *) memalign(0x100, this->sectorBufSize);
|
||||
@ -83,7 +83,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
return SUBSTATE_RETURN;
|
||||
}
|
||||
} else if (this->state == STATE_READ_DISC_INFO) {
|
||||
if (FSAEx_RawRead(__wut_devoptab_fs_client, this->sectorBuf, READ_SECTOR_SIZE, 1, 0, this->oddFd) >= 0) {
|
||||
if (FSAEx_RawReadEx(gFSAClientHandle, this->sectorBuf, READ_SECTOR_SIZE, 1, 0, this->oddFd) >= 0) {
|
||||
this->discId[10] = '\0';
|
||||
memcpy(this->discId.data(), sectorBuf, 10);
|
||||
this->state = STATE_READ_DISC_INFO_DONE;
|
||||
@ -96,7 +96,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
this->state = STATE_DUMP_DISC_KEY;
|
||||
} else if (this->state == STATE_DUMP_DISC_KEY) {
|
||||
// Read the WiiUDiscContentsHeader to determine if we need disckey and if it's the correct one.
|
||||
auto res = FSAEx_RawRead(__wut_devoptab_fs_client, this->sectorBuf, READ_SECTOR_SIZE, 1, 3, this->oddFd);
|
||||
auto res = FSAEx_RawReadEx(gFSAClientHandle, this->sectorBuf, READ_SECTOR_SIZE, 1, 3, this->oddFd);
|
||||
WUDDiscKey discKey;
|
||||
bool hasDiscKey = false;
|
||||
if (res >= 0) {
|
||||
@ -151,7 +151,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
}
|
||||
|
||||
size_t numSectors = this->currentSector + READ_NUM_SECTORS > this->totalSectorCount ? this->totalSectorCount - this->currentSector : READ_NUM_SECTORS;
|
||||
if ((this->readResult = FSAEx_RawRead(__wut_devoptab_fs_client, sectorBuf, READ_SECTOR_SIZE, numSectors, this->currentSector, this->oddFd)) >= 0) {
|
||||
if ((this->readResult = FSAEx_RawReadEx(gFSAClientHandle, sectorBuf, READ_SECTOR_SIZE, numSectors, this->currentSector, this->oddFd)) >= 0) {
|
||||
auto curWrittenSectors = fileHandle->writeSector((const uint8_t *) this->sectorBuf, numSectors);
|
||||
if (curWrittenSectors < 0) {
|
||||
this->setError(ERROR_WRITE_FAILED);
|
||||
@ -180,7 +180,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
} else {
|
||||
this->state = STATE_WAIT_USER_ERROR_CONFIRM;
|
||||
if (this->oddFd >= 0) {
|
||||
FSAEx_RawClose(__wut_devoptab_fs_client, this->oddFd);
|
||||
FSAEx_RawCloseEx(gFSAClientHandle, this->oddFd);
|
||||
this->oddFd = -1;
|
||||
}
|
||||
return ApplicationState::SUBSTATE_RUNNING;
|
||||
@ -203,7 +203,7 @@ ApplicationState::eSubState WUDDumperState::update(Input *input) {
|
||||
} else if (this->state == STATE_WAIT_USER_ERROR_CONFIRM) {
|
||||
if (this->autoSkipOnError) {
|
||||
if (this->oddFd >= 0) {
|
||||
FSAEx_RawClose(__wut_devoptab_fs_client, this->oddFd);
|
||||
FSAEx_RawCloseEx(gFSAClientHandle, this->oddFd);
|
||||
this->oddFd = -1;
|
||||
}
|
||||
}
|
||||
|
@ -4,3 +4,4 @@ int ntfs_mount_count = 0;
|
||||
BOOL gRunFromHBL = false;
|
||||
BOOL gBlockHomeButton = false;
|
||||
uint32_t gBlockHomeButtonCooldown = 0;
|
||||
FSAClientHandle gFSAClientHandle = 0;
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <coreinit/filesystem_fsa.h>
|
||||
#include <ntfs.h>
|
||||
#include <wut.h>
|
||||
|
||||
@ -9,12 +10,13 @@
|
||||
extern ntfs_md *ntfs_mounts;
|
||||
extern int ntfs_mount_count;
|
||||
|
||||
extern "C" FSClient *__wut_devoptab_fs_client;
|
||||
extern FSAClientHandle gFSAClientHandle;
|
||||
|
||||
extern BOOL gRunFromHBL;
|
||||
extern BOOL gBlockHomeButton;
|
||||
extern uint32_t gBlockHomeButtonCooldown;
|
||||
|
||||
|
||||
enum eDumpTarget {
|
||||
TARGET_SD,
|
||||
TARGET_NTFS
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <mocha/mocha.h>
|
||||
#include <ntfs.h>
|
||||
#include <padscore/kpad.h>
|
||||
#include <sndcore2/core.h>
|
||||
#include <thread>
|
||||
#include <whb/log.h>
|
||||
#include <whb/proc.h>
|
||||
@ -37,7 +38,7 @@ procHomeButtonDeniedCustom(void *context) {
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
initLogging();
|
||||
DEBUG_FUNCTION_LINE("Hello from wudump!");
|
||||
AXInit();
|
||||
WHBProcInit();
|
||||
WiiUScreen::Init();
|
||||
|
||||
@ -53,9 +54,7 @@ int main(int argc, char **argv) {
|
||||
|
||||
ProcUIClearCallbacks();
|
||||
ProcUIRegisterCallback(PROCUI_CALLBACK_HOME_BUTTON_DENIED,
|
||||
&procHomeButtonDeniedCustom, NULL, 100);
|
||||
|
||||
|
||||
&procHomeButtonDeniedCustom, nullptr, 100);
|
||||
} else {
|
||||
gRunFromHBL = false;
|
||||
}
|
||||
@ -64,7 +63,7 @@ int main(int argc, char **argv) {
|
||||
IMIsAPDEnabled(&isAPDEnabled);
|
||||
|
||||
if (isAPDEnabled) {
|
||||
DEBUG_FUNCTION_LINE("Disable auto shutdown");
|
||||
DEBUG_FUNCTION_LINE_VERBOSE("Disable auto shutdown");
|
||||
IMDisableAPD();
|
||||
}
|
||||
|
||||
@ -76,8 +75,19 @@ int main(int argc, char **argv) {
|
||||
|
||||
WPADInput::init();
|
||||
|
||||
gFSAClientHandle = FSAAddClient(nullptr);
|
||||
if (!gFSAClientHandle) {
|
||||
OSFatal("FSAAddClient failed");
|
||||
}
|
||||
|
||||
if (Mocha_UnlockFSClientEx(gFSAClientHandle) != MOCHA_RESULT_SUCCESS) {
|
||||
OSFatal("Failed to unlock FSAClientHandle");
|
||||
}
|
||||
|
||||
main_loop();
|
||||
|
||||
FSADelClient(gFSAClientHandle);
|
||||
|
||||
WPADInput::close();
|
||||
|
||||
if (ntfs_mounts != nullptr) {
|
||||
@ -89,7 +99,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
if (isAPDEnabled) {
|
||||
DEBUG_FUNCTION_LINE("Enable auto shutdown");
|
||||
DEBUG_FUNCTION_LINE_VERBOSE("Enable auto shutdown");
|
||||
IMEnableAPD();
|
||||
}
|
||||
|
||||
@ -97,12 +107,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
WiiUScreen::DeInit();
|
||||
WHBProcShutdown();
|
||||
AXQuit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void main_loop() {
|
||||
DEBUG_FUNCTION_LINE("Creating state");
|
||||
DEBUG_FUNCTION_LINE_VERBOSE("Creating state");
|
||||
std::unique_ptr<MainApplicationState> state = std::make_unique<MainApplicationState>();
|
||||
CombinedInput baseInput;
|
||||
VPadInput vpadInput;
|
||||
@ -112,7 +123,7 @@ void main_loop() {
|
||||
WPAD_CHAN_2,
|
||||
WPAD_CHAN_3};
|
||||
|
||||
DEBUG_FUNCTION_LINE("Entering main loop");
|
||||
DEBUG_FUNCTION_LINE_VERBOSE("Entering main loop");
|
||||
while (WHBProcIsRunning()) {
|
||||
baseInput.reset();
|
||||
if (vpadInput.update(1280, 720)) {
|
||||
@ -142,7 +153,7 @@ void initMochaLib() {
|
||||
|
||||
void deInitMochaLib() {
|
||||
if (slibMochaMount) {
|
||||
Mocha_DeinitLibrary();
|
||||
Mocha_DeInitLibrary();
|
||||
}
|
||||
|
||||
Mocha_sdio_disc_interface.shutdown();
|
||||
|
Loading…
x
Reference in New Issue
Block a user