Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

WiiXLaunch-BotW

A high-level, cross-platform (Switch / Wii U / Cemu) API for The Legend of Zelda: Breath of the Wild, built on top of WiiXLaunch. This is the game-specific knowledge (vtable slots, memory offsets, actor spawn plumbing) promoted out of individual mods into reusable classes, so a new mod writes:

#include <wiixlaunch.hpp>
#include <wiixlaunch/botw/botw.hpp>

using namespace WiiXLaunch::BotW;

WiiXLaunch::BotW::Actor sword = Player::GetEquippedSword();
if (Controller::IsPressed(Button::X)) { ... }

instead of hand-decoding vtable slot arithmetic or raw struct offsets per project.

This repo is deliberately not part of base WiiXLaunch (the template repo stays a generic, game-agnostic hooking framework) - it's an optional module for mods that target BotW specifically, added as a git submodule by the projects that want it.

What's here

Header Provides
botw/player.hpp Player - equipped sword/shield/bow, position, per-swing attack detection, a per-frame OnTick callback
botw/actor.hpp Actor - a thin wrapper around a raw actor pointer (GetName()), plus Actor::Spawn(name, anchor, x, y, z)
botw/controller.hpp Controller - unified button/stick reads across Switch NPad and Wii U VPAD/KPAD (WPAD Pro + Core)
botw/camera.hpp Camera - typed get/set accessors for a live camera object's position/look-at/up
botw/botw.hpp Umbrella include for all of the above

Every offset and vtable slot here was reverse-engineered against the game binaries (see the original mods' handwritten-symbols-botw.csv for provenance/confidence notes on each one) - not guessed or ported from public symbol databases.

Platform coverage

Every WiiXLaunch build targets exactly one platform at compile time (WIIXL_SWITCH / WIIXL_WIIU / WIIXL_CEMU), so capability gaps are plain constexpr bool flags resolved for whichever platform you're building, not a runtime check:

Feature Switch Wii U / Cemu
Equipped sword/shield/bow
Actor name (Actor::GetName)
Controller input
Camera pos/at/up
Player position (Player::SupportsPosition)
Attack-swing tracking (Player::SupportsAttackTracking)
Actor spawning (Actor::SupportsSpawn)

Switch-unsupported calls are safe no-ops (return false/an invalid Actor) rather than reading an offset that was never confirmed - check the Supports* flag if your mod needs to branch on it. Filling in the missing Switch RE work is welcome; see the confidence notes in the source mods' handwritten-symbols-botw.csv.

Using this in a mod

Add it as a submodule of your WiiXLaunch project:

git submodule add https://github.com/TKVSC-Team/WiiXLaunch-BotW vendor/wiixlaunch-botw
git submodule update --init --recursive

Then add its include/ to your build's include path, alongside your project's own -I include:

  • build_switch.bat/.sh, build_wiiu.bat/.sh, build_cemu.bat/.sh: add -I vendor\wiixlaunch-botw\include (or the Linux-path equivalent) next to the existing -I include.
  • CMakeLists.txt (Switch): add vendor/wiixlaunch-botw/include to target_include_directories.

No changes to your main.cpp's #include lines are needed either way - #include <wiixlaunch/botw/botw.hpp> resolves the same regardless of whether these headers are locally copied or pulled in as a submodule.

Design conventions

  • Header-only, matching WiiXLaunch's own include/wiixlaunch/*.hpp - no separate .cpp to build or link.
  • Self-installing hooks. Classes that need a hook expose a static Init() (call once from your WiiXLaunch_Init()); after that, only call typed getters - no raw offsets or WIIXL_HOOK_DEFINE_TRAMPOLINE in your own mod code.
  • Escape hatches, not a cage. Player::GetRaw() / Actor::GetRaw() reach the raw pointer for anything not yet wrapped here.
  • Depends only on WiiXLaunch's core (platform.hpp, hook.hpp, call.hpp) via #include <wiixlaunch/...> - resolved through your project's own include path, not assumed to be physically nested next to these files. No dependency on WIIXL_LOG/debug_log.hpp, since its signature isn't standardized across every WiiXLaunch project.

License

GPLv3, matching WiiXLaunch - see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages