1
0
mirror of https://github.com/sehugg/8bitworkshop.git synced 2026-04-25 18:47:56 +00:00

pixel editor takes 8'hxx format; fixed minor bugs

This commit is contained in:
Steven Hugg
2018-02-26 15:42:20 -06:00
parent 6fa030f398
commit 73bb496511
7 changed files with 323 additions and 22 deletions
+4 -1
View File
@@ -82,6 +82,8 @@ def tohex(v):
return '%02x'%v
def tohex2(v):
return '0x%02x'%v
def tohexv(v):
return "8'h%02x"%v
for arr in [output]:
if args.asmhex:
@@ -106,5 +108,6 @@ for arr in [output]:
#j += 1
#print "rom["+str(j)+"] = 32'h" + string.join(map(tohex,arr[i+height/2:i+height]),'') + ";"
#j += 1
print "rom["+str(j)+"] = 64'h" + string.join(map(tohex,arr[i:i+height]),'') + ";"
#print "rom["+str(j)+"] = 64'h" + string.join(map(tohex,arr[i:i+height]),'') + ";"
print string.join(map(tohexv,arr[i:i+height]),',') + ", //%d" % (i/height)
j += 1