3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 PVOID TextVideoBuffer
= NULL
;
25 * printf() - prints formatted text to stdout
26 * originally from GRUB
28 int printf(const char *format
, ... )
32 char c
, *ptr
, str
[16];
34 while ((c
= *(format
++)))
42 switch (c
= *(format
++))
44 case 'd': case 'u': case 'x':
46 _itoa(va_arg(ap
, unsigned long), str
, 16);
48 _itoa(va_arg(ap
, unsigned long), str
, 10);
54 MachConsPutChar(*(ptr
++));
58 case 'c': MachConsPutChar((va_arg(ap
,int))&0xff); break;
61 ptr
= va_arg(ap
,char *);
63 while ((c
= *(ptr
++)))
72 printf("\nprintf() invalid format specifier - %%%c\n", c
);
83 BOOLEAN
TuiInitialize(VOID
)
85 MachVideoClearScreen(ATTR(COLOR_WHITE
, COLOR_BLACK
));
86 MachVideoHideShowTextCursor(FALSE
);
88 TextVideoBuffer
= VideoAllocateOffScreenBuffer();
89 if (TextVideoBuffer
== NULL
)
97 VOID
TuiUnInitialize(VOID
)
99 if (UiUseSpecialEffects
)
105 MachVideoSetDisplayMode(NULL
, FALSE
);
108 //VideoClearScreen();
109 MachVideoHideShowTextCursor(TRUE
);
112 VOID
TuiDrawBackdrop(VOID
)
115 // Fill in the background (excluding title box & status bar)
118 TUI_TITLE_BOX_CHAR_HEIGHT
,
122 ATTR(UiBackdropFgColor
, UiBackdropBgColor
));
125 // Draw the title box
130 TUI_TITLE_BOX_CHAR_HEIGHT
- 1,
135 ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
142 GetFreeLoaderVersionString(),
143 ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
151 ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
155 ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
160 TuiDrawText(UiScreenWidth
- 16, 3, /*"F1 for Help"*/"F8 for Options", ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
165 TuiDrawText( (UiScreenWidth
/ 2) - (strlen(UiTitleBoxTitleText
) / 2),
168 ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
173 TuiDrawStatusText("Welcome to FreeLoader!");
176 // Update the date & time
180 VideoCopyOffScreenBufferToVRAM();
185 * This function assumes coordinates are zero-based
187 VOID
TuiFillArea(ULONG Left
, ULONG Top
, ULONG Right
, ULONG Bottom
, CHAR FillChar
, UCHAR Attr
/* Color Attributes */)
189 PUCHAR ScreenMemory
= (PUCHAR
)TextVideoBuffer
;
192 // Clip the area to the screen
193 if ((Left
>= UiScreenWidth
) || (Top
>= UiScreenHeight
))
197 if (Right
>= UiScreenWidth
)
199 Right
= UiScreenWidth
- 1;
201 if (Bottom
>= UiScreenHeight
)
203 Bottom
= UiScreenHeight
- 1;
206 // Loop through each line and fill it in
207 for (i
=Top
; i
<=Bottom
; i
++)
209 // Loop through each character (column) in the line and fill it in
210 for (j
=Left
; j
<=Right
; j
++)
212 ScreenMemory
[((i
*2)*UiScreenWidth
)+(j
*2)] = (UCHAR
)FillChar
;
213 ScreenMemory
[((i
*2)*UiScreenWidth
)+(j
*2)+1] = Attr
;
220 * This function assumes coordinates are zero-based
222 VOID
TuiDrawShadow(ULONG Left
, ULONG Top
, ULONG Right
, ULONG Bottom
)
224 PUCHAR ScreenMemory
= (PUCHAR
)TextVideoBuffer
;
227 // Shade the bottom of the area
228 if (Bottom
< (UiScreenHeight
- 1))
230 if (UiScreenHeight
< 34)
239 for (; Idx
<=Right
; Idx
++)
241 ScreenMemory
[(((Bottom
+1)*2)*UiScreenWidth
)+(Idx
*2)+1] = ATTR(COLOR_GRAY
, COLOR_BLACK
);
245 // Shade the right of the area
246 if (Right
< (UiScreenWidth
- 1))
248 for (Idx
=Top
+1; Idx
<=Bottom
; Idx
++)
250 ScreenMemory
[((Idx
*2)*UiScreenWidth
)+((Right
+1)*2)+1] = ATTR(COLOR_GRAY
, COLOR_BLACK
);
253 if (UiScreenHeight
< 34)
255 if ((Right
+ 1) < (UiScreenWidth
- 1))
257 for (Idx
=Top
+1; Idx
<=Bottom
; Idx
++)
259 ScreenMemory
[((Idx
*2)*UiScreenWidth
)+((Right
+2)*2)+1] = ATTR(COLOR_GRAY
, COLOR_BLACK
);
264 // Shade the bottom right corner
265 if ((Right
< (UiScreenWidth
- 1)) && (Bottom
< (UiScreenHeight
- 1)))
267 ScreenMemory
[(((Bottom
+1)*2)*UiScreenWidth
)+((Right
+1)*2)+1] = ATTR(COLOR_GRAY
, COLOR_BLACK
);
269 if (UiScreenHeight
< 34)
271 if (((Right
+ 1) < (UiScreenWidth
- 1)) && (Bottom
< (UiScreenHeight
- 1)))
273 ScreenMemory
[(((Bottom
+1)*2)*UiScreenWidth
)+((Right
+2)*2)+1] = ATTR(COLOR_GRAY
, COLOR_BLACK
);
280 * This function assumes coordinates are zero-based
282 VOID
TuiDrawBox(ULONG Left
, ULONG Top
, ULONG Right
, ULONG Bottom
, UCHAR VertStyle
, UCHAR HorzStyle
, BOOLEAN Fill
, BOOLEAN Shadow
, UCHAR Attr
)
284 UCHAR ULCorner
, URCorner
, LLCorner
, LRCorner
;
286 // Calculate the corner values
287 if (HorzStyle
== HORZ
)
289 if (VertStyle
== VERT
)
296 else // VertStyle == D_VERT
304 else // HorzStyle == D_HORZ
306 if (VertStyle
== VERT
)
313 else // VertStyle == D_VERT
322 // Fill in box background
325 TuiFillArea(Left
, Top
, Right
, Bottom
, ' ', Attr
);
329 TuiFillArea(Left
, Top
, Left
, Top
, ULCorner
, Attr
);
330 TuiFillArea(Right
, Top
, Right
, Top
, URCorner
, Attr
);
331 TuiFillArea(Left
, Bottom
, Left
, Bottom
, LLCorner
, Attr
);
332 TuiFillArea(Right
, Bottom
, Right
, Bottom
, LRCorner
, Attr
);
335 TuiFillArea(Left
, Top
+1, Left
, Bottom
-1, VertStyle
, Attr
);
337 TuiFillArea(Left
+1, Top
, Right
-1, Top
, HorzStyle
, Attr
);
338 // Fill in right line
339 TuiFillArea(Right
, Top
+1, Right
, Bottom
-1, VertStyle
, Attr
);
340 // Fill in bottom line
341 TuiFillArea(Left
+1, Bottom
, Right
-1, Bottom
, HorzStyle
, Attr
);
346 TuiDrawShadow(Left
, Top
, Right
, Bottom
);
352 * This function assumes coordinates are zero-based
354 VOID
TuiDrawText(ULONG X
, ULONG Y
, PCSTR Text
, UCHAR Attr
)
356 PUCHAR ScreenMemory
= (PUCHAR
)TextVideoBuffer
;
360 for (i
=X
, j
=0; Text
[j
] && i
<UiScreenWidth
; i
++,j
++)
362 ScreenMemory
[((Y
*2)*UiScreenWidth
)+(i
*2)] = (UCHAR
)Text
[j
];
363 ScreenMemory
[((Y
*2)*UiScreenWidth
)+(i
*2)+1] = Attr
;
367 VOID
TuiDrawCenteredText(ULONG Left
, ULONG Top
, ULONG Right
, ULONG Bottom
, PCSTR TextString
, UCHAR Attr
)
372 ULONG LineBreakCount
;
381 TextLength
= strlen(TextString
);
383 // Count the new lines and the box width
387 for (Index
=0; Index
<TextLength
; Index
++)
389 if (TextString
[Index
] == '\n')
396 if ((Index
- LastIndex
) > BoxWidth
)
398 BoxWidth
= (Index
- LastIndex
);
403 BoxHeight
= LineBreakCount
+ 1;
405 RealLeft
= (((Right
- Left
) - BoxWidth
) / 2) + Left
;
406 RealTop
= (((Bottom
- Top
) - BoxHeight
) / 2) + Top
;
409 for (Index
=0; Index
<TextLength
; Index
++)
411 if (TextString
[Index
] == '\n')
418 X
= RealLeft
+ LastIndex
;
421 Temp
[0] = TextString
[Index
];
423 TuiDrawText(X
, Y
, Temp
, Attr
);
428 VOID
TuiDrawStatusText(PCSTR StatusText
)
432 TuiDrawText(0, UiScreenHeight
-1, " ", ATTR(UiStatusBarFgColor
, UiStatusBarBgColor
));
433 TuiDrawText(1, UiScreenHeight
-1, StatusText
, ATTR(UiStatusBarFgColor
, UiStatusBarBgColor
));
435 for (i
=strlen(StatusText
)+1; i
<UiScreenWidth
; i
++)
437 TuiDrawText(i
, UiScreenHeight
-1, " ", ATTR(UiStatusBarFgColor
, UiStatusBarBgColor
));
440 VideoCopyOffScreenBufferToVRAM();
443 VOID
TuiUpdateDateTime(VOID
)
445 ULONG Year
, Month
, Day
;
446 ULONG Hour
, Minute
, Second
;
450 BOOLEAN PMHour
= FALSE
;
452 /* Don't draw the time if this has been disabled */
453 if (!UiDrawTime
) return;
455 MachRTCGetCurrentDateTime(&Year
, &Month
, &Day
, &Hour
, &Minute
, &Second
);
456 if (Year
< 1 || 9999 < Year
|| Month
< 1 || 12 < Month
|| Day
< 1 ||
457 31 < Day
|| 23 < Hour
|| 59 < Minute
|| 59 < Second
)
459 /* This happens on QEmu sometimes. We just skip updating */
462 // Get the month name
463 strcpy(DateString
, UiMonthNames
[Month
- 1]);
465 _itoa(Day
, TempString
, 10);
466 // Get the day postfix
467 if (1 == Day
|| 21 == Day
|| 31 == Day
)
469 strcat(TempString
, "st");
471 else if (2 == Day
|| 22 == Day
)
473 strcat(TempString
, "nd");
475 else if (3 == Day
|| 23 == Day
)
477 strcat(TempString
, "rd");
481 strcat(TempString
, "th");
484 // Add the day to the date
485 strcat(DateString
, TempString
);
486 strcat(DateString
, " ");
488 // Get the year and add it to the date
489 _itoa(Year
, TempString
, 10);
490 strcat(DateString
, TempString
);
493 TuiDrawText(UiScreenWidth
-strlen(DateString
)-2, 1, DateString
, ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
495 // Get the hour and change from 24-hour mode to 12-hour
505 _itoa(Hour
, TempString
, 10);
506 strcpy(TimeString
, " ");
507 strcat(TimeString
, TempString
);
508 strcat(TimeString
, ":");
509 _itoa(Minute
, TempString
, 10);
512 strcat(TimeString
, "0");
514 strcat(TimeString
, TempString
);
515 strcat(TimeString
, ":");
516 _itoa(Second
, TempString
, 10);
519 strcat(TimeString
, "0");
521 strcat(TimeString
, TempString
);
524 strcat(TimeString
, " PM");
528 strcat(TimeString
, " AM");
532 TuiDrawText(UiScreenWidth
-strlen(TimeString
)-2, 2, TimeString
, ATTR(UiTitleBoxFgColor
, UiTitleBoxBgColor
));
535 VOID
TuiSaveScreen(PUCHAR Buffer
)
537 PUCHAR ScreenMemory
= (PUCHAR
)TextVideoBuffer
;
540 for (i
=0; i
< (UiScreenWidth
* UiScreenHeight
* 2); i
++)
542 Buffer
[i
] = ScreenMemory
[i
];
546 VOID
TuiRestoreScreen(PUCHAR Buffer
)
548 PUCHAR ScreenMemory
= (PUCHAR
)TextVideoBuffer
;
551 for (i
=0; i
< (UiScreenWidth
* UiScreenHeight
* 2); i
++)
553 ScreenMemory
[i
] = Buffer
[i
];
557 VOID
TuiMessageBox(PCSTR MessageText
)
561 // Save the screen contents
562 ScreenBuffer
= MmAllocateMemory(UiScreenWidth
* UiScreenHeight
* 2);
563 TuiSaveScreen(ScreenBuffer
);
565 // Display the message box
566 TuiMessageBoxCritical(MessageText
);
568 // Restore the screen contents
569 TuiRestoreScreen(ScreenBuffer
);
570 MmFreeMemory(ScreenBuffer
);
573 VOID
TuiMessageBoxCritical(PCSTR MessageText
)
576 unsigned int height
= 1;
585 for (i
=0; i
<strlen(MessageText
); i
++)
587 if (MessageText
[i
] == '\n')
592 for (i
=0,j
=0,k
=0; i
<height
; i
++)
594 while ((MessageText
[j
] != '\n') && (MessageText
[j
] != 0))
607 // Calculate box area
608 x1
= (UiScreenWidth
- (width
+2))/2;
610 y1
= ((UiScreenHeight
- height
- 2)/2) + 1;
611 y2
= y1
+ height
+ 4;
614 TuiDrawBox(x1
, y1
, x2
, y2
, D_VERT
, D_HORZ
, TRUE
, TRUE
, ATTR(UiMessageBoxFgColor
, UiMessageBoxBgColor
));
617 for (i
=0,j
=0; i
<strlen(MessageText
)+1; i
++)
619 if ((MessageText
[i
] == '\n') || (MessageText
[i
] == 0))
623 UiDrawText(x1
+2, y1
+1+curline
, temp
, ATTR(UiMessageBoxFgColor
, UiMessageBoxBgColor
));
627 temp
[j
++] = MessageText
[i
];
631 strcpy(temp
, " OK ");
632 UiDrawText(x1
+((x2
-x1
)/2)-3, y2
-2, temp
, ATTR(COLOR_BLACK
, COLOR_GRAY
));
635 UiDrawStatusText("Press ENTER to continue");
637 VideoCopyOffScreenBufferToVRAM();
643 key
= MachConsGetCh();
644 if(key
== KEY_EXTENDED
)
645 key
= MachConsGetCh();
649 else if(key
== KEY_SPACE
)
651 else if(key
== KEY_ESC
)
657 VideoCopyOffScreenBufferToVRAM();
663 VOID
TuiDrawProgressBarCenter(ULONG Position
, ULONG Range
, PCHAR ProgressText
)
665 ULONG Left
, Top
, Right
, Bottom
;
666 ULONG Width
= 50; // Allow for 50 "bars"
669 Left
= (UiScreenWidth
- Width
- 4) / 2;
670 Right
= Left
+ Width
+ 3;
671 Top
= (UiScreenHeight
- Height
- 2) / 2;
673 Bottom
= Top
+ Height
+ 1;
675 TuiDrawProgressBar(Left
, Top
, Right
, Bottom
, Position
, Range
, ProgressText
);
678 VOID
TuiDrawProgressBar(ULONG Left
, ULONG Top
, ULONG Right
, ULONG Bottom
, ULONG Position
, ULONG Range
, PCHAR ProgressText
)
681 ULONG ProgressBarWidth
= (Right
- Left
) - 3;
683 // First make sure the progress bar text fits
684 UiTruncateStringEllipsis(ProgressText
, ProgressBarWidth
- 4);
686 if (Position
> Range
)
692 TuiDrawBox(Left
, Top
, Right
, Bottom
, VERT
, HORZ
, TRUE
, TRUE
, ATTR(UiMenuFgColor
, UiMenuBgColor
));
695 // Draw the "Loading..." text
697 TuiDrawCenteredText(Left
+ 2, Top
+ 2, Right
- 2, Top
+ 2, ProgressText
, ATTR(UiTextColor
, UiMenuBgColor
));
699 // Draw the percent complete
700 for (i
=0; i
<(Position
*ProgressBarWidth
)/Range
; i
++)
702 TuiDrawText(Left
+2+i
, Top
+2, "\xDB", ATTR(UiTextColor
, UiMenuBgColor
));
706 for (; i
<ProgressBarWidth
; i
++)
708 TuiDrawText(Left
+2+i
, Top
+2, "\xB2", ATTR(UiTextColor
, UiMenuBgColor
));
712 VideoCopyOffScreenBufferToVRAM();
715 UCHAR
TuiTextToColor(PCSTR ColorText
)
717 if (_stricmp(ColorText
, "Black") == 0)
719 else if (_stricmp(ColorText
, "Blue") == 0)
721 else if (_stricmp(ColorText
, "Green") == 0)
723 else if (_stricmp(ColorText
, "Cyan") == 0)
725 else if (_stricmp(ColorText
, "Red") == 0)
727 else if (_stricmp(ColorText
, "Magenta") == 0)
728 return COLOR_MAGENTA
;
729 else if (_stricmp(ColorText
, "Brown") == 0)
731 else if (_stricmp(ColorText
, "Gray") == 0)
733 else if (_stricmp(ColorText
, "DarkGray") == 0)
734 return COLOR_DARKGRAY
;
735 else if (_stricmp(ColorText
, "LightBlue") == 0)
736 return COLOR_LIGHTBLUE
;
737 else if (_stricmp(ColorText
, "LightGreen") == 0)
738 return COLOR_LIGHTGREEN
;
739 else if (_stricmp(ColorText
, "LightCyan") == 0)
740 return COLOR_LIGHTCYAN
;
741 else if (_stricmp(ColorText
, "LightRed") == 0)
742 return COLOR_LIGHTRED
;
743 else if (_stricmp(ColorText
, "LightMagenta") == 0)
744 return COLOR_LIGHTMAGENTA
;
745 else if (_stricmp(ColorText
, "Yellow") == 0)
747 else if (_stricmp(ColorText
, "White") == 0)
753 UCHAR
TuiTextToFillStyle(PCSTR FillStyleText
)
755 if (_stricmp(FillStyleText
, "Light") == 0)
759 else if (_stricmp(FillStyleText
, "Medium") == 0)
763 else if (_stricmp(FillStyleText
, "Dark") == 0)
771 VOID
TuiFadeInBackdrop(VOID
)
773 PPALETTE_ENTRY TuiFadePalette
= NULL
;
775 if (UiUseSpecialEffects
&& ! MachVideoIsPaletteFixed())
777 TuiFadePalette
= (PPALETTE_ENTRY
)MmAllocateMemory(sizeof(PALETTE_ENTRY
) * 64);
779 if (TuiFadePalette
!= NULL
)
781 VideoSavePaletteState(TuiFadePalette
, 64);
782 VideoSetAllColorsToBlack(64);
786 // Draw the backdrop and title box
789 if (UiUseSpecialEffects
&& ! MachVideoIsPaletteFixed() && TuiFadePalette
!= NULL
)
791 VideoFadeIn(TuiFadePalette
, 64);
792 MmFreeMemory(TuiFadePalette
);
796 VOID
TuiFadeOut(VOID
)
798 PPALETTE_ENTRY TuiFadePalette
= NULL
;
800 if (UiUseSpecialEffects
&& ! MachVideoIsPaletteFixed())
802 TuiFadePalette
= (PPALETTE_ENTRY
)MmAllocateMemory(sizeof(PALETTE_ENTRY
) * 64);
804 if (TuiFadePalette
!= NULL
)
806 VideoSavePaletteState(TuiFadePalette
, 64);
810 if (UiUseSpecialEffects
&& ! MachVideoIsPaletteFixed() && TuiFadePalette
!= NULL
)
815 MachVideoSetDisplayMode(NULL
, FALSE
);
817 if (UiUseSpecialEffects
&& ! MachVideoIsPaletteFixed() && TuiFadePalette
!= NULL
)
819 VideoRestorePaletteState(TuiFadePalette
, 64);
820 MmFreeMemory(TuiFadePalette
);
825 BOOLEAN
TuiEditBox(PCSTR MessageText
, PCHAR EditTextBuffer
, ULONG Length
)
828 unsigned int height
= 1;
836 ULONG EditBoxStartX
, EditBoxEndX
;
838 unsigned int EditBoxTextCount
;
839 int EditBoxTextDisplayIndex
;
843 // Save the screen contents
844 ScreenBuffer
= MmAllocateMemory(UiScreenWidth
* UiScreenHeight
* 2);
845 TuiSaveScreen(ScreenBuffer
);
848 for (i
=0; i
<strlen(MessageText
); i
++)
850 if (MessageText
[i
] == '\n')
855 for (i
=0,j
=0,k
=0; i
<height
; i
++)
857 while ((MessageText
[j
] != '\n') && (MessageText
[j
] != 0))
870 // Calculate box area
871 x1
= (UiScreenWidth
- (width
+2))/2;
873 y1
= ((UiScreenHeight
- height
- 2)/2) + 1;
874 y2
= y1
+ height
+ 4;
877 TuiDrawBox(x1
, y1
, x2
, y2
, D_VERT
, D_HORZ
, TRUE
, TRUE
, ATTR(UiMessageBoxFgColor
, UiMessageBoxBgColor
));
880 for (i
=0,j
=0; i
<strlen(MessageText
)+1; i
++)
882 if ((MessageText
[i
] == '\n') || (MessageText
[i
] == 0))
886 UiDrawText(x1
+2, y1
+1+curline
, temp
, ATTR(UiMessageBoxFgColor
, UiMessageBoxBgColor
));
890 temp
[j
++] = MessageText
[i
];
893 EditBoxTextCount
= 0;
894 EditBoxLine
= y2
- 2;
895 EditBoxStartX
= x1
+ 3;
896 EditBoxEndX
= x2
- 3;
897 UiFillArea(EditBoxStartX
, EditBoxLine
, EditBoxEndX
, EditBoxLine
, ' ', ATTR(UiEditBoxTextColor
, UiEditBoxBgColor
));
900 EditBoxCursorX
= EditBoxStartX
;
901 MachVideoSetTextCursorPosition(EditBoxCursorX
, EditBoxLine
);
902 MachVideoHideShowTextCursor(TRUE
);
905 UiDrawStatusText("Press ENTER to continue, or ESC to cancel");
907 VideoCopyOffScreenBufferToVRAM();
913 key
= MachConsGetCh();
914 if(key
== KEY_EXTENDED
)
916 key
= MachConsGetCh();
924 else if(key
== KEY_ESC
)
929 else if (key
== KEY_BACKSPACE
) // Remove a character
931 if (EditBoxTextCount
)
934 EditTextBuffer
[EditBoxTextCount
] = 0;
941 else // Add this key to the buffer
943 if (EditBoxTextCount
< Length
- 1)
945 EditTextBuffer
[EditBoxTextCount
] = key
;
947 EditTextBuffer
[EditBoxTextCount
] = 0;
956 // Draw the edit box background
957 UiFillArea(EditBoxStartX
, EditBoxLine
, EditBoxEndX
, EditBoxLine
, ' ', ATTR(UiEditBoxTextColor
, UiEditBoxBgColor
));
960 if (EditBoxTextCount
> (EditBoxEndX
- EditBoxStartX
))
962 EditBoxTextDisplayIndex
= EditBoxTextCount
- (EditBoxEndX
- EditBoxStartX
);
963 EditBoxCursorX
= EditBoxEndX
;
967 EditBoxTextDisplayIndex
= 0;
968 EditBoxCursorX
= EditBoxStartX
+ EditBoxTextCount
;
970 UiDrawText(EditBoxStartX
, EditBoxLine
, &EditTextBuffer
[EditBoxTextDisplayIndex
], ATTR(UiEditBoxTextColor
, UiEditBoxBgColor
));
973 MachVideoSetTextCursorPosition(EditBoxCursorX
, EditBoxLine
);
977 VideoCopyOffScreenBufferToVRAM();
980 // Hide the cursor again
981 MachVideoHideShowTextCursor(FALSE
);
983 // Restore the screen contents
984 TuiRestoreScreen(ScreenBuffer
);
985 MmFreeMemory(ScreenBuffer
);
990 const UIVTBL TuiVtbl
=
1003 TuiMessageBoxCritical
,
1004 TuiDrawProgressBarCenter
,