2017-04-08 21:45:39 -06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
header()
|
|
|
|
{
|
|
|
|
FILE=$1
|
|
|
|
VAR=$2
|
|
|
|
EOL=$3
|
|
|
|
BYTES=$(hexdump -v $FILE | sed 's/^.......//' | wc -w | awk '{print $1}');
|
|
|
|
|
|
|
|
echo "/*"
|
|
|
|
expand ${FILE}.s
|
|
|
|
echo "*/"
|
|
|
|
|
|
|
|
printf "unsigned char $VAR[] = {\n\t"
|
|
|
|
|
|
|
|
for i in $(hexdump -v $FILE | sed 's/^.......//');
|
|
|
|
do
|
|
|
|
printf "0x%02X" 0x$i
|
|
|
|
BYTES=$((BYTES - 1))
|
|
|
|
if ((BYTES != 0))
|
|
|
|
then
|
|
|
|
printf ","
|
|
|
|
fi
|
|
|
|
EOL=$((EOL - 1))
|
|
|
|
if ((EOL == 0))
|
|
|
|
then
|
|
|
|
EOL=8
|
|
|
|
printf "\n\t"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
printf "\n};\n"
|
|
|
|
}
|
|
|
|
|
|
|
|
cd asm
|
|
|
|
make clean
|
|
|
|
make
|
|
|
|
|
|
|
|
(
|
|
|
|
header loader loadercode 8
|
2017-04-22 20:13:22 -06:00
|
|
|
header bar barcode 8
|
2017-04-08 21:45:39 -06:00
|
|
|
) > ../c2d.h.1
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
cat c2d.h.[01] > c2d.h
|