Skip to content

Commit

Permalink
Update documentation and add gsheet docs
Browse files Browse the repository at this point in the history
  • Loading branch information
leoetlino committed Apr 14, 2020
1 parent 3f30f81 commit 7de3608
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 6 deletions.
38 changes: 38 additions & 0 deletions docs/source/gsheet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
######
gsheet
######

``#include <oead/gsheet.h>``

For more information about Grezzo datasheets, `refer to the wiki article <https://zeldamods.org/las/Datasheet>`_.

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
27 changes: 27 additions & 0 deletions docs/source/gsheet_py.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
###############
gsheet (Python)
###############

For more information about Grezzo datasheets, `refer to the wiki article <https://zeldamods.org/las/Datasheet>`_.

.. 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
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ oead
aamp_py
byml
byml_py
gsheet
gsheet_py
sarc
sarc_py
yaz0
Expand Down
14 changes: 11 additions & 3 deletions docs/source/types_py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,25 @@ All of the following types support the buffer protocol.

This class is the equivalent to ``std::vector<u8>``. 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<bool>``.

.. autoclass:: oead.BufferInt

This class is the equivalent to ``std::vector<int>``.
This is a list that can only store signed 32-bit integers. This class is the equivalent to ``std::vector<int>``.

.. autoclass:: oead.BufferF32

This class is the equivalent to ``std::vector<f32>``.
This is a list that can only store binary32 floating point numbers. This class is the equivalent to ``std::vector<f32>``.

.. autoclass:: oead.BufferString

This is a list that can only store strings. This class is the equivalent to ``std::vector<std::string>``.

.. autoclass:: oead.BufferU32

This class is the equivalent to ``std::vector<u32>``.
This is a list that can only store unsigned 32-bit integers. This class is the equivalent to ``std::vector<u32>``.

Numbers
=======
Expand Down
10 changes: 7 additions & 3 deletions readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://zeldamods.org/wiki/BYML>`_ (binary YAML): Versions 2, 3, and 4 are supported.
* `AAMP <https://zeldamods.org/wiki/AAMP>`_ (binary parameter archive): Only version 2 is supported.
* `BYML <https://zeldamods.org/wiki/BYML>`_ (binary YAML): Versions 2, 3, and 4 are supported.
* `SARC <https://zeldamods.org/wiki/SARC>`_ (archive)
* `Yaz0 <https://zeldamods.org/wiki/Yaz0>`_ (compression algorithm)

oead also supports a recent Grezzo format that is used in *Link's Awakening (Switch)*:

* `gsheet <https://zeldamods.org/las/Datasheet>`_ (Grezzo datasheet)

Getting started
===============

Expand All @@ -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

Expand Down

0 comments on commit 7de3608

Please sign in to comment.