From 071022d3aaca1c5411c70ce02125cb5f27135992 Mon Sep 17 00:00:00 2001 From: wiidev Date: Sun, 4 Apr 2021 19:00:03 +0100 Subject: [PATCH] Fix a crash caused by some third party controllers This requires libogc to be compiled from source because the release builds don't include the fix yet. --- .github/workflows/main.yml | 124 +++++++++++++++++++++++++++++-------- source/StartUpProcess.cpp | 7 ++- 2 files changed, 103 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 879ed8ad..c2067cdf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,22 +11,20 @@ on: - 'Languages/**' jobs: - build: + download-build-tools: runs-on: ubuntu-20.04 timeout-minutes: 20 steps: - - uses: actions/checkout@v2 - - - name: Cache + - name: Restore cache id: cache-1 uses: actions/cache@v2 with: path: cache key: ${{ runner.os }}-cache-1 - - name: Download devkitPPC r38, libogc 2.1.0, bin2s and elf2dol + - name: Download devkitPPC r38, libogc 2.1.0 and required tools if: steps.cache-1.outputs.cache-hit != 'true' - # general-tools is needed for bin2s and gamecube-tools is needed for elf2dol + # general-tools is needed for bin2s and gamecube-tools is needed for elf2dol & gcdsptool run: | mkdir cache && cd cache wget "https://wii.leseratte10.de/devkitPro/file.php/devkitPPC-r38-1-linux_x86_64.pkg.tar.xz" @@ -36,39 +34,54 @@ jobs: wget "https://wii.leseratte10.de/devkitPro/file.php/gamecube-tools-1.0.2-1-linux.pkg.tar.xz" cd .. - - name: Verify checksums for the downloaded files + - name: Verify checksums run: | sha256sum -c < /dev/null; PATH=$(pwd)/devkitpro/devkitPPC/bin:$PATH DEVKITPPC=$(pwd)/devkitpro/devkitPPC DEVKITPRO=$(pwd)/devkitpro make + run: | + sudo apt-get -qq remove subversion > /dev/null + PATH=$(pwd)/devkitpro/devkitPPC/bin:$PATH DEVKITPPC=$(pwd)/devkitpro/devkitPPC DEVKITPRO=$(pwd)/devkitpro make - name: Package id: pack run: | - mkdir -p upload/apps/usbloader_gx/ - cp boot.dol upload/apps/usbloader_gx/ - cp HBC/icon.png upload/apps/usbloader_gx/ - cp HBC/meta.xml upload/apps/usbloader_gx/ + mkdir -p upload/apps/usbloader_gx + cp boot.dol upload/apps/usbloader_gx + cp HBC/icon.png upload/apps/usbloader_gx + cp HBC/meta.xml upload/apps/usbloader_gx echo "::set-output name=sha::$(echo ${GITHUB_SHA} | head -c 7)" - name: Upload binary @@ -82,3 +95,64 @@ jobs: with: name: usbloadergx_${{ steps.pack.outputs.sha }}_debug path: boot.elf + + build-latest-libogc: + runs-on: ubuntu-20.04 + needs: download-build-tools + steps: + - uses: actions/checkout@v2 + + - name: Restore cache + id: cache-1 + uses: actions/cache@v2 + with: + path: cache + key: ${{ runner.os }}-cache-1 + + - name: Check cache + if: steps.cache-1.outputs.cache-hit != 'true' + run: exit 1 + + - name: Extract downloaded files + run: | + tar -xf cache/devkitPPC-r38-1-linux_x86_64.pkg.tar.xz --strip-components=1 + tar -xf cache/devkitppc-rules-1.1.0-1-any.pkg.tar.xz --strip-components=1 + tar -xf cache/general-tools-1.2.0-1-linux.pkg.tar.xz --strip-components=1 + tar -xf cache/gamecube-tools-1.0.2-1-linux.pkg.tar.xz --strip-components=1 + + - name: Checkout libogc + uses: actions/checkout@v2 + with: + repository: devkitPro/libogc + path: libogc + + - name: Compile and install libogc + run: PATH=$(pwd)/devkitpro/devkitPPC/bin:$PATH DEVKITPPC=$(pwd)/devkitpro/devkitPPC DEVKITPRO=$(pwd)/devkitpro make install -C libogc + + - name: Compile USB Loader GX + # version would be 0 unless subversion is removed + run: | + rm -r libogc + sudo apt-get -qq remove subversion > /dev/null + PATH=$(pwd)/devkitpro/devkitPPC/bin:$PATH DEVKITPPC=$(pwd)/devkitpro/devkitPPC DEVKITPRO=$(pwd)/devkitpro make + + - name: Package + id: pack + run: | + mkdir -p upload/apps/usbloader_gx + cp boot.dol upload/apps/usbloader_gx + cp HBC/icon.png upload/apps/usbloader_gx + cp HBC/meta.xml upload/apps/usbloader_gx + echo "::set-output name=sha::$(echo ${GITHUB_SHA} | head -c 7)" + + - name: Upload binary + uses: actions/upload-artifact@v2 + with: + name: usbloadergx_libogc_${{ steps.pack.outputs.sha }} + path: upload + + - name: Upload debug binary + uses: actions/upload-artifact@v2 + with: + name: usbloadergx_libogc_${{ steps.pack.outputs.sha }}_debug + path: boot.elf diff --git a/source/StartUpProcess.cpp b/source/StartUpProcess.cpp index 7124d011..bbd7be39 100644 --- a/source/StartUpProcess.cpp +++ b/source/StartUpProcess.cpp @@ -301,16 +301,17 @@ int StartUpProcess::Execute() // Re-Mount devices SetTextf("Reinitializing devices\n"); } + + // Start pads again + SetupPads(); gprintf("Current IOS: %i - have AHB access: %s\n", IOS_GetVersion(), AHBPROT_DISABLED ? "yes" : "no"); + DeviceHandler::Instance()->MountSD(); if(Settings.USBAutoMount == ON) { USBSpinUp(); DeviceHandler::Instance()->MountAllUSB(false); } - - // Start pads again - SetupPads(); } if(!IosLoader::IsHermesIOS() && !IosLoader::IsD2X())