shithub: pokecrystal

Download patch

ref: e90857dea1cb25cbb58ac68896158e4674110522
parent: 3e14c1f26e91b1fc1d18eed389518ae8454e938f
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Tue Jul 17 16:07:39 EDT 2018

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
+}