summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-06-16 01:22:15 -0400
committeryenatch <yenatch@gmail.com>2013-06-16 11:20:12 -0400
commit1578452ebccfd44fac82bd01defa75455ef00a41 (patch)
treeadcb61e5fccb22d5e9f2a1ddfa03b8b9796ac8f7
parentb4ff3d309874d987adc0987406dfd42c67c1b27b (diff)
symfile: fix address handling
original-commit-id: a4235e11bfe379f410f07aaab3b8a887a5d917ed
-rw-r--r--sym.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sym.py b/sym.py
index 445abb1..cc580fa 100644
--- a/sym.py
+++ b/sym.py
@@ -10,7 +10,7 @@ def make_sym_from_json(filename = '../pokecrystal.sym', j = 'labels.json'):
# todo: delete and remake labels.json at runtime
with open(filename, 'w') as sym:
for label in json.load(open(j)):
- sym.write('{0:x}:{1:x} {2}\n'.format(label['bank'], label['address']&0x3fff, label['label']))
+ sym.write('{0:x}:{1:x} {2}\n'.format(label['bank'], label['address']%0x4000 + (0x4000 if label['bank'] else 0), label['label']))
def make_sym_from_mapfile(filename = '../pokecrystal.sym', mapfile = '../mapfile.txt'):