1
0
mirror of https://github.com/weiju/amiga-stuff synced 2025-11-22 01:52:17 +00:00

cleaned up ks decoder

This commit is contained in:
Wei-ju Wu
2015-05-12 16:02:51 -07:00
parent 01681e300b
commit a71af9156a

View File

@ -9,7 +9,8 @@ SIZE_CLASSIC = 0x40000
SIZE_MODERN = 0x80000
MAX_ROM_SIZE = SIZE_MODERN
def decode_cloanto(rom, key, real_size):
def decode_cloanto(rom, key):
"""Decodes an encoded Kickstart ROM and returns a decoded ROM"""
rom = bytearray(rom)
key = bytearray(key)
result = bytearray(len(rom))
@ -39,7 +40,7 @@ if __name__ == '__main__':
size = len(data)
if size != SIZE_CLASSIC and size != SIZE_MODERN:
raise Exception("invalid rom size")
decoded = decode_cloanto(data, key_data, len(data))
decoded = decode_cloanto(data, key_data)
with open(args.target, 'wb') as outfile:
outfile.write(bytes(decoded))
else: