Skip to content

Commit

Permalink
Add CI workflow & cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
encounter committed Dec 19, 2024
1 parent 4d89e1f commit 82bfb05
Show file tree
Hide file tree
Showing 12 changed files with 238 additions and 84 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
# E203: whitespace before ':'
# E501: line too long
extend-ignore = E203,E501
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
*.sh text eol=lf
*.sha1 text eol=lf

# DTK keeps these files with LF
# decomp-toolkit writes files with LF
config/**/*.txt text eol=lf
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build

on:
push:
pull_request:

jobs:
build:
container: ghcr.io/doldecomp/sms-build:main

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: [GMSJ01] # GMSP01

steps:
# Checkout the repository
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

# Set Git config
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

# Copy the original files to the workspace
- name: Prepare
run: cp -R /orig .

# Build the project
- name: Build
run: |
python configure.py --map --version ${{ matrix.version }} \
--binutils /binutils --compilers /compilers
ninja all_source build/${{ matrix.version }}/progress.json \
build/${{ matrix.version }}/report.json
# Upload map files
- name: Upload map
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.version }}_maps
path: build/${{ matrix.version }}/**/*.MAP

# Upload progress report
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.version }}_report
path: build/${{ matrix.version }}/report.json
41 changes: 31 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,36 @@
# IDE folders
.idea/
.vs/

# Caches
__pycache__
.idea
.vscode
.cache
.mypy_cache
.cache/

# Original files
orig/*/*
!orig/*/.gitkeep
*.dol
*.rel
*.elf
*.o
*.map
*.MAP

# Build files
build/
.ninja_*
*.exe
build
build.ninja

# decompctx output
ctx.*
*.ctx

# Generated configs
objdiff.json
orig/*/*
!orig/*/.gitkeep
tools/mwcc_compiler/*
!tools/mwcc_compiler/.gitkeep
/*.txt
compile_commands.json

# Miscellaneous
/*.txt
*.exe
tools/mwcc_compiler
116 changes: 116 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
CC0 1.0 Universal

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.

For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:

i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;

ii. moral rights retained by the original author(s) and/or performer(s);

iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;

iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;

v. rights protecting the extraction, dissemination, use and reuse of data in
a Work;

vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and

vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.

4. Limitations and Disclaimers.

a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.

b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or
other defects, accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under applicable law.

c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer
disclaims responsibility for obtaining any necessary consents, permissions
or other rights required for any use of the Work.

d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.

For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>
44 changes: 11 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
Some Game
[![Build Status]][actions] ![Progress] ![DOL Progress] ![RELs Progress] [![Discord Badge]][discord]
Super Mario Sunshine
[![Build Status]][actions] [![Code Progress]][progress] [![Discord Badge]][discord]
=============

<!--
Replace with your repository's URL.
-->
[Build Status]: https://github.com/encounter/sms-dtk/actions/workflows/build.yml/badge.svg
[actions]: https://github.com/encounter/sms-dtk/actions/workflows/build.yml
<!---
Code progress URL:
https://progress.decomp.club/data/[project]/[version]/all/?mode=shield&measure=code
URL encoded then appended to: https://img.shields.io/endpoint?label=Code&url=
-->
[Progress]: https://img.shields.io/endpoint?label=Code&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Ftww%2FGZLE01%2Fall%2F%3Fmode%3Dshield%26measure%3Dcode
<!---
DOL progress URL:
https://progress.decomp.club/data/[project]/[version]/dol/?mode=shield&measure=code
URL encoded then appended to: https://img.shields.io/endpoint?label=DOL&url=
-->
[DOL Progress]: https://img.shields.io/endpoint?label=DOL&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Ftww%2FGZLE01%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode
<!--
REL progress URL:
https://progress.decomp.club/data/[project]/[version]/modules/?mode=shield&measure=code
URL encoded then appended to: https://img.shields.io/endpoint?label=RELs&url=
-->
[RELs Progress]: https://img.shields.io/endpoint?label=RELs&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Ftww%2FGZLE01%2Fmodules%2F%3Fmode%3Dshield%26measure%3Dcode
<!--
Replace with your Discord server's ID and invite URL.
-->
[Build Status]: https://github.com/doldecomp/sms/actions/workflows/build.yml/badge.svg
[actions]: https://github.com/doldecomp/sms/actions/workflows/build.yml
[Code Progress]: https://decomp.dev/doldecomp/sms.svg?mode=shield&measure=code&label=Code
[progress]: https://decomp.dev/doldecomp/sms
[Discord Badge]: https://img.shields.io/discord/727908905392275526?color=%237289DA&logo=discord&logoColor=%23FFFFFF
[discord]: https://discord.gg/hKx3FJJgrV

A work-in-progress decompilation of SMS.
A work-in-progress decompilation of Super Mario Sunshine.

This repository does **not** contain any game assets or assembly whatsoever. An existing copy of the game is required.

Supported versions:

- `GMSJ01`: Rev 0 (JP)
- `GMSJ01`: Rev 0 (JPN)
- `GMSP01`: Rev 0 (PAL)

Dependencies
Expand Down Expand Up @@ -88,10 +66,10 @@ Building
- Clone the repository:

```sh
git clone https://github.com/my/repo.git
git clone https://github.com/doldecomp/sms.git
```

- Copy your game's disc image to `orig/GAMEID`.
- Copy your game's disc image to `orig/GMSJ01`. (Or the appropriate version folder.)
- Supported formats: ISO (GCM), RVZ, WIA, WBFS, CISO, NFS, GCZ, TGC
- After the initial build, the disc image can be deleted to save space.

Expand All @@ -101,7 +79,7 @@ Building
python configure.py
```

To use a version other than `GAMEID` (USA), specify it with `--version`.
To use a version other than `GMSJ01` (JPN), specify it with `--version`.

- Build:

Expand Down
Binary file added assets/objdiff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion config/GMSJ01/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: mario
object: orig/GMSJ01/sys/main.dol
object_base: orig/GMSJ01
object: sys/main.dol

# Generated from mario.MAP
# map: orig/GMSJ01/files/mario.MAP
Expand Down
3 changes: 2 additions & 1 deletion config/GMSP01/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: marioEU
object: orig/GMSP01/sys/main.dol
object_base: orig/GMSP01
object: sys/main.dol

# Generated from mario.MAP
# map: orig/GMSP01/files/marioEU.MAP
Expand Down
32 changes: 16 additions & 16 deletions config/GMSP01/splits.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
Sections:
.init type:code
extab type:rodata
extabindex type:rodata
.text type:code
.ctors type:rodata
.dtors type:rodata
.rodata type:rodata
.data type:data
.bss type:bss
.sdata type:data
.sbss type:bss
.sdata2 type:rodata
.init type:code align:4
extab type:rodata align:32
extabindex type:rodata align:32
.text type:code align:8
.ctors type:rodata align:16
.dtors type:rodata align:16
.rodata type:rodata align:32
.data type:data align:16
.bss type:bss align:32
.sdata type:data align:4
.sbss type:bss align:16
.sdata2 type:rodata align:16

main.cpp:
.text start:0x80005600 end:0x8000566C
Expand Down Expand Up @@ -3675,12 +3675,12 @@ Runtime.PPCEABI.H/__va_arg.c:

Runtime.PPCEABI.H/global_destructor_chain.c:
.text start:0x8032FF40 end:0x8032FFA0
.dtors start:0x8036B6A8 end:0x8036B6B0
.dtors start:0x8036B6A8 end:0x8036B6AC
.sbss start:0x80405DF0 end:0x80405DF8

Runtime.PPCEABI.H/NMWException.cp:
extab start:0x80005540 end:0x80005588
extabindex start:0x800055A0 end:0x800055FC
extabindex start:0x800055A0 end:0x800055DC
.text start:0x8032FFA0 end:0x80330354

Runtime.PPCEABI.H/ptmf.c:
Expand Down Expand Up @@ -3800,7 +3800,7 @@ MSL_C.PPCEABI.bare.H/inverse_trig.c:

MSL_C.PPCEABI.bare.H/trigf.c:
.text start:0x8033474C end:0x80334B38
.ctors start:0x8036B690 end:0x8036B698
.ctors start:0x8036B690 end:0x8036B694
.rodata start:0x803A3168 end:0x803A3178
.data start:0x803DE188 end:0x803DE198
.sdata2 start:0x8040EB88 end:0x8040EBA0
Expand Down Expand Up @@ -4001,7 +4001,7 @@ os/__start.c:
.init start:0x800051EC end:0x80005440

os/__ppc_eabi_init.cpp:
.init start:0x80005440 end:0x80005530
.init start:0x80005440 end:0x80005494
.text start:0x80341B58 end:0x80341BEC

mtx/mtx.c:
Expand Down
Loading

0 comments on commit 82bfb05

Please sign in to comment.