mirror of
https://github.com/zeldaret/st
synced 2026-07-11 07:15:33 -04:00
make it build (and get wibo update from ph)
This commit is contained in:
+20
-3
@@ -10,7 +10,7 @@ import ninja_syntax
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description="Generates build.ninja")
|
||||
parser.add_argument('-w', type=str, default="wine", dest="wine", required=False, help="Path to Wine (linux only)")
|
||||
parser.add_argument('-w', type=str, default="./wibo", dest="wine", required=False, help="Path to Wine/Wibo (linux only)")
|
||||
parser.add_argument('version', help='Game version')
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -18,7 +18,7 @@ args = parser.parse_args()
|
||||
# Config
|
||||
GAME = "st"
|
||||
MWCC_VERSION = "2.0/sp1p5"
|
||||
DECOMP_ME_COMPILER = "mwcc_40_1051"
|
||||
DECOMP_ME_COMPILER = "mwcc_30_131"
|
||||
CC_FLAGS = " ".join([
|
||||
"-O4,p", # Optimize maximally for performance
|
||||
"-enum int", # Use int-sized enums
|
||||
@@ -27,11 +27,12 @@ CC_FLAGS = " ".join([
|
||||
"-proc arm946e", # Target processor
|
||||
"-gccext,on", # Enable GCC extensions
|
||||
"-fp soft", # Compute float operations in software
|
||||
"-inline on,noauto", # Inline only functions marked with 'inline'
|
||||
"-inline noauto", # Inline only functions marked with 'inline'
|
||||
"-lang=c++", # Set language to C++
|
||||
"-Cpp_exceptions off", # Disable C++ exceptions
|
||||
"-RTTI off", # Disable runtime type information
|
||||
"-interworking", # Enable ARM/Thumb interworking
|
||||
"-w off", # Disable warnings
|
||||
"-sym on", # Debug info, including line numbers
|
||||
"-gccinc", # Interpret #include "..." and #include <...> equally
|
||||
"-nolink", # Do not link
|
||||
@@ -179,6 +180,12 @@ def main():
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.rule(
|
||||
name="sha1",
|
||||
command=f"{PYTHON} tools/sha1.py $in -c $sha1_file"
|
||||
)
|
||||
n.newline()
|
||||
|
||||
game_build = build_path / game_version
|
||||
game_extract = extract_path / game_version
|
||||
|
||||
@@ -249,6 +256,16 @@ def add_mwld_and_rom_builds(n: ninja_syntax.Writer, game_build: Path, game_confi
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.build(
|
||||
inputs=rom_file,
|
||||
rule="sha1",
|
||||
variables={
|
||||
"sha1_file": str(Path(rom_file).with_suffix(".sha1"))
|
||||
},
|
||||
outputs="sha1",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
|
||||
def add_mwcc_builds(n: ninja_syntax.Writer, game_version: str, game_build: Path, mwcc_implicit: list[Path]):
|
||||
for source_file in get_c_cpp_files([src_path, libs_path]):
|
||||
|
||||
+15
-3
@@ -3,9 +3,10 @@ import zipfile
|
||||
import io
|
||||
from pathlib import Path
|
||||
import platform
|
||||
import stat
|
||||
|
||||
|
||||
DSD_VERSION = 'v0.3.2'
|
||||
DSD_VERSION = 'v0.4.0'
|
||||
WIBO_VERSION = '0.6.16'
|
||||
|
||||
|
||||
tools_path = Path(__file__).parent
|
||||
@@ -31,11 +32,22 @@ match platform.machine().lower():
|
||||
|
||||
print('\nInstalling dsd...')
|
||||
response = requests.get(f'https://github.com/AetiasHax/ds-decomp/releases/download/{DSD_VERSION}/dsd-{system}-{machine}{EXE}')
|
||||
with open(root_path / f'dsd{EXE}', 'wb') as f:
|
||||
dsd_path = root_path / f'dsd{EXE}'
|
||||
with open(dsd_path, 'wb') as f:
|
||||
f.write(response.content)
|
||||
dsd_path.chmod(dsd_path.stat().st_mode | stat.S_IEXEC)
|
||||
|
||||
|
||||
print('\nInstalling toolchain...')
|
||||
response = requests.get('http://decomp.aetias.com/files/mwccarm.zip')
|
||||
zip_file = zipfile.ZipFile(io.BytesIO(response.content))
|
||||
zip_file.extractall(tools_path)
|
||||
|
||||
|
||||
if system == "linux":
|
||||
print('\nInstalling wibo...')
|
||||
response = requests.get(f'https://github.com/decompals/wibo/releases/download/{WIBO_VERSION}/wibo')
|
||||
wibo_path = root_path / 'wibo'
|
||||
with open(wibo_path, 'wb') as f:
|
||||
f.write(response.content)
|
||||
wibo_path.chmod(wibo_path.stat().st_mode | stat.S_IEXEC)
|
||||
|
||||
Reference in New Issue
Block a user