summaryrefslogtreecommitdiff
path: root/crystal.py
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2012-04-27 17:16:45 -0500
committerBryan Bishop <kanzure@gmail.com>2012-04-27 17:16:45 -0500
commit4d06e74973d72818ed3c0cc1213834334e73f9fc (patch)
tree5d5932eeac194864cad1acbadc196a6adb7c402c /crystal.py
parent91609594510e5a0a291d37377c2e574e837ef506 (diff)
words/pointers should point within bank
original-commit-id: 94a6e1b0ccb531474e662a522940241a785b4739
Diffstat (limited to 'crystal.py')
-rw-r--r--crystal.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/crystal.py b/crystal.py
index 7be1aa9..5d9a8aa 100644
--- a/crystal.py
+++ b/crystal.py
@@ -1319,6 +1319,7 @@ class PointerLabelParam(MultiByteParam):
if not label:
#pointer_part = (", ".join([(self.prefix+"%.2x")%x for x in reversed(self.bytes[1:])]))
pointer_part = self.prefix+("%.2x"%self.bytes[1])+("%.2x"%self.bytes[0])
+
#bank positioning matters!
if bank == True or bank == "reverse": #bank, pointer
#possibly use BANK(LABEL) if we know the bank
@@ -1341,7 +1342,6 @@ class PointerLabelParam(MultiByteParam):
return pointer_part #probably in the same bank ?
raise Exception, "this should never happen"
-
class PointerLabelBeforeBank(PointerLabelParam):
bank = True #bank appears first, see calculate_pointer_from_bytes_at
size = 3
@@ -5018,7 +5018,11 @@ def get_label_for(address):
return "AlreadyParsedNoDefaultUnknownLabel_" + hex(address)
#return "NotYetParsed_"+hex(address)
- return "$%.2x"%(address)
+ if address > 0x7FFF:
+ value = 0x4000 + (address % 0x4000)
+ return "$%.2x"%(value)
+ else:
+ return "$%.2x"%(address)
def remove_quoted_text(line):
"""get rid of content inside quotes