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