# [libogc2](https://libogc2.org/) [![libogc2 build](https://github.com/extremscorner/libogc2/actions/workflows/continuous-integration-workflow.yml/badge.svg)](https://github.com/extremscorner/libogc2/actions/workflows/continuous-integration-workflow.yml) [![Extrems' Corner.org Discord](https://discordapp.com/api/guilds/243509579961466881/widget.png)](https://discord.extremscorner.org/) **libogc2** contains wide-ranging fixes and additions to most subsystems of libogc, provides hardware enablement for most new (and old) Nintendo GameCube accessories on the market or in prototype stage, and enables greater interoperability with [Swiss](https://libogc2.org/wiki/Interactions-with-Swiss). It is largely API compatible with libogc 2.1.0 and earlier. ## Projects using libogc2 - [240p Test Suite](https://github.com/ArtemioUrbina/240pTestSuite) - Video suite for game consoles - [ClassiCube](https://github.com/ClassiCube/ClassiCube) - Minecraft Classic client - [CleanRip](https://github.com/emukidid/cleanrip) - Nintendo GameCube/Wii disc image creation tool - [FCE Ultra GX](https://github.com/dborth/fceugx) - Nintendo Entertainment System emulator - [FlippyDrive](https://www.crowdsupply.com/team-offbroadway/flippydrive) - Nintendo GameCube optical drive emulator - [GC HTTP Server](https://github.com/emukidid/gchttpserver) - [GCC Test Suite](https://github.com/greenwave-1/GTS) - Nintendo GameCube controller tester - [GCMM](https://github.com/suloku/gcmm) - Nintendo GameCube memory card manager - [gekkoboot](https://github.com/redolution/gekkoboot) - Nintendo GameCube bootloader - [Genesis Plus GX](https://github.com/ekeeke/Genesis-Plus-GX) - Sega 8/16-bit emulator - [Meese Engine](https://meese4.github.io/) - Open-world voxel game - [Octave](https://github.com/mholtkamp/octave) - Cross-platform 3D game engine - [Vacpyre](https://github.com/mholtkamp/vacpyre) - Puzzle shooter game - [raylib4Consoles](https://github.com/raylib4Consoles/raylib4Gamecube) - Cross-platform game programming library - [Scratch Everywhere!](https://github.com/ScratchEverywhere/ScratchEverywhere) - Scratch 3.0 runtime - [Seta GX](https://github.com/fadedled/seta-gx) - Sega Saturn emulator - [Snes9x GX](https://github.com/dborth/snes9xgx) - Super Nintendo Entertainment System emulator - [SuDokuL](https://github.com/Mode8fx/SuDokuL) - Sudoku puzzle game - [Swiss](https://github.com/emukidid/swiss-gc) - Swiss army knife of GameCube homebrew - [Trogdor: Reburninated](https://github.com/Mode8fx/Trogdor-Reburninated) - Arcade action game - [Visual Boy Advance GX](https://github.com/dborth/vbagx) - Game Boy Advance emulator - [WakeMii](https://github.com/emukidid/wakemii) - Alarm clock music player - [Wii64/Cube64](https://github.com/emukidid/Wii64) - Nintendo 64 emulator - [WiiSX/CubeSX](https://github.com/emukidid/pcsxgc) - PlayStation 1 emulator - [Xeno Crisis](https://shop.bitmapbureau.com/collections/gamecube/products/xeno-crisis-gamecube) - Retro-style arena shooter game ### Unofficial ports - [ftpii](https://github.com/leo60228/ftpii) by **@leo60228** - FTP server - [MPlayer CE](https://github.com/SuperrSonic/mplayer-ce-libogc2) by **@SuperrSonic** - Media player - [NeoCD RX](https://github.com/TriVoxel/NeoCDRX) by **@TriVoxel** - Neo Geo CD emulator - [Neverball](https://github.com/extremscorner/neverball) by **@mardy** - Rolling ball game - [Nicky Boom](https://github.com/emukidid/Nicky-Boum) by **@emukidid** - Side-scrolling platform game - [Raptor: Call of the Shadows](https://github.com/RetroGamer02/raptor-consoles/tree/bswap-sys) by **@RetroGamer02** - Vertically scrolling shooter game - [RetroArch](https://github.com/SuperrSonic/RA-GCN) by **@SuperrSonic** - Multi-system emulator - [WiiMC](https://github.com/SuperrSonic/WiiMC-GCN) by **@SuperrSonic** - Media player ### Subprojects - [BtEmbedded](https://github.com/extremscorner/bt-embedded) - `libogc2-bt-embedded`, `libogc2-bt-embedded-obex` - [cubeboot-tools](https://github.com/extremscorner/cubeboot-tools) - [Embedded Game Controller](https://github.com/extremscorner/embedded-game-controller) - `libogc2-embedded-game-controller` - [gamecube-examples](https://github.com/extremscorner/gamecube-examples) - `libogc2-examples` - [gamecube-tools](https://github.com/extremscorner/gamecube-tools) - `gamecube-tools-git` - [GRRLIB](https://github.com/extremscorner/GRRLIB) - `libogc2-grrlib`, `libogc2-grrlib-docs`, `libogc2-grrlib-examples` - [libansnd](https://github.com/extremscorner/libansnd) - `libogc2-libansnd`, `libogc2-libansnd-examples` - [libdvm](https://github.com/extremscorner/libdvm) - `libogc2-libdvm` - [libfat](https://github.com/extremscorner/libfat) - `libogc2-libfat` - [libntfs](https://github.com/extremscorner/libntfs) - `libogc2-libntfs` - [libwiisocket](https://github.com/extremscorner/libwiisocket) - `libogc2-libwiisocket` - [OpenGX](https://github.com/extremscorner/opengx) - `libogc2-opengx` - [SDL](https://github.com/extremscorner/SDL) - `libogc2-sdl`, `libogc2-sdl2` - [wii-examples](https://github.com/extremscorner/wii-examples) - `libogc2-examples` ## Installing Follow the instructions from [pacman-packages](https://github.com/extremscorner/pacman-packages#readme). ``` sudo (dkp-)pacman -S libogc2 libogc2-docs libogc2-examples ``` When asked for a `libogc2-libfat` provider, `libogc2-libdvm` is generally preferred, but `libogc2-libfat` may be chosen if you have concerns regarding exFAT's legal status. If you have a need for `libogc2-libdvm` without exFAT support, please open an issue. No code changes should be necessary when migrating from libfat to libdvm, or for supporting exFAT. Docker users may opt to pull from `ghcr.io/extremscorner/libogc2:latest` instead. New images are pushed on a near-daily basis. ## Migrating from libogc libogc portlibs are not ABI compatible with libogc2. Consult the package list for substitutes. ``` (dkp-)pacman -Sl libogc2-devkitpro ``` ### GNU Make ```diff -include $(DEVKITPPC)/gamecube_rules +include $(DEVKITPRO)/libogc2/gamecube_rules ``` ```diff -include $(DEVKITPPC)/wii_rules +include $(DEVKITPRO)/libogc2/wii_rules ``` ### CMake ``` sudo (dkp-)pacman -S libogc2-cmake ``` `DKP_OGC_PLATFORM_LIBRARY` may be set to `libogc` or `libogc2` to build projects using either thereafter. ### GitHub Actions ```diff - container: devkitpro/devkitppc:latest + container: ghcr.io/extremscorner/libogc2:latest ``` See [installed packages in container](https://libogc2.org/wiki/Installed-packages-in-container). ## Porting to libogc2 While a porting guide is not yet available, you can familiarize yourself with the [GameCube](https://github.com/extremscorner/gamecube-examples/compare/v20210525...master) and [Wii](https://github.com/extremscorner/wii-examples/compare/v20210525...master) examples for basic differences with libogc. ## Building ### Pacman ``` git clone https://github.com/extremscorner/libogc2.git cd libogc2 makepkg -si ``` ``` git clone --recurse-submodules https://github.com/extremscorner/libdvm.git cd libdvm makepkg -si ``` ### GNU Make 1. Existing packages should first be uninstalled if already installed. ``` sudo (dkp-)pacman -R --cascade libogc2(-git) ``` 2. Install build dependencies. ``` sudo (dkp-)pacman -S --needed devkitPPC gamecube-tools ppc-libmad ``` 3. Clone and build source repositories. ``` git clone https://github.com/extremscorner/libogc2.git cd libogc2 make sudo -E make install ``` ``` git clone https://github.com/extremscorner/libfat.git cd libfat make ogc-release sudo -E make ogc-install ``` Using `sudo` is not necessary with MSYS2. ## Upgrading ### Pacman ``` cd libogc2 git pull makepkg -si ``` ``` cd libdvm git pull --recurse-submodules makepkg -si ``` ### GNU Make 1. Supporting packages should first be upgraded. ``` sudo (dkp-)pacman -Syu ``` 2. Clean, pull and rebuild source repositories. ``` cd libogc2 sudo -E make uninstall sudo -E make clean git pull make sudo -E make install ``` ``` cd libfat make ogc-clean git pull make ogc-release sudo -E make ogc-install ```