From 2e7f5d8087c0aae184acb7a7a41c0ae4880b71f7 Mon Sep 17 00:00:00 2001 From: Daryl Borth Date: Thu, 20 Mar 2025 15:48:41 -0600 Subject: [PATCH] switch to libogc2 --- .github/workflows/build.yml | 9 +++++++++ Makefile.gc | 2 ++ Makefile.wii | 2 ++ source/fileop.cpp | 28 ++++++++++++++-------------- source/networkop.cpp | 2 +- source/snes9xgx.cpp | 2 +- 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 09e5ad4..5b7f015 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,15 @@ jobs: container: devkitpro/devkitppc:latest steps: + - name: Install packages + run: | + sudo dkp-pacman-key --recv-keys C8A2759C315CFBC3429CC2E422B803BA8AA3D7CE --keyserver keyserver.ubuntu.com + sudo dkp-pacman-key --lsign-key C8A2759C315CFBC3429CC2E422B803BA8AA3D7CE + sudo sed -i '/^\[dkp-libs\]$/,$d' /opt/devkitpro/pacman/etc/pacman.conf + sudo echo -e '[extremscorner-devkitpro]\nServer = https://packages.extremscorner.org/devkitpro/linux/$arch' >> /opt/devkitpro/pacman/etc/pacman.conf + sudo dkp-pacman -Sy + sudo dkp-pacman -S --noconfirm --ask 4 gamecube-tools-git libogc2 libogc2-libdvm + - name: Checkout snes9xgx repo uses: actions/checkout@v4 with: diff --git a/Makefile.gc b/Makefile.gc index ae1a795..586797c 100644 --- a/Makefile.gc +++ b/Makefile.gc @@ -8,6 +8,8 @@ $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=dev endif include $(DEVKITPPC)/gamecube_rules +export LIBOGC_INC := $(DEVKITPRO)/libogc2/include +export LIBOGC_LIB := $(DEVKITPRO)/libogc2/lib/cube #--------------------------------------------------------------------------------- # TARGET is the name of the output diff --git a/Makefile.wii b/Makefile.wii index 339793a..199d64c 100644 --- a/Makefile.wii +++ b/Makefile.wii @@ -8,6 +8,8 @@ $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=dev endif include $(DEVKITPPC)/wii_rules +export LIBOGC_INC := $(DEVKITPRO)/libogc2/include +export LIBOGC_LIB := $(DEVKITPRO)/libogc2/lib/wii #--------------------------------------------------------------------------------- # TARGET is the name of the output diff --git a/source/fileop.cpp b/source/fileop.cpp index 473189d..9771bc8 100644 --- a/source/fileop.cpp +++ b/source/fileop.cpp @@ -47,14 +47,14 @@ bool unmountRequired[8] = { false, false, false, false, false, false, false, fal bool isMounted[8] = { false, false, false, false, false, false, false, false }; #ifdef HW_RVL - const DISC_INTERFACE* sd = &__io_wiisd; - const DISC_INTERFACE* usb = &__io_usbstorage; - const DISC_INTERFACE* dvd = &__io_wiidvd; + static DISC_INTERFACE* sd = &__io_wiisd; + static DISC_INTERFACE* usb = &__io_usbstorage; + static DISC_INTERFACE* dvd = &__io_wiidvd; #else - const DISC_INTERFACE* carda = &__io_gcsda; - const DISC_INTERFACE* cardb = &__io_gcsdb; - const DISC_INTERFACE* port2 = &__io_gcsd2; - const DISC_INTERFACE* dvd = &__io_gcdvd; + static DISC_INTERFACE* carda = &__io_gcsda; + static DISC_INTERFACE* cardb = &__io_gcsdb; + static DISC_INTERFACE* port2 = &__io_gcsd2; + static DISC_INTERFACE* dvd = &__io_gcdvd; #endif // folder parsing thread @@ -128,7 +128,7 @@ devicecallback (void *arg) { if(isMounted[DEVICE_SD]) { - if(!sd->isInserted()) // check if the device was removed + if(!sd->isInserted(sd)) // check if the device was removed { unmountRequired[DEVICE_SD] = true; isMounted[DEVICE_SD] = false; @@ -137,7 +137,7 @@ devicecallback (void *arg) if(isMounted[DEVICE_USB]) { - if(!usb->isInserted()) // check if the device was removed + if(!usb->isInserted(usb)) // check if the device was removed { unmountRequired[DEVICE_USB] = true; isMounted[DEVICE_USB] = false; @@ -146,7 +146,7 @@ devicecallback (void *arg) if(isMounted[DEVICE_DVD]) { - if(!dvd->isInserted()) // check if the device was removed + if(!dvd->isInserted(dvd)) // check if the device was removed { unmountRequired[DEVICE_DVD] = true; isMounted[DEVICE_DVD] = false; @@ -223,7 +223,7 @@ static bool MountFAT(int device, int silent) bool mounted = false; int retry = 1; char name[10], name2[10]; - const DISC_INTERFACE* disc = NULL; + DISC_INTERFACE* disc = NULL; switch(device) { @@ -263,13 +263,13 @@ static bool MountFAT(int device, int silent) { unmountRequired[device] = false; fatUnmount(name2); - disc->shutdown(); + disc->shutdown(disc); isMounted[device] = false; } while(retry) { - if(disc->startup() && fatMountSimple(name, disc)) + if(disc->startup(disc) && fatMountSimple(name, disc)) mounted = true; if(mounted || silent) @@ -317,7 +317,7 @@ bool MountDVD(bool silent) { ShowAction("Loading DVD..."); - if(!dvd->isInserted()) + if(!dvd->isInserted(dvd)) { if(silent) break; diff --git a/source/networkop.cpp b/source/networkop.cpp index 1eefca8..ef95e53 100644 --- a/source/networkop.cpp +++ b/source/networkop.cpp @@ -172,7 +172,7 @@ bool InitializeNetwork(bool silent) break; } #else - networkInit = !(if_config(wiiIP, NULL, NULL, true, 10) < 0); + networkInit = !(if_config(wiiIP, NULL, NULL, true) < 0); #endif CancelAction(); diff --git a/source/snes9xgx.cpp b/source/snes9xgx.cpp index 2cc7170..d7d0e38 100644 --- a/source/snes9xgx.cpp +++ b/source/snes9xgx.cpp @@ -174,7 +174,7 @@ void ShutdownCB() { ShutdownRequested = 1; } -void ResetCB(u32 irq, void *ctx) +void ResetCB() { ResetRequested = 1; }