diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-29 20:34:53 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-29 20:34:53 -0700 |
commit | b1dcfb03d00f93999da0225600fe5f9d708e439c (patch) | |
tree | f4f3978f93918d4551dd7e13b2f97f57f8b83db9 /translate | |
parent | 354c72a6377d04574efe1c5cfb4b29d91c939b15 (diff) | |
download | mu-b1dcfb03d00f93999da0225600fe5f9d708e439c.tar.gz |
load Font in a non-contiguous area of memory
Diffstat (limited to 'translate')
-rwxr-xr-x | translate | 21 |
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 |