mirror of https://github.com/PrimeDecomp/prime.git
parent
4393913060
commit
6af151fd3b
|
@ -26,7 +26,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
sudo dpkg --add-architecture i386
|
sudo dpkg --add-architecture i386
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get -y install build-essential ninja-build python3 gcc-multilib g++-multilib libc6:i386
|
sudo apt-get -y install build-essential ninja-build python3 python3-requests gcc-multilib g++-multilib libc6:i386
|
||||||
curl -L https://cdn.discordapp.com/attachments/727918646525165659/917185027656286218/GC_WII_COMPILERS.zip \
|
curl -L https://cdn.discordapp.com/attachments/727918646525165659/917185027656286218/GC_WII_COMPILERS.zip \
|
||||||
| bsdtar -xvf- -C tools --exclude Wii
|
| bsdtar -xvf- -C tools --exclude Wii
|
||||||
mv tools/GC/* tools/mwcc_compiler/
|
mv tools/GC/* tools/mwcc_compiler/
|
||||||
|
@ -39,6 +39,13 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
python3 configure.py --map --version ${{matrix.version}} --wine ./tools/WiBo/build/wibo
|
python3 configure.py --map --version ${{matrix.version}} --wine ./tools/WiBo/build/wibo
|
||||||
ninja
|
ninja
|
||||||
|
- name: Upload progress
|
||||||
|
continue-on-error: true
|
||||||
|
env:
|
||||||
|
PROGRESS_API_KEY: ${{secrets.PROGRESS_API_KEY}}
|
||||||
|
run: |
|
||||||
|
python3 tools/upload-progress.py -b https://progress.deco.mp/ -p prime -v ${{matrix.version}} \
|
||||||
|
build/mp1.${{matrix.version}}/main.dol.progress
|
||||||
- name: Upload map
|
- name: Upload map
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -1308,7 +1308,7 @@ if args.check:
|
||||||
# Progress script
|
# Progress script
|
||||||
###
|
###
|
||||||
if args.map:
|
if args.map:
|
||||||
n.rule(name="progress", command=ALLOW_CHAIN+"$python tools/calcprogress.py $in && touch $out",
|
n.rule(name="progress", command=ALLOW_CHAIN+"$python tools/calcprogress.py $in -o $out",
|
||||||
description="PROGRESS $in")
|
description="PROGRESS $in")
|
||||||
n.build("$builddir/main.dol.progress", "progress",
|
n.build("$builddir/main.dol.progress", "progress",
|
||||||
["$builddir/main.dol", "$builddir/MetroidPrime.MAP"])
|
["$builddir/main.dol", "$builddir/MetroidPrime.MAP"])
|
||||||
|
|
|
@ -24,6 +24,8 @@ import sys
|
||||||
import struct
|
import struct
|
||||||
import re
|
import re
|
||||||
import math
|
import math
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
|
||||||
###############################################
|
###############################################
|
||||||
# #
|
# #
|
||||||
|
@ -31,9 +33,6 @@ import math
|
||||||
# #
|
# #
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
DOL_PATH = sys.argv[1]
|
|
||||||
MAP_PATH = sys.argv[2]
|
|
||||||
|
|
||||||
MEM1_HI = 0x81200000
|
MEM1_HI = 0x81200000
|
||||||
MEM1_LO = 0x80004000
|
MEM1_LO = 0x80004000
|
||||||
|
|
||||||
|
@ -83,6 +82,12 @@ dataItem = "missiles" # data flavor item
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser(description="Calculate progress.")
|
||||||
|
parser.add_argument("dol", help="Path to DOL")
|
||||||
|
parser.add_argument("map", help="Path to map")
|
||||||
|
parser.add_argument("-o", "--output", help="JSON output file")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
# HACK: Check asm or src in obj_file.mk
|
# HACK: Check asm or src in obj_file.mk
|
||||||
# to avoid counting .comm/.lcomm as decompiled
|
# to avoid counting .comm/.lcomm as decompiled
|
||||||
asm_objs = []
|
asm_objs = []
|
||||||
|
@ -92,7 +97,7 @@ if __name__ == "__main__":
|
||||||
asm_objs.append(line.strip().rsplit('/', 1)[-1].rstrip('\\'))
|
asm_objs.append(line.strip().rsplit('/', 1)[-1].rstrip('\\'))
|
||||||
|
|
||||||
# Sum up DOL section sizes
|
# Sum up DOL section sizes
|
||||||
dol_handle = open(DOL_PATH, "rb")
|
dol_handle = open(args.dol, "rb")
|
||||||
|
|
||||||
# Seek to virtual addresses
|
# Seek to virtual addresses
|
||||||
dol_handle.seek(0x48)
|
dol_handle.seek(0x48)
|
||||||
|
@ -134,7 +139,7 @@ if __name__ == "__main__":
|
||||||
dol_code_size += i
|
dol_code_size += i
|
||||||
|
|
||||||
# Open map file
|
# Open map file
|
||||||
mapfile = open(MAP_PATH, "r")
|
mapfile = open(args.map, "r")
|
||||||
symbols = mapfile.readlines()
|
symbols = mapfile.readlines()
|
||||||
|
|
||||||
decomp_code_size = 0
|
decomp_code_size = 0
|
||||||
|
@ -205,3 +210,15 @@ if __name__ == "__main__":
|
||||||
print(f"\tCode sections: {decomp_code_size} / {dol_code_size}\tbytes in src ({codeCompletionPcnt:%})")
|
print(f"\tCode sections: {decomp_code_size} / {dol_code_size}\tbytes in src ({codeCompletionPcnt:%})")
|
||||||
print(f"\tData sections: {decomp_data_size} / {dol_data_size}\tbytes in src ({dataCompletionPcnt:%})")
|
print(f"\tData sections: {decomp_data_size} / {dol_data_size}\tbytes in src ({dataCompletionPcnt:%})")
|
||||||
print("\nYou have {} out of {} {} and collected {} out of {} {}.".format(codeCount, codeFrac, codeItem, dataCount, dataFrac, dataItem))
|
print("\nYou have {} out of {} {} and collected {} out of {} {}.".format(codeCount, codeFrac, codeItem, dataCount, dataFrac, dataItem))
|
||||||
|
|
||||||
|
if args.output:
|
||||||
|
data = {
|
||||||
|
"dol": {
|
||||||
|
"code": decomp_code_size,
|
||||||
|
"code/total": dol_code_size,
|
||||||
|
"data": decomp_data_size,
|
||||||
|
"data/total": dol_data_size,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
with open(args.output, "w") as f:
|
||||||
|
json.dump(data, f)
|
||||||
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
import requests
|
||||||
|
|
||||||
|
|
||||||
|
def get_git_commit_timestamp() -> int:
|
||||||
|
return int(subprocess.check_output(['git', 'show', '-s', '--format=%ct']).decode('ascii').rstrip())
|
||||||
|
|
||||||
|
|
||||||
|
def get_git_commit_sha() -> str:
|
||||||
|
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
|
||||||
|
|
||||||
|
|
||||||
|
def generate_url(args: argparse.Namespace) -> str:
|
||||||
|
url_components = [args.base_url.rstrip('/'), 'data']
|
||||||
|
|
||||||
|
for arg in [args.project, args.version]:
|
||||||
|
if arg != "":
|
||||||
|
url_components.append(arg)
|
||||||
|
|
||||||
|
return str.join('/', url_components) + '/'
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
parser = argparse.ArgumentParser(description="Upload progress information.")
|
||||||
|
parser.add_argument("-b", "--base_url", help="API base URL", required=True)
|
||||||
|
parser.add_argument("-a", "--api_key", help="API key (env var PROGRESS_API_KEY)")
|
||||||
|
parser.add_argument("-p", "--project", help="Project slug", required=True)
|
||||||
|
parser.add_argument("-v", "--version", help="Version slug", required=True)
|
||||||
|
parser.add_argument("input", help="Progress JSON input")
|
||||||
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
api_key = args.api_key or os.environ.get("PROGRESS_API_KEY")
|
||||||
|
if not api_key:
|
||||||
|
raise "API key required"
|
||||||
|
url = generate_url(args)
|
||||||
|
|
||||||
|
entries = []
|
||||||
|
with open(args.input, "r") as f:
|
||||||
|
data = json.load(f)
|
||||||
|
entries.append({
|
||||||
|
"timestamp": get_git_commit_timestamp(),
|
||||||
|
"git_hash": get_git_commit_sha(),
|
||||||
|
"categories": data,
|
||||||
|
})
|
||||||
|
|
||||||
|
print("Publishing entries to", url)
|
||||||
|
pprint(entries)
|
||||||
|
data = {
|
||||||
|
"api_key": args.api_key,
|
||||||
|
"entries": entries,
|
||||||
|
}
|
||||||
|
r = requests.post(url, json=data)
|
||||||
|
r.raise_for_status()
|
||||||
|
print("Done!")
|
Loading…
Reference in New Issue