ReactOS  0.4.15-dev-1184-g23e04ae
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  {
98  ExtendedKey = FALSE;
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  {
116  ExtendedKey = TRUE;
117  ExtendedScanCode = Regs.b.ah;
118  }
119 
120  /* Return keystroke */
121  return Regs.b.al;
122 }
#define TRUE
Definition: types.h:120
unsigned char ah
Definition: pcbios.h:126
int __cdecl Int386(int ivec, REGS *in, REGS *out)
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
unsigned char UCHAR
Definition: xmlstorage.h:181
BYTEREGS b
Definition: pcbios.h:157
unsigned char al
Definition: pcbios.h:125
Definition: pcbios.h:152

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 ah
Definition: pcbios.h:126
int __cdecl Int386(int ivec, REGS *in, REGS *out)
BYTEREGS b
Definition: pcbios.h:157
unsigned char bh
Definition: pcbios.h:129
Definition: pcbios.h:152

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 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define Ch(x, y, z)
Definition: sha2.c:141
ULONG VramText
Definition: pc98video.c:40
UCHAR TextLines
Definition: pc98video.c:22
VOID Pc98ConsPutChar(int Ch)
Definition: pc98cons.c:25
UCHAR TextCols
Definition: pc98video.c:21
#define TEXT_CHAR_SIZE
Definition: pc98cons.c:18
static USHORT CursorPosition
Definition: pc98cons.c:20
unsigned short * PUSHORT
Definition: retypes.h:2

Referenced by MachInit(), and Pc98ConsPutChar().

Variable Documentation

◆ CursorPosition

USHORT CursorPosition = 0
static

◆ TextCols

◆ TextLines

UCHAR TextLines

Definition at line 22 of file pc98video.c.

Referenced by Pc98ConsPutChar(), and Pc98VideoInit().

◆ VramText