Revert "internals: Support characters beyond the first unicode plane (WIP)"

This reverts commit d05c59f35b.
This commit is contained in:
Solomon Peachy 2025-08-20 16:09:49 -04:00
parent d05c59f35b
commit 84504c7471
44 changed files with 335 additions and 480 deletions

View file

@ -199,8 +199,8 @@ void grey_hline(int x1, int x2, int y)
/* nothing to draw? */
if (y < _grey_info.clip_t || y >= _grey_info.clip_b ||
x1 >= _grey_info.clip_r || x2 < _grey_info.clip_l)
return;
return;
/* drawmode and optimisation */
if (vp->drawmode & DRMODE_INVERSEVID)
{
@ -251,7 +251,7 @@ void grey_vline(int x, int y1, int y2)
unsigned char *dst, *dst_end;
void (*pfunc)(unsigned char *address);
int dwidth;
/* direction flip */
if (y2 < y1)
{
@ -264,7 +264,7 @@ void grey_vline(int x, int y1, int y2)
if (x < _grey_info.clip_l || x >= _grey_info.clip_r ||
y1 >= _grey_info.clip_b || y2 < _grey_info.clip_t)
return;
/* clipping */
if (y1 < _grey_info.clip_t)
y1 = _grey_info.clip_t;
@ -425,7 +425,7 @@ void grey_fillrect(int x, int y, int width, int height)
if (height <= 0)
return;
dwidth = _grey_info.cb_width;
dst = &_grey_info.curbuffer[
_GREY_MULUQ(dwidth, _grey_info.vp->y - _grey_info.cb_y + y) +
@ -653,8 +653,8 @@ void grey_gray_bitmap(const unsigned char *src, int x, int y, int width,
/* Put a string at a given pixel position, skipping first ofs pixel columns */
void grey_putsxyofs(int x, int y, int ofs, const unsigned char *str)
{
ucschar_t ch;
ucschar_t *ucs;
int ch;
unsigned short *ucs;
struct font* pf;
if (_grey_info.clip_b <= _grey_info.clip_t)
@ -680,7 +680,7 @@ void grey_putsxyofs(int x, int y, int ofs, const unsigned char *str)
bits = rb->font_get_bits(pf, ch);
grey_mono_bitmap_part(bits, ofs, 0, width, x, y, width - ofs, pf->height);
x += width - ofs;
ofs = 0;
}
@ -709,7 +709,7 @@ void grey_ub_clear_display(void)
#endif
}
/* Assembler optimised helper function for copying a single line to the
/* Assembler optimised helper function for copying a single line to the
* greyvalue buffer. */
void _grey_line1(int width, unsigned char *dst, const unsigned char *src,
const unsigned char *lut);
@ -725,7 +725,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
if ((width <= 0) || (height <= 0) || (x >= _grey_info.width)
|| (y >= _grey_info.height) || (x + width <= 0) || (y + height <= 0))
return;
/* clipping */
if (x < 0)
{
@ -744,7 +744,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
if (y + height > _grey_info.height)
height = _grey_info.height - y;
src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */
src += _GREY_MULUQ(stride, src_y) + src_x; /* move starting point */
yc = y;
ye = y + height;
dst = _grey_info.values + (x << _GREY_BSHIFT);
@ -773,7 +773,7 @@ void grey_ub_gray_bitmap_part(const unsigned char *src, int src_x, int src_y,
}
while (src_row < src_end);
#endif
src += stride;
}
while (++yc < ye);

View file

@ -22,8 +22,8 @@
#include "kbd_helper.h"
/* USAGE:
ucschar_t kbd[64];
ucschar_t *kbd_p = kbd;
unsigned short kbd[64];
unsigned short *kbd_p = kbd;
if (!kbd_create_layout("ABCD1234\n", kbd, sizeof(kbd)))
kbd_p = NULL;
@ -34,14 +34,14 @@
* success returns size of buffer used
* failure returns 0
*/
int kbd_create_layout(const char *layout, ucschar_t *buf, int bufsz)
int kbd_create_layout(const char *layout, unsigned short *buf, int bufsz)
{
ucschar_t *pbuf;
unsigned short *pbuf;
const unsigned char *p = layout;
int len = 0;
int total_len = 0;
pbuf = buf;
while (*p && (pbuf - buf + (ptrdiff_t) sizeof(ucschar_t)) < bufsz)
while (*p && (pbuf - buf + (ptrdiff_t) sizeof(unsigned short)) < bufsz)
{
p = rb->utf8decode(p, &pbuf[len+1]);
if (pbuf[len+1] == '\n')
@ -60,7 +60,7 @@ int kbd_create_layout(const char *layout, ucschar_t *buf, int bufsz)
*pbuf = len;
pbuf[len+1] = 0xFEFF; /* mark end of characters */
total_len += len + 1;
return total_len * sizeof(ucschar_t);
return total_len * sizeof(unsigned short);
}
return 0;

View file

@ -1,10 +1,10 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2020 William Wilgus
@ -22,6 +22,6 @@
#define KBD_HELPER_H
/* create a custom keyboard layout for kbd_input */
int kbd_create_layout(const char *layout, ucschar_t *buf, int bufsz);
int kbd_create_layout(const char *layout, unsigned short *buf, int bufsz);
#endif /* KBD_HELPER_H */

View file

@ -62,7 +62,7 @@ static const char* get_next_line(const char *text, struct view_info *info)
total = 0;
while(*ptr)
{
ucschar_t ch;
unsigned short ch;
n = ((intptr_t)rb->utf8decode(ptr, &ch) - (intptr_t)ptr);
if (rb->is_diacritic(ch, NULL))
w = 0;