mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add unicode replacement character onto VGA font.
This commit is contained in:
parent
6c339085fe
commit
9e67c78271
2 changed files with 3 additions and 1 deletions
|
@ -87,6 +87,8 @@ static void FetchVGAFont(uint8_t* font)
|
||||||
// The font data is now at 0xA0000, so fetch it. Note that there is
|
// The font data is now at 0xA0000, so fetch it. Note that there is
|
||||||
// reserved room for a 8x32 resolution but we are using 8x16.
|
// reserved room for a 8x32 resolution but we are using 8x16.
|
||||||
const uint8_t* data = (const uint8_t*) 0xA0000UL;
|
const uint8_t* data = (const uint8_t*) 0xA0000UL;
|
||||||
|
// Patch the replacement chararacter onto character 0.
|
||||||
|
memcpy((uint8_t*) data + ((32*8)/8 * 0), font_replacement_character, VGA_FONT_CHARSIZE);
|
||||||
for ( size_t i = 0; i < VGA_FONT_NUMCHARS; i++ )
|
for ( size_t i = 0; i < VGA_FONT_NUMCHARS; i++ )
|
||||||
{
|
{
|
||||||
const uint8_t* src = data + (32*8)/8 * i;
|
const uint8_t* src = data + (32*8)/8 * i;
|
||||||
|
|
|
@ -55,7 +55,7 @@ static uint16_t CharToTextEntry(TextChar c)
|
||||||
{
|
{
|
||||||
int remap = VGA::MapWideToVGAFont(c.c);
|
int remap = VGA::MapWideToVGAFont(c.c);
|
||||||
if ( remap < 0 )
|
if ( remap < 0 )
|
||||||
return (uint16_t) '?' | (uint16_t) COLOR8_RED << 8U;
|
remap = 0 /* replacement character */;
|
||||||
return (uint16_t) remap | (uint16_t) c.vgacolor << 8U;
|
return (uint16_t) remap | (uint16_t) c.vgacolor << 8U;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue