aboutsummaryrefslogtreecommitdiff
path: root/devtools/tasmrecover/tasm/cpp.py
diff options
context:
space:
mode:
authorMax Horn2011-12-06 20:55:59 +0100
committerWillem Jan Palenstijn2011-12-07 10:32:22 +0100
commitdc34fc1dfb04c8ef3d0fb31ba7176b3234fd8680 (patch)
tree948d01194fbc0f231e2aaab4d2cf9776709681ec /devtools/tasmrecover/tasm/cpp.py
parentf9fddab379c3af1e255f0a64b05fac963ef0cf0a (diff)
downloadscummvm-rg350-dc34fc1dfb04c8ef3d0fb31ba7176b3234fd8680.tar.gz
scummvm-rg350-dc34fc1dfb04c8ef3d0fb31ba7176b3234fd8680.tar.bz2
scummvm-rg350-dc34fc1dfb04c8ef3d0fb31ba7176b3234fd8680.zip
DREAMWEB: Move generated constants out of class DreamGenContext
Diffstat (limited to 'devtools/tasmrecover/tasm/cpp.py')
-rw-r--r--devtools/tasmrecover/tasm/cpp.py41
1 files changed, 24 insertions, 17 deletions
diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py
index b545d99f9b..24d353561a 100644
--- a/devtools/tasmrecover/tasm/cpp.py
+++ b/devtools/tasmrecover/tasm/cpp.py
@@ -617,29 +617,16 @@ namespace %s {
namespace %s {
-class %sContext : public DreamBase, public Context {
-public:
- DreamGenContext() : DreamBase(), Context(_realData) {}
-
- void __start();
"""
-%(self.namespace, self.namespace))
- if self.skip_dispatch_call == False:
- self.hd.write(
-""" void __dispatch_call(uint16 addr);
-""")
- self.hd.write(
-"""#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
-
-""")
+%(self.namespace))
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))
+ self.hd.write("static const uint16 addr_%s = 0x%04x;\n" %(name, addr))
for name,addr in self.used_data_offsets:
- self.hd.write("\tstatic const uint16 offset_%s = 0x%04x;\n" %(name, addr))
+ self.hd.write("static const uint16 offset_%s = 0x%04x;\n" %(name, addr))
offsets = []
for k, v in self.context.get_globals().items():
@@ -650,8 +637,28 @@ public:
offsets = sorted(offsets, key=lambda t: t[1])
for o in offsets:
- self.hd.write("\tstatic const uint16 k%s = %s;\n" %o)
+ self.hd.write("static const uint16 k%s = %s;\n" %o)
self.hd.write("\n")
+
+ self.hd.write(
+"""
+class %sContext : public DreamBase, public Context {
+public:
+ DreamGenContext() : DreamBase(), Context(_realData) {}
+
+ void __start();
+"""
+%(self.namespace))
+ if self.skip_dispatch_call == False:
+ self.hd.write(
+""" void __dispatch_call(uint16 addr);
+""")
+ self.hd.write(
+"""#include "stubs.h" // Allow hand-reversed functions to have a signature different than void f()
+
+""")
+
+
for p in set(self.methods):
if p in self.blacklist:
if self.header_omit_blacklisted == False: