Fixed bugs & readded dkr_decompressor to make the build OK again

This commit is contained in:
David Benepe
2020-06-13 08:14:27 -05:00
parent 7bee621031
commit d9623b3b1c
8 changed files with 4595 additions and 1094 deletions
+10 -1
View File
@@ -151,7 +151,8 @@ class LD:
if fileExtension == '.png' and int(fileProperties[1]) != 0:
continue
ramAddress = fileProperties[0]
outFilename = 'build/' + matchedGroups[0] + '.' + matchedGroups[1] + '.bin'
outFileExtension = '.cbin' if fileExtension == '.cbin' else '.bin'
outFilename = 'build/' + matchedGroups[0] + '.' + matchedGroups[1] + outFileExtension
if int(ramAddress, 16) >= ASSETS_START:
assetFiles.append((outFilename, ramAddress, fileExtension))
assetFiles.sort(key = lambda x: x[1]) # Sort tuples by RAM address
@@ -160,8 +161,16 @@ class LD:
def generate_assets_file(self):
assets = self.get_asset_files()
assetsText = '# This file was generated by generate_ld.py\n\n'
prevAssetMadeAlignment = False
for asset in assets:
if 'lut' in asset[0] and not prevAssetMadeAlignment:
assetsText += '.balign 16\n'
assetsText += '.incbin "./' + asset[0] + '"\n'
if asset[2] == '.png' or asset[2] == '.cbin': # Make sure that compressed data ends on a 16-byte boundary
assetsText += '.balign 16\n'
prevAssetMadeAlignment = True
else:
prevAssetMadeAlignment = False
with open(ASSETS_S_FILENAME, "w") as assetsFile:
assetsFile.write(assetsText)