Identify font glyphs in memory

This commit is contained in:
Joshua Bell 2017-09-15 21:31:20 -07:00
parent 97efeaf44d
commit 62ed78f148
2 changed files with 66 additions and 2 deletions

View File

@ -445,6 +445,33 @@ end:
;; .byte len, name (length-prefixed, spaces before/after; 17 byte buffer)
font_size_count := $8801 ; num glyphs + 1 (for height) ??
font_height := $8802
font_size_count := $8801 ; num glyphs + 1 (for height) / max glyphs ?
font_height := $8802 ; 9 pixels
font_width_table := $8803 ; width in pixels, indexed by ASCII code
font_glyphs := $8883 ; $80 glyphs, organized by row, 9 bytes per
;; So glyph for A $41
;; width is at $8803 + $41 = $8844 which is 7
;; row0 is at $8883 + $41 + (0 * $80) = $88C4 ~ $1E = %00011110
;; row1 is at $8883 + $41 + (1 * $80) = $8944 ~ $33 = %00110011
;; etc
;;
;; Glyphs $00-$1F are useful symbols; some overlap with MouseText
;; (called out as MT:X in the table below)
;;
;; $00 = space $10 = TM left
;; $01 = folder left (MT:X) $11 = TM right
;; $02 = folder right (MT:Y) $12 = pound
;; $03 = hourglass (MT:C) $13 = pi
;; $04 = insertion pt $14 = divide
;; $05 = pointer (MT:B) $15 = rarrow (MT:U)
;; $06 = vbar (MT:_) $16 = tri
;; $07 = hbar (MT:S) $17 = open circ
;; $08 = larrow $18 = close (MT:])
;; $09 = left box $19 = gray odd (MT:W)
;; $0A = darrow (MT:J) $1A = gray even (MT:V)
;; $0B = uarrow (MT:K) $1B = solid circ
;; $0C = right box $1C = inv check (MT:E)
;; $0D = return (MT:M) $1D = check (MT:D)
;; $0E = (C) $1E = solid apple (MT:@)
;; $0F = (R) $1F = open apple (MT:A)

37
desk.acc/res/fontdump.pl Normal file
View File

@ -0,0 +1,37 @@
#!/usr/bin/env perl
use strict;
use warnings;
# Dumps the font glyphs from DESKTOP2.$F1
# (Located at $8883 in memory)
my $num = 0x80;
my @chars;
for (my $i = 0; $i < $num; ++$i) {
$chars[$i] = '';
}
seek(STDIN, 0x4E03, 0);
my $c = 0;
for (my $row = 0; $row < 9; ++$row) {
for (my $c = 0; $c < $num; ++$c) {
for (my $shift = 0; $shift < 1; ++$shift) {
my $b;
read(STDIN, $b, 1);
$b = ord($b);
my $bits = sprintf("%07b", $b);
$bits =~ tr/01/ #/;
$bits = reverse $bits;
$chars[$c] .= $bits;
}
$chars[$c] .= "\n";
}
}
for (my $i = 0; $i < $num; ++$i) {
print "==".sprintf("%02x",$i)."==\n$chars[$i]";
}