mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Fixed bugs & readded dkr_decompressor to make the build OK again
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user