[nostalgia] Rewrite pkg-gba in Python
This commit is contained in:
32
scripts/pkg-gba.py
Executable file
32
scripts/pkg-gba.py
Executable file
@ -0,0 +1,32 @@
|
||||
#! /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'./dist/{host_env}-{current_build}/bin/'
|
||||
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}/nost-pack', '-src', nostalgia_project, '-rom-bin', nostalgia_gba])
|
||||
subprocess.run(['gbafix', nostalgia_gba])
|
Reference in New Issue
Block a user