Commit Graph

26 Commits

Author SHA1 Message Date
Lephe 4df3d69d8c
render: add a window setting to restrict rendering
Mono text rendering is a bad hack and probably not that fast, but meh.
We can optimize it the day it becomes a bottleneck, if ever...
2022-11-19 17:19:28 +01:00
Lephe 74438f5da5
render: add a dgetpixel() function 2022-11-16 19:12:48 +01:00
Lephe d3a2cf07a0
usb: add video capture through the fxlink protocol 2021-08-11 01:43:26 +02:00
Lephe 10180d31bc
add C++ header guards 2021-06-13 18:13:09 +02:00
Lephe 99403a9504
render: support C_INVERT on fx-CG 50 2021-05-12 09:17:25 +02: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 a086510885
display: add a maximum size parameter to dtext_opt()
This parameter controls the maximum number of glyphs to print.

For backwards compatibility, it is automatically inserted by a macro in
older calls with only 7 parameters.
2021-02-15 18:37:06 +01: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 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 94fb300e72
gray: finalize the gray engine API
* Define dgray() to replace gray_start() and gray_stop()
* Introduce a mechanism to override the d*() functions rather than using
  another set of functions, namely g*(). Gray rendering should now be
  done with d*() (a compatibility macro for g*() is available until v2.1).
* Gray engine now reserves TMU0 at the start of the add-in to prevent
  surprises if timers are exhausted, so it nevers fails to start
* Replace other gray engine functions with dgray_*()
* More general rendering functions (in render/) to lessen the burden of
  porting them to the gray engine. As a consequence, dtext_opt(),
  dprint_opt() and drect_border() are now available in the gray engine,
  which was an omission from 230b796.
* Allow C_NONE in more functions, mainly on fx-CG 50
* Remove the now-unused dupdate_noint()
2020-07-13 13:49:07 +02:00
Lephe 230b796196
render: add alignment options to dtext_opt() and dprint_opt()
This change introduces two new functions dtext_opt() and dprint_opt()
that have both color and alignment options. The regular dtext() and
dprint() have been changed to always used bg=C_NONE which is what most
calls want.
2020-06-18 18:31:13 +02:00
Lephe 06345967fd
render: add a drect_border() function 2020-06-18 17:50:27 +02:00
Lephe caa4f675c9
bopti: deprecate image_t, renamed to bopti_image_t 2020-06-01 12:11:59 +02:00
Lephe ef0e5e32f8
render: add one-parameter dvline() and dhline()
Behave like Basic's Horizontal and Vertical commands. Internal dline()
optimizations are renamed gint_dhline() and gint_dvline().

Also supports ghline() and gvline() in the gray engine.

Optimization cases here are amost negligible due to limiting RAM access
frequencies and the very limited amount of work accomplished in the
functions. Code maintainability is prioritized by using dline().
2019-09-07 11:26:11 +02:00
lephe b9cba1d00a
style, formatting, font 2019-09-03 22:29:04 +02:00
lephe e1aca8d89b
exc: add exception handlers, use them in the DMA
This change introduces exception handlers that default to a fatal error
with an on-screen description of the exception and some debugging
information.

It also adds the dprint() function as a definitely-needed helper and
removes bootlog_unmapped() by using the exception handler for the fatal
error display. (Also printf() is now required in all gint add-ins; this
is sad, but space is not as much of a constraint as debugging.)

Finally, the exception handler is used to handle an interrupt which is
an exception in practice, the DMA address error. On fx-CG 50, additional
DMA-related information is displayed on the screen. This is left out on
fx-9860G as there is not enough space.
2019-09-03 22:15:00 +02:00
lephe 652637d475 bopti: add support for r5g6b5 and r5g6b5a on fxcg50
This commit introduces bopti for fxcg50 with the first basic 16-bit
formats. The performance is rather slow, especially for large images,
and will need refinements and/or overclock to be really efficient in
full-screen real-time applications.
2019-08-27 21:04:07 +02:00
lephe d7c33b12a5 topti: return previously-configured font in dfont() 2019-07-27 19:47:04 -04:00
lephe ff2db385a8 TODO update and miscellaneous style 2019-07-16 18:34:10 -04:00
lephe f8d69dd56a display: add a dupdate_noint() for exceptions handlers 2019-07-04 11:46:26 -04:00
lephe 0055199359 render: refactor to share functions, and basic text on fxcg50 2019-06-15 01:05:31 -04:00
lephe f3c8964b84 render-cg: decently implement basic functions 2019-05-03 17:11:43 +02:00
lephe f33cb3cf80 core: better bootlog API and implementation
* Now uses topti instead of fxlib for text (including MMU failure)
* Fit .pretext into 4k for everything before MMU succeeds
* A short version of sprintf() for dynamic messages
* Support a driver function, status(), to allow early driver debug
* Expose more useful platform information in <gint/mpu.h>
* Expose the first of a few CASIOWIN syscalls
2019-03-06 14:32:51 +01:00
lephe 3f7c0a04ad way too much, including bopti/topti, timers, and more. 2019-02-21 21:00:26 +01:00
lephe 3b90b40dd7 Hybrid build system and runtime (no interrupts). t6k11 driver. Basic r61524 driver. 2018-04-19 13:24:26 +02:00