Skip to content

Instantly share code, notes, and snippets.

@ISSOtm
Created September 25, 2021 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ISSOtm/e4e8e4c0816f1547874eabf87e4ba2e2 to your computer and use it in GitHub Desktop.
Save ISSOtm/e4e8e4c0816f1547874eabf87e4ba2e2 to your computer and use it in GitHub Desktop.
Awk script for generating a Game Boy SYM file from a RGBDS map file
#!/usr/bin/awk -f
/^[^ \t]+[ \t]bank #([0-9]+):$/ {
bank = substr($3, 2)
sub(/:/, "", bank)
}
/^[ \t]*\$[0-9A-Fa-f]{4}[ \t]+=[ \t]+/ {
printf "%02x:%s %s\n", bank, substr($1, 2), $3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment