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