summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-07-02 12:19:14 -0400
committeryenatch <yenatch@gmail.com>2013-07-10 19:12:48 -0400
commitba5cd8bbb8b96a080e9a6fe1b1525cd5381fdb24 (patch)
treec34eb01e74345b361b7c1b3c764213016649c98e
parentdaf3930984690e8ce44b375dda35a9d725c0c1d2 (diff)
use wram from outside extras
-rw-r--r--extras/wram.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/extras/wram.py b/extras/wram.py
index bad0b9fa9..961964403 100644
--- a/extras/wram.py
+++ b/extras/wram.py
@@ -2,6 +2,10 @@
# RGBDS BSS section and constant parsing.
+import os
+path = os.path.dirname(os.path.abspath(__file__))
+
+
def read_bss_sections(bss):
sections = []
section = {}
@@ -33,7 +37,7 @@ def read_bss_sections(bss):
sections.append(section)
return sections
-wram_sections = read_bss_sections(open('../wram.asm', 'r').readlines())
+wram_sections = read_bss_sections(open(os.path.join(path, '../wram.asm'), 'r').readlines())
def make_wram_labels():
@@ -56,6 +60,6 @@ def scrape_constants(text):
text = text.split('\n')
return constants_to_dict([line for line in text if 'EQU' in line[:line.find(';')]])
-hram_constants = scrape_constants(open('../hram.asm','r').readlines())
-gbhw_constants = scrape_constants(open('../gbhw.asm','r').readlines())
+hram_constants = scrape_constants(open(os.path.join(path, '../hram.asm'),'r').readlines())
+gbhw_constants = scrape_constants(open(os.path.join(path, '../gbhw.asm'),'r').readlines())