2023-11-14 23:12:28 -05:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
LIN="uxncli $HOME/roms/uxnlin.rom"
|
|
|
|
ASM="uxncli $HOME/roms/drifblim.rom"
|
|
|
|
|
|
|
|
if [[ "$*" == *"--lint"* ]]
|
|
|
|
then
|
|
|
|
$LIN decoder.tal
|
|
|
|
clang-format -i lz_main.c
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Make c file
|
2023-11-14 23:30:09 -05:00
|
|
|
|
2023-11-14 23:12:28 -05:00
|
|
|
cc lz_main.c -o main && ./main
|
|
|
|
./main # read example.txt, write compressed.bin
|
|
|
|
|
2023-11-14 23:30:09 -05:00
|
|
|
# Decoding
|
|
|
|
|
2023-11-14 23:12:28 -05:00
|
|
|
$ASM decoder.tal decoder.rom
|
|
|
|
uxncli decoder.rom compressed.bin decompressed.txt
|
|
|
|
|
|
|
|
rm ./main
|
|
|
|
rm ./compressed.bin
|
|
|
|
rm ./decompressed.txt
|
2023-11-14 23:30:09 -05:00
|
|
|
|
|
|
|
# Encoding
|
|
|
|
|
|
|
|
$ASM encoder.tal encoder.rom
|
|
|
|
uxncli encoder.rom example-small.txt recompressed.bin
|
|
|
|
|
|
|
|
# Redecoding
|
|
|
|
|
|
|
|
uxncli decoder.rom recompressed.bin redecoded.txt
|
|
|
|
|
|
|
|
cat redecoded.txt
|