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 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);
34
35 VOID
36 InitPaletteWithTable(
37 _In_ PULONG Table,
38 _In_ ULONG Count);
39
40 VOID
41 PreserveRow(
42 _In_ ULONG CurrentTop,
43 _In_ ULONG TopDelta,
44 _In_ BOOLEAN Restore);
45
46 VOID
47 PrepareForSetPixel(VOID);
48
49 /* FUNCTIONS ******************************************************************/
50
51 FORCEINLINE
52 VOID
SetPixel(_In_ ULONG Left,_In_ ULONG Top,_In_ UCHAR Color)53 SetPixel(
54 _In_ ULONG Left,
55 _In_ ULONG Top,
56 _In_ UCHAR Color)
57 {
58 PUCHAR PixelPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(Left, Top));
59
60 WRITE_REGISTER_UCHAR(PixelPosition, Color);
61 }
62