diff --git a/res/moves/0468/anim.s b/res/moves/.shared/anim_0468_0474.s similarity index 100% rename from res/moves/0468/anim.s rename to res/moves/.shared/anim_0468_0474.s diff --git a/res/moves/0475/anim.s b/res/moves/.shared/anim_0475_0500.s similarity index 100% rename from res/moves/0475/anim.s rename to res/moves/.shared/anim_0475_0500.s diff --git a/res/moves/0468/data.json b/res/moves/0468/data.json deleted file mode 100644 index e9cf28d9bf..0000000000 --- a/res/moves/0468/data.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "", - "class": "CLASS_SPECIAL", - "type": "TYPE_NORMAL", - "power": 100, - "accuracy": 100, - "pp": 10, - "effect": { - "type": "BATTLE_EFFECT_HIT", - "chance": 0 - }, - "range": "RANGE_SINGLE_TARGET", - "priority": 0, - "flags": [ - "MOVE_FLAG_CAN_PROTECT", - "MOVE_FLAG_CAN_MIRROR_MOVE", - "MOVE_FLAG_TRIGGERS_KINGS_ROCK" - ], - "contest": { - "effect": "CONTEST_EFFECT_LOW_VOLTAGE_ADVANTAGE", - "type": "CONTEST_TYPE_BEAUTY" - } -} diff --git a/res/moves/0469/anim.s b/res/moves/0469/anim.s deleted file mode 100644 index 37bc294d9f..0000000000 --- a/res/moves/0469/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffectR SEQ_SE_DP_030 - Delay 60 - End diff --git a/res/moves/0469/data.json b/res/moves/0469/data.json deleted file mode 100644 index 293c73be6a..0000000000 --- a/res/moves/0469/data.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "", - "class": "CLASS_SPECIAL", - "type": "TYPE_NORMAL", - "power": 100, - "accuracy": 100, - "pp": 10, - "effect": { - "type": "BATTLE_EFFECT_HIT", - "chance": 0 - }, - "range": "RANGE_SINGLE_TARGET", - "priority": 0, - "flags": [ - "MOVE_FLAG_CAN_PROTECT", - "MOVE_FLAG_CAN_MIRROR_MOVE", - "MOVE_FLAG_TRIGGERS_KINGS_ROCK" - ], - "contest": { - "effect": "CONTEST_EFFECT_FIRST_PERFORMANCE_ADVANTAGE", - "type": "CONTEST_TYPE_CUTE" - } -} diff --git a/res/moves/0470/anim.s b/res/moves/0470/anim.s deleted file mode 100644 index 37bc294d9f..0000000000 --- a/res/moves/0470/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffectR SEQ_SE_DP_030 - Delay 60 - End diff --git a/res/moves/0470/data.json b/res/moves/0470/data.json deleted file mode 100644 index f80d08f76f..0000000000 --- a/res/moves/0470/data.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "", - "class": "CLASS_SPECIAL", - "type": "TYPE_NORMAL", - "power": 100, - "accuracy": 100, - "pp": 10, - "effect": { - "type": "BATTLE_EFFECT_HIT", - "chance": 0 - }, - "range": "RANGE_SINGLE_TARGET", - "priority": 0, - "flags": [ - "MOVE_FLAG_CAN_PROTECT", - "MOVE_FLAG_CAN_MIRROR_MOVE", - "MOVE_FLAG_TRIGGERS_KINGS_ROCK" - ], - "contest": { - "effect": "CONTEST_EFFECT_FINAL_PERFORMANCE_ADVANTAGE", - "type": "CONTEST_TYPE_SMART" - } -} diff --git a/res/moves/0471/anim.s b/res/moves/0471/anim.s deleted file mode 100644 index 37bc294d9f..0000000000 --- a/res/moves/0471/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffectR SEQ_SE_DP_030 - Delay 60 - End diff --git a/res/moves/0472/anim.s b/res/moves/0472/anim.s deleted file mode 100644 index 37bc294d9f..0000000000 --- a/res/moves/0472/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffectR SEQ_SE_DP_030 - Delay 60 - End diff --git a/res/moves/0473/anim.s b/res/moves/0473/anim.s deleted file mode 100644 index 37bc294d9f..0000000000 --- a/res/moves/0473/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffectR SEQ_SE_DP_030 - Delay 60 - End diff --git a/res/moves/0474/anim.s b/res/moves/0474/anim.s deleted file mode 100644 index 37bc294d9f..0000000000 --- a/res/moves/0474/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffectR SEQ_SE_DP_030 - Delay 60 - End diff --git a/res/moves/0476/anim.s b/res/moves/0476/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0476/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0477/anim.s b/res/moves/0477/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0477/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0478/anim.s b/res/moves/0478/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0478/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0479/anim.s b/res/moves/0479/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0479/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0480/anim.s b/res/moves/0480/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0480/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0481/anim.s b/res/moves/0481/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0481/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0482/anim.s b/res/moves/0482/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0482/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0483/anim.s b/res/moves/0483/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0483/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0484/anim.s b/res/moves/0484/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0484/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0485/anim.s b/res/moves/0485/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0485/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0486/anim.s b/res/moves/0486/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0486/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0487/anim.s b/res/moves/0487/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0487/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0488/anim.s b/res/moves/0488/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0488/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0489/anim.s b/res/moves/0489/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0489/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0490/anim.s b/res/moves/0490/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0490/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0491/anim.s b/res/moves/0491/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0491/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0492/anim.s b/res/moves/0492/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0492/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0493/anim.s b/res/moves/0493/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0493/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0494/anim.s b/res/moves/0494/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0494/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0495/anim.s b/res/moves/0495/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0495/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0496/anim.s b/res/moves/0496/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0496/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0497/anim.s b/res/moves/0497/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0497/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0498/anim.s b/res/moves/0498/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0498/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0499/anim.s b/res/moves/0499/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0499/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/0500/anim.s b/res/moves/0500/anim.s deleted file mode 100644 index 10a46dda5d..0000000000 --- a/res/moves/0500/anim.s +++ /dev/null @@ -1,10 +0,0 @@ -#include "macros/btlanimcmd.inc" - -L_0: - Func_Nop - Func_AnimExample - Func_SoundExample - Func_GenericExample - PlaySoundEffect SEQ_SE_DP_BASI - Delay 60 - End diff --git a/res/moves/meson.build b/res/moves/meson.build index d9e9fd84e6..c7a1d90123 100644 --- a/res/moves/meson.build +++ b/res/moves/meson.build @@ -1,48 +1,3 @@ -anim_script_subdirs = [ - 'none', - '0468', - '0469', - '0470', - '0471', - '0472', - '0473', - '0474', - '0475', - '0476', - '0477', - '0478', - '0479', - '0480', - '0481', - '0482', - '0483', - '0484', - '0485', - '0486', - '0487', - '0488', - '0489', - '0490', - '0491', - '0492', - '0493', - '0494', - '0495', - '0496', - '0497', - '0498', - '0499', - '0500', ] - -move_consts = fs.read(moves_txt).splitlines() -foreach move : move_consts - if move.startswith('MOVE_') and move != 'MOVE_NONE' - move_name = move.replace('MOVE_', '').to_lower() - # pl_waza_tbl_subdirs += move_name - anim_script_subdirs += move_name - endif -endforeach - move_text_bank_names = [ 'move_names.json', 'move_names_uppercase.json', @@ -53,6 +8,7 @@ move_text_bank_names = [ move_data = custom_target('move_data', output: [ 'move_data.narc', + 'anim_scripts.order', move_text_bank_names, ], @@ -67,12 +23,21 @@ move_data = custom_target('move_data', depfile: 'move_data.d', ) +move_anim_scripts_order = move_data[1] move_data_outputs = move_data.to_list() -move_text_banks = move_data_outputs.slice(1, move_data_outputs.length()) +move_text_banks = move_data_outputs.slice(2, move_data_outputs.length()) -anim_script_srcs = [] -foreach subdir : anim_script_subdirs - anim_script_srcs += subdir / 'anim.s' +anim_script_srcs = [ + '.shared/anim_0468_0474.s', + '.shared/anim_0475_0500.s', +] + +move_consts = fs.read(moves_txt).splitlines() +foreach move : move_consts + if move.startswith('MOVE_') + move_stem = move.replace('MOVE_', '').to_lower() + anim_script_srcs += move_stem / 'anim.s' + endif endforeach # This generator is shared by both move-specific animations (in this directory) @@ -105,12 +70,6 @@ battle_anim_script_bin_gen = generator(make_script_bin_sh, relative_build_dir = fs.relative_to(meson.current_build_dir(), meson.project_build_root()) -anim_scripts_order = custom_target('anim_scripts.order', - output: 'anim_scripts.order', - input: [ moves_txt ], - command: [ ordergen_battle_anim_scripts_py, '@INPUT@', meson.current_source_dir(), '@OUTPUT@' ], -) - anim_scripts_narc = custom_target('anim_scripts.narc', output: 'anim_scripts.narc', input: battle_anim_script_bin_gen.process( @@ -124,7 +83,7 @@ anim_scripts_narc = custom_target('anim_scripts.narc', command: [ nitroarc_exe, '--create', - '--files-from', anim_scripts_order, + '--files-from', move_anim_scripts_order, '--file', '@OUTPUT0@', '@PRIVATE_DIR@', ], diff --git a/tools/dataproc/lib/include/dataproc.h b/tools/dataproc/lib/include/dataproc.h index c546ba4faf..37d85e94ff 100644 --- a/tools/dataproc/lib/include/dataproc.h +++ b/tools/dataproc/lib/include/dataproc.h @@ -92,6 +92,7 @@ enum diaglevel dp_report(datafile_t *df); void dp_error(datanode_t *dn, const char *fmt, ...) __attribute__((format(printf, 2, 3))); void dp_warn(datanode_t *dn, const char *fmt, ...) __attribute__((format(printf, 2, 3))); void dp_note(datanode_t *dn, const char *fmt, ...) __attribute__((format(printf, 2, 3))); +void dp_gerror(datafile_t *df, size_t beg, size_t end, const char *errfmt, ...) __attribute__((format(printf, 4, 5))); datanode_t dp_try(datafile_t *df, const char *path); datanode_t dp_get(datafile_t *df, const char *path); diff --git a/tools/dataproc/lib/private.h b/tools/dataproc/lib/private.h index e2f779d8d5..08b6abcce9 100644 --- a/tools/dataproc/lib/private.h +++ b/tools/dataproc/lib/private.h @@ -20,7 +20,4 @@ struct diagnostic { diagnostic_t *next; }; -__attribute__((format(printf, 4, 5))) -void dp_gerror(datafile_t *df, size_t beg, size_t end, const char *errfmt, ...); - #endif // DATAPROC_PRIVATE_H diff --git a/tools/dataproc/src/common.c b/tools/dataproc/src/common.c index f224be228d..165e490eae 100644 --- a/tools/dataproc/src/common.c +++ b/tools/dataproc/src/common.c @@ -3,12 +3,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include "dataproc.h" #include "libenum.h" @@ -676,3 +678,9 @@ void bank_pushlines(datanode_t *root, const char *id, ...) { va_end(content); } + +bool order_subfile(const char *basename, const char *subfile, FILE *f_order) { + fprintf(f_order, "%s/%s\n", basename, subfile); + return true; +} + diff --git a/tools/dataproc/src/common.h b/tools/dataproc/src/common.h index 66370ed892..6ba2892068 100644 --- a/tools/dataproc/src/common.h +++ b/tools/dataproc/src/common.h @@ -199,4 +199,6 @@ void bank_pushlines(datanode_t *root, const char *id, ...); #define bank_pushm(bank, id, ...) bank_pushlines(&textbanks[bank].root, id, __VA_ARGS__, NULL) +bool order_subfile(const char *basename, const char *subfile, FILE *f_order); + #endif // DATAPROC_COMMON_H diff --git a/tools/dataproc/src/moveproc.c b/tools/dataproc/src/moveproc.c index 25a87ee88b..5e8fe2937f 100644 --- a/tools/dataproc/src/moveproc.c +++ b/tools/dataproc/src/moveproc.c @@ -1,10 +1,12 @@ #include #include #include +#include #include #include #include #include +#include #include "common.h" #include "dataproc.h" @@ -55,7 +57,11 @@ static textbank_template_t textbanks[] = { static void parse_args(int *pargc, char ***pargv); static void proc_move(datafile_t *df); static void proc_text(datafile_t *df, size_t i, const char *basename); +static void prep_scripts(const char *basename); static void pack_extra_moves(void); +static void prep_extra_scripts(void); +static void init_orderfiles(void); +static int close_orderfiles(void); static char *filename = NULL; static char *base_dir = NULL; @@ -77,6 +83,7 @@ int main(int argc, char **argv) { .archives = archives, .textbanks = textbanks, .extra_files = 3, + .hook_before = init_orderfiles, ); for (size_t i = 0; i < moves.size; i++) { @@ -89,6 +96,7 @@ int main(int argc, char **argv) { if (dp_load(&df, filepath) == 0) { proc_move(&df); proc_text(&df, i, basename); + prep_scripts(basename); } if (dp_report(&df) == DIAG_ERROR) errc = EXIT_FAILURE; @@ -99,7 +107,8 @@ int main(int argc, char **argv) { } pack_extra_moves(); - return common_done(errc, NULL); + prep_extra_scripts(); + return common_done(errc, close_orderfiles); } static void proc_move(datafile_t *df) { @@ -180,7 +189,28 @@ static void proc_text(datafile_t *df, size_t i, const char *basename) { #undef strfmt2 } +static FILE *f_anim_scripts = NULL; + +static void init_orderfiles(void) { + char *filepath = pathjoin(output_dir, NULL, "anim_scripts.order"); + f_anim_scripts = fopen(filepath, "wb"); + + free(filepath); +} + +static void prep_scripts(const char *basename) { + order_subfile(basename, "anim", f_anim_scripts); +} + +static int close_orderfiles(void) { + fclose(f_anim_scripts); + return EXIT_SUCCESS; +} + static void pack_extra_moves(void) { + // MATCH DETAIL: The retail game contains these 3 additional entries at the tail of the move data + // archive. They are inaccessible, but must be present to produce a binary match. + MoveTable m468 = { .class = CLASS_SPECIAL, .type = TYPE_NORMAL, @@ -231,6 +261,19 @@ static void pack_extra_moves(void) { nitroarc_ppack(&archives[0].packer, &m470, sizeof(m470), NULL); } +static void prep_extra_scripts(void) { + // MATCH DETAIL: The retail game contains additional entries in the animation scripts archive that + // must be present to produce a binary match. + + for (size_t i = 468; i <= 474; i++) { + order_subfile(".shared", "anim_0468_0474", f_anim_scripts); + } + + for (size_t i = 475; i <= 500; i++) { + order_subfile(".shared", "anim_0475_0500", f_anim_scripts); + } +} + static char *program_name = NULL; static void usage(const char *fmt, ...) { diff --git a/tools/ordergen/battle_anim_scripts.py b/tools/ordergen/battle_anim_scripts.py deleted file mode 100755 index 9465f92bc5..0000000000 --- a/tools/ordergen/battle_anim_scripts.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python3 - -import sys -from pathlib import Path - -def usage(): - print("Usage: battle_anim_scripts.py ") - print() - print("Process an input file containing a list of moves into an") - print("output file to order the contents of anim_scripts.narc.") - -if len(sys.argv) < 4: - usage() - sys.exit(1) - -with ( - open(sys.argv[1], "r", encoding="utf-8") as infile, - open(sys.argv[3], "w", encoding="utf-8") as outfile, -): - added = set() - def add(move_name): - print(f"{move_name}/anim", file=outfile) - added.add(move_name) - - for move in infile: - move = move.strip() - if not move or not move.startswith("MOVE_"): - continue - move_name = move.replace("MOVE_", "").lower() - add(move_name) - - for path in sorted(Path(sys.argv[2]).iterdir()): - if not path.is_dir() or not (path / 'anim.s').exists(): - continue - move_name = path.name - if move_name in added: - continue - add(move_name) diff --git a/tools/ordergen/meson.build b/tools/ordergen/meson.build index f39c82f281..74be15d010 100644 --- a/tools/ordergen/meson.build +++ b/tools/ordergen/meson.build @@ -1,4 +1,3 @@ -ordergen_battle_anim_scripts_py = find_program('battle_anim_scripts.py', native: true) ordergen_forms_py = find_program('forms.py', native: true) ordergen_species_py = find_program('species.py', native: true) ordergen_text_banks_py = find_program('text_banks.py', native: true)