summaryrefslogtreecommitdiff
path: root/extras/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-01-27 17:00:51 -0600
committerBryan Bishop <kanzure@gmail.com>2013-01-27 17:00:51 -0600
commitf22bbdd722bad8e2700b5801b45d935b631de6c8 (patch)
treeaafbb0892c60e780383bf1a525fb64963b1ae057 /extras/crystal.py
parent0ee57e94db13be9654c8bd1bbcb2b7bb2aa4e929 (diff)
remove a duplication of load_rom and load_asm
Diffstat (limited to 'extras/crystal.py')
-rw-r--r--extras/crystal.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/extras/crystal.py b/extras/crystal.py
index 2077c3748..4353ad560 100644
--- a/extras/crystal.py
+++ b/extras/crystal.py
@@ -145,12 +145,16 @@ def load_rom(filename="../baserom.gbc"):
elif os.lstat(filename).st_size != len(rom):
return direct_load_rom(filename)
+def direct_load_asm(filename="../main.asm"):
+ """returns asm source code (AsmList) from a file"""
+ asm = open(filename, "r").read().split("\n")
+ asm = AsmList(asm)
+ return asm
def load_asm(filename="../main.asm"):
- """loads the asm source code into memory"""
+ """returns asm source code (AsmList) from a file (uses a global)"""
global asm
- asm = open(filename, "r").read().split("\n")
- asm = AsmList(asm)
+ asm = direct_load_asm(filename=filename)
return asm
def grouper(some_list, count=2):