From f22bbdd722bad8e2700b5801b45d935b631de6c8 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Sun, 27 Jan 2013 17:00:51 -0600 Subject: remove a duplication of load_rom and load_asm --- extras/crystal.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'extras/crystal.py') 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): -- cgit v1.2.3