* Sync up to trunk head (r60691).
[reactos.git] / boot / freeldr / freeldr / machine.c
1 /*
2 * FreeLoader
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 */
18
19 #include <freeldr.h>
20
21 #undef MachConsPutChar
22 #undef MachConsKbHit
23 #undef MachConsGetCh
24 #undef MachVideoClearScreen
25 #undef MachVideoSetDisplayMode
26 #undef MachVideoGetDisplaySize
27 #undef MachVideoGetBufferSize
28 #undef MachVideoSetTextCursorPosition
29 #undef MachVideoHideShowTextCursor
30 #undef MachVideoPutChar
31 #undef MachVideoCopyOffScreenBufferToVRAM
32 #undef MachVideoIsPaletteFixed
33 #undef MachVideoSetPaletteColor
34 #undef MachVideoGetPaletteColor
35 #undef MachVideoSync
36 #undef MachBeep
37 #undef MachPrepareForReactOS
38 #undef MachDiskGetBootPath
39 #undef MachDiskReadLogicalSectors
40 #undef MachDiskGetDriveGeometry
41 #undef MachDiskGetCacheableBlockCount
42
43 MACHVTBL MachVtbl;
44
45 VOID
46 MachConsPutChar(int Ch)
47 {
48 MachVtbl.ConsPutChar(Ch);
49 }
50
51 BOOLEAN
52 MachConsKbHit()
53 {
54 return MachVtbl.ConsKbHit();
55 }
56
57 int
58 MachConsGetCh()
59 {
60 return MachVtbl.ConsGetCh();
61 }
62
63 VOID
64 MachVideoClearScreen(UCHAR Attr)
65 {
66 MachVtbl.VideoClearScreen(Attr);
67 }
68
69 VIDEODISPLAYMODE
70 MachVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
71 {
72 return MachVtbl.VideoSetDisplayMode(DisplayMode, Init);
73 }
74
75 VOID
76 MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
77 {
78 MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
79 }
80
81 ULONG
82 MachVideoGetBufferSize(VOID)
83 {
84 return MachVtbl.VideoGetBufferSize();
85 }
86
87 VOID
88 MachVideoSetTextCursorPosition(UCHAR X, UCHAR Y)
89 {
90 MachVtbl.VideoSetTextCursorPosition(X, Y);
91 }
92
93 VOID
94 MachVideoHideShowTextCursor(BOOLEAN Show)
95 {
96 MachVtbl.VideoHideShowTextCursor(Show);
97 }
98
99 VOID
100 MachVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
101 {
102 MachVtbl.VideoPutChar(Ch, Attr, X, Y);
103 }
104
105 VOID
106 MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
107 {
108 MachVtbl.VideoCopyOffScreenBufferToVRAM(Buffer);
109 }
110
111 BOOLEAN
112 MachVideoIsPaletteFixed(VOID)
113 {
114 return MachVtbl.VideoIsPaletteFixed();
115 }
116
117 VOID
118 MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
119 {
120 MachVtbl.VideoSetPaletteColor(Color, Red, Green, Blue);
121 }
122
123 VOID
124 MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
125 {
126 MachVtbl.VideoGetPaletteColor(Color, Red, Green, Blue);
127 }
128
129 VOID
130 MachVideoSync(VOID)
131 {
132 MachVtbl.VideoSync();
133 }
134
135 VOID
136 MachBeep(VOID)
137 {
138 MachVtbl.Beep();
139 }
140
141 VOID
142 MachPrepareForReactOS(IN BOOLEAN Setup)
143 {
144 MachVtbl.PrepareForReactOS(Setup);
145 }
146
147 BOOLEAN
148 MachDiskGetBootPath(char *BootPath, unsigned Size)
149 {
150 return MachVtbl.DiskGetBootPath(BootPath, Size);
151 }
152
153 BOOLEAN
154 MachDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
155 {
156 return MachVtbl.DiskReadLogicalSectors(DriveNumber, SectorNumber, SectorCount, Buffer);
157 }
158
159 BOOLEAN
160 MachDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
161 {
162 return MachVtbl.DiskGetDriveGeometry(DriveNumber, DriveGeometry);
163 }
164
165 ULONG
166 MachDiskGetCacheableBlockCount(UCHAR DriveNumber)
167 {
168 return MachVtbl.DiskGetCacheableBlockCount(DriveNumber);
169 }
170
171 /* EOF */