From 7de3608150eb0a7e6853dc3814a569a85e4fa026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Tue, 14 Apr 2020 16:20:27 +0200 Subject: [PATCH] Update documentation and add gsheet docs --- docs/source/gsheet.rst | 38 ++++++++++++++++++++++++++++++++++++++ docs/source/gsheet_py.rst | 27 +++++++++++++++++++++++++++ docs/source/index.rst | 2 ++ docs/source/types_py.rst | 14 +++++++++++--- readme.rst | 10 +++++++--- 5 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 docs/source/gsheet.rst create mode 100644 docs/source/gsheet_py.rst diff --git a/docs/source/gsheet.rst b/docs/source/gsheet.rst new file mode 100644 index 0000000..25cd422 --- /dev/null +++ b/docs/source/gsheet.rst @@ -0,0 +1,38 @@ +###### +gsheet +###### + +``#include `` + +For more information about Grezzo datasheets, `refer to the wiki article `_. + +Read-only API and binary format structs +======================================= + +This API is used to read binary datasheets efficiently. + +In line with Nintendo's naming conventions, structs that are directly used in the binary format have a `Res` prefix in their name. + +.. doxygenstruct:: oead::gsheet::ResHeader +.. doxygenstruct:: oead::gsheet::ResField +.. doxygenclass:: oead::gsheet::Sheet +.. doxygentypedef:: oead::gsheet::FieldMap +.. doxygenfunction:: oead::gsheet::MakeFieldMap + +Utilities for defining datasheet structures +------------------------------------------- + +These are useful to define structures which datasheet values can be casted to. + +.. doxygenstruct:: oead::gsheet::Nullable +.. doxygenstruct:: oead::gsheet::Array +.. doxygenstruct:: oead::gsheet::String + +Read-write API +============== + +This API is used to read, modify and write binary datasheets. Datasheets can also be constructed from scratch. + +.. doxygenstruct:: oead::gsheet::Field +.. doxygenstruct:: oead::gsheet::Data +.. doxygenstruct:: oead::gsheet::SheetRw diff --git a/docs/source/gsheet_py.rst b/docs/source/gsheet_py.rst new file mode 100644 index 0000000..6fb75bd --- /dev/null +++ b/docs/source/gsheet_py.rst @@ -0,0 +1,27 @@ +############### +gsheet (Python) +############### + +For more information about Grezzo datasheets, `refer to the wiki article `_. + +.. autoclass:: oead.gsheet.Struct + +Lists +===== + +These classes work like Python lists, but they can only store elements of a single type, i.e. all elements must be booleans, or all strings, etc. + +.. class:: oead.gsheet.StructArray +.. autoclass:: oead.gsheet.BoolArray +.. autoclass:: oead.gsheet.IntArray +.. autoclass:: oead.gsheet.FloatArray +.. autoclass:: oead.gsheet.StringArray + +Read-write API +============== + +This API is used to read, modify and write binary datasheets. Datasheets can also be constructed from scratch. + +.. autoclass:: oead.gsheet.Field +.. autoclass:: oead.gsheet.Sheet +.. autofunction:: oead.gsheet.parse diff --git a/docs/source/index.rst b/docs/source/index.rst index 2a1a4ca..79ee954 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -16,6 +16,8 @@ oead aamp_py byml byml_py + gsheet + gsheet_py sarc sarc_py yaz0 diff --git a/docs/source/types_py.rst b/docs/source/types_py.rst index ab6a4cc..6ea5144 100644 --- a/docs/source/types_py.rst +++ b/docs/source/types_py.rst @@ -11,17 +11,25 @@ All of the following types support the buffer protocol. This class is the equivalent to ``std::vector``. Python ``bytes`` will be implicitly converted to oead.Bytes, so explicitly doing something like ``oead.Bytes(b"my bytes")`` is unnecessary. +.. autoclass:: oead.BufferBool + + This is a list that can only store booleans. This class is the equivalent to ``std::vector``. + .. autoclass:: oead.BufferInt - This class is the equivalent to ``std::vector``. + This is a list that can only store signed 32-bit integers. This class is the equivalent to ``std::vector``. .. autoclass:: oead.BufferF32 - This class is the equivalent to ``std::vector``. + This is a list that can only store binary32 floating point numbers. This class is the equivalent to ``std::vector``. + +.. autoclass:: oead.BufferString + + This is a list that can only store strings. This class is the equivalent to ``std::vector``. .. autoclass:: oead.BufferU32 - This class is the equivalent to ``std::vector``. + This is a list that can only store unsigned 32-bit integers. This class is the equivalent to ``std::vector``. Numbers ======= diff --git a/readme.rst b/readme.rst index 8ef3fd8..42d7f8c 100644 --- a/readme.rst +++ b/readme.rst @@ -9,13 +9,17 @@ Python bindings for 3.6+ are also available. Features ======== -Currently, oead only handles two very common formats that are extensively used in recent games such as *Breath of the Wild* and *Super Mario Odyssey*. +Currently, oead only handles very common formats that are extensively used in recent games such as *Breath of the Wild* and *Super Mario Odyssey*. -* `BYML `_ (binary YAML): Versions 2, 3, and 4 are supported. * `AAMP `_ (binary parameter archive): Only version 2 is supported. +* `BYML `_ (binary YAML): Versions 2, 3, and 4 are supported. * `SARC `_ (archive) * `Yaz0 `_ (compression algorithm) +oead also supports a recent Grezzo format that is used in *Link's Awakening (Switch)*: + +* `gsheet `_ (Grezzo datasheet) + Getting started =============== @@ -33,7 +37,7 @@ Building from source Building oead from source requires: -* CMake 3.10+ +* CMake 3.12+ * A compiler that supports C++17 * Everything needed to build libyaml