Merge pull request #543 from Rangi42/master

Add tools/free_space.awk
This commit is contained in:
Rangi 2018-07-22 23:38:09 -04:00 committed by GitHub
commit 5ba5a7df46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 0 deletions

13
tools/free_space.awk Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/awk -f
# Usage: tools/free_space.awk pokecrystal.map
BEGIN {
total = free = 16384 * 128
}
/^ SECTION: \$[0-7]/ {
free -= strtonum("0x" substr($3, 3))
}
END {
printf "Free space: %d/%d (%.2f%%)\n", free, total, free * 100 / total
}