From 127925edde268d29f20b811400b2cebd49eac6ec Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Mon, 2 May 2022 00:00:12 +0200 Subject: [PATCH 1/2] Test doxygen m.css theme --- .gitignore | 2 ++ Doxyfile | 8 ++--- docs/doxygen/doxygen-extra.css | 5 --- doxygen_config.py | 63 ++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+), 9 deletions(-) delete mode 100644 docs/doxygen/doxygen-extra.css create mode 100644 doxygen_config.py diff --git a/.gitignore b/.gitignore index 69ee3035..eaed0e2a 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ translations/*.bin # doxygen docs/doxygen/html/ +docs/doxygen/xml/ # tools tools/agbcc @@ -86,3 +87,4 @@ _Deparsed_XSubs.pm __pycache__ Info.plist ctx.c +!doxygen_config.py diff --git a/Doxyfile b/Doxyfile index ea24a7eb..42a3a3c0 100644 --- a/Doxyfile +++ b/Doxyfile @@ -44,7 +44,7 @@ PROJECT_NUMBER = # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = "Decompilation of The Legend of Zelda: The Minish Cap" +PROJECT_BRIEF = "Docs" # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 @@ -1141,7 +1141,7 @@ IGNORE_PREFIX = # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. -GENERATE_HTML = YES +GENERATE_HTML = NO # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of @@ -1211,7 +1211,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = "./docs/doxygen/doxygen-extra.css" +#HTML_EXTRA_STYLESHEET = "./docs/doxygen/doxygen-extra.css" # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -2015,7 +2015,7 @@ MAN_LINKS = NO # captures the structure of the code including all documentation. # The default value is: NO. -GENERATE_XML = NO +GENERATE_XML = YES # The XML_OUTPUT tag is used to specify where the XML pages will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of diff --git a/docs/doxygen/doxygen-extra.css b/docs/doxygen/doxygen-extra.css deleted file mode 100644 index e852758c..00000000 --- a/docs/doxygen/doxygen-extra.css +++ /dev/null @@ -1,5 +0,0 @@ -body { - background-image: url("../beanstalk-bg.png"); - background-attachment: fixed; - background-size: cover; -} diff --git a/doxygen_config.py b/doxygen_config.py new file mode 100644 index 00000000..9d37b519 --- /dev/null +++ b/doxygen_config.py @@ -0,0 +1,63 @@ +# Configuration file for https://mcss.mosra.cz/documentation/doxygen/ +DOXYFILE = "Doxyfile" +MAIN_PROJECT_URL = "https://github.com/zeldaret/tmc" +SHOW_UNDOCUMENTED = True +SEARCH_RESULT_ID_BYTES = 4 +SEARCH_FILE_OFFSET_BYTES = 4 +SEARCH_NAME_SIZE_BYTES = 2 +SEARCH_DOWNLOAD_BINARY = True +HTML_HEADER = """ + +""" +LINKS_NAVBAR1 = [ + ("Modules", 'modules', []), + ("Pages", 'pages', []) +] +LINKS_NAVBAR2 = [ + ("Classes", 'annotated', []), + ("Files", 'files', []) +] \ No newline at end of file From f036a3fc74a9ca08479d970a52c998fa0284c66a Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sun, 4 Sep 2022 15:34:39 +0200 Subject: [PATCH 2/2] Adapt GitHub action --- .github/workflows/doxygen.yml | 19 +++++++--- Doxyfile | 6 ++-- README.md | 4 ++- docs/doxygen/style.css | 43 ++++++++++++++++++++++ doxygen_config.py | 67 +++++++---------------------------- include/entity.h | 10 +++--- 6 files changed, 81 insertions(+), 68 deletions(-) create mode 100644 docs/doxygen/style.css diff --git a/.github/workflows/doxygen.yml b/.github/workflows/doxygen.yml index e4e89b6b..a2a0c0b9 100644 --- a/.github/workflows/doxygen.yml +++ b/.github/workflows/doxygen.yml @@ -7,16 +7,25 @@ on: jobs: build: - runs-on: ubuntu-latest + # Ubuntu 22.04 is needed for an up-to-date version of doxygen. + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - - name: generate docs - uses: mattnotmitt/doxygen-action@v1 + - name: Checkout m.css + uses: actions/checkout@v2 with: - doxyfile-path: 'Doxyfile' + repository: octorock/m.css + ref: refs/heads/bitfields + path: ./m.css + - name: Install doxygen + run: sudo apt install -y doxygen + - name: Generate docs + run: ./m.css/documentation/doxygen.py doxygen_config.py - name: deploy docs to github pages uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/doxygen + publish_dir: ./docs/doxygen/html + # We do not need history for the gh-pages branch. + force_orphan: true diff --git a/Doxyfile b/Doxyfile index 42a3a3c0..9111f24c 100644 --- a/Doxyfile +++ b/Doxyfile @@ -1221,7 +1221,7 @@ HTML_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = docs/doxygen/beanstalk-bg.png # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to @@ -2295,14 +2295,14 @@ DOT_NUM_THREADS = 0 # The default value is: Helvetica. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTNAME = Helvetica +DOT_FONTNAME = Source Sans Pro # The DOT_FONTSIZE tag can be used to set the size (in points) of the font of # dot graphs. # Minimum value: 4, maximum value: 24, default value: 10. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTSIZE = 10 +DOT_FONTSIZE = 16 # By default doxygen will tell dot to use the default font as specified with # DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set diff --git a/README.md b/README.md index 5663c817..653c1824 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,12 @@ It can target the following ROMs: **Note:** This repository does not include any of the assets necessary to build the ROM. A prior copy of the game is required to extract the needed assets. -Website: +Website: Discord: +Documentation: + ## Installation To set up the repository, see [INSTALL.md](INSTALL.md). diff --git a/docs/doxygen/style.css b/docs/doxygen/style.css new file mode 100644 index 00000000..362ba283 --- /dev/null +++ b/docs/doxygen/style.css @@ -0,0 +1,43 @@ +html { + height: 100%; +} +dl { + padding-left: 1em; +} +body { + min-height: 100%; + background-image: url("beanstalk-bg.png"); + background-attachment: fixed; + background-size: cover; +} +body > header > nav { + background: #2f363fe5; +} +main>article>.m-container { + padding-top: 1em; + padding-bottom: 1em; + background: #2f363fe5; +} +code { + background: #2f363fe5; +} +body > footer > nav { + background: transparent; + padding: 0; + color: #555; +} +body > footer > nav a { + color: #222; +} +ul.m-doc li.m-doc-expansible > a:first-child::before, ul.m-doc li.m-doc-collapsible > a:first-child::before { + background: transparent; +} +.m-doc-template, dl.m-doc dd, ul.m-doc li > span.m-doc, dl.m-doc dd svg.m-math, ul.m-doc li > span.m-doc svg.m-math { + color: #a4a4a4; +} +img.m-image, svg.m-image { + display: inline-block; +} +main p { + text-indent: 0; +} \ No newline at end of file diff --git a/doxygen_config.py b/doxygen_config.py index 9d37b519..45b24d7e 100644 --- a/doxygen_config.py +++ b/doxygen_config.py @@ -1,63 +1,22 @@ # Configuration file for https://mcss.mosra.cz/documentation/doxygen/ -DOXYFILE = "Doxyfile" -MAIN_PROJECT_URL = "https://github.com/zeldaret/tmc" +DOXYFILE = 'Doxyfile' +MAIN_PROJECT_URL = 'https://github.com/zeldaret/tmc' SHOW_UNDOCUMENTED = True SEARCH_RESULT_ID_BYTES = 4 SEARCH_FILE_OFFSET_BYTES = 4 SEARCH_NAME_SIZE_BYTES = 2 SEARCH_DOWNLOAD_BINARY = True -HTML_HEADER = """ - -""" LINKS_NAVBAR1 = [ - ("Modules", 'modules', []), - ("Pages", 'pages', []) + ('Modules', 'modules', []), + ('Pages', 'pages', []) ] LINKS_NAVBAR2 = [ - ("Classes", 'annotated', []), - ("Files", 'files', []) -] \ No newline at end of file + ('Classes', 'annotated', []), + ('Files', 'files', []) +] +STYLESHEETS = [ + 'https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i%7CSource+Code+Pro:400,400i,600', + '../css/m-dark+documentation.compiled.css', + 'docs/doxygen/style.css' +] +FAVICON = 'https://zelda64.dev/favicon.ico' \ No newline at end of file diff --git a/include/entity.h b/include/entity.h index 30bc9a75..60ed7507 100644 --- a/include/entity.h +++ b/include/entity.h @@ -134,7 +134,7 @@ typedef struct Entity_ { /*0x15*/ u8 direction; /**< Facing direction. @see Direction */ /*0x16*/ u8 carryFlags; /**< Flags for carrying this Entity. */ /*0x17*/ u8 followerFlag; /**< Controls collisions between followers, unused. */ - /*0x18*/ struct { + /*0x18*/ struct SpriteSettings { /* */ u32 draw : 2; /**< Draw type. 0 = disabled, 1 = clip to screen, 3 = draw always */ /* 0x2 */ /* */ u32 ss2 : 1; /* 4 */ /* */ u32 ss3 : 1; /* 8 */ @@ -142,20 +142,20 @@ typedef struct Entity_ { /* */ u32 flipX : 1; /**< Flip sprite horizontally. */ /* 0x40 */ /* */ u32 flipY : 1; /**< Flip sprite vertically. */ /* 0x80 */ /* */ } PACKED spriteSettings; - /*0x19*/ struct { + /*0x19*/ struct SpriteRendering { /* */ u32 b0 : 2; /* 1-2 */ /* */ u32 alphaBlend : 2; /* 4-8 */ /* */ u32 b2 : 2; /* 0x10 */ /* */ u32 b3 : 2; /* 0x40 */ /* */ } PACKED spriteRendering; - /*0x1a*/ union { + /*0x1a*/ union Palette { /* */ u8 raw; - /* */ struct { + /* */ struct PaletteB { /* */ u8 b0 : 4; /* */ u8 b4 : 4; /* */ } PACKED b; /* */ } PACKED palette; - /*0x1b*/ struct { + /*0x1b*/ struct SpriteOrientation { /* */ u32 b0 : 1; /* 1 */ /* */ u32 b1 : 5; /* 0x2-0x10 */ /* */ u32 flipY : 2; /* 0x20-0x40 */