diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/script_extractor.py | 10 | ||||
-rw-r--r-- | tools/tcgdisasm.py | 21 |
2 files changed, 16 insertions, 15 deletions
diff --git a/tools/script_extractor.py b/tools/script_extractor.py index f043010..812678c 100644 --- a/tools/script_extractor.py +++ b/tools/script_extractor.py @@ -148,7 +148,7 @@ def printScript(game_data, loc, auto, ignore_broken, scriptList, \ #print("Error: first byte was not start_script") print(".ows_" + format(loc,"04x")) else: - + # TODO this is hacky please don't do this printHeader(loc, "Script_") loc += 1 @@ -188,14 +188,14 @@ def createList(): # this is a func just so all this can go at the bottom ("ScriptCommand_MoveActiveNPCByDirection", "w", DO_NOT_QUIT), ("ScriptCommand_CloseTextBox", "", DO_NOT_QUIT), ("ScriptCommand_GiveBoosterPacks", "bbb", DO_NOT_QUIT), - ("Func_cf0c", "bj", DO_NOT_QUIT), # more complex behavior too (jumping) - ("Func_cf12", "bj", DO_NOT_QUIT), + ("ScriptCommand_CheckIfCardInCollectionOrDecks", "bj", DO_NOT_QUIT), # more complex behavior too (jumping) + ("ScriptCommand_CheckIfCardInCollection", "bj", DO_NOT_QUIT), ("ScriptCommand_GiveCard", "b", DO_NOT_QUIT), ("ScriptCommand_TakeCard", "b", DO_NOT_QUIT), ("Func_cf53", "w", DO_NOT_QUIT), # more complex behavior too (jumping) ("Func_cf7b", "", DO_NOT_QUIT), - ("Func_cf2d", "bbbb", DO_NOT_QUIT), # more complex behavior too (jumping + ??) - ("Func_cf96", "w", DO_NOT_QUIT), # only jumps? still needs args to do that though + ("ScriptCommand_CheckRawAmountOfCardsOwned", "bbbb", DO_NOT_QUIT), # more complex behavior too (jumping + ??) + ("ScriptCommand_JumpBasedOnFightingClubPupilStatus", "w", DO_NOT_QUIT), # only jumps? still needs args to do that though ("Func_cfc6", "b", DO_NOT_QUIT), ("Func_cfd4", "", DO_NOT_QUIT), ("Func_d00b", "", DO_NOT_QUIT), # includes something with random and extra data diff --git a/tools/tcgdisasm.py b/tools/tcgdisasm.py index 579d577..a887b1e 100644 --- a/tools/tcgdisasm.py +++ b/tools/tcgdisasm.py @@ -763,16 +763,17 @@ class Disassembler(object): # handle the special flag macros found_flag_macro = False - for flag_macro in flag_macros: - if flag_macro[0] == target_offset: - found_flag_macro = True - current_flag_macro = flag_macro - event_flag = "EVENT_FLAG_" + format(opcode_arg_3, "02X") - opcode_output_str = flag_macro[1].format(event_flag) - - # we need to skip a byte since this macro takes one extra - opcode_nargs+=1 - break + if opcode_byte == 0xcd: + for flag_macro in flag_macros: + if flag_macro[0] == target_offset: + found_flag_macro = True + current_flag_macro = flag_macro + event_flag = "EVENT_FLAG_" + format(opcode_arg_3, "02X") + opcode_output_str = flag_macro[1].format(event_flag) + + # we need to skip a byte since this macro takes one extra + opcode_nargs+=1 + break if not found_flag_macro and opcode_byte in call_commands + absolute_jumps: |