summaryrefslogtreecommitdiff
path: root/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
commite5a2fa217490600281a7884fa024e789f1ebf025 (patch)
treece089fc50f214b4276fdf574c2771734a3321591 /crystal.py
parent01691e2659fbeb2221f1374c3e5495094b9e2822 (diff)
remove a duplication of load_rom and load_asm
original-commit-id: f22bbdd722bad8e2700b5801b45d935b631de6c8
Diffstat (limited to 'crystal.py')
-rw-r--r--crystal.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/crystal.py b/crystal.py
index 2077c37..4353ad5 100644
--- a/crystal.py
+++ b/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):