Logging to diagnose function_finder_psx

This commit is contained in:
Luciano Ciccariello 2023-09-11 13:42:02 +01:00
parent f91e4c4517
commit 3b97fc50c2
2 changed files with 9 additions and 0 deletions

View File

@ -3,6 +3,7 @@
# tool to list functions by difficulty and decomp.me WIP links
import argparse
from pathlib import Path
import sys
from tabulate import tabulate
import os
import concurrent.futures
@ -105,6 +106,8 @@ def find_wip(o):
name = o[0]
# look for a WIP on decomp.me
function_name = os.path.basename(name).split(".")[0]
print(f"scraping decompme for {function_name}", file=sys.stderr)
result = find_scratches(function_name, "ps1")
if result:
@ -114,9 +117,14 @@ def find_wip(o):
if __name__ == "__main__":
print("Start function_finder_psx", file=sys.stderr)
args = parser.parse_args()
asm_files = get_asm_files("asm/us")
print(f"Got {len(asm_files)} asm files", file=sys.stderr)
c_files = get_c_files("src")
print(f"Got {len(c_files)} asm files", file=sys.stderr)
# sort by name, then number of branches, then length
asm_files = sorted(asm_files, key=lambda x: (x["name"]))

View File

@ -19,6 +19,7 @@ def find_scratches(name, platform):
best_result = None
best_percent = 0
print(f"Got {len(scratches['results'])} results for {name} in {platform}")
for result in scratches["results"]:
if not "name" in result:
continue