ReactOS 0.4.16-dev-1990-gfa5cf28
pc98video.c File Reference
#include <freeldr.h>
#include <drivers/pc98/video.h>
#include "../../vgafont.h"
Include dependency graph for pc98video.c:

Go to the source code of this file.

Macros

#define VGA_CHAR_SIZE   2
 
#define TEXT_CHAR_SIZE   2
 
#define SCREEN_WIDTH   640
 
#define SCREEN_HEIGHT   400
 
#define BYTES_PER_SCANLINE   (SCREEN_WIDTH / 8)
 

Functions

VOID Pc98VideoInit (VOID)
 
VOID Pc98VideoClearScreen (UCHAR Attr)
 
VIDEODISPLAYMODE Pc98VideoSetDisplayMode (PCSTR DisplayModeName, BOOLEAN Init)
 
VOID Pc98VideoGetDisplaySize (PULONG Width, PULONG Height, PULONG Depth)
 
ULONG Pc98VideoGetBufferSize (VOID)
 
VOID Pc98VideoGetFontsFromFirmware (PULONG RomFontPointers)
 
VOID Pc98VideoSetTextCursorPosition (UCHAR X, UCHAR Y)
 
VOID Pc98VideoHideShowTextCursor (BOOLEAN Show)
 
static UCHAR Pc98VideoAttrToGdcAttr (UCHAR Attr)
 
static USHORT Pc98AsciiToJisX (int Ch)
 
static VOID Pc98VideoTextRamPutChar (int Ch, UCHAR Attr, unsigned X, unsigned Y)
 
VOID Pc98VideoPutChar (int Ch, UCHAR Attr, unsigned X, unsigned Y)
 
VOID Pc98VideoCopyOffScreenBufferToVRAM (PVOID Buffer)
 
BOOLEAN Pc98VideoIsPaletteFixed (VOID)
 
VOID Pc98VideoSetPaletteColor (UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
 
VOID Pc98VideoGetPaletteColor (UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
 
VOID Pc98VideoSync (VOID)
 
VOID Pc98VideoPrepareForReactOS (VOID)
 

Variables

BOOLEAN HiResoMachine
 
UCHAR TextCols
 
UCHAR TextLines
 
static BOOLEAN UseCGFont = TRUE
 
static BOOLEAN CGAccelDraw = TRUE
 
UCHAR MachDefaultTextColor = COLOR_WHITE
 
ULONG VramText
 
static ULONG VramPlaneB
 
static ULONG VramPlaneG
 
static ULONG VramPlaneR
 
static ULONG VramPlaneI
 
static const PALETTE_ENTRY CgaPalette []
 

Macro Definition Documentation

◆ BYTES_PER_SCANLINE

#define BYTES_PER_SCANLINE   (SCREEN_WIDTH / 8)

Definition at line 26 of file pc98video.c.

◆ SCREEN_HEIGHT

#define SCREEN_HEIGHT   400

Definition at line 25 of file pc98video.c.

◆ SCREEN_WIDTH

#define SCREEN_WIDTH   640

Definition at line 24 of file pc98video.c.

◆ TEXT_CHAR_SIZE

#define TEXT_CHAR_SIZE   2

Definition at line 20 of file pc98video.c.

◆ VGA_CHAR_SIZE

#define VGA_CHAR_SIZE   2

Definition at line 18 of file pc98video.c.

Function Documentation

◆ Pc98AsciiToJisX()

static USHORT Pc98AsciiToJisX ( int  Ch)
static

Definition at line 278 of file pc98video.c.

279{
280 switch (Ch)
281 {
282 /* Only characters required for pseudographic are handled here */
283 case 0x18: return 0x1E;
284 case 0x19: return 0x1F;
285 case 0xB3: return 0x260B;
286 case 0xB6: return 0x4C0B;
287 case 0xBA: return 0x270B;
288 case 0xBB: return 0x370B;
289 case 0xBC: return 0x3F0B;
290 case 0xBF: return 0x340B;
291 case 0xC0: return 0x380B;
292 case 0xC4: return 0x240B;
293 case 0xC7: return 0x440B;
294 case 0xC8: return 0x3B0B;
295 case 0xC9: return 0x330B;
296 case 0xCD: return 0x250B;
297 case 0xD9: return 0x3C0B;
298 case 0xDA: return 0x300B;
299 case 0xDB: return 0x87;
300 default: return Ch;
301 }
302}
#define Ch(x, y, z)
Definition: sha2.c:141

Referenced by Pc98VideoPutChar().

◆ Pc98VideoAttrToGdcAttr()

static UCHAR Pc98VideoAttrToGdcAttr ( UCHAR  Attr)
static

Definition at line 243 of file pc98video.c.

244{
245 switch (Attr & 0xF)
246 {
247 case COLOR_BLACK:
248 return GDC_ATTR_BLACK;
249 case COLOR_BLUE:
250 return GDC_ATTR_BLUE;
251 case COLOR_GREEN:
252 case COLOR_LIGHTGREEN:
253 return GDC_ATTR_GREEN;
254 case COLOR_CYAN:
255 case COLOR_GRAY:
256 case COLOR_DARKGRAY:
257 case COLOR_WHITE:
258 return GDC_ATTR_WHITE;
259 case COLOR_RED:
260 case COLOR_LIGHTRED:
261 return GDC_ATTR_RED;
262 case COLOR_MAGENTA:
264 return GDC_ATTR_PURPLE;
265 case COLOR_BROWN:
266 case COLOR_YELLOW:
267 return GDC_ATTR_YELLOW;
268 case COLOR_LIGHTBLUE:
269 case COLOR_LIGHTCYAN:
270 return GDC_ATTR_LIGHTBLUE;
271 default:
272 return GDC_ATTR_BLACK;
273 }
274}
#define COLOR_LIGHTBLUE
Definition: ui.h:338
#define COLOR_LIGHTMAGENTA
Definition: ui.h:342
#define COLOR_BLUE
Definition: ui.h:329
#define COLOR_DARKGRAY
Definition: ui.h:337
#define COLOR_LIGHTRED
Definition: ui.h:341
#define COLOR_GRAY
Definition: ui.h:335
#define COLOR_YELLOW
Definition: ui.h:343
#define COLOR_LIGHTCYAN
Definition: ui.h:340
#define COLOR_CYAN
Definition: ui.h:331
#define COLOR_MAGENTA
Definition: ui.h:333
#define COLOR_BROWN
Definition: ui.h:334
#define COLOR_WHITE
Definition: ui.h:344
#define COLOR_BLACK
Definition: ui.h:328
#define COLOR_LIGHTGREEN
Definition: ui.h:339
#define COLOR_RED
Definition: ui.h:332
#define COLOR_GREEN
Definition: ui.h:330
#define GDC_ATTR_RED
Definition: video.h:53
#define GDC_ATTR_LIGHTBLUE
Definition: video.h:56
#define GDC_ATTR_WHITE
Definition: video.h:58
#define GDC_ATTR_PURPLE
Definition: video.h:54
#define GDC_ATTR_GREEN
Definition: video.h:55
#define GDC_ATTR_YELLOW
Definition: video.h:57
#define GDC_ATTR_BLACK
Definition: video.h:51
#define GDC_ATTR_BLUE
Definition: video.h:52

Referenced by Pc98VideoTextRamPutChar().

◆ Pc98VideoClearScreen()

VOID Pc98VideoClearScreen ( UCHAR  Attr)

Definition at line 164 of file pc98video.c.

165{
166 USHORT i;
167 USHORT B = (Attr & 0x10) ? 0xFFFF : 0;
168 USHORT G = (Attr & 0x20) ? 0xFFFF : 0;
169 USHORT R = (Attr & 0x40) ? 0xFFFF : 0;
170 USHORT I = (Attr & 0x80) ? 0xFFFF : 0;
171
172 for (i = 0; i < VRAM_TEXT_SIZE; i += TEXT_CHAR_SIZE)
173 *(PUSHORT)(VramText + i) = ' ';
174
175 for (i = 0; i < BYTES_PER_SCANLINE * SCREEN_HEIGHT; i += sizeof(USHORT))
176 {
177 *(PUSHORT)(VramPlaneB + i) = B;
178 *(PUSHORT)(VramPlaneG + i) = G;
179 *(PUSHORT)(VramPlaneR + i) = R;
180 *(PUSHORT)(VramPlaneI + i) = I;
181 }
182}
#define G(r, i, a, b, c, d)
Definition: blake2b-ref.c:117
Definition: ehthrow.cxx:54
#define B(row, col)
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
#define I(s)
static ULONG VramPlaneB
Definition: pc98video.c:38
ULONG VramText
Definition: pc98video.c:37
static ULONG VramPlaneG
Definition: pc98video.c:39
static ULONG VramPlaneR
Definition: pc98video.c:40
#define SCREEN_HEIGHT
Definition: pc98video.c:25
static ULONG VramPlaneI
Definition: pc98video.c:41
#define BYTES_PER_SCANLINE
Definition: pc98video.c:26
#define TEXT_CHAR_SIZE
Definition: pc98video.c:20
unsigned short USHORT
Definition: pedump.c:61
#define VRAM_TEXT_SIZE
Definition: video.h:19
#define R(b, x)
Definition: sha2.c:134
uint16_t * PUSHORT
Definition: typedefs.h:56

Referenced by ChainLoadBiosBootSectorCode(), and MachInit().

◆ Pc98VideoCopyOffScreenBufferToVRAM()

VOID Pc98VideoCopyOffScreenBufferToVRAM ( PVOID  Buffer)

Definition at line 381 of file pc98video.c.

382{
383 PUCHAR OffScreenBuffer = (PUCHAR)Buffer;
384 USHORT X, Y;
385
386 for (Y = 0; Y < SCREEN_HEIGHT / CHAR_HEIGHT; Y++)
387 {
388 for (X = 0; X < SCREEN_WIDTH / CHAR_WIDTH; X++)
389 {
390 Pc98VideoPutChar(OffScreenBuffer[0], OffScreenBuffer[1], X, Y);
391 OffScreenBuffer += VGA_CHAR_SIZE;
392 }
393 }
394}
Definition: bufpool.h:45
#define Y(I)
#define X(b, s)
#define SCREEN_WIDTH
Definition: pc98video.c:24
#define VGA_CHAR_SIZE
Definition: pc98video.c:18
VOID Pc98VideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pc98video.c:313
unsigned char * PUCHAR
Definition: typedefs.h:53
#define CHAR_WIDTH
Definition: vgafont.h:10
#define CHAR_HEIGHT
Definition: vgafont.h:11

Referenced by MachInit().

◆ Pc98VideoGetBufferSize()

ULONG Pc98VideoGetBufferSize ( VOID  )

Definition at line 200 of file pc98video.c.

201{
203}

Referenced by MachInit().

◆ Pc98VideoGetDisplaySize()

VOID Pc98VideoGetDisplaySize ( PULONG  Width,
PULONG  Height,
PULONG  Depth 
)

Definition at line 192 of file pc98video.c.

193{
196 *Depth = 0;
197}
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819

Referenced by MachInit().

◆ Pc98VideoGetFontsFromFirmware()

VOID Pc98VideoGetFontsFromFirmware ( PULONG  RomFontPointers)

Definition at line 206 of file pc98video.c.

207{
208 *RomFontPointers = VramText + 0x4000;
209}
#define RomFontPointers
Definition: winldr.c:348

Referenced by MachInit().

◆ Pc98VideoGetPaletteColor()

VOID Pc98VideoGetPaletteColor ( UCHAR  Color,
UCHAR Red,
UCHAR Green,
UCHAR Blue 
)

Definition at line 415 of file pc98video.c.

416{
417 if (Color < 16)
418 {
423 }
424 else
425 {
426 *Red = 0;
427 *Green = 0;
428 *Blue = 0;
429 }
430}
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define GDC2_IO_i_BLUE
Definition: video.h:267
#define GDC2_IO_o_PALETTE_INDEX
Definition: video.h:275
#define GDC2_IO_i_RED
Definition: video.h:266
#define GDC2_IO_i_GREEN
Definition: video.h:265

Referenced by MachInit().

◆ Pc98VideoHideShowTextCursor()

VOID Pc98VideoHideShowTextCursor ( BOOLEAN  Show)

Definition at line 225 of file pc98video.c.

226{
227 CSRFORMPARAM CursorParameters;
228
229 RtlZeroMemory(&CursorParameters, sizeof(CSRFORMPARAM));
230 CursorParameters.Show = Show;
231 CursorParameters.Blink = TRUE;
232 CursorParameters.BlinkRate = 12;
233 CursorParameters.LinesPerRow = 16;
234 CursorParameters.StartScanLine = 12;
235 CursorParameters.EndScanLine = 15;
236
238 WRITE_GDC_CSRFORM((PUCHAR)GDC1_IO_o_PARAM, &CursorParameters);
239}
#define TRUE
Definition: types.h:120
FORCEINLINE VOID WRITE_GDC_CSRFORM(PUCHAR Port, PCSRFORMPARAM CursorParameters)
Definition: video.h:186
#define GDC1_IO_o_COMMAND
Definition: video.h:235
#define GDC1_IO_o_PARAM
Definition: video.h:234
#define GDC_COMMAND_CSRFORM
Definition: video.h:173
UCHAR StartScanLine
Definition: video.h:180
UCHAR LinesPerRow
Definition: video.h:179
BOOLEAN Show
Definition: video.h:176
UCHAR EndScanLine
Definition: video.h:181
BOOLEAN Blink
Definition: video.h:177
UCHAR BlinkRate
Definition: video.h:178
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by MachInit(), and Pc98VideoPrepareForReactOS().

◆ Pc98VideoInit()

VOID Pc98VideoInit ( VOID  )

Definition at line 66 of file pc98video.c.

67{
68 REGS Regs;
69 USHORT i;
70
71 if (HiResoMachine)
72 {
78 TextCols = 80;
79 TextLines = 31;
80 }
81 else
82 {
88 TextCols = 80;
89 TextLines = 25;
90 }
91
92 for (i = 0; i < VRAM_ATTR_SIZE; i += TEXT_CHAR_SIZE)
94
95 /* Int 18h AH=41h
96 * CRT BIOS - Stop displaying graphics
97 */
98 Regs.b.ah = 0x41;
99 Int386(0x18, &Regs, &Regs);
100
101 /* Int 18h AH=42h
102 * CRT BIOS - Set display area
103 *
104 * CH0-CH3 - always zero
105 * CH4 - video page
106 * CH5 - CRT display mode
107 * 0 - color
108 * 1 - monochrome
109 * CH6-CH7 - VRAM area
110 * 01 - Upper-half (16-32 kB), 640x200
111 * 10 - Lower-half (0-16 kB), 640x200
112 * 11 - All (0-32 kB), 640x400
113 */
114 Regs.b.ah = 0x42;
115 Regs.b.ch = 0xC0;
116 Int386(0x18, &Regs, &Regs); /* 640x400 */
117
121
123 for (i = 0; i < RTL_NUMBER_OF(CgaPalette); i++)
125
126 /* Int 18h AH=0Ah
127 * CRT BIOS - Set text screen mode
128 *
129 * AL0 - text rows
130 * 0 - 25
131 * 1 - 20
132 * AL1 - text cols
133 * 0 - 80
134 * 1 - 40
135 * AL2 - text attribute
136 * 0 - with vertical line
137 * 1 - normal
138 * AL3 - KCG access mode
139 * 0 - code
140 * 1 - bitmap
141 * AL4-AL7 - always zero
142 *
143 * High-resolution machine:
144 * AL4 - text rows, AL3 - KCG access mode
145 */
146 Regs.b.ah = 0x0A;
147 Regs.b.al = HiResoMachine ? 0x10 : 0x00;
148 Int386(0x18, &Regs, &Regs); /* 80x25(31) */
149
150 /* Int 18h AH=0Ch
151 * CRT BIOS - Start displaying text
152 */
153 Regs.b.ah = 0x0C;
154 Int386(0x18, &Regs, &Regs);
155
156 /* Int 18h AH=40h
157 * CRT BIOS - Start displaying graphics
158 */
159 Regs.b.ah = 0x40;
160 Int386(0x18, &Regs, &Regs);
161}
#define RTL_NUMBER_OF(x)
Definition: RtlRegistry.c:12
UCHAR TextLines
Definition: pc98video.c:22
UCHAR TextCols
Definition: pc98video.c:21
VOID Pc98VideoSync(VOID)
Definition: pc98video.c:433
VOID Pc98VideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: pc98video.c:403
BOOLEAN HiResoMachine
Definition: machpc98.c:17
static const PALETTE_ENTRY CgaPalette[]
Definition: pc98video.c:43
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define VRAM_TEXT_ATTR_OFFSET
Definition: video.h:18
#define GDC2_IO_o_MODE_FLIPFLOP2
Definition: video.h:280
#define VRAM_ATTR_SIZE
Definition: video.h:20
#define GDC_ATTR_VISIBLE
Definition: video.h:45
#define VRAM_HI_RESO_PLANE_B
Definition: video.h:28
#define GDC2_IO_o_VIDEO_PAGE_ACCESS
Definition: video.h:274
#define VRAM_HI_RESO_PLANE_R
Definition: video.h:30
#define VRAM_NORMAL_PLANE_B
Definition: video.h:12
#define VRAM_HI_RESO_PLANE_I
Definition: video.h:31
#define VRAM_HI_RESO_PLANE_G
Definition: video.h:29
#define VRAM_NORMAL_TEXT
Definition: video.h:17
#define GDC2_IO_o_VIDEO_PAGE
Definition: video.h:273
#define GDC2_MODE_COLORS_16
Definition: video.h:282
#define VRAM_NORMAL_PLANE_I
Definition: video.h:15
#define VRAM_NORMAL_PLANE_G
Definition: video.h:13
#define VRAM_HI_RESO_TEXT
Definition: video.h:32
#define VRAM_NORMAL_PLANE_R
Definition: video.h:14
unsigned char ch
Definition: pcbios.h:140
unsigned char al
Definition: pcbios.h:133
unsigned char ah
Definition: pcbios.h:134
Definition: pcbios.h:161
BYTEREGS b
Definition: pcbios.h:165

Referenced by MachInit().

◆ Pc98VideoIsPaletteFixed()

BOOLEAN Pc98VideoIsPaletteFixed ( VOID  )

Definition at line 397 of file pc98video.c.

398{
399 return FALSE;
400}
#define FALSE
Definition: types.h:117

Referenced by MachInit().

◆ Pc98VideoPrepareForReactOS()

VOID Pc98VideoPrepareForReactOS ( VOID  )

Definition at line 443 of file pc98video.c.

444{
445 REGS Regs;
446
447 /* Int 18h AH=41h
448 * CRT BIOS - Stop displaying graphics
449 */
450 Regs.b.ah = 0x41;
451 Int386(0x18, &Regs, &Regs);
452
454
455 if (UseCGFont && CGAccelDraw)
456 {
457 /* Clear the text screen, resetting to default attributes */
458 for (USHORT i = 0; i < VRAM_TEXT_SIZE; i += TEXT_CHAR_SIZE)
459 {
460 *(PUSHORT)(VramText + i) = ' ';
462 }
463 }
464}
static BOOLEAN CGAccelDraw
Definition: pc98video.c:33
VOID Pc98VideoHideShowTextCursor(BOOLEAN Show)
Definition: pc98video.c:225
static BOOLEAN UseCGFont
Definition: pc98video.c:29

Referenced by Pc98PrepareForReactOS().

◆ Pc98VideoPutChar()

VOID Pc98VideoPutChar ( int  Ch,
UCHAR  Attr,
unsigned  X,
unsigned  Y 
)

Definition at line 313 of file pc98video.c.

314{
315 UCHAR Line;
316 UCHAR B = (Attr & 0x10) ? 0xFF : 0;
317 UCHAR G = (Attr & 0x20) ? 0xFF : 0;
318 UCHAR R = (Attr & 0x40) ? 0xFF : 0;
319 UCHAR I = (Attr & 0x80) ? 0xFF : 0;
320 ULONG VramOffset = X + (Y * CHAR_HEIGHT) * BYTES_PER_SCANLINE;
321 const UCHAR* FontPtr = BitmapFont8x16 + Ch * CHAR_HEIGHT;
322 BOOLEAN CGFont = UseCGFont && (Ch != LIGHT_FILL && Ch != MEDIUM_FILL && Ch != DARK_FILL);
323
324 if (CGFont)
325 {
327
328 if (CGAccelDraw)
329 {
330 Pc98VideoTextRamPutChar(Ch, Attr, X, Y);
331 }
332 else
333 {
334 /* Set needed character code to obtain glyph from CG Window */
337 }
338 }
339 else if (UseCGFont && CGAccelDraw)
340 {
341 /* Clear character at this place in Text RAM */
342 Pc98VideoTextRamPutChar(' ', Attr, X, Y);
343 }
344
345 for (Line = 0; Line < CHAR_HEIGHT; Line++)
346 {
347 UCHAR CharLine = FontPtr[Line];
348 if (CGFont)
349 {
350 if (CGAccelDraw)
351 {
352 /* Character is already displayed by GDC (Text RAM),
353 * so display only background for it. */
354 CharLine = 0;
355 }
356 else
357 {
358 /* Obtain glyph data from CG Window */
361 }
362 }
363 if (Attr & 0x0F)
364 {
365 *(PUCHAR)(VramPlaneB + VramOffset + Line * BYTES_PER_SCANLINE) = B | ((Attr & 0x01) ? CharLine : 0);
366 *(PUCHAR)(VramPlaneG + VramOffset + Line * BYTES_PER_SCANLINE) = G | ((Attr & 0x02) ? CharLine : 0);
367 *(PUCHAR)(VramPlaneR + VramOffset + Line * BYTES_PER_SCANLINE) = R | ((Attr & 0x04) ? CharLine : 0);
368 *(PUCHAR)(VramPlaneI + VramOffset + Line * BYTES_PER_SCANLINE) = I | ((Attr & 0x08) ? CharLine : 0);
369 }
370 else
371 {
372 *(PUCHAR)(VramPlaneB + VramOffset + Line * BYTES_PER_SCANLINE) = B & ~CharLine;
373 *(PUCHAR)(VramPlaneG + VramOffset + Line * BYTES_PER_SCANLINE) = G & ~CharLine;
374 *(PUCHAR)(VramPlaneR + VramOffset + Line * BYTES_PER_SCANLINE) = R & ~CharLine;
375 *(PUCHAR)(VramPlaneI + VramOffset + Line * BYTES_PER_SCANLINE) = I & ~CharLine;
376 }
377 }
378}
unsigned char BOOLEAN
#define LIGHT_FILL
Definition: ui.h:316
#define MEDIUM_FILL
Definition: ui.h:317
#define DARK_FILL
Definition: ui.h:318
static VOID Pc98VideoTextRamPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pc98video.c:306
static USHORT Pc98AsciiToJisX(int Ch)
Definition: pc98video.c:278
#define KCG_IO_o_CHARCODE_HIGH
Definition: video.h:399
#define KCG_IO_o_LINE
Definition: video.h:401
#define KCG_IO_i_PATTERN
Definition: video.h:404
#define KCG_IO_o_CHARCODE_LOW
Definition: video.h:400
Definition: ncftp.h:79
uint32_t ULONG
Definition: typedefs.h:59
const UCHAR BitmapFont8x16[256 *CHAR_HEIGHT]
Definition: vgafont.c:13
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by MachInit(), and Pc98VideoCopyOffScreenBufferToVRAM().

◆ Pc98VideoSetDisplayMode()

VIDEODISPLAYMODE Pc98VideoSetDisplayMode ( PCSTR  DisplayModeName,
BOOLEAN  Init 
)

Definition at line 185 of file pc98video.c.

186{
187 /* Not supported by hardware */
188 return VideoTextMode;
189}
@ VideoTextMode
Definition: machine.h:35

Referenced by MachInit().

◆ Pc98VideoSetPaletteColor()

VOID Pc98VideoSetPaletteColor ( UCHAR  Color,
UCHAR  Red,
UCHAR  Green,
UCHAR  Blue 
)

Definition at line 403 of file pc98video.c.

404{
405 if (Color < 16)
406 {
411 }
412}
#define GDC2_IO_o_RED
Definition: video.h:277
#define GDC2_IO_o_GREEN
Definition: video.h:276
#define GDC2_IO_o_BLUE
Definition: video.h:278

Referenced by MachInit(), and Pc98VideoInit().

◆ Pc98VideoSetTextCursorPosition()

VOID Pc98VideoSetTextCursorPosition ( UCHAR  X,
UCHAR  Y 
)

Definition at line 212 of file pc98video.c.

213{
214 CSRWPARAM CursorParameters;
215
216 RtlZeroMemory(&CursorParameters, sizeof(CSRWPARAM));
217 CursorParameters.CursorAddress = X + Y * TextCols;
218 CursorParameters.DotAddress = 0;
219
221 WRITE_GDC_CSRW((PUCHAR)GDC1_IO_o_PARAM, &CursorParameters);
222}
FORCEINLINE VOID WRITE_GDC_CSRW(PUCHAR Port, PCSRWPARAM CursorParameters)
Definition: video.h:160
#define GDC_COMMAND_CSRW
Definition: video.h:151
UCHAR DotAddress
Definition: video.h:155
ULONG CursorAddress
Definition: video.h:154

Referenced by MachInit().

◆ Pc98VideoSync()

VOID Pc98VideoSync ( VOID  )

Definition at line 433 of file pc98video.c.

434{
436 NOTHING;
437
439 NOTHING;
440}
#define NOTHING
Definition: input_list.c:10
#define GDC2_IO_i_STATUS
Definition: video.h:260
#define GDC_STATUS_VSYNC
Definition: video.h:41

Referenced by MachInit(), and Pc98VideoInit().

◆ Pc98VideoTextRamPutChar()

static VOID Pc98VideoTextRamPutChar ( int  Ch,
UCHAR  Attr,
unsigned  X,
unsigned  Y 
)
static

Definition at line 306 of file pc98video.c.

307{
308 *(PUSHORT)(VramText + (X + Y * TextCols) * TEXT_CHAR_SIZE) = Ch;
310}
static UCHAR Pc98VideoAttrToGdcAttr(UCHAR Attr)
Definition: pc98video.c:243

Referenced by Pc98VideoPutChar().

Variable Documentation

◆ CGAccelDraw

BOOLEAN CGAccelDraw = TRUE
static

Definition at line 33 of file pc98video.c.

Referenced by Pc98VideoPrepareForReactOS(), and Pc98VideoPutChar().

◆ CgaPalette

const PALETTE_ENTRY CgaPalette[]
static
Initial value:
=
{
{0x00, 0x00, 0x00},
{0x00, 0x00, 0x0A},
{0x00, 0x0A, 0x00},
{0x00, 0x0A, 0x0A},
{0x0A, 0x00, 0x00},
{0x0A, 0x00, 0x0A},
{0x0A, 0x05, 0x00},
{0x0A, 0x0A, 0x0A},
{0x05, 0x05, 0x05},
{0x05, 0x05, 0x0F},
{0x05, 0x0F, 0x05},
{0x05, 0x0F, 0x0F},
{0x0F, 0x05, 0x05},
{0x0F, 0x05, 0x0F},
{0x0F, 0x0F, 0x05},
{0x0F, 0x0F, 0x0F}
}

Definition at line 43 of file pc98video.c.

Referenced by Pc98VideoInit().

◆ HiResoMachine

BOOLEAN HiResoMachine
extern

Definition at line 17 of file machpc98.c.

Referenced by MachInit(), Pc98GetExtendedBIOSData(), and Pc98VideoInit().

◆ MachDefaultTextColor

UCHAR MachDefaultTextColor = COLOR_WHITE

Definition at line 35 of file pc98video.c.

◆ TextCols

◆ TextLines

UCHAR TextLines

Definition at line 22 of file pc98video.c.

Referenced by Pc98ConsPutChar(), and Pc98VideoInit().

◆ UseCGFont

BOOLEAN UseCGFont = TRUE
static

Definition at line 29 of file pc98video.c.

Referenced by Pc98VideoPrepareForReactOS(), and Pc98VideoPutChar().

◆ VramPlaneB

ULONG VramPlaneB
static

Definition at line 38 of file pc98video.c.

Referenced by Pc98VideoClearScreen(), Pc98VideoInit(), and Pc98VideoPutChar().

◆ VramPlaneG

ULONG VramPlaneG
static

Definition at line 39 of file pc98video.c.

Referenced by Pc98VideoClearScreen(), Pc98VideoInit(), and Pc98VideoPutChar().

◆ VramPlaneI

ULONG VramPlaneI
static

Definition at line 41 of file pc98video.c.

Referenced by Pc98VideoClearScreen(), Pc98VideoInit(), and Pc98VideoPutChar().

◆ VramPlaneR

ULONG VramPlaneR
static

Definition at line 40 of file pc98video.c.

Referenced by Pc98VideoClearScreen(), Pc98VideoInit(), and Pc98VideoPutChar().

◆ VramText