summaryrefslogtreecommitdiff
path: root/addr_to_sym.py
diff options
context:
space:
mode:
authorMegaMech <MegaMech@users.noreply.github.com>2023-03-28 16:40:03 -0600
committerGitHub <noreply@github.com>2023-03-28 16:40:03 -0600
commit8d118db0b25edfbabb059e4b977e339ca9d8f885 (patch)
tree6a30217aed7887e33a4253ddc88ce6fe0966020b /addr_to_sym.py
parent889520b045f70b073ec1616f8d27621af76c5178 (diff)
Labelling of some hard-coded addr to syms (#294)
* Updated final displaylist symbol * Cleaned up loader script * Random changes * Various naming and decomp
Diffstat (limited to 'addr_to_sym.py')
-rw-r--r--addr_to_sym.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/addr_to_sym.py b/addr_to_sym.py
new file mode 100644
index 000000000..eb3dd0d3c
--- /dev/null
+++ b/addr_to_sym.py
@@ -0,0 +1,20 @@
+import re
+
+# Define the regex query to match the hex values
+regex_query = r'0x07[0-9a-fA-F]{6}'
+
+# Define a function to process each match
+def process_match(match):
+ offset = int(match.group(0)[4:], 16)
+ return f"d_course_big_donut_packed_dl_{hex(offset)[2:].upper()}"
+
+# Open the input file
+with open("courses/battle/big_donut/packed.inc.c", "r") as f:
+ # Read the file contents
+ file_content = f.read()
+
+ # Use re.sub() to find and replace all matches in the file content
+ modified_content = re.sub(regex_query, process_match, file_content)
+
+ # Print the modified content to console
+ print(modified_content)