[BOOTVID] Fix build for ARM port

- Move functions from header to main source, keeping their definitions
- Fix typo DefaultPalette -> VidpDefaultPalette
- Add missing PrepareForSetPixel() function

Addendum to 5f2ca473dc and cd91271796. CORE-17617 CORE-17604
This commit is contained in:
Stanislav Motylkov
2025-07-02 22:24:46 +02:00
parent 0db7879a66
commit 52e02af86b
2 changed files with 43 additions and 27 deletions
+4 -27
View File
@@ -29,42 +29,19 @@ extern PUSHORT VgaArmBase;
#define READ_REGISTER_USHORT(r) (*(volatile USHORT * const)(r))
#define WRITE_REGISTER_USHORT(r, v) (*(volatile USHORT *)(r) = (v))
FORCEINLINE
USHORT
VidpBuildColor(
_In_ UCHAR Color)
{
UCHAR Red, Green, Blue;
/* Extract color components */
Red = GetRValue(DefaultPalette[Color]) >> 3;
Green = GetGValue(DefaultPalette[Color]) >> 3;
Blue = GetBValue(DefaultPalette[Color]) >> 3;
/* Build the 16-bit color mask */
return ((Red & 0x1F) << 11) | ((Green & 0x1F) << 6) | ((Blue & 0x1F));
}
VOID
InitPaletteWithTable(
_In_ PULONG Table,
_In_ ULONG Count);
FORCEINLINE
VOID
PrepareForSetPixel(VOID);
VOID
SetPixel(
_In_ ULONG Left,
_In_ ULONG Top,
_In_ UCHAR Color)
{
PUSHORT PixelPosition;
/* Calculate the pixel position */
PixelPosition = &VgaArmBase[Left + (Top * SCREEN_WIDTH)];
/* Set our color */
WRITE_REGISTER_USHORT(PixelPosition, VidpBuildColor(Color));
}
_In_ UCHAR Color);
VOID
PreserveRow(
+39
View File
@@ -15,6 +15,45 @@ PHYSICAL_ADDRESS VgaPhysical;
/* PRIVATE FUNCTIONS *********************************************************/
FORCEINLINE
USHORT
VidpBuildColor(
_In_ UCHAR Color)
{
UCHAR Red, Green, Blue;
/* Extract color components */
Red = GetRValue(VidpDefaultPalette[Color]) >> 3;
Green = GetGValue(VidpDefaultPalette[Color]) >> 3;
Blue = GetBValue(VidpDefaultPalette[Color]) >> 3;
/* Build the 16-bit color mask */
return ((Red & 0x1F) << 11) | ((Green & 0x1F) << 6) | ((Blue & 0x1F));
}
VOID
PrepareForSetPixel(VOID)
{
/* Nothing to prepare */
NOTHING;
}
FORCEINLINE
VOID
SetPixel(
_In_ ULONG Left,
_In_ ULONG Top,
_In_ UCHAR Color)
{
PUSHORT PixelPosition;
/* Calculate the pixel position */
PixelPosition = &VgaArmBase[Left + (Top * SCREEN_WIDTH)];
/* Set our color */
WRITE_REGISTER_USHORT(PixelPosition, VidpBuildColor(Color));
}
VOID
DisplayCharacter(
_In_ CHAR Character,