Skip to content

Commit 0ffed7f

Browse files
committed
[FREELDR:PC] pccons.c, pcvesa.c, pcvideo.c: Reformatting (reactos#8504)
1 parent 5047e62 commit 0ffed7f

File tree

3 files changed

+849
-902
lines changed

3 files changed

+849
-902
lines changed

boot/freeldr/freeldr/arch/i386/pc/pccons.c

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -21,101 +21,101 @@
2121
VOID
2222
PcConsPutChar(int Ch)
2323
{
24-
REGS Regs;
24+
REGS Regs;
2525

26-
/* If we are displaying a CR '\n' then do a LF also */
27-
if ('\n' == Ch)
26+
/* If we are displaying a CR '\n' then do a LF also */
27+
if (Ch == '\n')
2828
{
29-
/* Display the LF */
30-
PcConsPutChar('\r');
29+
/* Display the LF */
30+
PcConsPutChar('\r');
3131
}
3232

33-
/* If we are displaying a TAB '\t' then display 8 spaces ' ' */
34-
if ('\t' == Ch)
33+
/* If we are displaying a TAB '\t' then display 8 spaces ' ' */
34+
if (Ch == '\t')
3535
{
36-
/* Display the 8 spaces ' ' */
37-
PcConsPutChar(' ');
38-
PcConsPutChar(' ');
39-
PcConsPutChar(' ');
40-
PcConsPutChar(' ');
41-
PcConsPutChar(' ');
42-
PcConsPutChar(' ');
43-
PcConsPutChar(' ');
44-
PcConsPutChar(' ');
45-
return;
36+
/* Display the 8 spaces ' ' */
37+
PcConsPutChar(' ');
38+
PcConsPutChar(' ');
39+
PcConsPutChar(' ');
40+
PcConsPutChar(' ');
41+
PcConsPutChar(' ');
42+
PcConsPutChar(' ');
43+
PcConsPutChar(' ');
44+
PcConsPutChar(' ');
45+
return;
4646
}
4747

48-
/* Int 10h AH=0Eh
49-
* VIDEO - TELETYPE OUTPUT
50-
*
51-
* AH = 0Eh
52-
* AL = character to write
53-
* BH = page number
54-
* BL = foreground color (graphics modes only)
55-
*/
56-
Regs.b.ah = 0x0E;
57-
Regs.b.al = Ch;
58-
Regs.w.bx = 1;
59-
Int386(0x10, &Regs, &Regs);
48+
/* Int 10h AH=0Eh
49+
* VIDEO - TELETYPE OUTPUT
50+
*
51+
* AH = 0Eh
52+
* AL = character to write
53+
* BH = page number
54+
* BL = foreground color (graphics modes only)
55+
*/
56+
Regs.b.ah = 0x0E;
57+
Regs.b.al = Ch;
58+
Regs.w.bx = 1;
59+
Int386(0x10, &Regs, &Regs);
6060
}
6161

6262
BOOLEAN
6363
PcConsKbHit(VOID)
6464
{
65-
REGS Regs;
65+
REGS Regs;
6666

67-
/* Int 16h AH=01h
68-
* KEYBOARD - CHECK FOR KEYSTROKE
69-
*
70-
* AH = 01h
71-
* Return:
72-
* ZF set if no keystroke available
73-
* ZF clear if keystroke available
74-
* AH = BIOS scan code
75-
* AL = ASCII character
76-
*/
77-
Regs.b.ah = 0x01;
78-
Int386(0x16, &Regs, &Regs);
67+
/* Int 16h AH=01h
68+
* KEYBOARD - CHECK FOR KEYSTROKE
69+
*
70+
* AH = 01h
71+
* Return:
72+
* ZF set if no keystroke available
73+
* ZF clear if keystroke available
74+
* AH = BIOS scan code
75+
* AL = ASCII character
76+
*/
77+
Regs.b.ah = 0x01;
78+
Int386(0x16, &Regs, &Regs);
7979

80-
return 0 == (Regs.x.eflags & EFLAGS_ZF);
80+
return !(Regs.x.eflags & EFLAGS_ZF);
8181
}
8282

8383
int
8484
PcConsGetCh(void)
8585
{
86-
REGS Regs;
87-
static BOOLEAN ExtendedKey = FALSE;
88-
static char ExtendedScanCode = 0;
86+
REGS Regs;
87+
static BOOLEAN ExtendedKey = FALSE;
88+
static char ExtendedScanCode = 0;
8989

90-
/* If the last time we were called an
91-
* extended key was pressed then return
92-
* that keys scan code. */
93-
if (ExtendedKey)
90+
/* If the last time we were called an
91+
* extended key was pressed then return
92+
* that keys scan code. */
93+
if (ExtendedKey)
9494
{
95-
ExtendedKey = FALSE;
96-
return ExtendedScanCode;
95+
ExtendedKey = FALSE;
96+
return ExtendedScanCode;
9797
}
9898

99-
/* Int 16h AH=00h
100-
* KEYBOARD - GET KEYSTROKE
101-
*
102-
* AH = 00h
103-
* Return:
104-
* AH = BIOS scan code
105-
* AL = ASCII character
106-
*/
107-
Regs.b.ah = 0x00;
108-
Int386(0x16, &Regs, &Regs);
99+
/* Int 16h AH=00h
100+
* KEYBOARD - GET KEYSTROKE
101+
*
102+
* AH = 00h
103+
* Return:
104+
* AH = BIOS scan code
105+
* AL = ASCII character
106+
*/
107+
Regs.b.ah = 0x00;
108+
Int386(0x16, &Regs, &Regs);
109109

110-
/* Check for an extended keystroke */
111-
if (0 == Regs.b.al)
110+
/* Check for an extended keystroke */
111+
if (Regs.b.al == 0)
112112
{
113-
ExtendedKey = TRUE;
114-
ExtendedScanCode = Regs.b.ah;
113+
ExtendedKey = TRUE;
114+
ExtendedScanCode = Regs.b.ah;
115115
}
116116

117-
/* Return keystroke */
118-
return Regs.b.al;
117+
/* Return keystroke */
118+
return Regs.b.al;
119119
}
120120

121121
/* EOF */

boot/freeldr/freeldr/arch/i386/pc/pcvesa.c

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,31 @@ DBG_DEFAULT_CHANNEL(HWDETECT);
2525
#include <pshpack2.h>
2626
typedef struct
2727
{
28-
UCHAR Signature[4]; // (ret) signature ("VESA")
28+
UCHAR Signature[4]; // (ret) signature ("VESA")
2929
// (call) VESA 2.0 request signature ("VBE2"), required to receive
3030
// version 2.0 info
31-
USHORT VesaVersion; // VESA version number (one-digit minor version -- 0102h = v1.2)
32-
ULONG OemNamePtr; // pointer to OEM name
31+
USHORT VesaVersion; // VESA version number (one-digit minor version -- 0102h = v1.2)
32+
ULONG OemNamePtr; // Pointer to OEM name
3333
// "761295520" for ATI
34-
ULONG Capabilities; // capabilities flags (see #00078)
35-
ULONG SupportedModeListPtr; // pointer to list of supported VESA and OEM video modes
34+
ULONG Capabilities; // Capabilities flags (see #00078)
35+
ULONG SupportedModeListPtr; // Pointer to list of supported VESA and OEM video modes
3636
// (list of words terminated with FFFFh)
37-
USHORT TotalVideoMemory; // total amount of video memory in 64K blocks
37+
USHORT TotalVideoMemory; // Total amount of video memory in 64K blocks
3838

3939
// ---VBE v1.x ---
40-
//UCHAR Reserved[236];
40+
//UCHAR Reserved[236];
4141

4242
// ---VBE v2.0 ---
43-
USHORT OemSoftwareVersion; // OEM software version (BCD, high byte = major, low byte = minor)
44-
ULONG VendorNamePtr; // pointer to vendor name
45-
ULONG ProductNamePtr; // pointer to product name
46-
ULONG ProductRevisionStringPtr; // pointer to product revision string
47-
USHORT VBE_AF_Version; // (if capabilities bit 3 set) VBE/AF version (BCD)
43+
USHORT OemSoftwareVersion; // OEM software version (BCD, high byte = major, low byte = minor)
44+
ULONG VendorNamePtr; // Pointer to vendor name
45+
ULONG ProductNamePtr; // Pointer to product name
46+
ULONG ProductRevisionStringPtr; // Pointer to product revision string
47+
USHORT VBE_AF_Version; // (if capabilities bit 3 set) VBE/AF version (BCD)
4848
// 0100h for v1.0P
49-
ULONG AcceleratedModeListPtr; // (if capabilities bit 3 set) pointer to list of supported
50-
// accelerated video modes (list of words terminated with FFFFh)
51-
UCHAR Reserved[216]; // reserved for VBE implementation
52-
UCHAR ScratchPad[256]; // OEM scratchpad (for OEM strings, etc.)
49+
ULONG AcceleratedModeListPtr; // (if capabilities bit 3 set) pointer to list of supported
50+
// Accelerated video modes (list of words terminated with FFFFh)
51+
UCHAR Reserved[216]; // Reserved for VBE implementation
52+
UCHAR ScratchPad[256]; // OEM scratchpad (for OEM strings, etc.)
5353
} VESA_SVGA_INFO, *PVESA_SVGA_INFO;
5454
#include <poppack.h>
5555

@@ -88,7 +88,7 @@ typedef struct
8888
#if 0
8989
static VOID BiosSetVideoFont8x16(VOID)
9090
{
91-
REGS Regs;
91+
REGS Regs;
9292

9393
// Int 10h AX=1114h
9494
// VIDEO - TEXT-MODE CHARGEN - LOAD ROM 8x16 CHARACTER SET (VGA)
@@ -108,7 +108,7 @@ static VOID VideoSetTextCursorPosition(ULONG X, ULONG Y)
108108

109109
static ULONG VideoGetTextCursorPositionX(VOID)
110110
{
111-
REGS Regs;
111+
REGS Regs;
112112

113113
// Int 10h AH=03h
114114
// VIDEO - GET CURSOR POSITION AND SIZE
@@ -133,7 +133,7 @@ static ULONG VideoGetTextCursorPositionX(VOID)
133133

134134
static ULONG VideoGetTextCursorPositionY(VOID)
135135
{
136-
REGS Regs;
136+
REGS Regs;
137137

138138
// Int 10h AH=03h
139139
// VIDEO - GET CURSOR POSITION AND SIZE
@@ -159,10 +159,10 @@ static ULONG VideoGetTextCursorPositionY(VOID)
159159

160160
USHORT BiosIsVesaSupported(VOID)
161161
{
162-
REGS Regs;
163-
PVESA_SVGA_INFO SvgaInfo = (PVESA_SVGA_INFO)BIOSCALLBUFFER;
164-
//USHORT* VideoModes;
165-
//USHORT Index;
162+
REGS Regs;
163+
PVESA_SVGA_INFO SvgaInfo = (PVESA_SVGA_INFO)BIOSCALLBUFFER;
164+
//USHORT* VideoModes;
165+
//USHORT Index;
166166

167167
TRACE("BiosIsVesaSupported()\n");
168168

@@ -237,7 +237,6 @@ USHORT BiosIsVesaSupported(VOID)
237237
return SvgaInfo->VesaVersion;
238238
}
239239

240-
241240
BOOLEAN
242241
BiosIsVesaDdcSupported(VOID)
243242
{
@@ -267,7 +266,6 @@ BiosIsVesaDdcSupported(VOID)
267266
return (Regs.b.ah == 0);
268267
}
269268

270-
271269
BOOLEAN
272270
BiosVesaReadEdid(VOID)
273271
{

0 commit comments

Comments
 (0)