Sync with trunk revision 64099.
[reactos.git] / boot / freeldr / freeldr / arch / i386 / machxbox.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 VOID
22 XboxMachInit(const char *CmdLine)
23 {
24 /* Set LEDs to red before anything is initialized */
25 XboxSetLED("rrrr");
26
27 /* Initialize our stuff */
28 XboxMemInit();
29 XboxVideoInit();
30
31 /* Setup vtbl */
32 MachVtbl.ConsPutChar = XboxConsPutChar;
33 MachVtbl.ConsKbHit = XboxConsKbHit;
34 MachVtbl.ConsGetCh = XboxConsGetCh;
35 MachVtbl.VideoClearScreen = XboxVideoClearScreen;
36 MachVtbl.VideoSetDisplayMode = XboxVideoSetDisplayMode;
37 MachVtbl.VideoGetDisplaySize = XboxVideoGetDisplaySize;
38 MachVtbl.VideoGetBufferSize = XboxVideoGetBufferSize;
39 MachVtbl.VideoHideShowTextCursor = XboxVideoHideShowTextCursor;
40 MachVtbl.VideoPutChar = XboxVideoPutChar;
41 MachVtbl.VideoCopyOffScreenBufferToVRAM = XboxVideoCopyOffScreenBufferToVRAM;
42 MachVtbl.VideoIsPaletteFixed = XboxVideoIsPaletteFixed;
43 MachVtbl.VideoSetPaletteColor = XboxVideoSetPaletteColor;
44 MachVtbl.VideoGetPaletteColor = XboxVideoGetPaletteColor;
45 MachVtbl.VideoSync = XboxVideoSync;
46 MachVtbl.Beep = PcBeep;
47 MachVtbl.PrepareForReactOS = XboxPrepareForReactOS;
48 MachVtbl.GetMemoryMap = XboxMemGetMemoryMap;
49 MachVtbl.DiskGetBootPath = DiskGetBootPath;
50 MachVtbl.DiskReadLogicalSectors = XboxDiskReadLogicalSectors;
51 MachVtbl.DiskGetDriveGeometry = XboxDiskGetDriveGeometry;
52 MachVtbl.DiskGetCacheableBlockCount = XboxDiskGetCacheableBlockCount;
53 MachVtbl.GetTime = XboxGetTime;
54 MachVtbl.InitializeBootDevices = XboxInitializeBootDevices;
55 MachVtbl.HwDetect = XboxHwDetect;
56 MachVtbl.HwIdle = XboxHwIdle;
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 }