diff options
author | Bryan Bishop <kanzure@gmail.com> | 2013-01-27 17:00:51 -0600 |
---|---|---|
committer | Bryan Bishop <kanzure@gmail.com> | 2013-01-27 17:00:51 -0600 |
commit | e5a2fa217490600281a7884fa024e789f1ebf025 (patch) | |
tree | ce089fc50f214b4276fdf574c2771734a3321591 /crystal.py | |
parent | 01691e2659fbeb2221f1374c3e5495094b9e2822 (diff) |
remove a duplication of load_rom and load_asm
original-commit-id: f22bbdd722bad8e2700b5801b45d935b631de6c8
Diffstat (limited to 'crystal.py')
-rw-r--r-- | crystal.py | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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): |