xref: /reactos/drivers/base/bootvid/i386/pc98/pc98.h (revision b5218987)
1 /*
2  * PROJECT:     ReactOS Boot Video Driver for NEC PC-98 series
3  * LICENSE:     GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4  * PURPOSE:     Arch-specific header file
5  * COPYRIGHT:   Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
6  */
7 
8 #pragma once
9 
10 /* INCLUDES *******************************************************************/
11 
12 #include <drivers/pc98/video.h>
13 
14 /* GLOBALS ********************************************************************/
15 
16 #define BYTES_PER_SCANLINE (SCREEN_WIDTH / 8)
17 #define FB_OFFSET(x, y)    ((y) * SCREEN_WIDTH + (x))
18 
19 extern ULONG_PTR FrameBuffer;
20 
21 /* PROTOTYPES *****************************************************************/
22 
23 VOID
24 NTAPI
25 DisplayCharacter(
26     _In_ CHAR Character,
27     _In_ ULONG Left,
28     _In_ ULONG Top,
29     _In_ ULONG TextColor,
30     _In_ ULONG BackColor);
31 
32 VOID
33 NTAPI
34 DoScroll(
35     _In_ ULONG Scroll);
36 
37 VOID
38 NTAPI
39 InitPaletteWithTable(
40     _In_ PULONG Table,
41     _In_ ULONG Count);
42 
43 VOID
44 NTAPI
45 PreserveRow(
46     _In_ ULONG CurrentTop,
47     _In_ ULONG TopDelta,
48     _In_ BOOLEAN Restore);
49 
50 VOID
51 PrepareForSetPixel(VOID);
52 
53 /* FUNCTIONS ******************************************************************/
54 
55 FORCEINLINE
56 VOID
57 SetPixel(
58     _In_ ULONG Left,
59     _In_ ULONG Top,
60     _In_ UCHAR Color)
61 {
62     PUCHAR PixelPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(Left, Top));
63 
64     WRITE_REGISTER_UCHAR(PixelPosition, Color);
65 }
66