Remove pigz dependency

This commit is contained in:
Ryan Dwyer 2020-02-24 23:28:27 +10:00
parent 56d6451a43
commit e3758839ed
3 changed files with 4 additions and 16 deletions

View File

@ -64,7 +64,6 @@ There is also a stagetable.txt in the repository root which includes multiplayer
* make
* mips build tools (Debian/Ubuntu: binutils-mips-linux-gnu, Arch: mips64-elf-binutils from AUR)
* Python 3
* pigz - a zlib compression tool
## Extracting the base ROM

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python3
import os
import subprocess
import zlib
"""
mkgamezips - Creates the ucode/gamezips.bin from ucode/game.bin
@ -70,13 +70,8 @@ def get_zips():
return [zip(part) for part in parts]
def zip(binary):
fd = open('build/part.bin', 'wb')
fd.write(binary)
fd.close()
zipped = subprocess.check_output(['tools/rarezip', 'build/part.bin', '--game'])
os.remove('build/part.bin')
return zipped
obj = zlib.compressobj(level=9, wbits=-15)
return b'\x11\x73' + len(binary).to_bytes(3, 'big') + obj.compress(binary) + obj.flush()
checksumsmaybe = [
0x94f1, 0xb0c7, 0x6f10, 0x0d50, 0x2361, 0xe64a, 0x7c32, 0xf8f5,

View File

@ -4,10 +4,4 @@ size=$(stat --format="%s" $1)
printf "0: 1173 %.6x" $size | xxd -r -g0
if [[ "$2" == '--game' ]]; then
# Use pigz, which uses the zlib library
pigz -c --no-name --best $1 | head --bytes=-8 | tail --bytes=+11
else
# Use gzip, which uses their own deflate implementation
tools/gzip -c --no-name --best $1 | head --bytes=-8 | tail --bytes=+11
fi
tools/gzip -c --no-name --best $1 | head --bytes=-8 | tail --bytes=+11