make get_text slightly more configurable

Add params to the get_text() function to dump text tiles from screen.
This commit is contained in:
Bryan Bishop
2013-11-14 00:43:52 -06:00
parent 106f45ac7a
commit dc0a7ac670

View File

@@ -718,14 +718,14 @@ class crystal(object):
self.vba.write_memory_at(0xd8dc, 5)
self.vba.write_memory_at(0xd8dd, 99)
def get_text(self, chars=chars):
def get_text(self, chars=chars, offset=0, bounds=1000):
"""
Returns alphanumeric text on the screen.
Other characters will not be shown.
"""
output = ""
tiles = self.vba.memory[0xc4a0:0xc4a0 + 1000]
tiles = self.vba.memory[0xc4a0 + offset:0xc4a0 + offset + bounds]
for each in tiles:
if each in chars.keys():
thing = chars[each]