shithub: pokecrystal

Download patch

ref: 5ba5a7df46822d4e95061583e3497744c6e48e50
parent: 8aebc7ba56746b19d3338ab548ad0ab59d2012aa
parent: e90857dea1cb25cbb58ac68896158e4674110522
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Sun Jul 22 19:38:09 EDT 2018

Merge pull request #543 from Rangi42/master

Add tools/free_space.awk

--- /dev/null
+++ b/tools/free_space.awk
@@ -1,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
+}