Skip to content

Commit

Permalink
Merge branch 'doldecomp:master' into itegg
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla authored Feb 22, 2024
2 parents 41c47e1 + 6c927e1 commit d030f29
Show file tree
Hide file tree
Showing 145 changed files with 8,353 additions and 7,346 deletions.
9 changes: 4 additions & 5 deletions .github/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Super Smash Bros Melee
[![Code Progress](https://img.shields.io/endpoint?label=Code&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Fmelee%2FGALE01%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode)](https://progress.decomp.club/data/melee/)
[![Data Progress](https://img.shields.io/endpoint?label=Data&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Fmelee%2FGALE01%2Fdol%2F%3Fmode%3Dshield%26measure%3Ddata)](https://progress.decomp.club/data/melee/)
[![Code Progress](https://img.shields.io/endpoint?label=Code&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Fmelee%2FGALE01%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode)](https://doldecomp.github.io/melee/progress/)
[![Data Progress](https://img.shields.io/endpoint?label=Data&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Fmelee%2FGALE01%2Fdol%2F%3Fmode%3Dshield%26measure%3Ddata)](https://doldecomp.github.io/melee/progress/)
[![GC/Wii Decompilation](https://discordapp.com/api/guilds/727908905392275526/widget.png?style=shield)](https://discord.gg/hKx3FJJgrV)
[![build-melee](https://github.com/doldecomp/melee/actions/workflows/build-melee.yml/badge.svg)](https://github.com/doldecomp/melee/actions/workflows/build-melee.yml)
[![publish-pages](https://github.com/doldecomp/melee/actions/workflows/publish-pages.yml/badge.svg)](https://github.com/doldecomp/melee/actions/workflows/publish-pages.yml)
[![build](https://github.com/doldecomp/melee/actions/workflows/build.yml/badge.svg)](https://github.com/doldecomp/melee/actions/workflows/build.yml)
[![publish-packages](https://github.com/doldecomp/melee/actions/workflows/publish-packages.yml/badge.svg)](https://github.com/doldecomp/melee/actions/workflows/publish-packages.yml)

This repo contains a WIP decompilation of Super Smash Bros Melee (US).
Expand Down Expand Up @@ -84,7 +83,7 @@ We use Python for our command line tooling. It is recommended that you use a [vi
```
1. After that, you can install or update our packages with:
```sh
pip install -r requirements.txt
pip install -r reqs/decomp.txt
```
1. Now you can run `decomp.py` to decomp a function using [m2c](https://github.com/matt-kempster/m2c). Pass it `-h` to see all the options.
```sh
Expand Down
11 changes: 7 additions & 4 deletions .github/packages/build-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@ ARG WIBO_PATH="/usr/local/sbin/wibo"
COPY --from=ghcr.io/decompals/wibo:latest \
${WIBO_PATH} \
${WIBO_PATH}
COPY requirements.txt /tmp/
ARG DEVKITPRO=/opt/devkitpro
ARG DEVKITPPC=${DEVKITPRO}/devkitPPC
COPY .github/packages/build-linux/setup.sh /usr/local/bin
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C
ENV MELEE_COMPILERS_URL='https://files.decomp.dev/compilers_latest.zip'
ENV BINUTILS_URL='https://github.com/encounter/gc-wii-binutils/releases/download/2.42-0/linux-x86_64.zip'
RUN setup.sh
ENV BINUTILS_URL='https://github.com/encounter/gc-wii-binutils/releases/download/2.42-1/linux-x86_64.zip'
ENV WINE=${WIBO_PATH}
ENV DEVKITPRO=${DEVKITPRO}
ENV DEVKITPPC=${DEVKITPPC}
Expand All @@ -23,11 +20,17 @@ FROM linux-base AS linux-rw
VOLUME [ "/input", "/output" ]

FROM linux-rw AS build-linux
COPY .github/packages/build-linux/setup.sh /usr/local/bin
RUN setup.sh
ENV MAKE_FLAGS="GENERATE_MAP=1"
COPY .github/packages/build-linux/entrypoint.sh /usr/local/bin
ENTRYPOINT entrypoint.sh

FROM linux-rw AS gen-pages
COPY .github/packages/gen-pages/setup.sh /usr/local/bin
COPY tools/progress-site/package*.json /tmp
COPY /reqs/gen-pages.txt /tmp/reqs/
RUN setup.sh
COPY .github/packages/gen-pages/entrypoint.sh /usr/local/bin
ENTRYPOINT entrypoint.sh

Expand Down
21 changes: 7 additions & 14 deletions .github/packages/build-linux/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,15 @@ set -euox pipefail
apt update

apt install -y --no-install-recommends \
git \
doxygen \
python3-full \
python-is-python3 \
git \
make \
ca-certificates \
curl \
gcc \
git \
libarchive-tools \
libc6-dev \
python3-full \
make \
python-is-python3 \
curl \
libarchive-tools

# Create and update Python venv
python -m venv --upgrade-deps /opt/venv
. /opt/venv/bin/activate
pip install --no-cache-dir -r /tmp/requirements.txt
python3-minimal

# Install melee compiler
curl -L "$MELEE_COMPILERS_URL" |
Expand All @@ -43,3 +35,4 @@ apt remove -y \
apt autoremove -y
apt clean
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/*
39 changes: 37 additions & 2 deletions .github/packages/gen-pages/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -euo pipefail
set -euox pipefail

git clone /input /tmp/input
cd /tmp/input
ln -s /opt/mwcc_compiler tools/

cp -R /opt/venv .venv
. .venv/bin/activate
pip install --no-cache-dir -r requirements.txt
pip install --no-cache-dir -r reqs/gen-pages.txt

touch /output/.nojekyll

Expand All @@ -20,3 +20,38 @@ cp -R build/doxygen/html/* /output
python tools/m2ctx/m2ctx.py -pqr
melee-mwcc build/ctx.c -v -o build/ctx.o
cp build/ctx.html /output/

# Progress site
cd /tmp/input/tools/progress-site

src='/opt/assets/progress'
static='static/extern'
lib='src/lib/extern'

# assets
for file in "$src"/*; do
if [[ $(basename "$file") == 'favicon.png' ]]; then
dst="$static"
else
dst="$lib"
fi
cp "$file" "$dst"
done

# progress
# BUG race condition between `build-melee` and `gen-pages`.
progress_url='https://progress.decomp.club/data/melee/GALE01?format=json&mode=all'
curl -s -L "$progress_url" -o "$lib/progress.json"

# install
cp -R /opt/node_modules .
export npm_config_cache='npm-cache'
npm install \
--no-audit \
--no-progress \
--prefer-offline

# build
npm run build
find build -type f -name '.gitkeep' -delete
mv build /output/progress
64 changes: 64 additions & 0 deletions .github/packages/gen-pages/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
set -euox pipefail

apt update

function install {
apt install -y --no-install-recommends "${@}"
}

install curl ca-certificates

curl -L https://deb.nodesource.com/setup_20.x | bash -

install \
doxygen \
git \
libarchive-tools \
nodejs \
python-is-python3 \
python3-full

# Acquire external assets
git clone --no-checkout --depth=1 \
'https://github.com/doldecomp/assets.git' \
/tmp/assets
pushd /tmp/assets
git sparse-checkout init --cone
git sparse-checkout set melee
git checkout
mv melee /opt/assets
popd

# Acquire fonts
fonts_url='https://media.fontsgeek.com/download/zip/a/-/a-otf-folk-pro_WeXVg.zip'
curl -L "$fonts_url" |
bsdtar -xvf- -C /tmp
mv '/tmp/A-OTF Folk Pro/A-OTF Folk Pro H/A-OTF Folk Pro H.otf' \
'/opt/assets/progress'

# Install progress site node modules
pushd /tmp
npm install --no-audit --no-progress
mv node_modules /opt
popd

# Create and update Python venv
python -m venv --upgrade-deps /opt/venv
. /opt/venv/bin/activate
pip install --no-cache-dir -r /tmp/reqs/gen-pages.txt

# Install melee compiler (for checking ctx.c)
curl -L "$MELEE_COMPILERS_URL" |
bsdtar -xvf- -C /tmp
mv /tmp/GC /tmp/mwcc_compiler
mv /tmp/mwcc_compiler /opt

# Clean up
apt remove -y \
libarchive-tools
apt autoremove -y
apt clean
npm cache clean --force
rm -rf /var/lib/apt/lists/*
rm -rf /tmp/*
75 changes: 71 additions & 4 deletions .github/workflows/build-melee.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build-melee
run-name: Build Melee
name: build
run-name: Build Melee & publish GitHub Pages

on:
push:
Expand All @@ -9,6 +9,12 @@ on:
env:
IMAGE_REPO: doldecomp/melee

permissions:
contents: read
id-token: write
packages: read
pages: write

jobs:
build-make:
name: Make
Expand Down Expand Up @@ -92,9 +98,9 @@ jobs:
run: ln -s /orig .
- name: Build
run: |
args='--version ${{matrix.version}} --compilers /compilers'
args='--compilers /compilers --max-errors 0 --verbose --version ${{matrix.version}}'
if [ -z '${{matrix.options}}' ]; then
args="--map $args"
args="--map --require-protos $args"
fi
echo "$args" | xargs python configure.py
echo "${{matrix.options}}" | xargs ninja
Expand Down Expand Up @@ -148,3 +154,64 @@ jobs:
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
"$REGISTRY/$IMAGE"
gen-pages:
name: Generate pages
runs-on: ubuntu-latest
needs: build-ninja
env:
REGISTRY: ghcr.io
OUTPUT: ${{github.workspace}}/output
steps:
- name: Get image name
env:
IMAGE_SUFFIX: gen-pages:latest
run: |
echo "IMAGE=$IMAGE_REPO/$IMAGE_SUFFIX" >> $GITHUB_ENV
- name: Checkout Melee repository
uses: actions/checkout@v3

- name: Log into container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull generator image
run: docker pull ${{ env.REGISTRY }}/${{ env.IMAGE }}

- name: Generate pages
run: |
mkdir -p "${{ env.OUTPUT }}"
docker run --rm \
--user "$(id -u):$(id -g)" \
--volume "$PWD:/input:ro" \
--volume "${{ env.OUTPUT }}:/output" \
${{ env.REGISTRY }}/${{ env.IMAGE }}
- name: Set up GitHub Pages
uses: actions/configure-pages@v4

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ${{ env.OUTPUT }}

deploy-pages:
concurrency:
group: deploy
cancel-in-progress: false
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: gen-pages
if: github.ref_name == github.event.repository.default_branch
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
77 changes: 0 additions & 77 deletions .github/workflows/publish-pages.yml

This file was deleted.

4 changes: 2 additions & 2 deletions asm/MetroTRK/mpc_7xx_603e.s
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
/* 8032A8A8 00327488 7F CE 04 A6 */ mfsr r30, 14
/* 8032A8AC 0032748C 7F EF 04 A6 */ mfsr r31, 15
/* 8032A8B0 00327490 BE 02 01 A8 */ stmw r16, 0x1a8(r2)
/* 8032A8B4 00327494 7D 4C 42 E6 */ .4byte 0x7D4C42E6
/* 8032A8B8 00327498 7D 6D 42 E6 */ .4byte 0x7D6D42E6
/* 8032A8B4 00327494 7D 4C 42 E6 */ mftb r10, 268
/* 8032A8B8 00327498 7D 6D 42 E6 */ mftb r11, 269
/* 8032A8BC 0032749C 7D 90 FA A6 */ mfspr r12, HID0
/* 8032A8C0 003274A0 7D B1 FA A6 */ mfspr r13, HID1
/* 8032A8C4 003274A4 7D DB 02 A6 */ mfsrr1 r14
Expand Down
Loading

0 comments on commit d030f29

Please sign in to comment.