mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-26 17:36:12 -05:00
Print recompiled address when using --verbose
This commit is contained in:
parent
89f66e4e0e
commit
b1a2aeaed6
1 changed files with 8 additions and 7 deletions
|
@ -463,11 +463,12 @@ def can_resolve_register_differences(original_asm, new_asm):
|
||||||
else:
|
else:
|
||||||
percenttext += colorama.Fore.RED + "*" + colorama.Style.RESET_ALL
|
percenttext += colorama.Fore.RED + "*" + colorama.Style.RESET_ALL
|
||||||
|
|
||||||
if not verbose:
|
|
||||||
if args.print_rec_addr:
|
if args.print_rec_addr:
|
||||||
addrs = '%s / %s' % (hex(addr), hex(recinfo.addr))
|
addrs = '%s / %s' % (hex(addr), hex(recinfo.addr))
|
||||||
else:
|
else:
|
||||||
addrs = hex(addr)
|
addrs = hex(addr)
|
||||||
|
|
||||||
|
if not verbose:
|
||||||
print(' %s (%s) is %s similar to the original' % (recinfo.name, addrs, percenttext))
|
print(' %s (%s) is %s similar to the original' % (recinfo.name, addrs, percenttext))
|
||||||
|
|
||||||
function_count += 1
|
function_count += 1
|
||||||
|
@ -477,16 +478,16 @@ def can_resolve_register_differences(original_asm, new_asm):
|
||||||
if recinfo.size:
|
if recinfo.size:
|
||||||
udiff = difflib.unified_diff(origasm, recompasm, n=10)
|
udiff = difflib.unified_diff(origasm, recompasm, n=10)
|
||||||
|
|
||||||
# If verbose, print the diff for that funciton to the output
|
# If verbose, print the diff for that function to the output
|
||||||
if verbose:
|
if verbose:
|
||||||
if effective_ratio == 1.0:
|
if effective_ratio == 1.0:
|
||||||
ok_text = "OK!" if plain else (colorama.Fore.GREEN + "✨ OK! ✨" + colorama.Style.RESET_ALL)
|
ok_text = "OK!" if plain else (colorama.Fore.GREEN + "✨ OK! ✨" + colorama.Style.RESET_ALL)
|
||||||
if ratio == 1.0:
|
if ratio == 1.0:
|
||||||
print("%s: %s 100%% match.\n\n%s\n\n" %
|
print("%s: %s 100%% match.\n\n%s\n\n" %
|
||||||
(hex(addr), recinfo.name, ok_text))
|
(addrs, recinfo.name, ok_text))
|
||||||
else:
|
else:
|
||||||
print("%s: %s Effective 100%% match. (Differs in register allocation only)\n\n%s (still differs in register allocation)\n\n" %
|
print("%s: %s Effective 100%% match. (Differs in register allocation only)\n\n%s (still differs in register allocation)\n\n" %
|
||||||
(hex(addr), recinfo.name, ok_text))
|
(addrs, recinfo.name, ok_text))
|
||||||
else:
|
else:
|
||||||
for line in udiff:
|
for line in udiff:
|
||||||
if line.startswith("++") or line.startswith("@@") or line.startswith("--"):
|
if line.startswith("++") or line.startswith("@@") or line.startswith("--"):
|
||||||
|
|
Loading…
Reference in a new issue