mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[BOOTVID][NTOSKRNL][HALX86] Move hardcoded coordinates of bootvid into one place. (#2504)
Co-Authored-By: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
This commit is contained in:
parent
1c706d7483
commit
1610367fe2
10 changed files with 92 additions and 33 deletions
|
@ -11,12 +11,6 @@
|
|||
#define BOOTCHAR_HEIGHT 13
|
||||
#define BOOTCHAR_WIDTH 8 // Each character line is encoded in a UCHAR.
|
||||
|
||||
/*
|
||||
* Screen resolution (for default VGA)
|
||||
*/
|
||||
#define SCREEN_WIDTH 640
|
||||
#define SCREEN_HEIGHT 480
|
||||
|
||||
#ifndef _M_ARM
|
||||
#include "vga.h"
|
||||
#endif /* _M_ARM */
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
/* INCLUDES *******************************************************************/
|
||||
|
||||
#include <hal.h>
|
||||
#include <drivers/bootvid/display.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -255,8 +257,8 @@ HalHandleNMI(IN PVOID NmiInfo)
|
|||
//
|
||||
// Fill the screen
|
||||
//
|
||||
InbvSolidColorFill(0, 0, 639, 479, 1);
|
||||
InbvSetScrollRegion(0, 0, 639, 479);
|
||||
InbvSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 1);
|
||||
InbvSetScrollRegion(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
|
||||
|
||||
//
|
||||
// Enable text
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntoskrnl.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
#include "bootvid/bootvid.h"
|
||||
|
||||
#include "inbv/logo.h"
|
||||
|
||||
/* See also mm/ARM3/miarm.h */
|
||||
#define MM_READONLY 1 // PAGE_READONLY
|
||||
|
@ -53,12 +55,6 @@ typedef enum _ROT_BAR_TYPE
|
|||
RB_PROGRESS_BAR
|
||||
} ROT_BAR_TYPE;
|
||||
|
||||
/*
|
||||
* Screen resolution (for default VGA)
|
||||
*/
|
||||
#define SCREEN_WIDTH 640
|
||||
#define SCREEN_HEIGHT 480
|
||||
|
||||
/*
|
||||
* BitBltAligned() alignments
|
||||
*/
|
||||
|
@ -1126,7 +1122,7 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
|||
/* Workstation; set colors */
|
||||
InbvSetTextColor(15);
|
||||
InbvSolidColorFill(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, 7);
|
||||
InbvSolidColorFill(0, 421, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, 1);
|
||||
InbvSolidColorFill(0, VID_FOOTER_BG_TOP, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, 1);
|
||||
|
||||
/* Get resources */
|
||||
Header = InbvGetResourceAddress(IDB_WKSTA_HEADER);
|
||||
|
@ -1137,7 +1133,7 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
|||
/* Server; set colors */
|
||||
InbvSetTextColor(14);
|
||||
InbvSolidColorFill(0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, 6);
|
||||
InbvSolidColorFill(0, 421, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, 1);
|
||||
InbvSolidColorFill(0, VID_FOOTER_BG_TOP, SCREEN_WIDTH-1, SCREEN_HEIGHT-1, 1);
|
||||
|
||||
/* Get resources */
|
||||
Header = InbvGetResourceAddress(IDB_SERVER_HEADER);
|
||||
|
@ -1145,7 +1141,8 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
|||
}
|
||||
|
||||
/* Set the scrolling region */
|
||||
InbvSetScrollRegion(32, 80, 631, 400);
|
||||
InbvSetScrollRegion(VID_SCROLL_AREA_LEFT, VID_SCROLL_AREA_TOP,
|
||||
VID_SCROLL_AREA_RIGHT, VID_SCROLL_AREA_BOTTOM);
|
||||
|
||||
/* Make sure we have resources */
|
||||
if (Header && Footer)
|
||||
|
@ -1239,16 +1236,19 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
|||
#endif
|
||||
|
||||
/* Set progress bar coordinates and display it */
|
||||
InbvSetProgressBarCoordinates(259, 352);
|
||||
InbvSetProgressBarCoordinates(VID_PROGRESS_BAR_LEFT, VID_PROGRESS_BAR_TOP);
|
||||
|
||||
#ifdef REACTOS_SKUS
|
||||
/* Check for non-workstation products */
|
||||
if (SharedUserData->NtProductType != NtProductWinNt)
|
||||
{
|
||||
/* Overwrite part of the logo for a server product */
|
||||
InbvScreenToBufferBlt(Buffer, 413, 237, 7, 7, 8);
|
||||
InbvSolidColorFill(418, 230, 454, 256, 0);
|
||||
InbvBufferToScreenBlt(Buffer, 413, 237, 7, 7, 8);
|
||||
InbvScreenToBufferBlt(Buffer, VID_SKU_SAVE_AREA_LEFT,
|
||||
VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
|
||||
InbvSolidColorFill(VID_SKU_AREA_LEFT, VID_SKU_AREA_TOP,
|
||||
VID_SKU_AREA_RIGHT, VID_SKU_AREA_BOTTOM, 0);
|
||||
InbvBufferToScreenBlt(Buffer, VID_SKU_SAVE_AREA_LEFT,
|
||||
VID_SKU_SAVE_AREA_TOP, 7, 7, 8);
|
||||
|
||||
/* In setup mode, you haven't selected a SKU yet */
|
||||
if (ExpInTextModeSetup) Text = NULL;
|
||||
|
@ -1274,7 +1274,8 @@ DisplayBootBitmap(IN BOOLEAN TextMode)
|
|||
|
||||
#ifdef REACTOS_SKUS
|
||||
/* Draw the SKU text if it exits */
|
||||
if (Text) BitBltPalette(Text, TRUE, 180, 121);
|
||||
if (Text)
|
||||
BitBltPalette(Text, TRUE, VID_SKU_TEXT_LEFT, VID_SKU_TEXT_TOP);
|
||||
#endif
|
||||
|
||||
#ifdef INBV_ROTBAR_IMPLEMENTED
|
||||
|
|
32
ntoskrnl/inbv/logo.h
Normal file
32
ntoskrnl/inbv/logo.h
Normal file
|
@ -0,0 +1,32 @@
|
|||
#pragma once
|
||||
|
||||
//
|
||||
// Positions of areas and images
|
||||
//
|
||||
|
||||
#define VID_SCROLL_AREA_LEFT 32
|
||||
#define VID_SCROLL_AREA_TOP 80
|
||||
#define VID_SCROLL_AREA_RIGHT 631
|
||||
#define VID_SCROLL_AREA_BOTTOM 400
|
||||
|
||||
#define VID_PROGRESS_BAR_LEFT 259
|
||||
#define VID_PROGRESS_BAR_TOP 352
|
||||
|
||||
/* 16px space between shutdown logo and message */
|
||||
#define VID_SHUTDOWN_LOGO_LEFT 225
|
||||
#define VID_SHUTDOWN_LOGO_TOP 114
|
||||
#define VID_SHUTDOWN_MSG_LEFT 213
|
||||
#define VID_SHUTDOWN_MSG_TOP 354
|
||||
|
||||
#define VID_SKU_AREA_LEFT 418
|
||||
#define VID_SKU_AREA_TOP 230
|
||||
#define VID_SKU_AREA_RIGHT 454
|
||||
#define VID_SKU_AREA_BOTTOM 256
|
||||
|
||||
#define VID_SKU_SAVE_AREA_LEFT 413
|
||||
#define VID_SKU_SAVE_AREA_TOP 237
|
||||
|
||||
#define VID_SKU_TEXT_LEFT 180
|
||||
#define VID_SKU_TEXT_TOP 121
|
||||
|
||||
#define VID_FOOTER_BG_TOP (SCREEN_HEIGHT - 59)
|
|
@ -1,5 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
// Native definitions from BOOTVID (Boot Video Driver).
|
||||
#include "bootvid/bootvid.h"
|
||||
|
||||
//
|
||||
// Driver Initialization
|
||||
//
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include <ntoskrnl.h>
|
||||
#include <reactos/buildno.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -417,11 +418,11 @@ KdpScreenAcquire(VOID)
|
|||
/* Acquire ownership and reset the display */
|
||||
InbvAcquireDisplayOwnership();
|
||||
InbvResetDisplay();
|
||||
InbvSolidColorFill(0, 0, 639, 479, 0);
|
||||
InbvSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0);
|
||||
InbvSetTextColor(15);
|
||||
InbvInstallDisplayStringFilter(NULL);
|
||||
InbvEnableDisplayString(TRUE);
|
||||
InbvSetScrollRegion(0, 0, 639, 479);
|
||||
InbvSetScrollRegion(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntoskrnl.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
|
@ -625,11 +626,11 @@ KiDisplayBlueScreen(IN ULONG MessageId,
|
|||
InbvResetDisplay();
|
||||
|
||||
/* Display blue screen */
|
||||
InbvSolidColorFill(0, 0, 639, 479, 4);
|
||||
InbvSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 4);
|
||||
InbvSetTextColor(15);
|
||||
InbvInstallDisplayStringFilter(NULL);
|
||||
InbvEnableDisplayString(TRUE);
|
||||
InbvSetScrollRegion(0, 0, 639, 479);
|
||||
InbvSetScrollRegion(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
|
||||
}
|
||||
|
||||
/* Check if this is a hard error */
|
||||
|
|
|
@ -12,9 +12,12 @@
|
|||
#ifdef NEWCC
|
||||
#include <cache/newcc.h>
|
||||
#endif
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#include "inbv/logo.h"
|
||||
|
||||
/* GLOBALS *******************************************************************/
|
||||
|
||||
ULONG PopShutdownPowerOffPolicy;
|
||||
|
@ -159,18 +162,17 @@ PopShutdownHandler(VOID)
|
|||
/* Yes we do, cleanup for shutdown screen */
|
||||
if (!InbvCheckDisplayOwnership()) InbvAcquireDisplayOwnership();
|
||||
InbvResetDisplay();
|
||||
InbvSolidColorFill(0, 0, 639, 479, 0);
|
||||
InbvSolidColorFill(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0);
|
||||
InbvEnableDisplayString(TRUE);
|
||||
InbvSetScrollRegion(0, 0, 639, 479);
|
||||
InbvSetScrollRegion(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1);
|
||||
|
||||
/* Display shutdown logo and message */
|
||||
Logo1 = InbvGetResourceAddress(IDB_SHUTDOWN_MSG);
|
||||
Logo2 = InbvGetResourceAddress(IDB_LOGO_DEFAULT);
|
||||
if ((Logo1) && (Logo2))
|
||||
{
|
||||
/* 16px space between logo and message */
|
||||
InbvBitBlt(Logo1, 213, 354);
|
||||
InbvBitBlt(Logo2, 225, 114);
|
||||
InbvBitBlt(Logo1, VID_SHUTDOWN_MSG_LEFT, VID_SHUTDOWN_MSG_TOP);
|
||||
InbvBitBlt(Logo2, VID_SHUTDOWN_LOGO_LEFT, VID_SHUTDOWN_LOGO_TOP);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -1,6 +1,17 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Boot Video Driver
|
||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||
* PURPOSE: Main BOOTVID header.
|
||||
* COPYRIGHT: Copyright 2007-2020 Alex Ionescu (alex.ionescu@reactos.org)
|
||||
*/
|
||||
|
||||
#ifndef _BOOTVID_
|
||||
#define _BOOTVID_
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "display.h"
|
||||
|
||||
BOOLEAN
|
||||
NTAPI
|
||||
VidInitialize(IN BOOLEAN SetMode);
|
||||
|
@ -67,4 +78,4 @@ VidSolidColorFill(IN ULONG Left,
|
|||
IN ULONG Bottom,
|
||||
IN UCHAR Color);
|
||||
|
||||
#endif
|
||||
#endif // _BOOTVID_
|
||||
|
|
12
sdk/include/reactos/drivers/bootvid/display.h
Normal file
12
sdk/include/reactos/drivers/bootvid/display.h
Normal file
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Boot Video Driver
|
||||
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
||||
* PURPOSE: Provides display settings for BOOTVID, HAL and NTOSKRNL.
|
||||
* COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* For default VGA */
|
||||
#define SCREEN_WIDTH 640
|
||||
#define SCREEN_HEIGHT 480
|
Loading…
Reference in a new issue