Skip to content

Commit

Permalink
move AsmList into romstr.py too
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzure committed May 29, 2012
1 parent ee7d39b commit 0edf9eb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
13 changes: 2 additions & 11 deletions extras/crystal.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ def map_name_cleaner(input):
replace("hooh", "HoOh").\
replace(" ", "")

from romstr import RomStr
from romstr import RomStr, AsmList

rom = RomStr(None)

def direct_load_rom(filename="../baserom.gbc"):
Expand All @@ -252,16 +253,6 @@ def load_rom(filename="../baserom.gbc"):
elif os.lstat(filename).st_size != len(rom):
return direct_load_rom(filename)

class AsmList(list):
"""simple wrapper to prevent all asm lines from being shown on screen"""

def length(self):
"""len(self)"""
return len(self)

def __repr__(self):
return "AsmList(too long)"


def load_asm(filename="../main.asm"):
"""loads the asm source code into memory"""
Expand Down
10 changes: 10 additions & 0 deletions extras/romstr.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,13 @@ 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)

class AsmList(list):
"""simple wrapper to prevent all asm lines from being shown on screen"""

def length(self):
"""len(self)"""
return len(self)

def __repr__(self):
return "AsmList(too long)"

0 comments on commit 0edf9eb

Please sign in to comment.