From f01ad092a54893344157ad6d275febaa7d8d124c Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 01:33:46 -0600 Subject: TX_RAM for text engine command $1 in pretty_text hg-commit-id: e4f95976fef8 --- extras/analyze_texts.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index 36d80413..780bc08e 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -385,7 +385,7 @@ def find_missing_08s(all_texts): def text_pretty_printer_at(start_address, label="SomeLabel"): commands = parse_text_script(start_address, None, None) - needs_to_begin_with_0 = False + needs_to_begin_with_0 = True #how should this be determined? wanted_command = None if needs_to_begin_with_0: @@ -403,11 +403,28 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): first_line = True for this_command in commands.keys(): - if not "lines" in commands[this_command].keys(): continue + if not "lines" in commands[this_command].keys(): + command = commands[this_command] + if command["type"] == 0x1: + if first_line: + output = "\n" + output += label + ": ; " + hex(start_address) + "\n" + first_line = False + p1 = command["pointer"][0] + p2 = command["pointer"][1] + + #remember to account for big endian -> little endian + output += spacing + "TX_RAM $" + hex(p2)[2:] + hex(p1)[2:] + "\n" + + byte_count += 3 + + #everything else is for $0s, really + continue lines = commands[this_command]["lines"] #add the ending byte to the last line- always seems $57 - lines[len(lines.keys())-1].append(commands[1]["type"]) + #this should already be in there, but it's not because of a bug in the text parser + lines[len(lines.keys())-1].append(commands[len(commands.keys())-1]["type"]) if first_line: output = "\n" -- cgit v1.3.1-sl0p From 42fa336ec607bff085b22a3a753e6e2c6f436571 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 03:11:11 -0600 Subject: analyze_texts - find possible TX_FARs hg-commit-id: 3b5f657bd072 --- extras/analyze_texts.py | 97 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 75 insertions(+), 22 deletions(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index 780bc08e..4fcba162 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -387,16 +387,16 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): commands = parse_text_script(start_address, None, None) needs_to_begin_with_0 = True #how should this be determined? - wanted_command = None - if needs_to_begin_with_0: - wanted_command = None - for command_id in commands: - command = commands[command_id] - if command["type"] == 0: - wanted_command = command_id - - if wanted_command == None: - raise "error: address did not start with a $0 text" + #wanted_command = None + #if needs_to_begin_with_0: + # wanted_command = None + # for command_id in commands: + # command = commands[command_id] + # if command["type"] == 0: + # wanted_command = command_id + # + # if wanted_command == None: + # raise "error: address did not start with a $0 text" #start with zero please byte_count = 0 @@ -405,6 +405,10 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): for this_command in commands.keys(): if not "lines" in commands[this_command].keys(): command = commands[this_command] + if not "type" in command.keys(): + output = "ERROR in command: " + str(command) + continue #dunno what to do here? + if command["type"] == 0x1: if first_line: output = "\n" @@ -486,7 +490,7 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): output += "\n" #output += "\n" - output += "; " + hex(start_address + byte_count) + output += "; " + hex(start_address + byte_count + 1) print output return (output, byte_count) @@ -532,27 +536,76 @@ def find_undone_texts(): for result in sorted_results: print str(result[1]) + " times: " + hex(result[0]) +def scan_rom_for_tx_fars(): + """find TX_FARs + search only addresses that are INCBINed + keep only TX_FARs that are valid""" + rom = extract_maps.rom + + analyze_incbins.load_asm() + analyze_incbins.isolate_incbins() + analyze_incbins.process_incbins() + + possible_tx_fars = [] + possible_tx_far_targets = [] + + for incbin_line_number in analyze_incbins.processed_incbins.keys(): + incbin = analyze_incbins.processed_incbins[incbin_line_number] + start_address = incbin["start"] + end_address = incbin["end"] + + subrom = rom[start_address:end_address] + for address in range(start_address, end_address): + current_byte = ord(rom[address]) + if current_byte == 0x17: + if ord(rom[address+4]) == 0x50: + byte1 = ord(rom[address+1]) + byte2 = ord(rom[address+2]) + address2 = byte1 + (byte2 << 8) + if address2 > 0x3fff: + address2 = extract_maps.calculate_pointer(address2, ord(rom[address+3])) + #print "possible TX_FAR at " + hex(address) + " to " + hex(address2) + possible_tx_fars.append(address) + possible_tx_far_targets.append([address2, address]) + + pre_handled = [] + for address_bundle in possible_tx_far_targets: + if address_bundle[0] in [0xa82f8, 0xa8315]: + continue #bad + if address_bundle[0] in pre_handled: + continue #already did this + + print "-------" + print "TX_FAR is at: " + hex(address_bundle[1]) + text_pretty_printer_at(address_bundle[0], "blah") + print "-------" + pre_handled.append(address_bundle[0]) + if __name__ == "__main__": extract_maps.load_rom() extract_maps.load_map_pointers() extract_maps.read_all_map_headers() - text_output = analyze_texts() + #text_output = analyze_texts() #print text_output - missing_08s = find_missing_08s(text_output) + #these aren't really "missing", just a certain type that was + #known to be missed on a first pass. + #missing_08s = find_missing_08s(text_output) - print "\n\n---- stats ----\n\n" + #print "\n\n---- stats ----\n\n" - popular_text_commands = sorted(totals.iteritems(), key=itemgetter(1), reverse=True) + #popular_text_commands = sorted(totals.iteritems(), key=itemgetter(1), reverse=True) #convert the first values (command byte) to hex - for popular_item in popular_text_commands: - print hex(popular_item[0]) + " was used " + str(popular_item[1]) + " times." + #for popular_item in popular_text_commands: + # print hex(popular_item[0]) + " was used " + str(popular_item[1]) + " times." #print "popular text commands: " + str(popular_text_commands) - print "total text commands: " + str(total_text_commands) - print "total text scripts: " + str(should_be_total) - print "missing 08s: " + str(missing_08s) - print "\n\n" + #print "total text commands: " + str(total_text_commands) + #print "total text scripts: " + str(should_be_total) + #print "missing 08s: " + str(missing_08s) + #print "\n\n" #text_pretty_printer_at(0x800b1) - find_undone_texts() + #find_undone_texts() + + scan_rom_for_tx_fars() -- cgit v1.3.1-sl0p From fe40cc4c7462bd5b528ad30c1d04f4d2702fd787 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 11:02:52 -0600 Subject: improve text printer, including TX_RAM and TX_NUM hg-commit-id: 6ee4e09c729c --- extras/analyze_texts.py | 117 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 93 insertions(+), 24 deletions(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index 4fcba162..fe46067d 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -226,7 +226,7 @@ def parse_text_script(text_pointer, text_id, map_id, txfar=False): "read_byte": read_byte, #split this up when we make a macro for this } - offset += 4 + 1 + offset += 4 elif command_byte == 0xB: #0B = sound_86 (Hiro obtains ITEM)[same as 0F] command = {"type": command_byte, "start_address": offset, "end_address": offset} @@ -401,30 +401,82 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): #start with zero please byte_count = 0 + had_text_end_byte = False + had_text_end_byte_57_58 = False + had_db_last = False first_line = True for this_command in commands.keys(): if not "lines" in commands[this_command].keys(): command = commands[this_command] if not "type" in command.keys(): - output = "ERROR in command: " + str(command) + print "ERROR in command: " + str(command) continue #dunno what to do here? - if command["type"] == 0x1: + if command["type"] == 0x1: #TX_RAM if first_line: output = "\n" - output += label + ": ; " + hex(start_address) + "\n" + output += label + ": ; " + hex(start_address) first_line = False p1 = command["pointer"][0] p2 = command["pointer"][1] #remember to account for big endian -> little endian - output += spacing + "TX_RAM $" + hex(p2)[2:] + hex(p1)[2:] + "\n" - + output += "\n" + spacing + "TX_RAM $" + hex(p2)[2:] + hex(p1)[2:] byte_count += 3 - + had_db_last = False + elif command["type"] == 0x17: #TX_FAR + if first_line: + output = "\n" + output += label + ": ; " + hex(start_address) + first_line = False + #p1 = command["pointer"][0] + #p2 = command["pointer"][1] + output += "\n" + spacing + "TX_FAR _" + label + byte_count += 4 #$17, bank, address word + had_db_last = False + elif command["type"] == 0x9: #TX_RAM_HEX2DEC + if first_line: + output = "\n" + label + ": ; " + hex(start_address) + first_line = False + #address, read_byte + output += "\n" + spacing + "TX_NUM $%.2x%.2x, $%.2x" % (command["address"][1], command["address"][0], command["read_byte"]) + had_db_last = False + byte_count += 4 + elif command["type"] == 0x50 and not had_text_end_byte: + #had_text_end_byte helps us avoid repeating $50s + if first_line: + output = "\n" + label + ": ; " + hex(start_address) + first_line = False + if had_db_last: + output += ", $50" + else: + output += "\n" + spacing + "db $50" + byte_count += 1 + had_db_last = True + elif command["type"] in [0x57, 0x58] and not had_text_end_byte_57_58: + if first_line: #shouldn't happen, really + output = "\n" + label + ": ; " + hex(start_address) + first_line = False + if had_db_last: + output += ", $%.2x" % (command["type"]) + else: + output += "\n" + spacing + "db $%.2x" % (command["type"]) + byte_count += 1 + had_db_last = True + elif command["type"] in [0x57, 0x58] and had_text_end_byte_57_58: + pass #this is ok + elif command["type"] == 0x50 and had_text_end_byte: + pass #this is also ok + else: + print "ERROR in command: " + hex(command["type"]) + had_db_last = False + #everything else is for $0s, really continue lines = commands[this_command]["lines"] + + #reset this in case we have non-$0s later + had_db_last = False #add the ending byte to the last line- always seems $57 #this should already be in there, but it's not because of a bug in the text parser @@ -434,6 +486,8 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): output = "\n" output += label + ": ; " + hex(start_address) + "\n" first_line = False + else: + output += "\n" first = True #first byte for line_id in lines: @@ -447,6 +501,11 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): first_byte = True was_byte = False for byte in line: + if byte == 0x50: + had_text_end_byte = True #don't repeat it + if byte in [0x58, 0x57]: + had_text_end_byte_57_58 = True + if byte in txt_bytes: if not quotes_open and not first_byte: #start text output += ", \"" @@ -488,9 +547,10 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): quotes_open = False output += "\n" - - #output += "\n" - output += "; " + hex(start_address + byte_count + 1) + include_newline = "\n" + if output[-1] == "\n": + include_newline = "" + output += include_newline + "; " + hex(start_address + byte_count + 1) print output return (output, byte_count) @@ -536,10 +596,12 @@ def find_undone_texts(): for result in sorted_results: print str(result[1]) + " times: " + hex(result[0]) -def scan_rom_for_tx_fars(): +def scan_rom_for_tx_fars(printer=True): """find TX_FARs search only addresses that are INCBINed - keep only TX_FARs that are valid""" + keep only TX_FARs that are valid + + returns a list of [TX_FAR target address, TX_FAR address]""" rom = extract_maps.rom analyze_incbins.load_asm() @@ -568,18 +630,25 @@ def scan_rom_for_tx_fars(): possible_tx_fars.append(address) possible_tx_far_targets.append([address2, address]) - pre_handled = [] - for address_bundle in possible_tx_far_targets: - if address_bundle[0] in [0xa82f8, 0xa8315]: - continue #bad - if address_bundle[0] in pre_handled: - continue #already did this - - print "-------" - print "TX_FAR is at: " + hex(address_bundle[1]) - text_pretty_printer_at(address_bundle[0], "blah") - print "-------" - pre_handled.append(address_bundle[0]) + if printer: + pre_handled = [] + #address_bundle is [TX_FAR target address, TX_FAR address] + for address_bundle in possible_tx_far_targets: + if address_bundle[0] in [0xa82f8, 0xa8315]: + continue #bad + if address_bundle[0] in pre_handled: + continue #already did this + + print "-------" + print "TX_FAR is at: " + hex(address_bundle[1]) + + #let's try printing out the TX_FAR? + text_pretty_printer_at(address_bundle[1], "blah") + + text_pretty_printer_at(address_bundle[0], "_blah") + print "-------" + pre_handled.append(address_bundle[0]) + return possible_tx_far_targets if __name__ == "__main__": extract_maps.load_rom() -- cgit v1.3.1-sl0p From e5f9d4a1444d7a5dcb755ab1304b9be3ee4db6ed Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 13:34:51 -0600 Subject: text insertion code for unnamed TX_FARs These TX_FARs are found in ASM inside INCBIN intervals, and as a consequence do not have good names. Someone will have to review the naming. Note that these texts may or may not be referenced in scripts that will eventually be imported. Some of these are raw texts that could be completely unreferenced, but so far that doesn't look like the case. hg-commit-id: 47239e73071a --- extras/analyze_incbins.py | 1 + extras/analyze_texts.py | 1 + extras/insert_texts.py | 37 +++++++++++++++++++++++++++++-------- 3 files changed, 31 insertions(+), 8 deletions(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_incbins.py b/extras/analyze_incbins.py index 353e5ea6..cc8d9810 100644 --- a/extras/analyze_incbins.py +++ b/extras/analyze_incbins.py @@ -236,6 +236,7 @@ def apply_diff(diff, try_fixing=True): #confirm it's working try: subprocess.check_call("cd ../; make clean; LC_CTYPE=UTF-8 make", shell=True) + return True except Exception, exc: if try_fixing: os.system("mv ../common1.asm ../common.asm") diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index fe46067d..3e288dd0 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -627,6 +627,7 @@ def scan_rom_for_tx_fars(printer=True): if address2 > 0x3fff: address2 = extract_maps.calculate_pointer(address2, ord(rom[address+3])) #print "possible TX_FAR at " + hex(address) + " to " + hex(address2) + possible_tx_fars.append(address) possible_tx_far_targets.append([address2, address]) diff --git a/extras/insert_texts.py b/extras/insert_texts.py index 7a61e854..dc7f872c 100644 --- a/extras/insert_texts.py +++ b/extras/insert_texts.py @@ -1,9 +1,9 @@ #!/usr/bin/python2.7 #author: Bryan Bishop -#date: 2012-01-07 +#date: 2012-01-07, 2012-01-17 #insert TX_FAR targets into pokered.asm import extract_maps -from analyze_texts import analyze_texts, text_pretty_printer_at +from analyze_texts import analyze_texts, text_pretty_printer_at, scan_rom_for_tx_fars from pretty_map_headers import map_name_cleaner, make_text_label, map_constants, find_all_tx_fars, tx_far_pretty_printer, tx_far_label_maker import pretty_map_headers from analyze_incbins import asm, offset_to_pointer, find_incbin_to_replace_for, split_incbin_line_into_three, generate_diff_insert, load_asm, isolate_incbins, process_incbins, reset_incbins, apply_diff @@ -396,7 +396,7 @@ def insert_asm(start_address, label, text_asm=None, end_address=None): result = apply_diff(diff, try_fixing=True) return True -def insert_text(address, label): +def insert_text(address, label, apply=False): "inserts a text script (but not $8s)" start_address = address @@ -427,7 +427,10 @@ def insert_text(address, label): diff = generate_diff_insert(line_number, newlines) print diff - #apply_diff(diff) + if apply: + return apply_diff(diff) + else: #simulate a successful insertion + return True #move this into another file? def scan_for_map_scripts_pointer(): @@ -586,6 +589,23 @@ def scan_for_map_scripts_pointer(): print script_asm sys.exit(0) +def scan_rom_for_tx_fars_and_insert(): + """calls analyze_texts.scan_rom_for_tx_fars() + looks through INCBIN'd addresses from common.asm, + finds TX_FARs that aren't included yet. + """ + address_bundles = scan_rom_for_tx_fars(printer=True) + for address_bundle in address_bundles: + tx_far_address = address_bundle[1] + tx_far_target_address = address_bundle[0] + + tx_far_label = "UnnamedText_%.2x" % (tx_far_address) + tx_far_target_label = "_" + tx_far_label + + result = insert_text(tx_far_target_address, tx_far_target_label, apply=True) + if result: + result2 = insert_text(tx_far_address, tx_far_label, apply=True) + if __name__ == "__main__": #load map headers and object data extract_maps.load_rom() @@ -593,15 +613,16 @@ if __name__ == "__main__": extract_maps.read_all_map_headers() #load texts (these two have different formats) - all_texts = pretty_map_headers.analyze_texts.analyze_texts() - pretty_map_headers.all_texts = all_texts - tx_fars = pretty_map_headers.find_all_tx_fars() + #all_texts = pretty_map_headers.analyze_texts.analyze_texts() + #pretty_map_headers.all_texts = all_texts + #tx_fars = pretty_map_headers.find_all_tx_fars() #load incbins reset_incbins() #scan_for_map_scripts_pointer() - insert_text(0xa586b, "_VermilionCityText14") + scan_rom_for_tx_fars_and_insert() + #insert_text(0xa586b, "_VermilionCityText14") #insert _ViridianCityText10 #insert_tx_far(1, 10) -- cgit v1.3.1-sl0p From be34aed58e24303a9d8dee6cf36009cbc2653568 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 14:54:06 -0600 Subject: fix some offset errors in insert_texts.py hg-commit-id: b131d049ecd3 --- extras/analyze_incbins.py | 2 +- extras/analyze_texts.py | 3 ++- extras/insert_texts.py | 22 ++++++++++++++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_incbins.py b/extras/analyze_incbins.py index cc8d9810..9cdc2083 100644 --- a/extras/analyze_incbins.py +++ b/extras/analyze_incbins.py @@ -235,7 +235,7 @@ def apply_diff(diff, try_fixing=True): #confirm it's working try: - subprocess.check_call("cd ../; make clean; LC_CTYPE=UTF-8 make", shell=True) + subprocess.check_call("cd ../; make clean; LC_CTYPE=C make", shell=True) return True except Exception, exc: if try_fixing: diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index 3e288dd0..b843581e 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -496,6 +496,7 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): if first and needs_to_begin_with_0: output += "$0, " first = False + byte_count += 1 quotes_open = False first_byte = True @@ -550,7 +551,7 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): include_newline = "\n" if output[-1] == "\n": include_newline = "" - output += include_newline + "; " + hex(start_address + byte_count + 1) + output += include_newline + "; " + hex(start_address) + " + " + str(byte_count) + " bytes" print output return (output, byte_count) diff --git a/extras/insert_texts.py b/extras/insert_texts.py index dc7f872c..8438127e 100644 --- a/extras/insert_texts.py +++ b/extras/insert_texts.py @@ -15,6 +15,19 @@ spacing = " " tx_fars = None failed_attempts = {} +def local_reset_incbins(): + asm = None + incbin_lines = [] + processed_incbins = {} + analyze_incbins.asm = None + analyze_incbins.incbin_lines = [] + analyze_incbins.processed_incbins = {} + + #reload + load_asm() + isolate_incbins() + process_incbins() + def find_tx_far_entry(map_id, text_id): for tx_far_line in tx_fars: if tx_far_line[0] == map_id and tx_far_line[1] == text_id: @@ -396,7 +409,7 @@ def insert_asm(start_address, label, text_asm=None, end_address=None): result = apply_diff(diff, try_fixing=True) return True -def insert_text(address, label, apply=False): +def insert_text(address, label, apply=False, try_fixing=True): "inserts a text script (but not $8s)" start_address = address @@ -428,7 +441,7 @@ def insert_text(address, label, apply=False): diff = generate_diff_insert(line_number, newlines) print diff if apply: - return apply_diff(diff) + return apply_diff(diff, try_fixing=try_fixing) else: #simulate a successful insertion return True @@ -594,6 +607,7 @@ def scan_rom_for_tx_fars_and_insert(): looks through INCBIN'd addresses from common.asm, finds TX_FARs that aren't included yet. """ + x = 0 address_bundles = scan_rom_for_tx_fars(printer=True) for address_bundle in address_bundles: tx_far_address = address_bundle[1] @@ -603,8 +617,12 @@ def scan_rom_for_tx_fars_and_insert(): tx_far_target_label = "_" + tx_far_label result = insert_text(tx_far_target_address, tx_far_target_label, apply=True) + local_reset_incbins() if result: result2 = insert_text(tx_far_address, tx_far_label, apply=True) + if not result or not result2: + sys.exit(0) + local_reset_incbins() if __name__ == "__main__": #load map headers and object data -- cgit v1.3.1-sl0p From ffdd92db777e410a0c365f7b301f0a5a5bdc56ca Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 15:39:36 -0600 Subject: skip some incbins from analyze_texts for 0-size intervals hg-commit-id: a63d92b4534c --- extras/analyze_texts.py | 1 + extras/insert_texts.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index b843581e..fbf320fc 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -616,6 +616,7 @@ def scan_rom_for_tx_fars(printer=True): incbin = analyze_incbins.processed_incbins[incbin_line_number] start_address = incbin["start"] end_address = incbin["end"] + if incbin["interval"] == 0: continue #skip this one subrom = rom[start_address:end_address] for address in range(start_address, end_address): diff --git a/extras/insert_texts.py b/extras/insert_texts.py index 53ff4841..d358db97 100644 --- a/extras/insert_texts.py +++ b/extras/insert_texts.py @@ -418,6 +418,12 @@ def insert_text(address, label, apply=False, try_fixing=True): print "skipping text at " + hex(start_address) + " with address " + label return "skip" + #another reason to skip is if the interval is 0 + processed_incbin = analyze_incbins.processed_incbins[line_number] + if processed_incbin["interval"] == 0: + print "skipping text at " + hex(start_address) + " with address " + label + " because the interval is 0" + return "skip" + text_asm, byte_count = text_pretty_printer_at(start_address, label) end_address = start_address + byte_count newlines = split_incbin_line_into_three(line_number, start_address, byte_count) @@ -612,7 +618,7 @@ def scan_rom_for_tx_fars_and_insert(): for address_bundle in address_bundles: tx_far_address = address_bundle[1] tx_far_target_address = address_bundle[0] - if tx_far_address < 0x6150f: continue + #if tx_far_address < 0x7627b: continue #because it stopped a few times for errors tx_far_label = "UnnamedText_%.2x" % (tx_far_address) tx_far_target_label = "_" + tx_far_label -- cgit v1.3.1-sl0p From b48dfcd123921fbd047a5af274eeba15a8bbbd2b Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Tue, 17 Jan 2012 16:16:27 -0600 Subject: fix TX_RAM injector for addresses between $a-$f inclusive hg-commit-id: 82f2343a6d11 --- extras/analyze_texts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'extras/analyze_texts.py') diff --git a/extras/analyze_texts.py b/extras/analyze_texts.py index fbf320fc..30a6b5dc 100644 --- a/extras/analyze_texts.py +++ b/extras/analyze_texts.py @@ -421,7 +421,7 @@ def text_pretty_printer_at(start_address, label="SomeLabel"): p2 = command["pointer"][1] #remember to account for big endian -> little endian - output += "\n" + spacing + "TX_RAM $" + hex(p2)[2:] + hex(p1)[2:] + output += "\n" + spacing + "TX_RAM $%.2x%.2x" %(p2, p1) byte_count += 3 had_db_last = False elif command["type"] == 0x17: #TX_FAR -- cgit v1.3.1-sl0p