[FREELDR] Reimplement i386PrintText(), adding line wrap handling. CORE-16268

Co-Authored-By: Stanislav Motylkov <x86corez@gmail.com>
This commit is contained in:
Serge Gautherie 2019-07-31 15:48:46 +02:00 committed by Hermès Bélusca-Maïto
parent 043307624f
commit ad43210b41
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -49,21 +49,26 @@ i386PrintChar(CHAR chr, ULONG x, ULONG y)
static void
i386PrintText(CHAR *pszText)
{
char chr;
while (1)
{
chr = *pszText++;
ULONG Width, Unused;
if (chr == 0) break;
if (chr == '\n')
MachVideoGetDisplaySize(&Width, &Unused, &Unused);
for (; *pszText != ANSI_NULL; ++pszText)
{
if (*pszText == '\n')
{
i386_ScreenPosY++;
i386_ScreenPosX = 0;
++i386_ScreenPosY;
continue;
}
MachVideoPutChar(chr, SCREEN_ATTR, i386_ScreenPosX, i386_ScreenPosY);
i386_ScreenPosX++;
MachVideoPutChar(*pszText, SCREEN_ATTR, i386_ScreenPosX, i386_ScreenPosY);
if (++i386_ScreenPosX >= Width)
{
i386_ScreenPosX = 0;
++i386_ScreenPosY;
}
// FIXME: Implement vertical screen scrolling if we are at the end of the screen.
}
}