46. Base slot 7 is the font table¶
Section 40 placed the slot, as the table the screen language's opcode 16 indexes, and left its targets unread. They are glyphs, and with them a config's text can be drawn.
Corrected in place. The first version of this section, committed the day before, read the byte at the start of a set as its slot count. It is the glyph height. That single mistake cut every set from 46 to 76 glyphs down to 8 to 18, made the corpus look like 913 images when it holds 3933, and then produced a second, worse error: the inline strings' codes appeared to run past the end of the set their program selected, and this section declared the obvious reading ruled out. It is not ruled out; it is right, and the closure below is as clean as any in this document. The lesson is the one section 17 already recorded in different words: when a structure refuses to make sense, suspect the field assignment before writing up the anomaly.
The set¶
+0x00 u8 glyph height in pixels, shared by every glyph in the set
+0x01 u8 the first glyph code
+0x02 u8 the glyph count
+0x03 u24 glyph[count] NULL for a code this config never draws
Corrected again in section 78, and the correction is recorded here rather than only there,
because this is the layout other sections quote. The version this section published read +0x01 as
"the glyph count on arch 12, and 1 on arch 8, 9 and 14" and +0x02 as the reverse, and marked which
byte holds the count as measured rather than explained. It is the byte at +0x02, unless that byte
is zero and then the count is at +0x01; and +0x01 is not a spare but the first glyph code,
which is 1 in every container the corpus had when this section was written. The count is not keyed
on the architecture: the One's own safe mode container carries the other shape.
The count is the same for every set in a container and differs between containers: 75 on the Harmony 700, 71 on the 600, 73 and 72 on the two Ones, 74 to 76 on the arch 8 configs, 66 on the 525 and 46 in all three safe mode containers. So it is a character set size, chosen per config rather than per typeface, and most of its codes are NULL because a config ships only the glyphs its own text uses. That too holds only of the corpus as it was: the arch 9 safe mode container declares 91, 90, 50 and 90 in one container, so it is chosen per set and every generated config happens to choose once.
The glyph¶
+0x00 u8 width in pixels
then a stream of one byte operations:
| byte | meaning |
|---|---|
0x00 |
end of glyph |
0x80 plus n |
n pixels of the background, not stored |
n, below 0x80 |
n literal pixels follow, two bytes each |
A row is exactly width pixels and the next one begins as soon as that many are accounted for.
Three closures¶
Every row comes to exactly width. 3933 glyphs across arch 8, arch 12 and arch 14, every
stream ending on 0x00 with no row half finished. The operations are variable length and nothing
marks a row boundary, so one wrong pixel size desynchronises everything after it.
Every glyph produces exactly the height its set declares. 3933 of 3933. The height is stored once, in the set header, and recovered 3933 times from streams that never mention it.
Every inline string resolves. Walking every reachable screen program and tracking which font
opcode 16 last selected, 16054 glyph codes across twelve containers land on a non-NULL glyph of
that font, with the code taken as one based. Not one is out of range and not one hits a NULL
slot. Zero is the string terminator, which is why the index is the code minus one, exactly as the
firmware does it at 0x185E4.
The wrong pixel size scores near zero¶
The calibration this project asks for, on a decode rather than on an address. The same decoder with a one byte pixel:
| config | two byte pixel | one byte pixel |
|---|---|---|
| Harmony 700 | 130 of 130 | 11 of 130 |
| Harmony One | 147 of 147 | 0 of 147 |
| Harmony 880 | 66 of 66 | 6 of 66 |
Arch 9 is not covered. The Harmony 525's glyphs share the 0x00 terminator and nothing else
this decoder understands, and no arch 9 firmware exists here, so gspm.images refuses that
architecture rather than producing a plausible wrong bitmap.
The firmware¶
Opcode 16's handler at 0x18508 on the Harmony 700 reads its one byte operand, seeks base slot 7,
reads the section's u16 count, indexes by the operand and stores the resulting u24 into
0x398 to 0x39A. That is the pointer section 40 found the renderer using and could not trace to
a source.
The renderer, at 0x185E4, seeks that address, skips one byte, reads a u16, and then indexes
what follows at stride three by the code minus one before following the pointer. Skipping one
and reading two is the three byte header above, so the index lands on glyph[code - 1].
They are letters¶
tools/screen_dump.py --strings draws each inline string through the font its own program
selected. The Harmony 700's come out as readable labels of the form (0 sec), (0.1 sec),
(0.2 sec), which are the delay choices in its menus. That exercises the whole chain in one go:
the program walk, opcode 16, the code minus one, and the bitmap decoder.
The pixel is sixteen bits and fifteen distinct values occur across the corpus, dominated by
0xFFFF and 0x0000. Whether those are RGB565 is not established and does not matter to the
decode.
What is not established¶
Which header byte is the count was the item here, and section 78 settled it.
What the glyph codes mean. They are a per config character set, so code 5 is a space in the 700's configs and nothing says it is a space in anyone else's. A writer that wants to add text has to build a set and number it, not look a character up. Section 78 narrows this too: the arch 9 safe mode container's codes are ASCII, so the encoding is a choice a generator makes rather than a property of the format, and a config that starts its sets at 1 has renumbered.
Arch 9's packing.
Section 45 | the archive | section 47. Section 46 of the findings archive, which is frozen; the reference holds the current answer. The archive on GitHub.