ams: support building unit test programs on windows/linux/macos

This commit is contained in:
Michael Scire authored and SciresM committed 2022-03-21 17:21:44 -07:00
1 parent 9a38be201a
commit 64a97576d0
756 files changed
+33359 -9372

No files matched your search

+4 -4
View File
@@ -20,17 +20,17 @@ def split_binary(data):
#print ('%X %X %X %X' % (START, BOOT_CODE_START, BOOT_CODE_END, PROGRAM_START))
boot_code = data[BOOT_CODE_START - START:BOOT_CODE_END - BOOT_CODE_START]
program = data[PROGRAM_START - START:]
return [('boot_code%s.lz4', lz4_compress(boot_code)), ('program%s.lz4', lz4_compress(program))]
return [('boot_code.lz4', lz4_compress(boot_code)), ('program.lz4', lz4_compress(program))]
def main(argc, argv):
if argc != 4:
print('Usage: %s in suffix outdir' % argv[0])
if argc != 3:
print('Usage: %s in outdir' % argv[0])
return 1
with open(argv[1], 'rb') as f:
data = f.read()
assert len(data) >= 0x40
for (fn, fdata) in split_binary(data):
with open('%s/%s' % (argv[3], fn % argv[2]), 'wb') as f:
with open('%s/%s' % (argv[2], fn), 'wb') as f:
f.write(fdata)
return 0