fix independent references to T6K11 registers not cumulating

This commit is contained in:
Lephenixnoir 2022-02-04 18:41:29 +01:00
parent 3680b56765
commit 86d8f7ec95
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
1 changed files with 7 additions and 3 deletions

View File

@ -223,18 +223,22 @@ def main(g1a_input, g1a_output):
t6k11_addr2 = make_pattern("b4010000")
refs2 = search_pattern(t6k11_addr2, data, 0, len(data), alignment=4)
fun_occ = []
if len(refs1) == 0:
print(f"no reference to T6K11 address {t6k11_addr1} found")
return 1
for offset, _ in refs1:
print(f"T6K11 reference address {t6k11_addr1} found at 0x{offset:08x}")
fun_occ = pcrel_find(offset, data, 0, len(data))
local_fun_occ = pcrel_find(offset, data, 0, len(data))
if len(fun_occ) == 0:
if len(local_fun_occ) == 0:
print(" Never loaded")
for (pc, n) in fun_occ:
for (pc, n) in local_fun_occ:
print(f" 0x{pc:08x}: Load into r{n}")
fun_occ += local_fun_occ
print()
# Find function boundaries around, assuming rts marks the end of a function