HiSprite: fixed binary constant formatting

* MAC/65 does indeed do binary constants
This commit is contained in:
Rob McMullen 2017-06-26 12:40:19 -07:00
parent bb6dcae6fb
commit 5d550a6ef0
1 changed files with 2 additions and 3 deletions

View File

@ -80,7 +80,7 @@ class AssemblerSyntax(object):
_ = len(value)
return "#%%%s" % value
except TypeError:
return "#%s" % format(value, "08b")
return "#%%%s" % format(value, "08b")
class Mac65(AssemblerSyntax):
@ -88,13 +88,12 @@ class Mac65(AssemblerSyntax):
return self.asm(".word %s" % text)
def binary_constant(self, value):
# MAC/65 doesn't do binary constants
try:
# a string
value = int(value, 2)
except TypeError:
pass
return "#$%02x ; %s" % (value, format(value, "08b"))
return "#~%s" % format(value, "08b")
class CC65(AssemblerSyntax):