tft: text (plain) and touch cap; 55 Editor samples reproduced byte for byte

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Fable 5.2 committed 2026-11-16 18:29:12 +01:00
1 parent 0532a59120
commit b5eaa68298
7 files changed
+102 -16

No files matched your search

+1 -1
View File
@@ -113,7 +113,7 @@ byte for byte, or a file written by nxhmi was opened in the Editor and showed th
| Trailer checksum | solved for any length (`tft.trailer`); one model measured |
| 3 header checksums (0x44, 0xC4, 0x18C) | solved (`tft.header_checksums`, `tft.seal`) |
| Pictures and fonts inside the TFT | solved (FORMAT.md 7.2) |
| Compiled page format | structure solved (code blob, name hashes, RAM image, attribute records, page table, object records -- FORMAT.md 7.3-7.5); per-type tables done for page, hotspot, int variable, timer; the other types need their slot tables and generated draw scripts |
| Compiled page format | structure solved (code blob, name hashes, RAM image, attribute records, page table, object records -- FORMAT.md 7.3-7.5); per-type tables done for page, hotspot, text (solid background, flat style), int variable, timer, touch cap; the other types need their slot tables and generated draw scripts |
| Event-code tokens | solved for what was sampled (FORMAT.md 7.6): 27 commands, 33 system variables/colours, numbers, global variables, attribute references, if/else/while/for. Not sampled: string functions and attributes, the remaining commands and system variables, `>=` op code |
| Builder (`nxhmi build-tft`) | byte-identical to the Editor for the supported subset (one model: NX4832T035); refuses anything else. **Never tested on a real display** |
| Licensing | every `.tft` embeds Nextion's firmware files; the repo must never ship them -- a builder would read them from the user's own Editor installation |
+13 -6
View File
@@ -164,9 +164,11 @@ Script (same day): tokens, global variables, timers and control flow are in (FOR
before a long number), mixed `&&`/`||`, parentheses in conditions, braces-less `if`.
- The Editor appends one `page 0` chunk to the program even when Program.s already ends with it.
Not done: sliders, touch cap and every drawing component (text, number, button, progress bar,
gauge, waveform, picture, crop, checkbox, radio, QR code ...); string variables and string
functions; page backgrounds other than a solid colour; global (vscope) components; other
Added later the same day: touch cap and plain text (55 samples reproduced).
Not done: sliders and the other drawing components (number, button, progress bar, gauge,
waveform, picture, crop, checkbox, radio, QR code ...); text with a border, picture or crop
background; string attributes in script (`t0.txt="x"`), string variables and string functions; page backgrounds other than a solid colour; global (vscope) components; other
models, portrait, other series; and nothing has been loaded onto a display.
Samples: `tools/make_tft_samples.py` writes the 63 study projects (`tools/tft_samples.json`);
@@ -179,9 +181,14 @@ Starting points for the next component types (from those samples, not yet in the
order (text: font, isbr, pco, bco, xcen, ycen, pw, then txt with `txt_maxl + 1` bytes).
Kinds seen: 0x21/0x31 u8, 0x22/0x32 u16, 0x39 i32, 0x3F string (size = bytes reserved),
0x02 `txt_maxl`.
- Text draw section: `09 1C 08 x,y,w,h,<font>,<pco>,<bco>,<xcen>,<ycen>,1,<txt>,0,0,<isbr>,0`
then `09 13 04` with four `03 7FFF` numbers and a record reference; every `<..>` is a
record reference, so changing an attribute at run time needs no recompilation.
- Text draw section (implemented): `09 1C 08 x,y,w,h,<font>,<pco>,<bco>,<xcen>,<ycen>,1,<isbr>,0,0,<pw>,0`
then `09 13 04` with four `03 7FFF` numbers and `<txt>`; every `<..>` is a record reference,
so changing an attribute at run time needs no recompilation. The literal 1 and 0s are
probably sta, spax, spay and the border -- untested, so other values are refused. The `font`
record's maximum is the number of fonts - 1.
- Number looks like text but keeps `sta` and `style` in RAM (plus three unexplained bytes) and
draws with `09 1C 08` + `09 11 04 <val>,<lenth>,<format>`. Button (default 3D style) has a
long generated script with conditional jumps on `val`.
- Progress bar draw section: `<sys 0005/04>=<val>*w/100`, then two fills (`09 0D 04`) for the
filled and the empty part. Gauge: one `09 0A 08` line. QR code: one `09 08 08` line.
- Slider and touch cap add the init line `09 16 04 1`; slider has a `slide` event label.