ReactOS 0.4.15-dev-7928-g68a8619
arm.h File Reference

Go to the source code of this file.

Macros

#define LCDTIMING0_PPL(x)   ((((x) / 16 - 1) & 0x3f) << 2)
 
#define LCDTIMING1_LPP(x)   (((x) & 0x3ff) - 1)
 
#define LCDCONTROL_LCDPWR   (1 << 11)
 
#define LCDCONTROL_LCDEN   (1)
 
#define LCDCONTROL_LCDBPP(x)   (((x) & 7) << 1)
 
#define LCDCONTROL_LCDTFT   (1 << 5)
 
#define PL110_LCDTIMING0   (PVOID)0xE0020000
 
#define PL110_LCDTIMING1   (PVOID)0xE0020004
 
#define PL110_LCDTIMING2   (PVOID)0xE0020008
 
#define PL110_LCDUPBASE   (PVOID)0xE0020010
 
#define PL110_LCDLPBASE   (PVOID)0xE0020014
 
#define PL110_LCDCONTROL   (PVOID)0xE0020018
 
#define READ_REGISTER_ULONG(r)   (*(volatile ULONG * const)(r))
 
#define WRITE_REGISTER_ULONG(r, v)   (*(volatile ULONG *)(r) = (v))
 
#define READ_REGISTER_USHORT(r)   (*(volatile USHORT * const)(r))
 
#define WRITE_REGISTER_USHORT(r, v)   (*(volatile USHORT *)(r) = (v))
 

Functions

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

Variables

PUSHORT VgaArmBase
 

Macro Definition Documentation

◆ LCDCONTROL_LCDBPP

#define LCDCONTROL_LCDBPP (   x)    (((x) & 7) << 1)

Definition at line 16 of file arm.h.

◆ LCDCONTROL_LCDEN

#define LCDCONTROL_LCDEN   (1)

Definition at line 15 of file arm.h.

◆ LCDCONTROL_LCDPWR

#define LCDCONTROL_LCDPWR   (1 << 11)

Definition at line 14 of file arm.h.

◆ LCDCONTROL_LCDTFT

#define LCDCONTROL_LCDTFT   (1 << 5)

Definition at line 17 of file arm.h.

◆ LCDTIMING0_PPL

#define LCDTIMING0_PPL (   x)    ((((x) / 16 - 1) & 0x3f) << 2)

Definition at line 12 of file arm.h.

◆ LCDTIMING1_LPP

#define LCDTIMING1_LPP (   x)    (((x) & 0x3ff) - 1)

Definition at line 13 of file arm.h.

◆ PL110_LCDCONTROL

#define PL110_LCDCONTROL   (PVOID)0xE0020018

Definition at line 24 of file arm.h.

◆ PL110_LCDLPBASE

#define PL110_LCDLPBASE   (PVOID)0xE0020014

Definition at line 23 of file arm.h.

◆ PL110_LCDTIMING0

#define PL110_LCDTIMING0   (PVOID)0xE0020000

Definition at line 19 of file arm.h.

◆ PL110_LCDTIMING1

#define PL110_LCDTIMING1   (PVOID)0xE0020004

Definition at line 20 of file arm.h.

◆ PL110_LCDTIMING2

#define PL110_LCDTIMING2   (PVOID)0xE0020008

Definition at line 21 of file arm.h.

◆ PL110_LCDUPBASE

#define PL110_LCDUPBASE   (PVOID)0xE0020010

Definition at line 22 of file arm.h.

◆ READ_REGISTER_ULONG

#define READ_REGISTER_ULONG (   r)    (*(volatile ULONG * const)(r))

Definition at line 26 of file arm.h.

◆ READ_REGISTER_USHORT

#define READ_REGISTER_USHORT (   r)    (*(volatile USHORT * const)(r))

Definition at line 29 of file arm.h.

◆ WRITE_REGISTER_ULONG

#define WRITE_REGISTER_ULONG (   r,
  v 
)    (*(volatile ULONG *)(r) = (v))

Definition at line 27 of file arm.h.

◆ WRITE_REGISTER_USHORT

#define WRITE_REGISTER_USHORT (   r,
  v 
)    (*(volatile USHORT *)(r) = (v))

Definition at line 30 of file arm.h.

Function Documentation

◆ DisplayCharacter()

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

Definition at line 19 of file bootvid.c.

25{
26 PUCHAR FontChar;
27 ULONG i, j, XOffset;
28
29 /* Get the font line for this character */
30 FontChar = &VidpFontData[Character * BOOTCHAR_HEIGHT - Top];
31
32 /* Loop each pixel height */
33 for (i = BOOTCHAR_HEIGHT; i > 0; --i)
34 {
35 /* Loop each pixel width */
36 XOffset = Left;
37 for (j = (1 << 7); j > 0; j >>= 1)
38 {
39 /* Check if we should draw this pixel */
40 if (FontChar[Top] & (UCHAR)j)
41 {
42 /* We do, use the given Text Color */
43 SetPixel(XOffset, Top, (UCHAR)TextColor);
44 }
45 else if (BackColor < BV_COLOR_NONE)
46 {
47 /*
48 * This is a background pixel. We're drawing it
49 * unless it's transparent.
50 */
51 SetPixel(XOffset, Top, (UCHAR)BackColor);
52 }
53
54 /* Increase X Offset */
55 XOffset++;
56 }
57
58 /* Move to the next Y ordinate */
59 Top++;
60 }
61}
FORCEINLINE VOID SetPixel(_In_ ULONG Left, _In_ ULONG Top, _In_ UCHAR Color)
Definition: arm.h:55
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

Referenced by VidDisplayString(), and VidDisplayStringXY().

◆ DoScroll()

VOID DoScroll ( _In_ ULONG  Scroll)

Definition at line 64 of file bootvid.c.

66{
68 PUSHORT SourceOffset, DestOffset;
69 PUSHORT i, j;
70
71 /* Set memory positions of the scroll */
73 DestOffset = &SourceOffset[Scroll * (SCREEN_WIDTH / 8)];
74
75 /* Start loop */
76 for (Top = VidpScrollRegion[1]; Top <= VidpScrollRegion[3]; ++Top)
77 {
78 /* Set number of bytes to loop and start offset */
79 Offset = VidpScrollRegion[0] >> 3;
81
82 /* Check if this is part of the scroll region */
83 if (Offset <= (VidpScrollRegion[2] >> 3))
84 {
85 /* Update position */
86 i = (PUSHORT)(DestOffset - SourceOffset);
87
88 /* Loop the X axis */
89 do
90 {
91 /* Write value in the new position so that we can do the scroll */
93
94 /* Move to the next memory location to write to */
95 j++;
96
97 /* Move to the next byte in the region */
98 Offset++;
99
100 /* Make sure we don't go past the scroll region */
101 } while (Offset <= (VidpScrollRegion[2] >> 3));
102 }
103
104 /* Move to the next line */
105 SourceOffset += (SCREEN_WIDTH / 8);
106 DestOffset += (SCREEN_WIDTH / 8);
107 }
108}
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

Referenced by VidDisplayString().

◆ InitPaletteWithTable()

VOID InitPaletteWithTable ( _In_ PULONG  Table,
_In_ ULONG  Count 
)

Definition at line 172 of file bootvid.c.

175{
177}
#define UNIMPLEMENTED
Definition: debug.h:115

Referenced by VidBitBlt().

◆ PreserveRow()

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

Definition at line 111 of file bootvid.c.

115{
116 PUSHORT Position1, Position2;
117 ULONG Count;
118
119 /* Calculate the position in memory for the row */
120 if (Restore)
121 {
122 /* Restore the row by copying back the contents saved off-screen */
123 Position1 = &VgaArmBase[CurrentTop * (SCREEN_WIDTH / 8)];
124 Position2 = &VgaArmBase[SCREEN_HEIGHT * (SCREEN_WIDTH / 8)];
125 }
126 else
127 {
128 /* Preserve the row by saving its contents off-screen */
129 Position1 = &VgaArmBase[SCREEN_HEIGHT * (SCREEN_WIDTH / 8)];
130 Position2 = &VgaArmBase[CurrentTop * (SCREEN_WIDTH / 8)];
131 }
132
133 /* Set the count and loop every pixel */
134 Count = TopDelta * (SCREEN_WIDTH / 8);
135 while (Count--)
136 {
137 /* Write the data back on the other position */
138 WRITE_REGISTER_USHORT(Position1, READ_REGISTER_USHORT(Position2));
139
140 /* Increase both positions */
141 Position1++;
142 Position2++;
143 }
144}
int Count
Definition: noreturn.cpp:7
#define SCREEN_HEIGHT
Definition: pc98video.c:28

Referenced by VidDisplayString().

◆ SetPixel()

◆ VidpBuildColor()

FORCEINLINE USHORT VidpBuildColor ( _In_ UCHAR  Color)

Definition at line 34 of file arm.h.

36{
38
39 /* Extract color components */
43
44 /* Build the 16-bit color mask */
45 return ((Red & 0x1F) << 11) | ((Green & 0x1F) << 6) | ((Blue & 0x1F));
46}
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
static const UCHAR DefaultPalette[]
Definition: blue.c:69
#define GetBValue(quad)
Definition: precomp.h:75
#define GetGValue(quad)
Definition: precomp.h:74
#define GetRValue(quad)
Definition: precomp.h:73

Referenced by SetPixel().

Variable Documentation

◆ VgaArmBase

PUSHORT VgaArmBase
extern

Definition at line 13 of file bootvid.c.

Referenced by DoScroll(), PreserveRow(), SetPixel(), and VidInitialize().