update python implementation to support image changes

FossilOrigin-Name: bd8f98ee3677556c37efd199bed4d188f64b2c2119761a5351dc5c4778ac480d
This commit is contained in:
crc 2021-10-08 09:47:26 +00:00
parent 5cd2fae3b3
commit 3f063a7a05

8
vm/nga-python/retro.py Normal file → Executable file
View file

@ -149,7 +149,7 @@ class Retro:
Dictionary = dict() Dictionary = dict()
header = self.memory[2] header = self.memory[2]
while header != 0: while header != 0:
named = self.extract_string(header + 3) named = self.extract_string(header + 4)
if not named in Dictionary: if not named in Dictionary:
Dictionary[named] = header Dictionary[named] = header
header = self.memory[header] header = self.memory[header]
@ -162,7 +162,7 @@ class Retro:
header = self.memory[2] header = self.memory[2]
Done = False Done = False
while header != 0 and not Done: while header != 0 and not Done:
if named == self.extract_string(header + 3): if named == self.extract_string(header + 4):
self.Dictionary[named] = header self.Dictionary[named] = header
Done = True Done = True
else: else:
@ -679,7 +679,7 @@ class Retro:
else: else:
for token in line.split(): for token in line.split():
self.inject_string(token, self.memory[7]) self.inject_string(token, self.memory[7])
self.stack.push(1024) self.stack.push(self.memory[7])
self.execute(self.Cached["interpreter"], self.Cached["not_found"]) self.execute(self.Cached["interpreter"], self.Cached["not_found"])
def run_file(self, file): def run_file(self, file):
@ -695,7 +695,7 @@ class Retro:
elif in_block: elif in_block:
for token in line.strip().split(): for token in line.strip().split():
self.inject_string(token, self.memory[7]) self.inject_string(token, self.memory[7])
self.stack.push(1024) self.stack.push(self.memory[7])
self.execute( self.execute(
self.Cached["interpreter"], self.Cached["not_found"] self.Cached["interpreter"], self.Cached["not_found"]
) )