about summary refs log tree commit diff stats
path: root/translate
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-08-31 22:49:27 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-08-31 23:03:34 -0700
commitb8afd4becf993f5f868f05c4f9e5fcb87be9adb2 (patch)
tree48f1d7c7d92e7aa590078ef16323f34ff75c559f /translate
parent281f38a7c279087e586890730553612d0378847f (diff)
downloadmu-b8afd4becf993f5f868f05c4f9e5fcb87be9adb2.tar.gz
start hacky experiment to support combining chars
https://en.wikipedia.org/wiki/Combining_character

The plan: just draw the combining character in the same space as the
previous character. This will almost certainly not work for some Unicode
blocks (tibetan?)

This commit only changes the data/memory/disk model to make some space.
As always in Mu, we avoid bit-mask tricks even if that wastes memory.
Diffstat (limited to 'translate')
-rwxr-xr-xtranslate14
1 files changed, 13 insertions, 1 deletions
diff --git a/translate b/translate
index a8831504..9c1fc38d 100755
--- a/translate
+++ b/translate
@@ -7,7 +7,7 @@ set -e
 export DISK=20160  # 20*16*63 512-byte sectors = almost 10MB
 dd if=/dev/zero of=code.img count=$DISK status=none
 # code: sectors 0-8999
-# font: sectors 9000-10079  (1080 sectors = space enough for 16k glyphs (1080 * 512 / 33 bytes per glyph))
+# font: sectors 9000-10079  (1080 sectors = space enough for 16k glyphs (1080 * 512 / 34 bytes per glyph))
 export FONT=9000  # keep this sync'd with boot.subx
 # debug: sector 10080 onwards
 export DEBUG=10080
@@ -74,6 +74,18 @@ dd if=labels of=code.img seek=$DEBUG conv=notrunc status=none  # keep this sync'
 ## Font data at another well-defined location
 cat font.subx   |sed 's,/[^ ]*,,'    |linux/hex    > a.font
 
+if [ `stat --printf="%s" a.font` -ge 262144 ]  # 0x200 sectors * 512 bytes per sector (keep this sync'd with boot.subx)
+then
+  echo "font won't all be loaded on boot"
+  exit 1
+fi
+
+if [ `stat --printf="%s" a.font` -ge 14680064 ]  # 0x00e00000 = 0x00f00000 - 0x00100000
+then
+  echo "font is so large it overlaps the ISA memory hole; see https://wiki.osdev.org/Memory_Map_(x86)"
+  exit 1
+fi
+
 if [ `stat --printf="%s" a.font` -ge $(( ($DEBUG - $FONT) * 512 )) ]
 then
   echo "font will overwrite debug info in disk"