sort the symfile by symbol type

This commit is contained in:
yenatch 2018-01-01 22:40:35 -05:00
parent f27f79488a
commit f185cc9b77
2 changed files with 11 additions and 2 deletions

View File

@ -77,12 +77,12 @@ endif
pokecrystal11.gbc: $(crystal11_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal11.sym -m pokecrystal11.map -l pokecrystal.link -o $@ $(crystal11_obj)
$(RGBFIX) -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -n 1 -p 0 -r 3 -t PM_CRYSTAL $@
sort pokecrystal11.sym -o pokecrystal11.sym
tools/sort_symfile.sh pokecrystal11.sym
pokecrystal.gbc: $(crystal_obj) pokecrystal.link
$(RGBLINK) -n pokecrystal.sym -m pokecrystal.map -l pokecrystal.link -o $@ $(crystal_obj)
$(RGBFIX) -Cjv -i BYTE -k 01 -l 0x33 -m 0x10 -p 0 -r 3 -t PM_CRYSTAL $@
sort pokecrystal.sym -o pokecrystal.sym
tools/sort_symfile.sh pokecrystal.sym
# For files that the compressor can't match, there will be a .lz file suffixed with the md5 hash of the correct uncompressed file.

9
tools/sort_symfile.sh Executable file
View File

@ -0,0 +1,9 @@
sed $1 \
-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" \
| sort -o $1
sed -i $1 -e "s/^\w*@//g"