summaryrefslogtreecommitdiff
path: root/wram.py
diff options
context:
space:
mode:
Diffstat (limited to 'wram.py')
-rw-r--r--wram.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/wram.py b/wram.py
index b74fa66..0e8e09a 100644
--- a/wram.py
+++ b/wram.py
@@ -107,4 +107,17 @@ def read_hram_constants():
hram_constants = read_hram_constants()
-gbhw_constants = scrape_constants(open(os.path.join(os.path.dirname(path), 'gbhw.asm'),'r').readlines())
+def read_gbhw_constants():
+ """
+ Load constants from gbhw.asm.
+ """
+ try:
+ gbhw_file_handler = open(os.path.join(os.path.dirname(path), 'gbhw.asm'), 'r')
+ except IOError as exception:
+ gbhw_lines = [""]
+ else:
+ gbhw_lines = gbhw_file_handler.readlines()
+ gbhw_constants = scrape_constants(gbhw_lines)
+ return gbhw_constants
+
+gbhw_constants = read_gbhw_constants()