summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rwxr-xr-xtools/sort_symfile.sh9
2 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 2a746f2ca..9c355212f 100644
--- a/Makefile
+++ b/Makefile
@@ -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.
diff --git a/tools/sort_symfile.sh b/tools/sort_symfile.sh
new file mode 100755
index 000000000..1b39fbc6f
--- /dev/null
+++ b/tools/sort_symfile.sh
@@ -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"