jasper/util/scripts/pkg-gba.py
Gary Talent 4ea4a61d54 Squashed 'deps/nostalgia/' changes from 98ddb08a..791b7746
791b7746 [nostalgia] Update liccor file
842e3587 [nostalgia] Update .gitignore for new location of scripts dir
318e7900 [ox] Update liccor file
9f338a74 [ox] Run liccor
645e48af [nostalgia,olympic] Run liccor
ef92c8df [nostalgia] Make pkg-gba.py force lower case for pack tool
849d50be [nostalgia/core] Make getTileIdx return an Optional
845092f1 [turbine] Make common turbine.cpp file private to its target
75819a17 [ox/std] Add SmallMap::values()
d66da857 [ox/std] SmallMap fixes, add findIdx function

git-subtree-dir: deps/nostalgia
git-subtree-split: 791b7746f331a3ad02cfdcdbc7c3ecde0cab7779
2025-01-11 12:32:00 -06:00

40 lines
1.1 KiB
Python
Executable File

#! /usr/bin/env python3
#
# Copyright 2016 - 2023 gary@drinkingtea.net
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import platform
import shutil
import subprocess
import sys
os = platform.system().lower()
arch = platform.machine()
host_env = f'{os}-{arch}'
# get current build type
with open(".current_build", "r") as f:
current_build = f.readlines()[0]
if current_build[len(current_build) - 1] == '\n':
current_build = current_build[:len(current_build) - 1]
project_dir = sys.argv[1]
project_name = sys.argv[2]
bin = f'./build/{host_env}-{current_build}/bin/'
project_bin = f'build/gba-release/bin/{project_name}.bin'
project_gba = f'{project_name}.gba'
project_manifest = f'{project_name.lower()}-manifest.json'
shutil.copyfile(project_bin, project_gba)
subprocess.run([
f'{bin}/{project_name.lower()}-pack',
'-src', project_dir,
'-rom-bin', project_gba,
'-manifest', project_manifest])
subprocess.run(['gbafix', project_gba])