- Merge from trunk up to r45543
[reactos.git] / boot / freeldr / freeldr / arch / i386 / machxbox.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 VOID
23 XboxMachInit(const char *CmdLine)
24 {
25 /* Set LEDs to red before anything is initialized */
26 XboxSetLED("rrrr");
27
28 /* Initialize our stuff */
29 XboxMemInit();
30 XboxVideoInit();
31
32 /* Setup vtbl */
33 MachVtbl.ConsPutChar = XboxConsPutChar;
34 MachVtbl.ConsKbHit = XboxConsKbHit;
35 MachVtbl.ConsGetCh = XboxConsGetCh;
36 MachVtbl.VideoClearScreen = XboxVideoClearScreen;
37 MachVtbl.VideoSetDisplayMode = XboxVideoSetDisplayMode;
38 MachVtbl.VideoGetDisplaySize = XboxVideoGetDisplaySize;
39 MachVtbl.VideoGetBufferSize = XboxVideoGetBufferSize;
40 MachVtbl.VideoHideShowTextCursor = XboxVideoHideShowTextCursor;
41 MachVtbl.VideoPutChar = XboxVideoPutChar;
42 MachVtbl.VideoCopyOffScreenBufferToVRAM = XboxVideoCopyOffScreenBufferToVRAM;
43 MachVtbl.VideoIsPaletteFixed = XboxVideoIsPaletteFixed;
44 MachVtbl.VideoSetPaletteColor = XboxVideoSetPaletteColor;
45 MachVtbl.VideoGetPaletteColor = XboxVideoGetPaletteColor;
46 MachVtbl.VideoSync = XboxVideoSync;
47 MachVtbl.Beep = PcBeep;
48 MachVtbl.PrepareForReactOS = XboxPrepareForReactOS;
49 MachVtbl.GetMemoryMap = XboxMemGetMemoryMap;
50 MachVtbl.DiskGetBootPath = DiskGetBootPath;
51 MachVtbl.DiskNormalizeSystemPath = DiskNormalizeSystemPath;
52 MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors;
53 MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry;
54 MachVtbl.DiskGetCacheableBlockCount = XboxDiskGetCacheableBlockCount;
55 MachVtbl.GetTime = XboxGetTime;
56 MachVtbl.HwDetect = XboxHwDetect;
57
58 /* Set LEDs to orange after init */
59 XboxSetLED("oooo");
60 }
61
62 VOID
63 XboxPrepareForReactOS(IN BOOLEAN Setup)
64 {
65 //
66 // On XBOX, prepare video and turn off the floppy motor
67 //
68 XboxVideoPrepareForReactOS(Setup);
69 DiskStopFloppyMotor();
70 }