Reactos

[BOOTVID] Split common.c into graphics-specific and console (in console.c) parts (#8547)

In addition:
- move back common function prototypes to precomp.h;
- const-ify `VidpFontData` and adjust its usages;
- improve SAL annotations for `InitPaletteWithTable()`;
- rename the (Vid)ResetDisplay() parameter to "SetMode".

+248 -306
+1
drivers/base/bootvid/CMakeLists.txt
··· 27 27 28 28 list(APPEND SOURCE 29 29 common.c 30 + console.c 30 31 fontdata.c 31 32 precomp.h) 32 33
+1 -19
drivers/base/bootvid/arm/arm.h
··· 31 31 32 32 VOID 33 33 InitPaletteWithTable( 34 - _In_ PULONG Table, 34 + _In_reads_(Count) const ULONG* Table, 35 35 _In_ ULONG Count); 36 36 37 37 VOID ··· 42 42 _In_ ULONG Left, 43 43 _In_ ULONG Top, 44 44 _In_ UCHAR Color); 45 - 46 - VOID 47 - PreserveRow( 48 - _In_ ULONG CurrentTop, 49 - _In_ ULONG TopDelta, 50 - _In_ BOOLEAN Restore); 51 - 52 - VOID 53 - DoScroll( 54 - _In_ ULONG Scroll); 55 - 56 - VOID 57 - DisplayCharacter( 58 - _In_ CHAR Character, 59 - _In_ ULONG Left, 60 - _In_ ULONG Top, 61 - _In_ ULONG TextColor, 62 - _In_ ULONG BackColor);
+6 -17
drivers/base/bootvid/arm/bootvid.c
··· 62 62 _In_ ULONG TextColor, 63 63 _In_ ULONG BackColor) 64 64 { 65 - PUCHAR FontChar; 65 + const UCHAR* FontChar; 66 66 ULONG i, j, XOffset; 67 67 68 68 /* Get the font line for this character */ ··· 209 209 210 210 VOID 211 211 InitPaletteWithTable( 212 - _In_ PULONG Table, 212 + _In_reads_(Count) const ULONG* Table, 213 213 _In_ ULONG Count) 214 214 { 215 215 UNIMPLEMENTED; ··· 251 251 } 252 252 253 253 VOID 254 - NTAPI 255 - VidResetDisplay( 256 - _In_ BOOLEAN HalReset) 254 + ResetDisplay( 255 + _In_ BOOLEAN SetMode) 257 256 { 258 - // 259 - // Clear the current position 260 - // 261 - VidpCurrentX = 0; 262 - VidpCurrentY = 0; 263 - 264 - // 265 - // Re-initialize the VGA Display 266 - // 257 + /* Re-initialize the display */ 267 258 VidpInitializeDisplay(); 268 259 269 - // 270 - // Re-initialize the palette and fill the screen black 271 - // 260 + /* Re-initialize the palette and fill the screen black */ 272 261 InitializePalette(); 273 262 VidSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, BV_COLOR_BLACK); 274 263 }
-153
drivers/base/bootvid/common.c
··· 11 11 12 12 /* GLOBALS ********************************************************************/ 13 13 14 - UCHAR VidpTextColor = BV_COLOR_WHITE; 15 - 16 - ULONG VidpCurrentX = 0; 17 - ULONG VidpCurrentY = 0; 18 - 19 - ULONG VidpScrollRegion[4] = 20 - { 21 - 0, 22 - 0, 23 - SCREEN_WIDTH - 1, 24 - SCREEN_HEIGHT - 1 25 - }; 26 - 27 14 /* 28 15 * Boot video driver default palette is similar to the standard 16-color 29 16 * CGA palette, but it has Red and Blue channels swapped, and also dark ··· 48 35 RGB( 0, 255, 255), /* Light Cyan */ 49 36 RGB(255, 255, 255), /* White */ 50 37 }; 51 - 52 - static BOOLEAN ClearRow = FALSE; 53 38 54 39 /* PRIVATE FUNCTIONS **********************************************************/ 55 40 ··· 309 294 } 310 295 311 296 /* PUBLIC FUNCTIONS ***********************************************************/ 312 - 313 - ULONG 314 - NTAPI 315 - VidSetTextColor( 316 - _In_ ULONG Color) 317 - { 318 - ULONG OldColor; 319 - 320 - /* Save the old color and set the new one */ 321 - OldColor = VidpTextColor; 322 - VidpTextColor = Color; 323 - return OldColor; 324 - } 325 - 326 - VOID 327 - NTAPI 328 - VidDisplayStringXY( 329 - _In_z_ PUCHAR String, 330 - _In_ ULONG Left, 331 - _In_ ULONG Top, 332 - _In_ BOOLEAN Transparent) 333 - { 334 - ULONG BackColor; 335 - 336 - /* 337 - * If the caller wanted transparent, then send the special value (16), 338 - * else use our default and call the helper routine. 339 - */ 340 - BackColor = Transparent ? BV_COLOR_NONE : BV_COLOR_LIGHT_CYAN; 341 - 342 - /* Loop every character and adjust the position */ 343 - for (; *String; ++String, Left += BOOTCHAR_WIDTH) 344 - { 345 - /* Display a character */ 346 - DisplayCharacter(*String, Left, Top, BV_COLOR_LIGHT_BLUE, BackColor); 347 - } 348 - } 349 - 350 - VOID 351 - NTAPI 352 - VidSetScrollRegion( 353 - _In_ ULONG Left, 354 - _In_ ULONG Top, 355 - _In_ ULONG Right, 356 - _In_ ULONG Bottom) 357 - { 358 - /* Assert alignment */ 359 - ASSERT((Left % BOOTCHAR_WIDTH) == 0); 360 - ASSERT((Right % BOOTCHAR_WIDTH) == BOOTCHAR_WIDTH - 1); 361 - 362 - /* Set Scroll Region */ 363 - VidpScrollRegion[0] = Left; 364 - VidpScrollRegion[1] = Top; 365 - VidpScrollRegion[2] = Right; 366 - VidpScrollRegion[3] = Bottom; 367 - 368 - /* Set current X and Y */ 369 - VidpCurrentX = Left; 370 - VidpCurrentY = Top; 371 - } 372 - 373 - VOID 374 - NTAPI 375 - VidDisplayString( 376 - _In_z_ PUCHAR String) 377 - { 378 - /* Start looping the string */ 379 - for (; *String; ++String) 380 - { 381 - /* Treat new-line separately */ 382 - if (*String == '\n') 383 - { 384 - /* Modify Y position */ 385 - VidpCurrentY += BOOTCHAR_HEIGHT + 1; 386 - if (VidpCurrentY + BOOTCHAR_HEIGHT > VidpScrollRegion[3]) 387 - { 388 - /* Scroll the view and clear the current row */ 389 - DoScroll(BOOTCHAR_HEIGHT + 1); 390 - VidpCurrentY -= BOOTCHAR_HEIGHT + 1; 391 - PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, TRUE); 392 - } 393 - else 394 - { 395 - /* Preserve the current row */ 396 - PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, FALSE); 397 - } 398 - 399 - /* Update current X */ 400 - VidpCurrentX = VidpScrollRegion[0]; 401 - 402 - /* No need to clear this row */ 403 - ClearRow = FALSE; 404 - } 405 - else if (*String == '\r') 406 - { 407 - /* Update current X */ 408 - VidpCurrentX = VidpScrollRegion[0]; 409 - 410 - /* If a new-line does not follow we will clear the current row */ 411 - if (String[1] != '\n') ClearRow = TRUE; 412 - } 413 - else 414 - { 415 - /* Clear the current row if we had a return-carriage without a new-line */ 416 - if (ClearRow) 417 - { 418 - PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, TRUE); 419 - ClearRow = FALSE; 420 - } 421 - 422 - /* Display this character */ 423 - DisplayCharacter(*String, VidpCurrentX, VidpCurrentY, VidpTextColor, BV_COLOR_NONE); 424 - VidpCurrentX += BOOTCHAR_WIDTH; 425 - 426 - /* Check if we should scroll */ 427 - if (VidpCurrentX + BOOTCHAR_WIDTH - 1 > VidpScrollRegion[2]) 428 - { 429 - /* Update Y position and check if we should scroll it */ 430 - VidpCurrentY += BOOTCHAR_HEIGHT + 1; 431 - if (VidpCurrentY + BOOTCHAR_HEIGHT > VidpScrollRegion[3]) 432 - { 433 - /* Scroll the view and clear the current row */ 434 - DoScroll(BOOTCHAR_HEIGHT + 1); 435 - VidpCurrentY -= BOOTCHAR_HEIGHT + 1; 436 - PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, TRUE); 437 - } 438 - else 439 - { 440 - /* Preserve the current row */ 441 - PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, FALSE); 442 - } 443 - 444 - /* Update current X */ 445 - VidpCurrentX = VidpScrollRegion[0]; 446 - } 447 - } 448 - } 449 - } 450 297 451 298 VOID 452 299 NTAPI
+181
drivers/base/bootvid/console.c
··· 1 + /* 2 + * PROJECT: ReactOS Boot Video Driver 3 + * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later) 4 + * PURPOSE: Platform-independent console functionality 5 + * COPYRIGHT: Copyright 2010 Gregor Schneider <gregor.schneider@reactos.org> 6 + * Copyright 2011 Rafal Harabien <rafalh@reactos.org> 7 + * Copyright 2020 Stanislav Motylkov <x86corez@gmail.com> 8 + */ 9 + 10 + #include "precomp.h" 11 + 12 + /* GLOBALS ********************************************************************/ 13 + 14 + UCHAR VidpTextColor = BV_COLOR_WHITE; 15 + 16 + ULONG VidpCurrentX = 0; 17 + ULONG VidpCurrentY = 0; 18 + 19 + ULONG VidpScrollRegion[4] = 20 + { 21 + 0, 22 + 0, 23 + SCREEN_WIDTH - 1, 24 + SCREEN_HEIGHT - 1 25 + }; 26 + 27 + static BOOLEAN ClearRow = FALSE; 28 + 29 + /* PUBLIC FUNCTIONS ***********************************************************/ 30 + 31 + VOID 32 + NTAPI 33 + VidResetDisplay( 34 + _In_ BOOLEAN SetMode) 35 + { 36 + /* Clear the current position */ 37 + VidpCurrentX = 0; 38 + VidpCurrentY = 0; 39 + 40 + /* Invoke the hardware-specific routine */ 41 + ResetDisplay(SetMode); 42 + } 43 + 44 + ULONG 45 + NTAPI 46 + VidSetTextColor( 47 + _In_ ULONG Color) 48 + { 49 + ULONG OldColor; 50 + 51 + /* Save the old color and set the new one */ 52 + OldColor = VidpTextColor; 53 + VidpTextColor = Color; 54 + return OldColor; 55 + } 56 + 57 + VOID 58 + NTAPI 59 + VidSetScrollRegion( 60 + _In_ ULONG Left, 61 + _In_ ULONG Top, 62 + _In_ ULONG Right, 63 + _In_ ULONG Bottom) 64 + { 65 + /* Assert alignment */ 66 + ASSERT((Left % BOOTCHAR_WIDTH) == 0); 67 + ASSERT((Right % BOOTCHAR_WIDTH) == BOOTCHAR_WIDTH - 1); 68 + 69 + /* Set Scroll Region */ 70 + VidpScrollRegion[0] = Left; 71 + VidpScrollRegion[1] = Top; 72 + VidpScrollRegion[2] = Right; 73 + VidpScrollRegion[3] = Bottom; 74 + 75 + /* Set current X and Y */ 76 + VidpCurrentX = Left; 77 + VidpCurrentY = Top; 78 + } 79 + 80 + VOID 81 + NTAPI 82 + VidDisplayStringXY( 83 + _In_z_ PUCHAR String, 84 + _In_ ULONG Left, 85 + _In_ ULONG Top, 86 + _In_ BOOLEAN Transparent) 87 + { 88 + ULONG BackColor; 89 + 90 + /* 91 + * If the caller wanted transparent, then send the special value (16), 92 + * else use our default and call the helper routine. 93 + */ 94 + BackColor = Transparent ? BV_COLOR_NONE : BV_COLOR_LIGHT_CYAN; 95 + 96 + /* Loop every character and adjust the position */ 97 + for (; *String; ++String, Left += BOOTCHAR_WIDTH) 98 + { 99 + /* Display a character */ 100 + DisplayCharacter(*String, Left, Top, BV_COLOR_LIGHT_BLUE, BackColor); 101 + } 102 + } 103 + 104 + VOID 105 + NTAPI 106 + VidDisplayString( 107 + _In_z_ PUCHAR String) 108 + { 109 + /* Start looping the string */ 110 + for (; *String; ++String) 111 + { 112 + /* Treat new-line separately */ 113 + if (*String == '\n') 114 + { 115 + /* Modify Y position */ 116 + VidpCurrentY += BOOTCHAR_HEIGHT + 1; 117 + if (VidpCurrentY + BOOTCHAR_HEIGHT > VidpScrollRegion[3]) 118 + { 119 + /* Scroll the view and clear the current row */ 120 + DoScroll(BOOTCHAR_HEIGHT + 1); 121 + VidpCurrentY -= BOOTCHAR_HEIGHT + 1; 122 + PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, TRUE); 123 + } 124 + else 125 + { 126 + /* Preserve the current row */ 127 + PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, FALSE); 128 + } 129 + 130 + /* Update current X */ 131 + VidpCurrentX = VidpScrollRegion[0]; 132 + 133 + /* No need to clear this row */ 134 + ClearRow = FALSE; 135 + } 136 + else if (*String == '\r') 137 + { 138 + /* Update current X */ 139 + VidpCurrentX = VidpScrollRegion[0]; 140 + 141 + /* If a new-line does not follow we will clear the current row */ 142 + if (String[1] != '\n') 143 + ClearRow = TRUE; 144 + } 145 + else 146 + { 147 + /* Clear the current row if we had a return-carriage without a new-line */ 148 + if (ClearRow) 149 + { 150 + PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, TRUE); 151 + ClearRow = FALSE; 152 + } 153 + 154 + /* Display this character */ 155 + DisplayCharacter(*String, VidpCurrentX, VidpCurrentY, VidpTextColor, BV_COLOR_NONE); 156 + VidpCurrentX += BOOTCHAR_WIDTH; 157 + 158 + /* Check if we should scroll */ 159 + if (VidpCurrentX + BOOTCHAR_WIDTH - 1 > VidpScrollRegion[2]) 160 + { 161 + /* Update Y position and check if we should scroll it */ 162 + VidpCurrentY += BOOTCHAR_HEIGHT + 1; 163 + if (VidpCurrentY + BOOTCHAR_HEIGHT > VidpScrollRegion[3]) 164 + { 165 + /* Scroll the view and clear the current row */ 166 + DoScroll(BOOTCHAR_HEIGHT + 1); 167 + VidpCurrentY -= BOOTCHAR_HEIGHT + 1; 168 + PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, TRUE); 169 + } 170 + else 171 + { 172 + /* Preserve the current row */ 173 + PreserveRow(VidpCurrentY, BOOTCHAR_HEIGHT + 1, FALSE); 174 + } 175 + 176 + /* Update current X */ 177 + VidpCurrentX = VidpScrollRegion[0]; 178 + } 179 + } 180 + } 181 + }
+1 -1
drivers/base/bootvid/fontdata.c
··· 13 13 // Available from https://web.archive.org/web/20210510052051/http://mirtchovski.com/p9/fonts/ 14 14 // FontData Array generated by bootvid_font_generator. 15 15 // 16 - UCHAR VidpFontData[256 * BOOTCHAR_HEIGHT] = 16 + const UCHAR VidpFontData[256 * BOOTCHAR_HEIGHT] = 17 17 { 18 18 0x00, 0x00, 0x00, 0x00, 0xFE, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFE, 0x00, 0x00, // 0 19 19 0x00, 0x00, 0x00, 0x00, 0xFE, 0x82, 0x82, 0x82, 0x82, 0x82, 0xFE, 0x00, 0x00, // 13
+7 -16
drivers/base/bootvid/i386/pc/bootvid.c
··· 440 440 /* Set the VGA Memory Base */ 441 441 VgaBase = Base; 442 442 443 - /* Now check if we have to set the mode */ 443 + /* Check whether we have to set the video mode */ 444 444 if (SetMode) 445 445 { 446 446 /* Clear the current position */ ··· 460 460 } 461 461 } 462 462 463 - /* VGA is ready */ 464 463 return TRUE; 465 464 } 466 465 467 466 VOID 468 - NTAPI 469 - VidResetDisplay( 470 - _In_ BOOLEAN HalReset) 467 + ResetDisplay( 468 + _In_ BOOLEAN SetMode) 471 469 { 472 - /* Clear the current position */ 473 - VidpCurrentX = 0; 474 - VidpCurrentY = 0; 475 - 476 - /* Clear the screen with HAL if we were asked to */ 477 - if (HalReset) 470 + /* Reset the video mode with HAL if requested */ 471 + if (SetMode && !HalResetDisplay()) 478 472 { 479 - if (!HalResetDisplay()) 480 - { 481 - /* The HAL didn't handle the display, fully re-initialize the VGA */ 482 - VgaInterpretCmdStream(VGA_640x480); 483 - } 473 + /* The HAL didn't handle the display, fully re-initialize the VGA */ 474 + VgaInterpretCmdStream(VGA_640x480); 484 475 } 485 476 486 477 /* Always re-initialize the AC registers */
+1 -19
drivers/base/bootvid/i386/pc/pc.h
··· 27 27 28 28 VOID 29 29 InitPaletteWithTable( 30 - _In_ PULONG Table, 30 + _In_reads_(Count) const ULONG* Table, 31 31 _In_ ULONG Count); 32 32 33 33 VOID ··· 54 54 /* Set the new color */ 55 55 WRITE_REGISTER_UCHAR(PixelPosition, Color); 56 56 } 57 - 58 - VOID 59 - PreserveRow( 60 - _In_ ULONG CurrentTop, 61 - _In_ ULONG TopDelta, 62 - _In_ BOOLEAN Restore); 63 - 64 - VOID 65 - DoScroll( 66 - _In_ ULONG Scroll); 67 - 68 - VOID 69 - DisplayCharacter( 70 - _In_ CHAR Character, 71 - _In_ ULONG Left, 72 - _In_ ULONG Top, 73 - _In_ ULONG TextColor, 74 - _In_ ULONG BackColor);
+4 -3
drivers/base/bootvid/i386/pc/vga.c
··· 117 117 _In_ ULONG TextColor, 118 118 _In_ ULONG BackColor) 119 119 { 120 - PUCHAR FontChar, PixelPtr; 120 + const UCHAR* FontChar; 121 + PUCHAR PixelPtr; 121 122 ULONG Height; 122 123 UCHAR Shift; 123 124 ··· 215 216 216 217 VOID 217 218 InitPaletteWithTable( 218 - _In_ PULONG Table, 219 + _In_reads_(Count) const ULONG* Table, 219 220 _In_ ULONG Count) 220 221 { 222 + const ULONG* Entry = Table; 221 223 ULONG i; 222 - PULONG Entry = Table; 223 224 224 225 for (i = 0; i < Count; i++, Entry++) 225 226 {
+7 -12
drivers/base/bootvid/i386/pc98/bootvid.c
··· 252 252 253 253 VOID 254 254 InitPaletteWithTable( 255 - _In_ PULONG Table, 255 + _In_reads_(Count) const ULONG* Table, 256 256 _In_ ULONG Count) 257 257 { 258 + const ULONG* Entry = Table; 258 259 ULONG i; 259 - PULONG Entry = Table; 260 260 261 261 for (i = 0; i < Count; i++) 262 262 SetPaletteEntryRGB(i, *Entry++); ··· 273 273 _In_ ULONG TextColor, 274 274 _In_ ULONG BackColor) 275 275 { 276 + const UCHAR* FontChar = GetFontPtr(Character); 276 277 ULONG X, Y, PixelMask; 277 - PUCHAR FontChar = GetFontPtr(Character); 278 278 279 279 for (Y = Top; 280 280 Y < Top + BOOTCHAR_HEIGHT; ··· 394 394 } 395 395 396 396 VOID 397 - NTAPI 398 - VidResetDisplay( 399 - _In_ BOOLEAN HalReset) 397 + ResetDisplay( 398 + _In_ BOOLEAN SetMode) 400 399 { 401 400 PULONG PixelsPosition = (PULONG)(FrameBuffer + FB_OFFSET(0, 0)); 402 401 ULONG PixelCount = ((SCREEN_WIDTH * SCREEN_HEIGHT) / sizeof(ULONG)) + 1; 403 402 404 - /* Clear the current position */ 405 - VidpCurrentX = 0; 406 - VidpCurrentY = 0; 407 - 408 - /* Clear the screen with HAL if we were asked to */ 409 - if (HalReset) 403 + /* Reset the video mode with HAL if requested */ 404 + if (SetMode) 410 405 HalResetDisplay(); 411 406 412 407 WRITE_PORT_UCHAR((PUCHAR)GDC1_IO_o_MODE_FLIPFLOP1, GRAPH_MODE_DISPLAY_DISABLE);
+2 -22
drivers/base/bootvid/i386/pc98/pc98.h
··· 18 18 19 19 extern ULONG_PTR FrameBuffer; 20 20 21 - /* PROTOTYPES *****************************************************************/ 22 - 23 - VOID 24 - DisplayCharacter( 25 - _In_ CHAR Character, 26 - _In_ ULONG Left, 27 - _In_ ULONG Top, 28 - _In_ ULONG TextColor, 29 - _In_ ULONG BackColor); 30 - 31 - VOID 32 - DoScroll( 33 - _In_ ULONG Scroll); 21 + /* FUNCTIONS ******************************************************************/ 34 22 35 23 VOID 36 24 InitPaletteWithTable( 37 - _In_ PULONG Table, 25 + _In_reads_(Count) const ULONG* Table, 38 26 _In_ ULONG Count); 39 27 40 28 VOID 41 - PreserveRow( 42 - _In_ ULONG CurrentTop, 43 - _In_ ULONG TopDelta, 44 - _In_ BOOLEAN Restore); 45 - 46 - VOID 47 29 PrepareForSetPixel(VOID); 48 - 49 - /* FUNCTIONS ******************************************************************/ 50 30 51 31 FORCEINLINE 52 32 VOID
+9 -13
drivers/base/bootvid/i386/xbox/bootvid.c
··· 10 10 #include "precomp.h" 11 11 #include <drivers/xbox/xgpu.h> 12 12 13 + #define NDEBUG 13 14 #include <debug.h> 14 15 15 16 /* GLOBALS ********************************************************************/ ··· 199 200 /* Place backbuffer in the hidden part of framebuffer */ 200 201 BackBuffer = (PUCHAR)(FrameBufferStart + NV2A_VIDEO_MEMORY_SIZE - BackBufferSize); 201 202 202 - /* Now check if we have to set the mode */ 203 + /* Check whether we have to set the video mode */ 203 204 if (SetMode) 204 205 VidResetDisplay(TRUE); 205 206 ··· 220 221 } 221 222 222 223 VOID 223 - NTAPI 224 - VidResetDisplay( 225 - _In_ BOOLEAN HalReset) 224 + ResetDisplay( 225 + _In_ BOOLEAN SetMode) 226 226 { 227 - /* Clear the current position */ 228 - VidpCurrentX = 0; 229 - VidpCurrentY = 0; 230 - 231 - /* Clear the screen with HAL if we were asked to */ 232 - if (HalReset) 227 + /* Reset the video mode with HAL if requested */ 228 + if (SetMode) 233 229 HalResetDisplay(); 234 230 235 231 /* Re-initialize the palette and fill the screen black */ ··· 240 236 241 237 VOID 242 238 InitPaletteWithTable( 243 - _In_ PULONG Table, 239 + _In_reads_(Count) const ULONG* Table, 244 240 _In_ ULONG Count) 245 241 { 246 - PULONG Entry = Table; 242 + const ULONG* Entry = Table; 247 243 248 244 for (ULONG i = 0; i < Count; i++, Entry++) 249 245 { ··· 354 350 _In_ ULONG BackColor) 355 351 { 356 352 /* Get the font and pixel pointer */ 357 - PUCHAR FontChar = GetFontPtr(Character); 353 + const UCHAR* FontChar = GetFontPtr(Character); 358 354 359 355 /* Loop each pixel height */ 360 356 for (ULONG y = Top; y < Top + BOOTCHAR_HEIGHT; y++, FontChar += FONT_PTR_DELTA)
+1 -24
drivers/base/bootvid/i386/xbox/xbox.h
··· 7 7 * Copyright 2020 Stanislav Motylkov <x86corez@gmail.com> 8 8 */ 9 9 10 - #ifndef _BOOTVID_XBOX_H_ 11 - #define _BOOTVID_XBOX_H_ 12 - 13 10 #pragma once 14 11 15 12 #define BB_OFFSET(x, y) ((y) * SCREEN_WIDTH + (x)) ··· 17 14 18 15 VOID 19 16 InitPaletteWithTable( 20 - _In_ PULONG Table, 17 + _In_reads_(Count) const ULONG* Table, 21 18 _In_ ULONG Count); 22 19 23 20 VOID ··· 28 25 _In_ ULONG Left, 29 26 _In_ ULONG Top, 30 27 _In_ UCHAR Color); 31 - 32 - VOID 33 - PreserveRow( 34 - _In_ ULONG CurrentTop, 35 - _In_ ULONG TopDelta, 36 - _In_ BOOLEAN Restore); 37 - 38 - VOID 39 - DoScroll( 40 - _In_ ULONG Scroll); 41 - 42 - VOID 43 - DisplayCharacter( 44 - _In_ CHAR Character, 45 - _In_ ULONG Left, 46 - _In_ ULONG Top, 47 - _In_ ULONG TextColor, 48 - _In_ ULONG BackColor); 49 - 50 - #endif /* _BOOTVID_XBOX_H_ */
+26 -6
drivers/base/bootvid/precomp.h
··· 7 7 * Copyright 2020 Stanislav Motylkov <x86corez@gmail.com> 8 8 */ 9 9 10 - #ifndef _BOOTVID_PCH_ 11 - #define _BOOTVID_PCH_ 10 + #pragma once 12 11 13 12 #include <ntifs.h> 14 13 #include <ndk/halfuncs.h> 15 14 #include <drivers/bootvid/bootvid.h> 16 15 17 - /* Arch specific includes */ 16 + /* Arch-specific includes */ 18 17 #if defined(_M_IX86) || defined(_M_AMD64) 19 18 #if defined(SARCH_PC98) 20 19 #include "i386/pc98/pc98.h" ··· 30 29 #error Unknown architecture 31 30 #endif 32 31 33 - /* Define if FontData has upside down characters */ 32 + /* Define if FontData has upside-down characters */ 34 33 #undef CHAR_GEN_UPSIDE_DOWN 35 34 36 35 #define BOOTCHAR_HEIGHT 13 ··· 65 64 extern ULONG VidpCurrentX; 66 65 extern ULONG VidpCurrentY; 67 66 extern ULONG VidpScrollRegion[4]; 68 - extern UCHAR VidpFontData[256 * BOOTCHAR_HEIGHT]; 67 + extern const UCHAR VidpFontData[256 * BOOTCHAR_HEIGHT]; 69 68 extern const RGBQUAD VidpDefaultPalette[BV_MAX_COLORS]; 70 69 71 70 #define RGB(r, g, b) ((RGBQUAD)(((UCHAR)(b) | ((USHORT)((UCHAR)(g))<<8)) | (((ULONG)(UCHAR)(r))<<16))) ··· 84 83 # define FONT_PTR_DELTA (1) 85 84 #endif 86 85 87 - #endif /* _BOOTVID_PCH_ */ 86 + 87 + VOID 88 + PreserveRow( 89 + _In_ ULONG CurrentTop, 90 + _In_ ULONG TopDelta, 91 + _In_ BOOLEAN Restore); 92 + 93 + VOID 94 + DoScroll( 95 + _In_ ULONG Scroll); 96 + 97 + VOID 98 + DisplayCharacter( 99 + _In_ CHAR Character, 100 + _In_ ULONG Left, 101 + _In_ ULONG Top, 102 + _In_ ULONG TextColor, 103 + _In_ ULONG BackColor); 104 + 105 + VOID 106 + ResetDisplay( 107 + _In_ BOOLEAN SetMode);
+1 -1
sdk/include/reactos/drivers/bootvid/bootvid.h
··· 20 20 VOID 21 21 NTAPI 22 22 VidResetDisplay( 23 - _In_ BOOLEAN HalReset); 23 + _In_ BOOLEAN SetMode); 24 24 25 25 ULONG 26 26 NTAPI