diff options
-rwxr-xr-x | devtools/tasmrecover/tasm-recover | 3 | ||||
-rw-r--r-- | devtools/tasmrecover/tasm/cpp.py | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover index f0411fa3f9..431c4e7cb2 100755 --- a/devtools/tasmrecover/tasm-recover +++ b/devtools/tasmrecover/tasm-recover @@ -353,7 +353,8 @@ generator = cpp(context, "DreamGen", blacklist = [ 'inventory', 'mainscreen', 'doload', - ], skip_dispatch_call = True, header_omit_blacklisted = True, + ], skip_dispatch_call = True, skip_addr_constants = False, + header_omit_blacklisted = True, function_name_remapping = { # This remaps the function naming at output for readability 'bothchannels' : 'bothChannels', diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index 648b434075..44df0a381c 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -33,7 +33,7 @@ def parse_bin(s): return v class cpp: - def __init__(self, context, namespace, skip_first = 0, blacklist = [], skip_output = [], skip_dispatch_call = False, header_omit_blacklisted = False, function_name_remapping = { }): + def __init__(self, context, namespace, skip_first = 0, blacklist = [], skip_output = [], skip_dispatch_call = False, skip_addr_constants = False, header_omit_blacklisted = False, function_name_remapping = { }): self.namespace = namespace fname = namespace.lower() + ".cpp" header = namespace.lower() + ".h" @@ -81,6 +81,7 @@ class cpp: self.failed = list(blacklist) self.skip_output = skip_output self.skip_dispatch_call = skip_dispatch_call + self.skip_addr_constants = skip_addr_constants self.header_omit_blacklisted = header_omit_blacklisted self.function_name_remapping = function_name_remapping self.translated = [] @@ -631,8 +632,9 @@ public: """) - for name,addr in self.proc_addr: - self.hd.write("\tstatic const uint16 addr_%s = 0x%04x;\n" %(name, addr)) + if self.skip_addr_constants == False: + for name,addr in self.proc_addr: + self.hd.write("\tstatic const uint16 addr_%s = 0x%04x;\n" %(name, addr)) for name,addr in self.used_data_offsets: |