diff options
author | Vladimir Menshakov | 2011-06-10 00:58:13 +0400 |
---|---|---|
committer | Alyssa Milburn | 2011-06-15 17:33:49 +0200 |
commit | 2f9e63579d22ff1075620ef16b3c04e829dc73f4 (patch) | |
tree | 1426f25a04cf0fb38fe3c36fc99c7e5d639e7df3 /devtools/tasmrecover | |
parent | 90440a2b6890d65ce05ed93b5f83f3b4b20e070a (diff) | |
download | scummvm-rg350-2f9e63579d22ff1075620ef16b3c04e829dc73f4.tar.gz scummvm-rg350-2f9e63579d22ff1075620ef16b3c04e829dc73f4.tar.bz2 scummvm-rg350-2f9e63579d22ff1075620ef16b3c04e829dc73f4.zip |
DREAMWEB: fixed missing explicit segment specification. added verbose data dump to the generator
Diffstat (limited to 'devtools/tasmrecover')
-rw-r--r-- | devtools/tasmrecover/tasm/cpp.py | 10 | ||||
-rw-r--r-- | devtools/tasmrecover/tasm/parser.py | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/devtools/tasmrecover/tasm/cpp.py b/devtools/tasmrecover/tasm/cpp.py index f5f7057211..831074976d 100644 --- a/devtools/tasmrecover/tasm/cpp.py +++ b/devtools/tasmrecover/tasm/cpp.py @@ -146,9 +146,11 @@ namespace %s { m = re.match(r'(\w{2,2}):(.*)$', expr) if m is not None: - seg = m.group(1) + seg_prefix = m.group(1) expr = m.group(2).strip() - print "SEGMENT %s, remains: %s" %(seg, expr) + print "SEGMENT %s, remains: %s" %(seg_prefix, expr) + else: + seg_prefix = "ds" m = re.match(r'(([abcd][xhl])|si|di|bp|sp)([\+-].*)?$', expr) if m is not None: @@ -174,9 +176,9 @@ namespace %s { if indirection == 1: if size == 1: - expr = "context.ds.byte(%s)" %expr + expr = "context.%s.byte(%s)" %(seg_prefix, expr) elif size == 2: - expr = "context.ds.word(%s)" %expr + expr = "context.%s.word(%s)" %(seg_prefix, expr) else: expr = "@invalid size 0" elif indirection == 0: diff --git a/devtools/tasmrecover/tasm/parser.py b/devtools/tasmrecover/tasm/parser.py index 2391aa442b..b1d7995597 100644 --- a/devtools/tasmrecover/tasm/parser.py +++ b/devtools/tasmrecover/tasm/parser.py @@ -101,6 +101,7 @@ class parser: return text def fix_dollar(self, v): + print("$ = %d" %len(self.binary_data)) return re.sub(r'\$', "%d" %len(self.binary_data), v) def parse_int(self, v): @@ -198,6 +199,7 @@ class parser: if cmd0 == 'db' or cmd0 == 'dw' or cmd0 == 'dd': arg = " ".join(cmd[1:]) + print "%d: %s" %(len(self.binary_data), line) #fixme: COPYPASTE binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd0[1]] self.binary_data += self.compact_data(binary_width, lex.parse_args(arg)) continue @@ -221,6 +223,7 @@ class parser: v = cmd[2] self.set_global(cmd0, op.const(self.fix_dollar(v))) elif cmd1 == 'db' or cmd1 == 'dw' or cmd1 == 'dd': + print "%d: %s" %(len(self.binary_data), line) binary_width = {'b': 1, 'w': 2, 'd': 4}[cmd1[1]] offset = len(self.binary_data) self.binary_data += self.compact_data(binary_width, lex.parse_args(" ".join(cmd[2:]))) |