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