From a8986d8c1641d5833cc8f07c941ec78e9cb58df5 Mon Sep 17 00:00:00 2001 From: yenatch Date: Fri, 14 Jun 2013 02:19:35 -0400 Subject: gbz80disasm: only use gbhw/hram constants >= 0xff00 original-commit-id: 2f21ff4ef5f4b26801463db720be32f55cfaf7d4 --- gbz80disasm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbz80disasm.py b/gbz80disasm.py index c1d129c..4975108 100644 --- a/gbz80disasm.py +++ b/gbz80disasm.py @@ -583,7 +583,7 @@ def find_label(local_address, bank_id=0): if local_address in wram_labels.keys(): return wram_labels[local_address][-1] for constants in [gbhw_constants, hram_constants]: - if local_address in constants.keys(): + if local_address in constants.keys() and local_address >= 0xff00: return constants[local_address] return None -- cgit v1.2.3 From b4ff3d309874d987adc0987406dfd42c67c1b27b Mon Sep 17 00:00:00 2001 From: yenatch Date: Sat, 15 Jun 2013 14:11:50 -0400 Subject: gbz80disasm: fix labels outside of banks 0 and 1 original-commit-id: dfb241619203a2b1b9eb389055cbe0ff31baa7a0 --- gbz80disasm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbz80disasm.py b/gbz80disasm.py index 4975108..2dc57e5 100644 --- a/gbz80disasm.py +++ b/gbz80disasm.py @@ -577,7 +577,7 @@ def find_label(local_address, bank_id=0): if local_address < 0x8000: for label_entry in all_labels: - if label_entry["address"] == local_address: + if label_entry["address"] & 0x7fff == local_address: if label_entry["bank"] == bank_id or label_entry["bank"] == 0: return label_entry["label"] if local_address in wram_labels.keys(): -- cgit v1.2.3 From 1578452ebccfd44fac82bd01defa75455ef00a41 Mon Sep 17 00:00:00 2001 From: yenatch Date: Sun, 16 Jun 2013 01:22:15 -0400 Subject: symfile: fix address handling original-commit-id: a4235e11bfe379f410f07aaab3b8a887a5d917ed --- sym.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'): -- cgit v1.2.3