ReactOS 0.4.15-dev-8231-g29a56f3
pc98cons.c File Reference
#include <freeldr.h>
Include dependency graph for pc98cons.c:

Go to the source code of this file.

Macros

#define TEXT_CHAR_SIZE   2
 

Functions

VOID Pc98ConsPutChar (int Ch)
 
BOOLEAN Pc98ConsKbHit (VOID)
 
int Pc98ConsGetCh (VOID)
 

Variables

ULONG VramText
 
UCHAR TextCols
 
UCHAR TextLines
 
static USHORT CursorPosition = 0
 

Macro Definition Documentation

◆ TEXT_CHAR_SIZE

#define TEXT_CHAR_SIZE   2

Definition at line 18 of file pc98cons.c.

Function Documentation

◆ Pc98ConsGetCh()

int Pc98ConsGetCh ( VOID  )

Definition at line 85 of file pc98cons.c.

86{
87 static BOOLEAN ExtendedKey = FALSE;
88 static UCHAR ExtendedScanCode = 0;
89 REGS Regs;
90
91 /*
92 * If the last time we were called an
93 * extended key was pressed then return
94 * that keys scan code.
95 */
96 if (ExtendedKey)
97 {
99
100 return ExtendedScanCode;
101 }
102
103 /* Int 18h AH=00h
104 * KEYBOARD - GET KEYSTROKE
105 *
106 * Return:
107 * AH - BIOS scan code
108 * AL - ASCII character
109 */
110 Regs.b.ah = 0x00;
111 Int386(0x18, &Regs, &Regs);
112
113 /* Check for an extended keystroke */
114 if (Regs.b.al == 0)
115 {
117 ExtendedScanCode = Regs.b.ah;
118 }
119
120 /* Return keystroke */
121 return Regs.b.al;
122}
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
int __cdecl Int386(int ivec, REGS *in, REGS *out)
unsigned char al
Definition: pcbios.h:131
unsigned char ah
Definition: pcbios.h:132
static BOOLEAN ExtendedKey
Definition: ueficon.c:20
static char ExtendedScanCode
Definition: ueficon.c:21
Definition: pcbios.h:159
BYTEREGS b
Definition: pcbios.h:163
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by MachInit().

◆ Pc98ConsKbHit()

BOOLEAN Pc98ConsKbHit ( VOID  )

Definition at line 64 of file pc98cons.c.

65{
66 REGS Regs;
67
68 /* Int 18h AH=01h
69 * KEYBOARD - CHECK FOR KEYSTROKE
70 *
71 * Return:
72 * BH - status
73 * 00h - if no keystroke available
74 * 01h - if keystroke available
75 * AH - BIOS scan code
76 * AL - ASCII character
77 */
78 Regs.b.ah = 0x01;
79 Int386(0x18, &Regs, &Regs);
80
81 return Regs.b.bh == 1;
82}
unsigned char bh
Definition: pcbios.h:135

Referenced by MachInit().

◆ Pc98ConsPutChar()

VOID Pc98ConsPutChar ( int  Ch)

Definition at line 25 of file pc98cons.c.

26{
27 /* If scrolling is needed */
29 {
33
35 }
36
37 if (Ch == '\n')
38 {
39 if (CursorPosition % TextCols != 0)
41
42 return;
43 }
44
45 if (Ch == '\t')
46 {
47 Pc98ConsPutChar(' ');
48 Pc98ConsPutChar(' ');
49 Pc98ConsPutChar(' ');
50 Pc98ConsPutChar(' ');
51 Pc98ConsPutChar(' ');
52 Pc98ConsPutChar(' ');
53 Pc98ConsPutChar(' ');
54 Pc98ConsPutChar(' ');
55
56 return;
57 }
58
61}
UCHAR TextLines
Definition: pc98video.c:22
ULONG VramText
Definition: pc98video.c:40
UCHAR TextCols
Definition: pc98video.c:21
VOID Pc98ConsPutChar(int Ch)
Definition: pc98cons.c:25
#define TEXT_CHAR_SIZE
Definition: pc98cons.c:18
static USHORT CursorPosition
Definition: pc98cons.c:20
#define Ch(x, y, z)
Definition: sha2.c:141
uint16_t * PUSHORT
Definition: typedefs.h:56
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263

Referenced by MachInit(), and Pc98ConsPutChar().

Variable Documentation

◆ CursorPosition

USHORT CursorPosition = 0
static

◆ TextCols

UCHAR TextCols
extern

◆ TextLines

UCHAR TextLines
extern

Definition at line 22 of file pc98video.c.

Referenced by Pc98ConsPutChar(), and Pc98VideoInit().

◆ VramText