mirror of
https://github.com/open-goal/jak-project
synced 2026-08-10 03:06:18 -04:00
d/jak2: finish progress menu code and initialize the camera (#1945)
This PR does a few main things: - finish decompiling the progress related code - implemented changes necessary to load the text files end-to-end - japanese/korean character encodings were not added - finish more camera code, which is required to spawn the progress menu / init the default language settings needed for text - initialized the camera as well Still havn't opened the menu as there are a lot of checks around `*target*` which I havn't yet gone through and attempted to comment out.
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
import re
|
||||
from jak1_file_list import file_list
|
||||
import argparse
|
||||
import os
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--files")
|
||||
args = parser.parse_args()
|
||||
|
||||
files = args.files.split(",")
|
||||
|
||||
throw_error = False
|
||||
|
||||
method_split_pattern = re.compile('t9-\d+\s\(method-of-object')
|
||||
function_split_pattern = re.compile('\(t9-\d+\)')
|
||||
missing_res_tag_pattern = re.compile('(sv-\d{2,} int)')
|
||||
decompiler_error_pattern = re.compile(';; ERROR')
|
||||
missing_arg = re.compile('local-vars.*none\)')
|
||||
|
||||
for file in files:
|
||||
src_path = ""
|
||||
for f in file_list:
|
||||
if f[2] != 3:
|
||||
continue
|
||||
if f[0] == file:
|
||||
src_path = f[4]
|
||||
break
|
||||
|
||||
if not os.path.exists("./goal_src/{}".format(src_path)):
|
||||
print("{} couldn't find in /goal_src!".format(file))
|
||||
throw_error = True
|
||||
continue
|
||||
|
||||
file_path = "./goal_src/{}/{}.gc".format(src_path, file)
|
||||
with open(file_path) as f:
|
||||
for lineno, line in enumerate(f):
|
||||
method_split_match = method_split_pattern.search(line)
|
||||
if method_split_match:
|
||||
print("method_split - {}:{}".format(file_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
function_split_match = function_split_pattern.search(line)
|
||||
if function_split_match:
|
||||
print("function_split - {}:{}".format(file_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
missing_res_tag_match = missing_res_tag_pattern.search(line)
|
||||
if missing_res_tag_match:
|
||||
print("missing_res_tag - {}:{}".format(file_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
decompiler_error_match = decompiler_error_pattern.search(line)
|
||||
if decompiler_error_match:
|
||||
print("decompiler_error - {}:{}".format(file_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
missing_arg_match = missing_arg.search(line)
|
||||
if missing_arg_match:
|
||||
print("missing_arg - {}:{}".format(file_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
|
||||
if throw_error:
|
||||
print("found potential problems!")
|
||||
exit(1)
|
||||
else:
|
||||
print("looks good!")
|
||||
@@ -0,0 +1,62 @@
|
||||
import re
|
||||
import argparse
|
||||
import os
|
||||
from utils import get_gsrc_path_from_filename
|
||||
|
||||
parser = argparse.ArgumentParser("lint-gsrc-file")
|
||||
parser.add_argument("--game", help="The name of the game", type=str)
|
||||
parser.add_argument("--file", help="The name of the file", type=str)
|
||||
args = parser.parse_args()
|
||||
|
||||
throw_error = False
|
||||
|
||||
# TODO - if more code is added here overtime, be smarter about this / group errors
|
||||
method_split_pattern = re.compile('method-of-type')
|
||||
function_split_pattern = re.compile('\(t9-\d+(?:\s+[^\s]+\s*)?\)')
|
||||
missing_res_tag_pattern = re.compile('.pcpyud')
|
||||
decompiler_error_pattern = re.compile(';; ERROR')
|
||||
missing_arg = re.compile('local-vars.*[at].*\s+none\)')
|
||||
casting_stack_var = re.compile('the-as\s+[^\s]*\s+.*\(new \'stack')
|
||||
|
||||
src_path = get_gsrc_path_from_filename(args.game, args.file)
|
||||
|
||||
print("Linting GOAL_SRC File...")
|
||||
|
||||
with open(src_path) as f:
|
||||
for lineno, line in enumerate(f):
|
||||
method_split_match = method_split_pattern.search(line)
|
||||
if method_split_match:
|
||||
print("method_split - {}:{}".format(src_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
function_split_match = function_split_pattern.search(line)
|
||||
if function_split_match:
|
||||
print("function_split - {}:{}".format(src_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
missing_res_tag_match = missing_res_tag_pattern.search(line)
|
||||
if missing_res_tag_match:
|
||||
print("missing_res_tag - {}:{}".format(src_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
decompiler_error_match = decompiler_error_pattern.search(line)
|
||||
if decompiler_error_match:
|
||||
print("decompiler_error - {}:{}".format(src_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
missing_arg_match = missing_arg.search(line)
|
||||
if missing_arg_match:
|
||||
print("missing_arg - {}:{}".format(src_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
casting_stack_var_match = casting_stack_var.search(line)
|
||||
if casting_stack_var_match:
|
||||
print("casting stack var - {}:{}".format(src_path, lineno + 1))
|
||||
throw_error = True
|
||||
continue
|
||||
|
||||
if throw_error:
|
||||
print("Found potential problems, exiting with code 1!")
|
||||
exit(1)
|
||||
else:
|
||||
print("Looks good!")
|
||||
@@ -93,7 +93,8 @@ lines_to_ignore = [
|
||||
";; failed to figure",
|
||||
";; Used lq/sq",
|
||||
";; this part is debug only",
|
||||
";; WARN: Return type mismatch int vs none"
|
||||
";; WARN: Return type mismatch int vs none",
|
||||
";; WARN: Stack slot offset"
|
||||
]
|
||||
|
||||
if decomp_ignore_errors:
|
||||
|
||||
Reference in New Issue
Block a user