From dc0a7ac670915a089d1b1ba27df0b5daca2b56f3 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Thu, 14 Nov 2013 00:43:52 -0600 Subject: make get_text slightly more configurable Add params to the get_text() function to dump text tiles from screen. --- pokemontools/vba/vba.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pokemontools/vba/vba.py') diff --git a/pokemontools/vba/vba.py b/pokemontools/vba/vba.py index c7a0bf9..204e102 100644 --- a/pokemontools/vba/vba.py +++ b/pokemontools/vba/vba.py @@ -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] -- cgit v1.2.3