BOOLEAN TuiInitialize(VOID)
{
- MachVideoClearScreen(ATTR(COLOR_WHITE, COLOR_BLACK));
MachVideoHideShowTextCursor(FALSE);
+ MachVideoClearScreen(ATTR(COLOR_GRAY, COLOR_BLACK));
TextVideoBuffer = VideoAllocateOffScreenBuffer();
if (TextVideoBuffer == NULL)
MachVideoSetDisplayMode(NULL, FALSE);
}
- //VideoClearScreen();
+ MachVideoClearScreen(ATTR(COLOR_GRAY, COLOR_BLACK));
MachVideoHideShowTextCursor(TRUE);
}
//
// Draw title text
//
- TuiDrawText( (UiScreenWidth / 2) - (strlen(UiTitleBoxTitleText) / 2),
+ TuiDrawText( (UiScreenWidth / 2) - ((ULONG)strlen(UiTitleBoxTitleText) / 2),
2,
UiTitleBoxTitleText,
ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
- //
- // Draw status bar
- //
- TuiDrawStatusText("Welcome to FreeLoader!");
-
//
// Update the date & time
//
VOID TuiFillArea(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, CHAR FillChar, UCHAR Attr /* Color Attributes */)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i, j;
+ ULONG i, j;
// Clip the area to the screen
if ((Left >= UiScreenWidth) || (Top >= UiScreenHeight))
VOID TuiDrawShadow(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG Idx;
+ ULONG Idx;
// Shade the bottom of the area
if (Bottom < (UiScreenHeight - 1))
VOID TuiDrawText(ULONG X, ULONG Y, PCSTR Text, UCHAR Attr)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i, j;
+ ULONG i, j;
// Draw the text
for (i=X, j=0; Text[j] && i<UiScreenWidth; i++,j++)
VOID TuiDrawCenteredText(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, PCSTR TextString, UCHAR Attr)
{
- ULONG TextLength;
- ULONG BoxWidth;
- ULONG BoxHeight;
- ULONG LineBreakCount;
- ULONG Index;
- ULONG LastIndex;
- ULONG RealLeft;
- ULONG RealTop;
- ULONG X;
- ULONG Y;
+ SIZE_T TextLength;
+ ULONG BoxWidth;
+ ULONG BoxHeight;
+ ULONG LineBreakCount;
+ SIZE_T Index;
+ SIZE_T LastIndex;
+ ULONG RealLeft;
+ ULONG RealTop;
+ ULONG X;
+ ULONG Y;
CHAR Temp[2];
TextLength = strlen(TextString);
{
if ((Index - LastIndex) > BoxWidth)
{
- BoxWidth = (Index - LastIndex);
+ BoxWidth = (ULONG)(Index - LastIndex);
}
}
}
}
else
{
- X = RealLeft + LastIndex;
+ X = (ULONG)(RealLeft + LastIndex);
Y = RealTop;
LastIndex++;
Temp[0] = TextString[Index];
VOID TuiDrawStatusText(PCSTR StatusText)
{
- ULONG i;
+ SIZE_T i;
TuiDrawText(0, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
TuiDrawText(1, UiScreenHeight-1, StatusText, ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
for (i=strlen(StatusText)+1; i<UiScreenWidth; i++)
{
- TuiDrawText(i, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
+ TuiDrawText((ULONG)i, UiScreenHeight-1, " ", ATTR(UiStatusBarFgColor, UiStatusBarBgColor));
}
VideoCopyOffScreenBufferToVRAM();
strcat(DateString, TempString);
// Draw the date
- TuiDrawText(UiScreenWidth-strlen(DateString)-2, 1, DateString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
+ TuiDrawText(UiScreenWidth-(ULONG)strlen(DateString)-2, 1, DateString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
// Get the hour and change from 24-hour mode to 12-hour
if (TimeInfo->Hour > 12)
}
// Draw the time
- TuiDrawText(UiScreenWidth-strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
+ TuiDrawText(UiScreenWidth-(ULONG)strlen(TimeString)-2, 2, TimeString, ATTR(UiTitleBoxFgColor, UiTitleBoxBgColor));
}
VOID TuiSaveScreen(PUCHAR Buffer)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i;
+ ULONG i;
for (i=0; i < (UiScreenWidth * UiScreenHeight * 2); i++)
{
VOID TuiRestoreScreen(PUCHAR Buffer)
{
PUCHAR ScreenMemory = (PUCHAR)TextVideoBuffer;
- ULONG i;
+ ULONG i;
for (i=0; i < (UiScreenWidth * UiScreenHeight * 2); i++)
{
TuiUpdateDateTime();
VideoCopyOffScreenBufferToVRAM();
+
+ MachHwIdle();
}
}
-
VOID TuiDrawProgressBarCenter(ULONG Position, ULONG Range, PCHAR ProgressText)
{
- ULONG Left, Top, Right, Bottom;
- ULONG Width = 50; // Allow for 50 "bars"
- ULONG Height = 2;
+ ULONG Left, Top, Right, Bottom;
+ ULONG Width = 50; // Allow for 50 "bars"
+ ULONG Height = 2;
Left = (UiScreenWidth - Width - 4) / 2;
Right = Left + Width + 3;
VOID TuiDrawProgressBar(ULONG Left, ULONG Top, ULONG Right, ULONG Bottom, ULONG Position, ULONG Range, PCHAR ProgressText)
{
- ULONG i;
- ULONG ProgressBarWidth = (Right - Left) - 3;
+ ULONG i;
+ ULONG ProgressBarWidth = (Right - Left) - 3;
// First make sure the progress bar text fits
UiTruncateStringEllipsis(ProgressText, ProgressBarWidth - 4);
TuiUpdateDateTime();
VideoCopyOffScreenBufferToVRAM();
+
+ MachHwIdle();
}
// Hide the cursor again