All Projects → open-ead → sead

open-ead / sead

Licence: other
Decompilation of sead: the standard C++ library for first-party Nintendo games

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to sead

joyconpi
An attempt at emulating a Nintendo Switch Joy-Con controller with a Raspberry Pi
Stars: ✭ 24 (-73.63%)
Mutual labels:  nintendo-switch
Universal-Manager
Multimedia tool for Nintendo DSi, Nintendo 3DS and Nintendo Switch.
Stars: ✭ 26 (-71.43%)
Mutual labels:  nintendo-switch
BetterJoyForDolphin
Allows the Nintendo Switch Pro Controller and Joycons to be used with the Dolphin Emulator
Stars: ✭ 44 (-51.65%)
Mutual labels:  nintendo-switch
switch-launcher
GUI-Based desktop switch payload launcher based on a modified reswitched injector
Stars: ✭ 19 (-79.12%)
Mutual labels:  nintendo-switch
SysBot.AnimalCrossing
Animal Crossing: New Horizons bot using SysBot.NET
Stars: ✭ 54 (-40.66%)
Mutual labels:  nintendo-switch
SlideNX
A work in progress module to change JoyCon attach/detach sound
Stars: ✭ 24 (-73.63%)
Mutual labels:  nintendo-switch
ebsrc
Source code recreation for the game Earthbound
Stars: ✭ 91 (+0%)
Mutual labels:  decompilation
MiiPort
A Nintendo Switch homebrew for importing and exporting Miis.
Stars: ✭ 22 (-75.82%)
Mutual labels:  nintendo-switch
switch-cmake
CMake toolchain for Nintendo Switch homebrew development
Stars: ✭ 38 (-58.24%)
Mutual labels:  nintendo-switch
Miyamoto
A supercharged fork of the modern day level editor.
Stars: ✭ 67 (-26.37%)
Mutual labels:  nintendo-switch
sarc
Nintendo SARC archive reader and writer
Stars: ✭ 16 (-82.42%)
Mutual labels:  nintendo-switch
NSW-Custom-Game-Icons
Nintendo Switch custom game icons, icon repo for NX-GiC
Stars: ✭ 33 (-63.74%)
Mutual labels:  nintendo-switch
fusee-nano
A minimalist re-implementation of the Fusée Gelée exploit (http://memecpy.com), designed to run on embedded Linux devices. (Zero dependencies)
Stars: ✭ 49 (-46.15%)
Mutual labels:  nintendo-switch
Switch-Screenshots
Script to organize Nintendo Switch screenshots by directory instead of date.
Stars: ✭ 50 (-45.05%)
Mutual labels:  nintendo-switch
pikmin
A decompilation of Pikmin brought to you by fans of the series.
Stars: ✭ 43 (-52.75%)
Mutual labels:  decompilation
libusbhsfs
USB Mass Storage Class Host + Filesystem Mounter static library for Nintendo Switch homebrew applications.
Stars: ✭ 81 (-10.99%)
Mutual labels:  nintendo-switch
botw-unexplored
Easily view the unexplored korok seeds and locations in your BotW savefile on your Switch
Stars: ✭ 79 (-13.19%)
Mutual labels:  nintendo-switch
sdl-hello-world
Draw "hello world" on the screen of the Nintendo Switch
Stars: ✭ 36 (-60.44%)
Mutual labels:  nintendo-switch
sys-clk-Overlay
Editor for your sys-clk configuration using ovl-loader!
Stars: ✭ 53 (-41.76%)
Mutual labels:  nintendo-switch
RingfitAdventure-BotW-Mod
Using a Ring Fit Adventure mod for The Legend of Zelda: Breath of the Wild. This allows the user to control the game with exercises.
Stars: ✭ 66 (-27.47%)
Mutual labels:  nintendo-switch

sead

This is a decompilation of sead, the standard C++ library for first-party Nintendo games.

Unlike the original sead decompilation project, which this repo derives from, this project targets more recent versions of sead.

The objective is to recreate the standard library as accurately as possible, so that interoperability can eventually be achieved by adding support for other platforms and by making it easier to create projects that interact with sead games.

Because sead is statically linked in games (and only in games), acquiring the original sead requires legally owning at least one recent first-party Nintendo game. Picking a game that ships with debugging symbols is strongly recommended:

  • Super Mario Odyssey (version 1.0.0) (buy it here)
  • Splatoon 2 (version <= 3.1.0) (buy it here)
  • Nintendo Labo (the pilot build has symbols, file names and assertions)
  • Any other title that has symbols and uses sead

File names, function names and the file organization come from debugging symbols, assertions and information in all of the aforementioned titles. Nobody except Nintendo has the source code of sead, not even third-party developers.

Note that many names (especially for inlined, templated functions) are just plain guesses.

Modules

For progress, refer to the GitHub project page. Several modules currently fail to build for Switch.

  • audio - Audio
  • basis - Types, asserts, allocation operators
  • codec - Base64, CRC16, CRC32
  • container - Templated container classes
  • controller - Controller
  • devenv - Development environment (debug utilities)
  • filedevice - File IO
  • framework - Framework (game framework, tasks, etc.)
  • geom - Geometry
  • gfx - Graphics
  • heap - Heap (arenas, disposers, different types of heaps)
  • hostio - Host IO (communication with PCs)
  • math - Maths utilities (vector, matrix, etc.)
  • message - libms wrapper
  • mc - Multi-core support
  • prim - Primitives (strings, enums, RTTI, etc.)
  • random - Random number generator
  • resource - Resource (loading, decompressing, etc.)
  • stream - Stream IO
  • thread - Thread utilities (threads, critical sections, message queues, etc.)
  • time - Time utilities

Platform specific source

Platform-specific files are usually placed into a subdirectory that is called:

  • cafe for Wii U
  • ctr for 3DS
  • nin for nnSdk (Switch)

Building

Building this project requires:

  • A C++17 capable compiler (or >= Clang 4.0). While older parts of sead are written in C++03, the newer modules in sead target C++11 (or newer) and recent C++ language or library features make writing C++ more convenient.
  • CMake 3.10+

Configuration

sead can be configured with several compile-time defines:

  • SEAD_DEBUG: enables assertions and HostIO code.

Platforms

  • cafe: Wii U
  • NNSDK: nnSdk (Switch and any platform that is supported by modern nnSdk)

Other platforms (generic Unix, iOS, Android, CTR) are not supported.

Matching hacks

This project sometimes uses small hacks to force particular code to be generated by the compiler. Those have no semantic effects but can help with matching assembly code especially when the hacks are used for functions that are inlined.

  • MATCHING_HACK_NX_CLANG: Hacks for Switch sead, when compiling with Clang.

Contributing

Non-inlined functions

When implementing non-inlined functions, please compare the assembly output against the original function and make it match the original code. At this scale, that is pretty much the only reliable way to ensure accuracy and functional equivalency.

However, given the large number of functions, certain kinds of small differences can be ignored when a function would otherwise be equivalent:

  • Regalloc differences.

  • Instruction reorderings when it is obvious the function is still semantically equivalent (e.g. two add/mov instructions that operate on entirely different registers being reordered)

When ignoring minor differences, add a // NOT_MATCHING: explanation comment and explain what does not match.

Header utilities or inlined functions

For header-only utilities (like container classes), use pilot/debug builds, assertion messages and common sense to try to undo function inlining. For example, if you see the same assertion appear in many functions and the file name is a header file, or if you see identical snippets of code in many different places, chances are that you are dealing with an inlined function. In that case, you should refactor the inlined code into its own function.

Also note that introducing inlined functions is sometimes necessary to get the desired codegen.

If a function is inlined, you should try as hard as possible to make it match perfectly. For inlined functions, it is better to use weird code or small hacks to force a match as differences would otherwise appear in every single function that inlines the non-matching code, which drastically complicates matching other functions. If a hack is used, wrap it inside a #ifdef MATCHING_HACK_{PLATFORM} (see above for a list of defines).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].