1 /* $Id: machine.h,v 1.7 2004/11/28 22:42:40 gvg Exp $
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.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 typedef enum tagVIDEODISPLAYMODE
35 } VIDEODISPLAYMODE
, *PVIDEODISPLAYMODE
;
37 typedef struct tagMACHVTBL
39 VOID (*ConsPutChar
)(int Ch
);
40 BOOL (*ConsKbHit
)(VOID
);
41 int (*ConsGetCh
)(VOID
);
43 VOID (*VideoClearScreen
)(U8 Attr
);
44 VIDEODISPLAYMODE (*VideoSetDisplayMode
)(char *DisplayMode
, BOOL Init
);
45 VOID (*VideoGetDisplaySize
)(PU32 Width
, PU32 Height
, PU32 Depth
);
46 U32 (*VideoGetBufferSize
)(VOID
);
47 VOID (*VideoSetTextCursorPosition
)(U32 X
, U32 Y
);
48 VOID (*VideoHideShowTextCursor
)(BOOL Show
);
49 VOID (*VideoPutChar
)(int Ch
, U8 Attr
, unsigned X
, unsigned Y
);
50 VOID (*VideoCopyOffScreenBufferToVRAM
)(PVOID Buffer
);
51 BOOL (*VideoIsPaletteFixed
)(VOID
);
52 VOID (*VideoSetPaletteColor
)(U8 Color
, U8 Red
, U8 Green
, U8 Blue
);
53 VOID (*VideoGetPaletteColor
)(U8 Color
, U8
* Red
, U8
* Green
, U8
* Blue
);
54 VOID (*VideoSync
)(VOID
);
55 VOID (*VideoPrepareForReactOS
)(VOID
);
57 U32 (*GetMemoryMap
)(PBIOS_MEMORY_MAP BiosMemoryMap
, U32 MaxMemoryMapSize
);
59 BOOL (*DiskReadLogicalSectors
)(U32 DriveNumber
, U64 SectorNumber
, U32 SectorCount
, PVOID Buffer
);
60 BOOL (*DiskGetPartitionEntry
)(U32 DriveNumber
, U32 PartitionNumber
, PPARTITION_TABLE_ENTRY PartitionTableEntry
);
61 BOOL (*DiskGetDriveGeometry
)(U32 DriveNumber
, PGEOMETRY DriveGeometry
);
62 U32 (*DiskGetCacheableBlockCount
)(U32 DriveNumber
);
64 VOID (*RTCGetCurrentDateTime
)(PU32 Year
, PU32 Month
, PU32 Day
, PU32 Hour
, PU32 Minute
, PU32 Second
);
66 VOID (*HwDetect
)(VOID
);
67 } MACHVTBL
, *PMACHVTBL
;
71 extern MACHVTBL MachVtbl
;
73 #define MachConsPutChar(Ch) MachVtbl.ConsPutChar(Ch)
74 #define MachConsKbHit() MachVtbl.ConsKbHit()
75 #define MachConsGetCh() MachVtbl.ConsGetCh()
76 #define MachVideoClearScreen(Attr) MachVtbl.VideoClearScreen(Attr)
77 #define MachVideoSetDisplayMode(Mode, Init) MachVtbl.VideoSetDisplayMode((Mode), (Init))
78 #define MachVideoGetDisplaySize(W, H, D) MachVtbl.VideoGetDisplaySize((W), (H), (D))
79 #define MachVideoGetBufferSize() MachVtbl.VideoGetBufferSize()
80 #define MachVideoSetTextCursorPosition(X, Y) MachVtbl.VideoSetTextCursorPosition((X), (Y))
81 #define MachVideoHideShowTextCursor(Show) MachVtbl.VideoHideShowTextCursor(Show)
82 #define MachVideoPutChar(Ch, Attr, X, Y) MachVtbl.VideoPutChar((Ch), (Attr), (X), (Y))
83 #define MachVideoCopyOffScreenBufferToVRAM(Buf) MachVtbl.VideoCopyOffScreenBufferToVRAM(Buf)
84 #define MachVideoIsPaletteFixed() MachVtbl.VideoIsPaletteFixed()
85 #define MachVideoSetPaletteColor(Col, R, G, B) MachVtbl.VideoSetPaletteColor((Col), (R), (G), (B))
86 #define MachVideoGetPaletteColor(Col, R, G, B) MachVtbl.VideoGetPaletteColor((Col), (R), (G), (B))
87 #define MachVideoSync() MachVtbl.VideoSync()
88 #define MachVideoPrepareForReactOS() MachVtbl.VideoPrepareForReactOS()
89 #define MachGetMemoryMap(MMap, Size) MachVtbl.GetMemoryMap((MMap), (Size))
90 #define MachDiskReadLogicalSectors(Drive, Start, Count, Buf) MachVtbl.DiskReadLogicalSectors((Drive), (Start), (Count), (Buf))
91 #define MachDiskGetPartitionEntry(Drive, Part, Entry) MachVtbl.DiskGetPartitionEntry((Drive), (Part), (Entry))
92 #define MachDiskGetDriveGeometry(Drive, Geom) MachVtbl.DiskGetDriveGeometry((Drive), (Geom))
93 #define MachDiskGetCacheableBlockCount(Drive) MachVtbl.DiskGetCacheableBlockCount(Drive)
94 #define MachRTCGetCurrentDateTime(Y, Mo, D, H, Mi, S) MachVtbl.RTCGetCurrentDateTime((Y), (Mo), (D), (H), (Mi), (S));
95 #define MachHwDetect() MachVtbl.HwDetect()
97 #endif /* __MACHINE_H_ */