ReactOS 0.4.16-dev-1520-gb558596
pc98.h File Reference
Include dependency graph for pc98.h:

Go to the source code of this file.

Macros

#define BYTES_PER_SCANLINE   (SCREEN_WIDTH / 8)
 
#define FB_OFFSET(x, y)   ((y) * SCREEN_WIDTH + (x))
 

Functions

VOID DisplayCharacter (_In_ CHAR Character, _In_ ULONG Left, _In_ ULONG Top, _In_ ULONG TextColor, _In_ ULONG BackColor)
 
VOID DoScroll (_In_ ULONG Scroll)
 
VOID InitPaletteWithTable (_In_ PULONG Table, _In_ ULONG Count)
 
VOID PreserveRow (_In_ ULONG CurrentTop, _In_ ULONG TopDelta, _In_ BOOLEAN Restore)
 
VOID PrepareForSetPixel (VOID)
 
FORCEINLINE VOID SetPixel (_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
 

Variables

ULONG_PTR FrameBuffer
 

Macro Definition Documentation

◆ BYTES_PER_SCANLINE

#define BYTES_PER_SCANLINE   (SCREEN_WIDTH / 8)

Definition at line 16 of file pc98.h.

◆ FB_OFFSET

#define FB_OFFSET (   x,
  y 
)    ((y) * SCREEN_WIDTH + (x))

Definition at line 17 of file pc98.h.

Function Documentation

◆ DisplayCharacter()

VOID DisplayCharacter ( _In_ CHAR  Character,
_In_ ULONG  Left,
_In_ ULONG  Top,
_In_ ULONG  TextColor,
_In_ ULONG  BackColor 
)

Definition at line 58 of file bootvid.c.

64{
65 PUCHAR FontChar;
66 ULONG i, j, XOffset;
67
68 /* Get the font line for this character */
69 FontChar = &VidpFontData[Character * BOOTCHAR_HEIGHT - Top];
70
71 /* Loop each pixel height */
72 for (i = BOOTCHAR_HEIGHT; i > 0; --i)
73 {
74 /* Loop each pixel width */
75 XOffset = Left;
76 for (j = (1 << 7); j > 0; j >>= 1)
77 {
78 /* Check if we should draw this pixel */
79 if (FontChar[Top] & (UCHAR)j)
80 {
81 /* We do, use the given Text Color */
82 SetPixel(XOffset, Top, (UCHAR)TextColor);
83 }
84 else if (BackColor < BV_COLOR_NONE)
85 {
86 /*
87 * This is a background pixel. We're drawing it
88 * unless it's transparent.
89 */
90 SetPixel(XOffset, Top, (UCHAR)BackColor);
91 }
92
93 /* Increase X Offset */
94 XOffset++;
95 }
96
97 /* Move to the next Y ordinate */
98 Top++;
99 }
100}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: bootvid.c:43
static LPHIST_ENTRY Top
Definition: history.c:53
#define BOOTCHAR_HEIGHT
Definition: precomp.h:36
UCHAR VidpFontData[256 *BOOTCHAR_HEIGHT]
Definition: fontdata.c:16
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define BV_COLOR_NONE
Definition: display.h:31
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
unsigned char UCHAR
Definition: xmlstorage.h:181

◆ DoScroll()

VOID DoScroll ( _In_ ULONG  Scroll)

Definition at line 103 of file bootvid.c.

105{
107 PUSHORT SourceOffset, DestOffset;
108 PUSHORT i, j;
109
110 /* Set memory positions of the scroll */
112 DestOffset = &SourceOffset[Scroll * (SCREEN_WIDTH / 8)];
113
114 /* Start loop */
115 for (Top = VidpScrollRegion[1]; Top <= VidpScrollRegion[3]; ++Top)
116 {
117 /* Set number of bytes to loop and start offset */
118 Offset = VidpScrollRegion[0] >> 3;
119 j = SourceOffset;
120
121 /* Check if this is part of the scroll region */
122 if (Offset <= (VidpScrollRegion[2] >> 3))
123 {
124 /* Update position */
125 i = (PUSHORT)(DestOffset - SourceOffset);
126
127 /* Loop the X axis */
128 do
129 {
130 /* Write value in the new position so that we can do the scroll */
132
133 /* Move to the next memory location to write to */
134 j++;
135
136 /* Move to the next byte in the region */
137 Offset++;
138
139 /* Make sure we don't go past the scroll region */
140 } while (Offset <= (VidpScrollRegion[2] >> 3));
141 }
142
143 /* Move to the next line */
144 SourceOffset += (SCREEN_WIDTH / 8);
145 DestOffset += (SCREEN_WIDTH / 8);
146 }
147}
PUSHORT VgaArmBase
Definition: bootvid.c:13
#define WRITE_REGISTER_USHORT(r, v)
Definition: arm.h:30
#define READ_REGISTER_USHORT(r)
Definition: arm.h:29
ULONG VidpScrollRegion[4]
Definition: common.c:19
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define SCREEN_WIDTH
Definition: pc98video.c:27
uint16_t * PUSHORT
Definition: typedefs.h:56
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Must_inspect_result_ _In_ WDFMEMORY _In_ size_t SourceOffset
Definition: wdfmemory.h:320

◆ InitPaletteWithTable()

VOID InitPaletteWithTable ( _In_ PULONG  Table,
_In_ ULONG  Count 
)

Definition at line 211 of file bootvid.c.

214{
216}
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15

◆ PrepareForSetPixel()

VOID PrepareForSetPixel ( VOID  )

Definition at line 35 of file bootvid.c.

36{
37 /* Nothing to prepare */
38 NOTHING;
39}
#define NOTHING
Definition: input_list.c:10

◆ PreserveRow()

VOID PreserveRow ( _In_ ULONG  CurrentTop,
_In_ ULONG  TopDelta,
_In_ BOOLEAN  Restore 
)

Definition at line 150 of file bootvid.c.

154{
155 PUSHORT Position1, Position2;
156 ULONG Count;
157
158 /* Calculate the position in memory for the row */
159 if (Restore)
160 {
161 /* Restore the row by copying back the contents saved off-screen */
162 Position1 = &VgaArmBase[CurrentTop * (SCREEN_WIDTH / 8)];
163 Position2 = &VgaArmBase[SCREEN_HEIGHT * (SCREEN_WIDTH / 8)];
164 }
165 else
166 {
167 /* Preserve the row by saving its contents off-screen */
168 Position1 = &VgaArmBase[SCREEN_HEIGHT * (SCREEN_WIDTH / 8)];
169 Position2 = &VgaArmBase[CurrentTop * (SCREEN_WIDTH / 8)];
170 }
171
172 /* Set the count and loop every pixel */
173 Count = TopDelta * (SCREEN_WIDTH / 8);
174 while (Count--)
175 {
176 /* Write the data back on the other position */
177 WRITE_REGISTER_USHORT(Position1, READ_REGISTER_USHORT(Position2));
178
179 /* Increase both positions */
180 Position1++;
181 Position2++;
182 }
183}
int Count
Definition: noreturn.cpp:7
#define SCREEN_HEIGHT
Definition: pc98video.c:28

◆ SetPixel()

FORCEINLINE VOID SetPixel ( _In_ ULONG  Left,
_In_ ULONG  Top,
_In_ UCHAR  Color 
)

Definition at line 53 of file pc98.h.

57{
58 PUCHAR PixelPosition = (PUCHAR)(FrameBuffer + FB_OFFSET(Left, Top));
59
60 WRITE_REGISTER_UCHAR(PixelPosition, Color);
61}
#define FB_OFFSET(x, y)
Definition: pc98.h:17
ULONG_PTR FrameBuffer
Definition: xboxvideo.c:28
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)

Variable Documentation

◆ FrameBuffer