Sync with trunk head (part 1 of 2)
[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 MachDiskReadLogicalSectors
41 #undef MachDiskGetDriveGeometry
42 #undef MachDiskGetCacheableBlockCount
43
44 MACHVTBL MachVtbl;
45
46 VOID
47 MachConsPutChar(int Ch)
48 {
49 MachVtbl.ConsPutChar(Ch);
50 }
51
52 BOOLEAN
53 MachConsKbHit()
54 {
55 return MachVtbl.ConsKbHit();
56 }
57
58 int
59 MachConsGetCh()
60 {
61 return MachVtbl.ConsGetCh();
62 }
63
64 VOID
65 MachVideoClearScreen(UCHAR Attr)
66 {
67 MachVtbl.VideoClearScreen(Attr);
68 }
69
70 VIDEODISPLAYMODE
71 MachVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
72 {
73 return MachVtbl.VideoSetDisplayMode(DisplayMode, Init);
74 }
75
76 VOID
77 MachVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
78 {
79 MachVtbl.VideoGetDisplaySize(Width, Height, Depth);
80 }
81
82 ULONG
83 MachVideoGetBufferSize(VOID)
84 {
85 return MachVtbl.VideoGetBufferSize();
86 }
87
88 VOID
89 MachVideoSetTextCursorPosition(ULONG X, ULONG Y)
90 {
91 MachVtbl.VideoSetTextCursorPosition(X, Y);
92 }
93
94 VOID
95 MachVideoHideShowTextCursor(BOOLEAN Show)
96 {
97 MachVtbl.VideoHideShowTextCursor(Show);
98 }
99
100 VOID
101 MachVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
102 {
103 MachVtbl.VideoPutChar(Ch, Attr, X, Y);
104 }
105
106 VOID
107 MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
108 {
109 MachVtbl.VideoCopyOffScreenBufferToVRAM(Buffer);
110 }
111
112 BOOLEAN
113 MachVideoIsPaletteFixed(VOID)
114 {
115 return MachVtbl.VideoIsPaletteFixed();
116 }
117
118 VOID
119 MachVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
120 {
121 MachVtbl.VideoSetPaletteColor(Color, Red, Green, Blue);
122 }
123
124 VOID
125 MachVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
126 {
127 MachVtbl.VideoGetPaletteColor(Color, Red, Green, Blue);
128 }
129
130 VOID
131 MachVideoSync(VOID)
132 {
133 MachVtbl.VideoSync();
134 }
135
136 VOID
137 MachBeep(VOID)
138 {
139 MachVtbl.Beep();
140 }
141
142 VOID
143 MachPrepareForReactOS(IN BOOLEAN Setup)
144 {
145 MachVtbl.PrepareForReactOS(Setup);
146 }
147
148 BOOLEAN
149 MachDiskGetBootPath(char *BootPath, unsigned Size)
150 {
151 return MachVtbl.DiskGetBootPath(BootPath, Size);
152 }
153
154 BOOLEAN
155 MachDiskReadLogicalSectors(ULONG DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
156 {
157 return MachVtbl.DiskReadLogicalSectors(DriveNumber, SectorNumber, SectorCount, Buffer);
158 }
159
160 BOOLEAN
161 MachDiskGetDriveGeometry(ULONG DriveNumber, PGEOMETRY DriveGeometry)
162 {
163 return MachVtbl.DiskGetDriveGeometry(DriveNumber, DriveGeometry);
164 }
165
166 ULONG
167 MachDiskGetCacheableBlockCount(ULONG DriveNumber)
168 {
169 return MachVtbl.DiskGetCacheableBlockCount(DriveNumber);
170 }
171
172 /* EOF */