Commit Graph

13 Commits

Author SHA1 Message Date
Lephe 93169e8803
render: fix drsize() skipping one byte past NUL
This would work if the string has double NUL, which is common enough
that this bug never came up before. x)
2022-03-22 18:48:06 +00:00
Lephe 97ca5ba82f
display: add a dfont_default() function to get the default font 2021-02-28 22:28:12 +01:00
Lephe bd40a0a41c
display: add more text size options dnsize() and drsize()
* dnsize() works like dsize() but a limit on the number of bytes is
  specified. This is useful to obtain the length of a substring.
* drsize() has a reverse limit; the input specifies a number of pixels
  and the function determines how much of the input fits. This is useful
  for word wrapping algorithms.
2021-02-22 16:43:02 +01:00
Lephe 078edb50b2
small cleanup 2020-10-05 16:31:37 +02:00
Lephe 240f29f9d5
topti: custom character and word spacing (#13)
This commit introduces custom character spacing with a new fxconv
parameter "char-spacing". Word spacing is also tied to the width of the
space character (0x20). This removes the need for special semantics on
the space character, but requires that its size be specified with gray
pixels for proportional fonts.

This also fixes problems with the size of spaces in dsize() not being
correlated with their size during rendering, since on fx-9860G topti
already used the glyph's with as word spacing.

Since fxconv changes but gint's Makefile does not track updates to
external tools, a full rebuild of gint is required past this commit.
2020-10-05 16:14:12 +02:00
Lephe e16f3acfa1
topti: support Unicode fonts
This change adds UTF-8 decoding to dtext() to fully use Unicode fonts
provided by fxconv.
2020-07-14 15:28:46 +02:00
Lephe e3042755d2
topti: support Unicode in the data structures (WIP)
This change modifies the font_t type to replace the concept of charset
with a more generic list of non-overlapping Unicode blocks defined by a
starting code point and a size.

It also takes advantage of the assembly feature of fxconv, introduced
for libimg long after the first version of topti, to support pointers in
the converted structure rather than having to tediously compute offsets
within a variable-size structure.
2020-07-14 12:11:12 +02:00
Lephe 77de9e7796
move private headers to subfolders of src/
This keeps the include/ folder clean.
2020-07-13 17:47:21 +02:00
Lephe d8886c7dbf
core: answer TLB misses and remove startup mapping (UNSTABLE)
This change adds a TLB miss handler that calls __TLB_LoadPTEH() and
removes the startu mapping of add-in pages in the explore() routine of
src/core/start.c.

Note that calling __TLB_LoadPTEH() manually might unexpectedly lead to a
TLB multihit problem as the requested page might be accidentally loaded
by a TLB miss in the code that loads it. A TLB multihit is a platform
reset, so this function should always be considered unsafe to call
(unless the calling code is in a combination of P1 space and ILRAM).

This change also moves a lot of functions out of the .pretext section,
notably topti, as this was designed to allow panic messages when the
add-in couldn't be mapped entirely. By contrast, a GMAPPED macro has
been defined to mark crucial kernel code and data that must remain
mapped at all times. This currently puts the data in ILRAM because
static RAM is not executable. An alternative will have to be found for
SH3-based fx9860g machines.

This version still does not allow TLB misses in timer callbacks and
breaks return-to-menu in a severe way! It is not suitable for any
stable application!
2020-06-14 18:22:20 +02:00
lephe d7c33b12a5 topti: return previously-configured font in dfont() 2019-07-27 19:47:04 -04:00
lephe c80debacd7 keyboard stdio: some fixes 2019-07-17 19:29:12 -04:00
lephe 11b40b445c render-cg: 8x9 font and proportional font rendering 2019-06-23 17:27:44 -04:00
lephe 0055199359 render: refactor to share functions, and basic text on fxcg50 2019-06-15 01:05:31 -04:00