shithub: pokecrystal

ref: 65a780994f87445f2bf8d9761f7dbf3c1389648a
dir: /tools/free_space.awk/

View raw version
#!/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
}