PUSHORT VgaArmBase;
PHYSICAL_ADDRESS VgaPhysical;
-BOOLEAN ClearRow = FALSE;
/* PRIVATE FUNCTIONS *********************************************************/
VOID
NTAPI
-DisplayCharacter(IN CHAR Character,
- IN ULONG Left,
- IN ULONG Top,
- IN ULONG TextColor,
- IN ULONG BackColor)
+DisplayCharacter(
+ _In_ CHAR Character,
+ _In_ ULONG Left,
+ _In_ ULONG Top,
+ _In_ ULONG TextColor,
+ _In_ ULONG BackColor)
{
PUCHAR FontChar;
ULONG i, j, XOffset;
/* Get the font line for this character */
- FontChar = &FontData[Character * BOOTCHAR_HEIGHT - Top];
+ FontChar = &VidpFontData[Character * BOOTCHAR_HEIGHT - Top];
/* Loop each pixel height */
for (i = BOOTCHAR_HEIGHT; i > 0; --i)
/* We do, use the given Text Color */
SetPixel(XOffset, Top, (UCHAR)TextColor);
}
- else if (BackColor < 16)
+ else if (BackColor < BV_COLOR_NONE)
{
/*
* This is a background pixel. We're drawing it
VOID
NTAPI
-VgaScroll(IN ULONG Scroll)
+DoScroll(
+ _In_ ULONG Scroll)
{
ULONG Top, Offset;
PUSHORT SourceOffset, DestOffset;
VOID
NTAPI
-PreserveRow(IN ULONG CurrentTop,
- IN ULONG TopDelta,
- IN BOOLEAN Restore)
+PreserveRow(
+ _In_ ULONG CurrentTop,
+ _In_ ULONG TopDelta,
+ _In_ BOOLEAN Restore)
{
PUSHORT Position1, Position2;
ULONG Count;
*/
BOOLEAN
NTAPI
-VidInitialize(IN BOOLEAN SetMode)
+VidInitialize(
+ _In_ BOOLEAN SetMode)
{
DPRINT1("bv-arm v0.1\n");
*/
VOID
NTAPI
-VidResetDisplay(IN BOOLEAN HalReset)
+VidResetDisplay(
+ _In_ BOOLEAN HalReset)
{
//
// Clear the current position
//
// Re-initialize the palette and fill the screen black
//
- //InitializePalette();
- VidSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0);
-}
-
-/*
- * @implemented
- */
-ULONG
-NTAPI
-VidSetTextColor(IN ULONG Color)
-{
- UCHAR OldColor;
-
- //
- // Save the old, set the new
- //
- OldColor = VidpTextColor;
- VidpTextColor = Color;
-
- //
- // Return the old text color
- //
- return OldColor;
+ InitializePalette();
+ VidSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, BV_COLOR_BLACK);
}
/*
*/
VOID
NTAPI
-VidDisplayString(IN PUCHAR String)
-{
- ULONG TopDelta = BOOTCHAR_HEIGHT + 1;
-
- /* Start looping the string */
- for (; *String; ++String)
- {
- /* Treat new-line separately */
- if (*String == '\n')
- {
- /* Modify Y position */
- VidpCurrentY += TopDelta;
- if (VidpCurrentY + TopDelta - 1 > VidpScrollRegion[3])
- {
- /* Scroll the view and clear the current row */
- VgaScroll(TopDelta);
- VidpCurrentY -= TopDelta;
- PreserveRow(VidpCurrentY, TopDelta, TRUE);
- }
- else
- {
- /* Preserve the current row */
- PreserveRow(VidpCurrentY, TopDelta, FALSE);
- }
-
- /* Update current X */
- VidpCurrentX = VidpScrollRegion[0];
-
- /* No need to clear this row */
- ClearRow = FALSE;
- }
- else if (*String == '\r')
- {
- /* Update current X */
- VidpCurrentX = VidpScrollRegion[0];
-
- /* If a new-line does not follow we will clear the current row */
- if (String[1] != '\n') ClearRow = TRUE;
- }
- else
- {
- /* Clear the current row if we had a return-carriage without a new-line */
- if (ClearRow)
- {
- PreserveRow(VidpCurrentY, TopDelta, TRUE);
- ClearRow = FALSE;
- }
-
- /* Display this character */
- DisplayCharacter(*String,
- VidpCurrentX,
- VidpCurrentY,
- VidpTextColor,
- 16);
- VidpCurrentX += 8;
-
- /* Check if we should scroll */
- if (VidpCurrentX + 7 > VidpScrollRegion[2])
- {
- /* Update Y position and check if we should scroll it */
- VidpCurrentY += TopDelta;
- if (VidpCurrentY + TopDelta - 1 > VidpScrollRegion[3])
- {
- /* Scroll the view and clear the current row */
- VgaScroll(TopDelta);
- VidpCurrentY -= TopDelta;
- PreserveRow(VidpCurrentY, TopDelta, TRUE);
- }
- else
- {
- /* Preserve the current row */
- PreserveRow(VidpCurrentY, TopDelta, FALSE);
- }
-
- /* Update current X */
- VidpCurrentX = VidpScrollRegion[0];
- }
- }
- }
-}
-
-/*
- * @implemented
- */
-VOID
-NTAPI
-VidScreenToBufferBlt(OUT PUCHAR Buffer,
- IN ULONG Left,
- IN ULONG Top,
- IN ULONG Width,
- IN ULONG Height,
- IN ULONG Delta)
+VidScreenToBufferBlt(
+ _Out_ PUCHAR Buffer,
+ _In_ ULONG Left,
+ _In_ ULONG Top,
+ _In_ ULONG Width,
+ _In_ ULONG Height,
+ _In_ ULONG Delta)
{
UNIMPLEMENTED;
while (TRUE);
*/
VOID
NTAPI
-VidSolidColorFill(IN ULONG Left,
- IN ULONG Top,
- IN ULONG Right,
- IN ULONG Bottom,
- IN UCHAR Color)
+VidSolidColorFill(
+ _In_ ULONG Left,
+ _In_ ULONG Top,
+ _In_ ULONG Right,
+ _In_ ULONG Bottom,
+ _In_ UCHAR Color)
{
int y, x;