summaryrefslogtreecommitdiff
path: root/extras/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-05-29 13:08:43 -0500
committerBryan Bishop <kanzure@gmail.com>2012-05-29 13:08:43 -0500
commitee7d39bf046ca4b8c40eb293d50657cda151dc58 (patch)
tree4a0aa5f96f63b9f61fc193503d91031091612d8b /extras/crystal.py
parentcfb8bb4d7fece943148c03c96489ae079bff3a05 (diff)
move RomStr into a shared file
Diffstat (limited to 'extras/crystal.py')
-rw-r--r--extras/crystal.py26
1 files changed, 1 insertions, 25 deletions
diff --git a/extras/crystal.py b/extras/crystal.py
index 59d914918..bd4f17ec0 100644
--- a/extras/crystal.py
+++ b/extras/crystal.py
@@ -230,31 +230,7 @@ def map_name_cleaner(input):
replace("hooh", "HoOh").\
replace(" ", "")
-class RomStr(str):
- """simple wrapper to prevent a giant rom from being shown on screen"""
-
- def length(self):
- """len(self)"""
- return len(self)
-
- def __repr__(self):
- return "RomStr(too long)"
-
- def interval(self, offset, length, strings=True, debug=True):
- """returns hex values for the rom starting at offset until offset+length"""
- returnable = []
- for byte in self[offset:offset+length]:
- if strings:
- returnable.append(hex(ord(byte)))
- else:
- returnable.append(ord(byte))
- return returnable
-
- def until(self, offset, byte, strings=True, debug=False):
- """returns hex values from rom starting at offset until the given byte"""
- return self.interval(offset, self.find(chr(byte), offset) - offset, strings=strings)
-
-
+from romstr import RomStr
rom = RomStr(None)
def direct_load_rom(filename="../baserom.gbc"):