Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/wiiu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build Wii U WUHB

on:
push:
branches:
- master
paths:
- '.github/workflows/wiiu.yml'
- 'CMakeLists.txt'
- 'assets/wiiu/**'
- 'shadowflare/**'
- 'thirdparty/twl/**'
- 'thirdparty/tal/**'
- 'tools/wiiu/**'
pull_request:
paths:
- '.github/workflows/wiiu.yml'
- 'CMakeLists.txt'
- 'assets/wiiu/**'
- 'shadowflare/**'
- 'thirdparty/twl/**'
- 'thirdparty/tal/**'
- 'tools/wiiu/**'
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
container:
image: devkitpro/devkitppc:20260203

steps:
- name: Check out the repository
uses: actions/checkout@v6

- name: Install build tools
run: |
apt-get update
apt-get install -y ninja-build git

- name: Build the release WUHB
run: sh tools/wiiu/build-wuhb.sh

- name: Verify the WUHB
run: test -s build/wiiu/release/OpenShadowFlare.wuhb

- name: Upload the WUHB
uses: actions/upload-artifact@v4
with:
name: openshadowflare-wiiu-release
path: build/wiiu/release/OpenShadowFlare.wuhb
if-no-files-found: error
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ project(
LANGUAGES C CXX
)

if(NINTENDO_SWITCH)
if(NINTENDO_SWITCH OR WIIU)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
endif()

Expand Down Expand Up @@ -39,12 +39,14 @@ set_property(
CACHE OPENSHADOWFLARE_PRESENTATION_BACKEND
PROPERTY STRINGS lgl nxfb
)

add_subdirectory(thirdparty/lwl)
add_subdirectory(thirdparty/lal)
if(OPENSHADOWFLARE_BUILD_EXE OR BUILD_TESTING)
add_subdirectory(thirdparty/lwl)
add_subdirectory(thirdparty/lal)
endif()
add_subdirectory(thirdparty/twl)
add_subdirectory(thirdparty/tal)
if(OPENSHADOWFLARE_PRESENTATION_BACKEND STREQUAL "lgl" OR BUILD_TESTING)
if((OPENSHADOWFLARE_BUILD_EXE AND
OPENSHADOWFLARE_PRESENTATION_BACKEND STREQUAL "lgl") OR BUILD_TESTING)
add_subdirectory(thirdparty/lgl)
endif()

Expand Down
Binary file added assets/wiiu/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions documentation/wiiu-port.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Wii U port

The Wii U build compiles the small C99 ShadowFlare runtime and packages it as an
Aroma-compatible Homebrew Bundle (`.wuhb`). It does not include retail game data.

## Install the toolchain

Install devkitPro's Wii U toolchain and Ninja:

```bash
sudo dkp-pacman -S --needed wiiu-dev ninja
```

Set `DEVKITPRO` if devkitPro is not installed at `/opt/devkitpro`.

## Build

From the repository root:

```bash
sh tools/wiiu/build-wuhb.sh
```

The bundle is written to:

```text
build/wiiu/release/OpenShadowFlare.wuhb
```

## Move the game files

The retail data is loaded from the SD card and is never bundled. Copy your
ShadowFlare `System` folder and `SFlare.Cfg` to:

```text
sdcard/wiiu/OpenShadowFlare/ShadowFlare/
SFlare.Cfg
System/
...
```
24 changes: 24 additions & 0 deletions shadowflare/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,27 @@ if(OPENSHADOWFLARE_ENABLE_DEBUG_TOOLS)
Twl::Twl
)
endif()
if(WIIU)
target_compile_definitions(
shadowflare_core PRIVATE
SF_RETAIL_ROOT_FALLBACK="/vol/external01/wiiu/OpenShadowFlare/ShadowFlare")

if(NOT COMMAND wut_create_rpx)
message(FATAL_ERROR
"wut_create_rpx is unavailable. Configure the Wii U build with "
"$ENV{DEVKITPRO}/portlibs/wiiu/bin/powerpc-eabi-cmake.")
endif()
wut_create_rpx(osf)
if(COMMAND wut_create_wuhb)
wut_create_wuhb(
osf
NAME "OpenShadowFlare"
AUTHOR "OpenShadowFlare contributors"
ICON "${PROJECT_SOURCE_DIR}/assets/wiiu/icon.png"
CONTENT "${PROJECT_SOURCE_DIR}/thirdparty/twl/backends/wiiu/content"
)
else()
message(WARNING
"wut_create_wuhb is unavailable: only osf.rpx will be produced.")
endif()
endif()
5 changes: 5 additions & 0 deletions shadowflare/assets/retail_paths.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ bool sf_retail_root_find(
root[0] = '\0';
if (requested_root)
return sf_retail_try_root(root, capacity, requested_root);
#ifdef SF_RETAIL_ROOT_FALLBACK
/* A build may pin a data root when the platform has no meaningful executable
* path or working directory (e.g. a console loading from a fixed SD path). */
if (sf_retail_try_root(root, capacity, SF_RETAIL_ROOT_FALLBACK)) return true;
#endif
if (sf_retail_executable_directory(
executable_directory, sizeof(executable_directory), executable_path)) {
if (sf_retail_try_root(root, capacity, executable_directory)) return true;
Expand Down
2 changes: 2 additions & 0 deletions thirdparty/tal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
target_sources(tal PRIVATE tal_alsa.c)
find_package(ALSA REQUIRED)
target_link_libraries(tal PRIVATE ALSA::ALSA)
elseif(WIIU)
target_sources(tal PRIVATE tal_wiiu.c)
else()
target_sources(tal PRIVATE tal_null.c)
endif()
Loading
Loading