mirror of
https://github.com/NinjaCheetah/libWiiPy.git
synced 2025-04-25 04:41:01 -04:00
Added new plugins, began writing tutorials
This commit is contained in:
parent
df1ed559ef
commit
04fa9034a0
@ -3,23 +3,23 @@
|
||||
# For the full list of built-in configuration values, see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
from datetime import date
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
||||
|
||||
project = 'libWiiPy'
|
||||
copyright = '2024, NinjaCheetah & Contributors'
|
||||
copyright = f'{date.today().year}, NinjaCheetah & Contributors'
|
||||
author = 'NinjaCheetah & Contributors'
|
||||
release = '0.4.0'
|
||||
release = 'main'
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
||||
|
||||
extensions = ['myst_parser', 'sphinx.ext.napoleon']
|
||||
extensions = ['myst_parser', 'sphinx.ext.napoleon', 'sphinx_copybutton', 'sphinx_tippy', 'sphinx_design']
|
||||
|
||||
templates_path = ['_templates']
|
||||
exclude_patterns = []
|
||||
|
||||
|
||||
exclude_patterns = ["Thumbs.db", ".DS_Store"]
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
||||
@ -32,3 +32,7 @@ html_theme_options = {
|
||||
"repository_url": "https://github.com/NinjaCheetah/libWiiPy",
|
||||
"use_repository_button": True
|
||||
}
|
||||
|
||||
# MyST Configuration
|
||||
|
||||
myst_enable_extensions = ['colon_fence', 'deflist']
|
||||
|
@ -1,12 +1,40 @@
|
||||
# libWiiPy API Docs
|
||||
---
|
||||
sd_hide_title: true
|
||||
---
|
||||
|
||||
```{toctree}
|
||||
:maxdepth: 2
|
||||
:caption: Contents:
|
||||
```
|
||||
# Overview
|
||||
|
||||
# libWiiPy API Docs
|
||||
|
||||
Welcome to the API documentation website for libWiiPy! libWiiPy is a modern Python 3 library for handling the various files and formats found on the Wii.
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
|
||||
self
|
||||
```
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
:caption: The Basics
|
||||
|
||||
usage/installation.md
|
||||
usage/getting-started.md
|
||||
```
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
:caption: Working with Titles
|
||||
|
||||
titles/title-anatomy.md
|
||||
```
|
||||
|
||||
```{toctree}
|
||||
:hidden:
|
||||
:caption: Other Useful Pages
|
||||
|
||||
modules.md
|
||||
```
|
||||
|
||||
## Indices and tables
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
# libWiiPy
|
||||
# Modules Overview
|
||||
|
||||
```{toctree}
|
||||
:maxdepth: 4
|
||||
|
30
docs/source/titles/title-anatomy.md
Normal file
30
docs/source/titles/title-anatomy.md
Normal file
@ -0,0 +1,30 @@
|
||||
# Anatomy of a Title
|
||||
|
||||
Before we start working with titles, it's important to understand what components make up a title on the Wii, and how each of those components are handled in libWiiPy. If you're here, you likely already understand what a title is in the context of the Wii, but if not, [WiiBrew](https://wiibrew.org/wiki/Main_Page) is a great reference to learn more about the Wii's software.
|
||||
|
||||
:::{note}
|
||||
"Title" can be used to refer to both digital titles preinstalled on the Wii and distributed via the Wii Shop Channel and system updates, as well as games released on discs. libWiiPy does not currently offer methods to interact with most data found on a game disc, so for all intents and purposes, "title" in this documentation is referring to digital titles only unless otherwise specified.
|
||||
:::
|
||||
|
||||
There are three major components of a title: the **TMD**, the **Ticket**, and the **contents**. A brief summary of each is provided below.
|
||||
|
||||
## TMD
|
||||
<project:#libWiiPy.title.tmd>
|
||||
|
||||
A **TMD** (**T**itle **M**eta**d**ata) contains basic information about a title, such as its Title ID, version, what IOS and version it's designed to run under, whether it's for the vWii or not, and more related information. The TMD also stores a list of content records that specify the index and ID of each content, as well as the SHA-1 hash of the decrypted content, to ensure that decryption was successful.
|
||||
|
||||
In libWiiPy, a TMD is represented by a `TMD()` object, which is part of the `tmd` module in the `title` subpackge, and is imported automatically. A content record is represented by its own `ContentRecord()` object, which is a private class designed to only be used by other modules.
|
||||
|
||||
## Ticket
|
||||
<project:#libWiiPy.title.ticket>
|
||||
|
||||
A **Ticket** primarily contains the encrypted Title Key for a title, as well as the information required to decrypt that key. They come in two forms: common tickets, which are freely available from the Nintendo Update Servers, and personalized tickets, which are issued to your console specifically by the Wii Shop Channel (or at least they were before it closed, excluding the free titles still available).
|
||||
|
||||
In libWiiPy, a Ticket is represented by a `Ticket()` object, which is part of the `ticket` module in the `title` subpackage, and is imported automatically.
|
||||
|
||||
## Content
|
||||
<project:#libWiiPy.title.content>
|
||||
|
||||
**Contents** are the files in a title that contain the actual data, whether that be the main executable or resources required by it. They're usually stored encrypted in a WAD file or on the Nintendo Update Servers, until they are decrypted during installation to a console. The Title Key stored in the Ticket is required to decrypt the contents of a title. Each content has a matching record with its index and Content ID, as well as the SHA-1 hash of its decrypted data. These records are stored in the TMD.
|
||||
|
||||
In libWiiPy, contents are represented by a `ContentRegion()` object, which is part of the `content` module in the `title` subpackge, and is imported automatically. A content record is represented by its own `ContentRecord()` object, which is a private class designed to only be used by other modules.
|
42
docs/source/usage/getting-started.md
Normal file
42
docs/source/usage/getting-started.md
Normal file
@ -0,0 +1,42 @@
|
||||
# Getting Started
|
||||
Once you have libWiiPy installed, it's time to write your first code!
|
||||
|
||||
As an example, let's say you have a TMD file with a generic name, `title.tmd`, and because of this you need to find out some information about it, so you know what title it belongs to.
|
||||
|
||||
First off, let's import `libWiiPy`, and load up our file:
|
||||
```pycon
|
||||
>>> import libWiiPy
|
||||
>>> tmd_file = open("title.tmd", "rb").read()
|
||||
>>>
|
||||
```
|
||||
|
||||
Then we'll create a new TMD object, and load our file into it:
|
||||
```pycon
|
||||
>>> tmd = libWiiPy.title.TMD()
|
||||
>>> tmd.load(tmd_file)
|
||||
>>>
|
||||
```
|
||||
|
||||
And ta-da! We now have a new TMD object that can be used to find out whatever we need to know about this TMD.
|
||||
|
||||
So, to find out what title this TMD is for, let's try looking at the TMD's `title_id` property, like this:
|
||||
```pycon
|
||||
>>> print(tmd.title_id)
|
||||
0000000100000002
|
||||
|
||||
>>>
|
||||
```
|
||||
|
||||
Aha! `0000000100000002`! That means this TMD belongs to the Wii Menu. But what version? Well, we can use the TMD's `title_version` property to check, like so:
|
||||
```pycon
|
||||
>>> print(tmd.title_version)
|
||||
513
|
||||
|
||||
>>>
|
||||
```
|
||||
|
||||
513! So now we know that this TMD is from the Wii Menu, and is version 513, which is the version number used for v4.3U.
|
||||
|
||||
So now you know how to identify what title and version a TMD file is from! But, realistically, trying to identify a lone unlabeled TMD file is not something you'll ever really need to do, either in your day-to-day life or in whatever program you're developing. In the next chapter, we'll dive in to working with more components of a title, which is a lot more useful for programs that need to manipulate them.
|
||||
|
||||
The full documentation on the TMD class can be found here: <project:#libWiiPy.title.tmd>
|
20
docs/source/usage/installation.md
Normal file
20
docs/source/usage/installation.md
Normal file
@ -0,0 +1,20 @@
|
||||
# Installation
|
||||
The first thing you'll want to do to get set up is to install the `libWiiPy` package. This can be done one of two ways.
|
||||
|
||||
**For a more stable experience,** you can install the latest release from PyPI just like any other Python package:
|
||||
```shell
|
||||
pip install libWiiPy
|
||||
```
|
||||
|
||||
**If you prefer to live on the edge** (or just want to use features currently in development), you can also build the latest version from git:
|
||||
```shell
|
||||
pip install git+https://github.com/NinjaCheetah/libWiiPy
|
||||
```
|
||||
|
||||
If you'd like to check the latest release, our PyPI page can be found [here](https://pypi.org/project/libWiiPy/). Release notes and build files for each release can be found over on our [GitHub releases page](https://github.com/NinjaCheetah/libWiiPy/releases/latest).
|
||||
|
||||
:::{caution}
|
||||
libWiiPy is under heavy active development! While we try our hardest to not make breaking changes, things move quickly and that sometimes can cause problems.
|
||||
:::
|
||||
|
||||
For those who are truly brave and want to experiment with the latest features, you can try building from an alternative branch. However, if you're going to do this, please be aware that features on branches other than `main` are likely very incomplete, and potentially completely broken. New features are only merged into `main` once they've been proven to at least work for their intended purpose. This does not guarantee a bug-free experience, but you are significantly less likely to run into show-stopping bugs.
|
@ -4,3 +4,6 @@ requests
|
||||
sphinx
|
||||
sphinx-book-theme
|
||||
myst-parser
|
||||
sphinx-copybutton
|
||||
sphinx-tippy
|
||||
sphinx-design
|
||||
|
Loading…
x
Reference in New Issue
Block a user