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.
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.
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.
33 typedef enum tagVIDEODISPLAYMODE
37 } VIDEODISPLAYMODE
, *PVIDEODISPLAYMODE
;
39 typedef struct tagMACHVTBL
41 VOID (*ConsPutChar
)(int Ch
);
42 BOOLEAN (*ConsKbHit
)(VOID
);
43 int (*ConsGetCh
)(VOID
);
45 VOID (*VideoClearScreen
)(UCHAR Attr
);
46 VIDEODISPLAYMODE (*VideoSetDisplayMode
)(char *DisplayMode
, BOOLEAN Init
);
47 VOID (*VideoGetDisplaySize
)(PULONG Width
, PULONG Height
, PULONG Depth
);
48 ULONG (*VideoGetBufferSize
)(VOID
);
49 VOID (*VideoSetTextCursorPosition
)(UCHAR X
, UCHAR Y
);
50 VOID (*VideoHideShowTextCursor
)(BOOLEAN Show
);
51 VOID (*VideoPutChar
)(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
52 VOID (*VideoCopyOffScreenBufferToVRAM
)(PVOID Buffer
);
53 BOOLEAN (*VideoIsPaletteFixed
)(VOID
);
54 VOID (*VideoSetPaletteColor
)(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
55 VOID (*VideoGetPaletteColor
)(UCHAR Color
, UCHAR
* Red
, UCHAR
* Green
, UCHAR
* Blue
);
56 VOID (*VideoSync
)(VOID
);
58 VOID (*PrepareForReactOS
)(IN BOOLEAN Setup
);
60 MEMORY_DESCRIPTOR
* (*GetMemoryDescriptor
)(MEMORY_DESCRIPTOR
* Current
);
61 PMEMORY_DESCRIPTOR (*GetMemoryMap
)(PULONG MaxMemoryMapSize
);
63 BOOLEAN (*DiskGetBootPath
)(char *BootPath
, unsigned Size
);
64 BOOLEAN (*DiskReadLogicalSectors
)(UCHAR DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
65 BOOLEAN (*DiskGetDriveGeometry
)(UCHAR DriveNumber
, PGEOMETRY DriveGeometry
);
66 ULONG (*DiskGetCacheableBlockCount
)(UCHAR DriveNumber
);
68 TIMEINFO
* (*GetTime
)(VOID
);
69 ULONG (*GetRelativeTime
)(VOID
);
71 PCONFIGURATION_COMPONENT_DATA (*HwDetect
)(VOID
);
72 } MACHVTBL
, *PMACHVTBL
;
74 VOID
MachInit(const char *CmdLine
);
76 extern MACHVTBL MachVtbl
;
78 VOID
MachConsPutChar(int Ch
);
79 BOOLEAN
MachConsKbHit(VOID
);
80 int MachConsGetCh(VOID
);
81 VOID
MachVideoClearScreen(UCHAR Attr
);
82 VIDEODISPLAYMODE
MachVideoSetDisplayMode(char *DisplayMode
, BOOLEAN Init
);
83 VOID
MachVideoGetDisplaySize(PULONG Width
, PULONG Height
, PULONG Depth
);
84 ULONG
MachVideoGetBufferSize(VOID
);
85 VOID
MachVideoSetTextCursorPosition(UCHAR X
, UCHAR Y
);
86 VOID
MachVideoHideShowTextCursor(BOOLEAN Show
);
87 VOID
MachVideoPutChar(int Ch
, UCHAR Attr
, unsigned X
, unsigned Y
);
88 VOID
MachVideoCopyOffScreenBufferToVRAM(PVOID Buffer
);
89 BOOLEAN
MachVideoIsPaletteFixed(VOID
);
90 VOID
MachVideoSetPaletteColor(UCHAR Color
, UCHAR Red
, UCHAR Green
, UCHAR Blue
);
91 VOID
MachVideoGetPaletteColor(UCHAR Color
, UCHAR
*Red
, UCHAR
*Green
, UCHAR
*Blue
);
92 VOID
MachVideoSync(VOID
);
94 BOOLEAN
MachDiskGetBootPath(char *BootPath
, unsigned Size
);
95 BOOLEAN
MachDiskNormalizeSystemPath(char *SystemPath
, unsigned Size
);
96 BOOLEAN
MachDiskReadLogicalSectors(UCHAR DriveNumber
, ULONGLONG SectorNumber
, ULONG SectorCount
, PVOID Buffer
);
97 BOOLEAN
MachDiskGetDriveGeometry(UCHAR DriveNumber
, PGEOMETRY DriveGeometry
);
98 ULONG
MachDiskGetCacheableBlockCount(UCHAR DriveNumber
);
99 VOID
MachPrepareForReactOS(IN BOOLEAN Setup
);
101 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
102 #define MachConsKbHit() MachVtbl.ConsKbHit()
103 #define MachConsGetCh() MachVtbl.ConsGetCh()
104 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
105 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
106 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
107 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
108 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
109 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
110 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
111 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
112 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
113 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
114 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
115 #define MachVideoSync() MachVtbl.VideoSync()
116 #define MachBeep() MachVtbl.Beep()
117 #define MachPrepareForReactOS(a) MachVtbl.PrepareForReactOS(a)
118 #define MachDiskGetBootPath(Path, Size) MachVtbl.DiskGetBootPath((Path), (Size))
119 #define MachDiskNormalizeSystemPath(Path, Size) MachVtbl.DiskNormalizeSystemPath((Path), (Size))
120 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
121 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
122 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
123 #define MachHwDetect() MachVtbl.HwDetect()