nostalgia/scripts/pkg-gba.py

33 lines
882 B
Python
Raw Normal View History

2023-07-01 19:58:57 -05:00
#! /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]
bin = f'./build/{host_env}-{current_build}/bin/'
2023-07-01 19:58:57 -05:00
nostalgia_bin = 'build/gba-release/bin/nostalgia.bin'
nostalgia_project = sys.argv[1]
nostalgia_gba = 'nostalgia.gba'
shutil.copyfile(nostalgia_bin, nostalgia_gba)
subprocess.run([
f'{bin}/nostalgia-pack', '-src', nostalgia_project, '-rom-bin', nostalgia_gba])
2023-07-01 19:58:57 -05:00
subprocess.run(['gbafix', nostalgia_gba])