From b1dcfb03d00f93999da0225600fe5f9d708e439c Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 29 Aug 2021 20:34:53 -0700 Subject: load Font in a non-contiguous area of memory --- translate | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'translate') 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 -- cgit 1.4.1-2-gfad0