Add unicode replacement character onto VGA font.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-12-28 20:18:25 +01:00
parent 6c339085fe
commit 9e67c78271
2 changed files with 3 additions and 1 deletions

View File

@ -87,6 +87,8 @@ static void FetchVGAFont(uint8_t* font)
// 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.
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++ )
{
const uint8_t* src = data + (32*8)/8 * i;

View File

@ -55,7 +55,7 @@ static uint16_t CharToTextEntry(TextChar c)
{
int remap = VGA::MapWideToVGAFont(c.c);
if ( remap < 0 )
return (uint16_t) '?' | (uint16_t) COLOR8_RED << 8U;
remap = 0 /* replacement character */;
return (uint16_t) remap | (uint16_t) c.vgacolor << 8U;
}