aboutsummaryrefslogtreecommitdiff
path: root/devtools/tasmrecover/tasm
diff options
context:
space:
mode:
authorVladimir2011-06-07 02:02:14 +0400
committerAlyssa Milburn2011-06-15 17:31:00 +0200
commitb76035db6696a0afb4cb0521c6c16a28878c3ff1 (patch)
tree42e2f4cb95bd738f669f483fb4356c328cc6a0c6 /devtools/tasmrecover/tasm
parent59b0c4b4b5992d6fe0bdc0b88849169d167b98fe (diff)
downloadscummvm-rg350-b76035db6696a0afb4cb0521c6c16a28878c3ff1.tar.gz
scummvm-rg350-b76035db6696a0afb4cb0521c6c16a28878c3ff1.tar.bz2
scummvm-rg350-b76035db6696a0afb4cb0521c6c16a28878c3ff1.zip
DREAMWEB: put data offsets, not labels into public
Diffstat (limited to 'devtools/tasmrecover/tasm')
-rw-r--r--devtools/tasmrecover/tasm/cpp.py10
-rw-r--r--devtools/tasmrecover/tasm/parser.py6
2 files changed, 11 insertions, 5 deletions
diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py
index fe7f3ff9d6..a8d225359b 100644
--- a/devtools/tasmrecover/tasm/cpp.py
+++ b/devtools/tasmrecover/tasm/cpp.py
@@ -523,8 +523,14 @@ namespace %s {
self.hd.write("\tvoid %s(Context &context);\n" %f)
offsets_decl = "\n"
- for k,v in self.context.get_offsets().items():
- offsets_decl += "\tconst static uint16 k%s = %d;\n" %(k.capitalize(), v[0])
+ offsets = []
+ for k, v in self.context.get_globals().items():
+ if isinstance(v, op.var):
+ offsets.append((k.capitalize(), v.offset))
+
+ offsets = sorted(offsets, key=lambda t: t[1])
+ for o in offsets:
+ offsets_decl += "\tconst static uint16 k%s = %d;\n" %o
offsets_decl += "\n"
self.hd.write(offsets_decl);
diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py
index 6342a17d84..3eb553fdd1 100644
--- a/devtools/tasmrecover/tasm/parser.py
+++ b/devtools/tasmrecover/tasm/parser.py
@@ -48,6 +48,9 @@ class parser:
name = name.lower()
return self.__globals[name]
+ def get_globals(self):
+ return self.__globals
+
def has_global(self, name):
name = name.lower()
return self.__globals.has_key(name)
@@ -65,9 +68,6 @@ class parser:
name = name.lower()
return self.__offsets[name]
- def get_offsets(self):
- return self.__offsets
-
def include(self, basedir, fname):
path = fname.split('\\')[self.strip_path:]
path = os.path.join(basedir, os.path.pathsep.join(path))