about summary refs log tree commit diff stats
path: root/translate
diff options
context:
space:
mode:
Diffstat (limited to 'translate')
-rwxr-xr-xtranslate21
1 files changed, 17 insertions, 4 deletions
diff --git a/translate b/translate
index e0e3ba02..e9fec574 100755
--- a/translate
+++ b/translate
@@ -6,7 +6,9 @@ set -e
 # Map of the Mu code disk
 export DISK=20160  # 20*16*63 512-byte sectors = almost 10MB
 dd if=/dev/zero of=code.img count=$DISK
-# code: sectors 0-10079
+# code: sectors 0-8999
+# font: sectors 9000-10079  (1080 sectors = space enough for 16k glyphs (1080 * 512 / 33 bytes per glyph))
+export FONT=9000  # keep this sync'd with boot.subx
 # debug: sector 10080 onwards
 export DEBUG=10080
 
@@ -14,7 +16,7 @@ export DEBUG=10080
 
 cat $* [0-9]*.mu                                          |linux/mu                         > a.subx
 
-cat boot.subx font.subx mu-init.subx [0-9]*.subx a.subx   |linux/braces                     > a.braces
+cat boot.subx mu-init.subx [0-9]*.subx a.subx             |linux/braces                     > a.braces
 
 cat a.braces                                              |linux/calls                      > a.calls
 
@@ -47,9 +49,9 @@ then
   exit 1
 fi
 
-if [ `stat --printf="%s" a.bin` -ge $(($DEBUG*512)) ]
+if [ `stat --printf="%s" a.bin` -ge $(($FONT*512)) ]
 then
-  echo "a.bin will overwrite debug info on disk"
+  echo "a.bin will overwrite font in disk"
   exit 1
 fi
 
@@ -68,3 +70,14 @@ then
 fi
 
 dd if=labels of=code.img seek=$DEBUG conv=notrunc  # keep this sync'd with abort.subx
+
+## Some space for font data at another well-defined location
+cat font.subx   |sed 's,#.*,,' |sed 's,/[^ ]*,,'    |linux/hex    > a.font
+
+if [ `stat --printf="%s" a.bin` -ge $(( ($DEBUG - $FONT) * 512 )) ]
+then
+  echo "font will overwrite debug info in disk"
+  exit 1
+fi
+
+dd if=a.font of=code.img seek=$FONT conv=notrunc