Skip to content

Commit

Permalink
Use a shell script for the final ROM target
Browse files Browse the repository at this point in the history
  • Loading branch information
lhearachel committed Feb 14, 2025
1 parent 7145113 commit acd9d7e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 17 deletions.
21 changes: 4 additions & 17 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -216,29 +216,16 @@ pokeplatinum_nds = custom_target('pokeplatinum.us.nds',
'pokeplatinum.us.nlf'
],
input: [
main,
banner_bnr,
rom_header_template,
rom_rsf,
ichneumon_sub,
ichneumon_sub_defs,
fixrom_exe,
nitrofs_files # Make sure this is always listed last
],
command : [
makerom_exe,
'-DTITLE_NAME=POKEMON PL',
'-DBNR=@INPUT1@',
'-DHEADER_TEMPLATE=@INPUT2@',
'-DARM7=@INPUT4@',
'-DARM7_DEFS=@INPUT5@',
'@INPUT3@',
'@OUTPUT0@',
'@OUTPUT1@',
'&&','sh', '-c',
'@INPUT6@ @OUTPUT0@ --secure-crc 0xF8B8 --game-code CPUE'
],
build_by_default: true
# makerom_exe must always be last, as it may contain a wine component
command : [ make_rom_sh, '@INPUT@', '@OUTPUT@', fixrom_exe, makerom_exe ],
build_by_default: true,
depends: [ main, nitrofs_files ],
)

############################################################
Expand Down
23 changes: 23 additions & 0 deletions tools/scripts/make_rom.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

set -euo pipefail

BANNER_BNR="$1"; shift
HEADER_TEMPLATE="$1"; shift
ROM_RSF="$1"; shift
ARM7_BIN="$1"; shift
ARM7_DEFS="$1"; shift
NDS_OUT="$1"; shift
NLF_OUT="$1"; shift
FIXROM_EXE="$1"; shift

$@ -DTITLE_NAME="POKEMON PL" \
-DBNR=$BANNER_BNR \
-DHEADER_TEMPLATE=$HEADER_TEMPLATE \
-DARM7=$ARM7_BIN \
-DARM7_DEFS=$ARM7_DEFS \
$ROM_RSF \
$NDS_OUT \
$NLF_OUT

$FIXROM_EXE $NDS_OUT --secure-crc 0xF8B8 --game-code CPUE
1 change: 1 addition & 0 deletions tools/scripts/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
make_rom_sh = find_program('make_rom.sh', native: true)
make_pl_poke_icon_py = find_program('make_pl_poke_icon.py', native: true)
make_pl_pokegra_py = find_program('make_pl_pokegra.py', native: true)
make_pl_otherpoke_py = find_program('make_pl_otherpoke.py', native: true)
Expand Down

0 comments on commit acd9d7e

Please # to comment.