pokecrystal-board/tools/sort_symfile.sh

14 lines
321 B
Bash
Raw Normal View History

2018-01-14 20:51:24 -08:00
#!/bin/sh
TEMP_FILE=$(mktemp)
sed \
2018-01-01 19:40:35 -08:00
-e "s/^..:[0-3]/0_ROM0@&/g" \
-e "s/^..:[4-7]/1_ROMX@&/g" \
-e "s/^..:[8-9]/2_VRAM@&/g" \
-e "s/^..:[A-B]/3_SRAM@&/g" \
-e "s/^00:[C-D]/4_WRAM0@&/g" \
-e "s/^..:[D-D]/5_WRAMX@&/g" \
$1 \
| sort -o $TEMP_FILE
sed -e "s/^.*@//g" $TEMP_FILE > $1
rm $TEMP_FILE