ReactOS  0.4.15-dev-2355-gaf9df93
pc98vid.h File Reference
#include <ntdef.h>
#include <section_attribs.h>
#include <dderror.h>
#include <devioctl.h>
#include <miniport.h>
#include <video.h>
#include <debug.h>
#include <drivers/pc98/video.h>
Include dependency graph for pc98vid.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _VIDEOMODE
 
struct  _HW_DEVICE_EXTENSION
 

Macros

#define WRITE_PORT_UCHAR(p, d)   VideoPortWritePortUchar(p, d)
 
#define READ_PORT_UCHAR(p)   VideoPortReadPortUchar(p)
 
#define MONITOR_HW_ID   0x1033FACE /* Dummy */
 

Typedefs

typedef struct _VIDEOMODE VIDEOMODE
 
typedef struct _VIDEOMODEPVIDEOMODE
 
typedef struct _HW_DEVICE_EXTENSION HW_DEVICE_EXTENSION
 
typedef struct _HW_DEVICE_EXTENSIONPHW_DEVICE_EXTENSION
 

Functions

BOOLEAN NTAPI HasPegcController (_In_ PHW_DEVICE_EXTENSION DeviceExtension)
 
BOOLEAN NTAPI Pc98VidStartIO (_In_ PVOID HwDeviceExtension, _Inout_ PVIDEO_REQUEST_PACKET RequestPacket)
 
VP_STATUS FASTCALL Pc98VidSetCurrentMode (_In_ PHW_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_MODE RequestedMode)
 
VP_STATUS FASTCALL Pc98VidSetColorRegisters (_In_ PVIDEO_CLUT ColorLookUpTable)
 
VP_STATUS NTAPI Pc98VidGetPowerState (_In_ PVOID HwDeviceExtension, _In_ ULONG HwId, _In_ PVIDEO_POWER_MANAGEMENT VideoPowerControl)
 
VP_STATUS NTAPI Pc98VidSetPowerState (_In_ PVOID HwDeviceExtension, _In_ ULONG HwId, _In_ PVIDEO_POWER_MANAGEMENT VideoPowerControl)
 

Variables

const VIDEOMODE VideoModes []
 

Macro Definition Documentation

◆ MONITOR_HW_ID

#define MONITOR_HW_ID   0x1033FACE /* Dummy */

Definition at line 25 of file pc98vid.h.

◆ READ_PORT_UCHAR

#define READ_PORT_UCHAR (   p)    VideoPortReadPortUchar(p)

Definition at line 22 of file pc98vid.h.

◆ WRITE_PORT_UCHAR

#define WRITE_PORT_UCHAR (   p,
  d 
)    VideoPortWritePortUchar(p, d)

Definition at line 21 of file pc98vid.h.

Typedef Documentation

◆ HW_DEVICE_EXTENSION

◆ PHW_DEVICE_EXTENSION

◆ PVIDEOMODE

◆ VIDEOMODE

Function Documentation

◆ HasPegcController()

BOOLEAN NTAPI HasPegcController ( _In_ PHW_DEVICE_EXTENSION  DeviceExtension)

Definition at line 63 of file hardware.c.

65 {
67 
69  return TestMmio(DeviceExtension);
70 
73  Success = GraphGetStatus(GRAPH_STATUS_PEGC) ? TestMmio(DeviceExtension) : FALSE;
76 
77  return Success;
78 }
unsigned char * PUCHAR
Definition: retypes.h:3
#define GRAPH_STATUS_PEGC
Definition: video.h:352
#define GDC2_IO_o_MODE_FLIPFLOP2
Definition: video.h:280
#define GDC2_EGC_FF_PROTECT
Definition: video.h:285
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
#define GDC2_EGC_FF_UNPROTECT
Definition: video.h:286
#define GDC2_MODE_PEGC_ENABLE
Definition: video.h:288
#define GDC2_MODE_PEGC_DISABLE
Definition: video.h:287
static BOOLEAN TestMmio(_In_ PHW_DEVICE_EXTENSION DeviceExtension)
Definition: hardware.c:31
static BOOLEAN GraphGetStatus(_In_ UCHAR Status)
Definition: hardware.c:19
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)

◆ Pc98VidGetPowerState()

VP_STATUS NTAPI Pc98VidGetPowerState ( _In_ PVOID  HwDeviceExtension,
_In_ ULONG  HwId,
_In_ PVIDEO_POWER_MANAGEMENT  VideoPowerControl 
)

Definition at line 292 of file hardware.c.

296 {
297  PAGED_CODE();
298 
299  VideoDebugPrint((Trace, "%s() Id %lX, State %x\n",
300  __FUNCTION__, HwId, VideoPowerControl->PowerState));
301 
302  if (HwId == MONITOR_HW_ID || HwId == DISPLAY_ADAPTER_HW_ID)
303  {
304  switch (VideoPowerControl->PowerState)
305  {
306  case VideoPowerOn:
307  case VideoPowerStandBy:
308  case VideoPowerSuspend:
309  case VideoPowerOff:
310  case VideoPowerShutdown:
311  return NO_ERROR;
312  }
313  }
314 
316 }
#define DISPLAY_ADAPTER_HW_ID
Definition: video.h:115
#define MONITOR_HW_ID
Definition: pc98vid.h:25
#define NO_ERROR
Definition: dderror.h:5
#define ERROR_DEVICE_REINITIALIZATION_NEEDED
Definition: dderror.h:16
#define Trace(x)
Definition: inflate.c:42
#define VideoDebugPrint(x)
Definition: video.h:75
#define __FUNCTION__
Definition: types.h:112
#define PAGED_CODE()

Referenced by DriverEntry().

◆ Pc98VidSetColorRegisters()

VP_STATUS FASTCALL Pc98VidSetColorRegisters ( _In_ PVIDEO_CLUT  ColorLookUpTable)

Definition at line 261 of file hardware.c.

263 {
264  USHORT Entry;
265 
266  PAGED_CODE();
267 
268  VideoDebugPrint((Trace, "%s()\n", __FUNCTION__));
269 
270  if (ColorLookUpTable->NumEntries > PEGC_MAX_COLORS)
272 
273  for (Entry = ColorLookUpTable->FirstEntry;
274  Entry < ColorLookUpTable->FirstEntry + ColorLookUpTable->NumEntries;
275  ++Entry)
276  {
279  ColorLookUpTable->LookupTable[Entry].RgbArray.Red);
281  ColorLookUpTable->LookupTable[Entry].RgbArray.Green);
283  ColorLookUpTable->LookupTable[Entry].RgbArray.Blue);
284  }
285 
286  return NO_ERROR;
287 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define GDC2_IO_o_RED
Definition: video.h:277
struct _Entry Entry
Definition: kefuncs.h:627
#define GDC2_IO_o_BLUE
Definition: video.h:278
unsigned char * PUCHAR
Definition: retypes.h:3
#define PEGC_MAX_COLORS
Definition: hardware.c:14
#define NO_ERROR
Definition: dderror.h:5
#define GDC2_IO_o_PALETTE_INDEX
Definition: video.h:275
#define GDC2_IO_o_GREEN
Definition: video.h:276
#define Trace(x)
Definition: inflate.c:42
#define VideoDebugPrint(x)
Definition: video.h:75
unsigned short USHORT
Definition: pedump.c:61
#define __FUNCTION__
Definition: types.h:112
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
base of all file and directory entries
Definition: entries.h:82
#define PAGED_CODE()

Referenced by Pc98VidStartIO().

◆ Pc98VidSetCurrentMode()

VP_STATUS FASTCALL Pc98VidSetCurrentMode ( _In_ PHW_DEVICE_EXTENSION  DeviceExtension,
_In_ PVIDEO_MODE  RequestedMode 
)

Definition at line 83 of file hardware.c.

86 {
87  SYNCPARAM SyncParameters;
88  CSRFORMPARAM CursorParameters;
90  PITCHPARAM PitchParameters;
91  PRAMPARAM RamParameters;
92  ZOOMPARAM ZoomParameters;
93  UCHAR RelayState;
94 
95  PAGED_CODE();
96 
97  VideoDebugPrint((Trace, "%s() Mode %d\n",
98  __FUNCTION__, RequestedMode->RequestedMode));
99 
100  if (RequestedMode->RequestedMode > DeviceExtension->ModeCount)
102 
103  /* Blank screen */
105 
106  /* RESET, without FIFO check */
109 
110  /* Configure chipset */
118  VideoModes[RequestedMode->RequestedMode].Clock1);
120  VideoModes[RequestedMode->RequestedMode].Clock2);
122  VideoModes[RequestedMode->RequestedMode].HorizontalScanRate);
125 
126  /* =========================== MASTER ============================ */
127 
128  /* MASTER */
130 
131  /* SYNC */
132  SyncParameters = VideoModes[RequestedMode->RequestedMode].TextSyncParameters;
136  WRITE_GDC_SYNC((PUCHAR)GDC1_IO_o_PARAM, &SyncParameters);
137 
138  /* CSRFORM */
139  CursorParameters.Show = FALSE;
140  CursorParameters.Blink = FALSE;
141  CursorParameters.BlinkRate = 12;
142  CursorParameters.LinesPerRow = 16;
143  CursorParameters.StartScanLine = 0;
144  CursorParameters.EndScanLine = 15;
146  WRITE_GDC_CSRFORM((PUCHAR)GDC1_IO_o_PARAM, &CursorParameters);
147 
148  /* PITCH */
149  PitchParameters.WordsPerScanline = 80;
151  WRITE_GDC_PITCH((PUCHAR)GDC1_IO_o_PARAM, &PitchParameters);
152 
153  /* PRAM */
154  RamParameters.StartingAddress = 0;
155  RamParameters.Length = 1023;
156  RamParameters.ImageBit = FALSE;
157  RamParameters.WideDisplay = FALSE;
159  WRITE_GDC_PRAM((PUCHAR)GDC1_IO_o_PARAM, &RamParameters);
160 
161  /* ZOOM */
162  ZoomParameters.DisplayZoomFactor = 0;
163  ZoomParameters.WritingZoomFactor = 0;
165  WRITE_GDC_ZOOM((PUCHAR)GDC1_IO_o_PARAM, &ZoomParameters);
166 
167  /* CSRW */
168  CursorPosition.CursorAddress = 0;
169  CursorPosition.DotAddress = 0;
172 
173  /* START */
175 
176  /* ============================ SLAVE ============================ */
177 
178  /* SLAVE */
180 
181  /* SYNC */
182  SyncParameters = VideoModes[RequestedMode->RequestedMode].VideoSyncParameters;
187  WRITE_GDC_SYNC((PUCHAR)GDC2_IO_o_PARAM, &SyncParameters);
188 
189  /* CSRFORM */
190  CursorParameters.Show = FALSE;
191  CursorParameters.Blink = FALSE;
192  CursorParameters.BlinkRate = 0;
193  CursorParameters.LinesPerRow = 1;
194  CursorParameters.StartScanLine = 0;
195  CursorParameters.EndScanLine = 0;
197  WRITE_GDC_CSRFORM((PUCHAR)GDC2_IO_o_PARAM, &CursorParameters);
198 
199  /* PITCH */
200  PitchParameters.WordsPerScanline = 80;
202  WRITE_GDC_PITCH((PUCHAR)GDC2_IO_o_PARAM, &PitchParameters);
203 
204  /* PRAM */
205  RamParameters.StartingAddress = 0;
206  RamParameters.Length = 1023;
207  RamParameters.ImageBit = TRUE;
208  RamParameters.WideDisplay = FALSE;
210  WRITE_GDC_PRAM((PUCHAR)GDC2_IO_o_PARAM, &RamParameters);
211 
212  /* ZOOM */
213  ZoomParameters.DisplayZoomFactor = 0;
214  ZoomParameters.WritingZoomFactor = 0;
216  WRITE_GDC_ZOOM((PUCHAR)GDC2_IO_o_PARAM, &ZoomParameters);
217 
218  /* CSRW */
219  CursorPosition.CursorAddress = 0;
220  CursorPosition.DotAddress = 0;
223 
224  /* Synchronize the master sync source */
225  TextSync();
226  TextSync();
227  TextSync();
228  TextSync();
229 
230  /* START */
232 
233  /* 256 colors, packed pixel */
237  VideoModes[RequestedMode->RequestedMode].Mem);
239  VideoPortWriteRegisterUshort((PUSHORT)(DeviceExtension->PegcControlVa +
241  VideoPortWriteRegisterUshort((PUSHORT)(DeviceExtension->PegcControlVa +
243 
244  /* Select the video source */
247  RelayState |= GRAPH_VID_SRC_INTERNAL | GRAPH_SRC_GDC;
249 
250  /* Unblank screen */
252 
253  DeviceExtension->CurrentMode = RequestedMode->RequestedMode;
254 
255  return NO_ERROR;
256 }
#define GRAPH_RELAY_0
Definition: video.h:365
#define GDC_COMMAND_CSRFORM
Definition: video.h:173
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define PEGC_FB_MAP
Definition: video.h:426
#define GDC2_MODE_LINES_400
Definition: video.h:301
#define GRAPH_MODE_DISPLAY_DISABLE
Definition: video.h:253
#define GRAPH_VID_SRC_INTERNAL
Definition: video.h:370
BOOLEAN ImageBit
Definition: video.h:207
USHORT Length
Definition: video.h:206
ULONG StartingAddress
Definition: video.h:205
UCHAR StartScanLine
Definition: video.h:180
#define TRUE
Definition: types.h:120
#define GDC1_IO_o_MODE_FLIPFLOP1
Definition: video.h:238
#define GDC_COMMAND_MASTER
Definition: video.h:200
unsigned char * PUCHAR
Definition: retypes.h:3
#define GRAPH_SRC_GDC
Definition: video.h:373
#define GRAPH_IO_i_RELAY
Definition: video.h:364
#define GDC2_IO_o_VIDEO_PAGE_ACCESS
Definition: video.h:274
#define GDC2_IO_o_VIDEO_PAGE
Definition: video.h:273
#define NO_ERROR
Definition: dderror.h:5
#define GDC_COMMAND_BCTRL_START
Definition: video.h:73
FORCEINLINE VOID WRITE_GDC1_COMMAND(UCHAR Command)
Definition: video.h:326
#define GDC2_IO_o_MODE_FLIPFLOP2
Definition: video.h:280
FORCEINLINE VOID WRITE_GDC_ZOOM(PUCHAR Port, PZOOMPARAM ZoomParameters)
Definition: video.h:133
#define GDC2_MODE_LCD
Definition: video.h:298
#define SYNC_DRAW_DURING_ACTIVE_DISPLAY_TIME_AND_RETRACE_BLANKING
Definition: video.h:87
BOOLEAN WideDisplay
Definition: video.h:208
VPAPI UCHAR NTAPI VideoPortReadPortUchar(IN PUCHAR Port)
#define GDC2_EGC_FF_PROTECT
Definition: video.h:285
static VOID TextSync(VOID)
Definition: hardware.c:52
#define FALSE
Definition: types.h:117
FORCEINLINE VOID WRITE_GDC_PITCH(PUCHAR Port, PPITCHPARAM PitchParameters)
Definition: video.h:146
UCHAR WritingZoomFactor
Definition: video.h:128
#define GDC_COMMAND_PITCH
Definition: video.h:138
FORCEINLINE VOID WRITE_GDC_CSRFORM(PUCHAR Port, PCSRFORMPARAM CursorParameters)
Definition: video.h:186
#define GDC2_MODE_GRCG
Definition: video.h:283
UCHAR DisplayZoomFactor
Definition: video.h:127
UCHAR EndScanLine
Definition: video.h:181
#define SYNC_DISPLAY_MODE_GRAPHICS_AND_CHARACTERS
Definition: video.h:79
static CONST VGA_MODE VideoModes[BIOS_MAX_VIDEO_MODE+1]
Definition: vidbios.c:1941
FORCEINLINE VOID WRITE_GDC2_COMMAND(UCHAR Command)
Definition: video.h:336
#define PEGC_MMIO_MODE
Definition: video.h:420
#define SYNC_DISPLAY_MODE_GRAPHICS
Definition: video.h:80
#define GDC_COMMAND_RESET1
Definition: video.h:68
unsigned char UCHAR
Definition: xmlstorage.h:181
#define GDC2_IO_o_COMMAND
Definition: video.h:272
#define GDC_COMMAND_SLAVE
Definition: video.h:199
VPAPI VOID NTAPI VideoPortWriteRegisterUshort(IN PUSHORT Register, IN USHORT Value)
#define GDC2_EGC_FF_UNPROTECT
Definition: video.h:286
#define GRAPH_MODE_COLORED
Definition: video.h:241
FORCEINLINE VOID WRITE_GDC_SYNC(PUCHAR Port, PSYNCPARAM SyncParameters)
Definition: video.h:105
#define PEGC_MMIO_FRAMEBUFFER
Definition: video.h:424
#define Trace(x)
Definition: inflate.c:42
#define GDC2_MODE_PEGC_ENABLE
Definition: video.h:288
#define SYNC_DRAW_ONLY_DURING_RETRACE_BLANKING
Definition: video.h:88
UCHAR Flags
Definition: video.h:78
#define GDC_COMMAND_SYNC_ON
Definition: video.h:75
#define GRAPH_IO_o_HORIZONTAL_SCAN_RATE
Definition: video.h:360
#define GDC_COMMAND_CSRW
Definition: video.h:151
#define SYNC_VIDEO_FRAMING_NONINTERLACED
Definition: video.h:83
BOOLEAN Show
Definition: video.h:176
FORCEINLINE VOID WRITE_GDC_CSRW(PUCHAR Port, PCSRWPARAM CursorParameters)
Definition: video.h:160
#define VideoDebugPrint(x)
Definition: video.h:75
ULONG WordsPerScanline
Definition: video.h:141
#define PEGC_MODE_PACKED
Definition: video.h:421
UCHAR BlinkRate
Definition: video.h:178
BOOLEAN Blink
Definition: video.h:177
#define GDC1_IO_o_PARAM
Definition: video.h:234
#define GRAPH_RELAY_1
Definition: video.h:366
FORCEINLINE VOID WRITE_GDC_PRAM(PUCHAR Port, PPRAMPARAM RamParameters)
Definition: video.h:213
#define GDC_COMMAND_PRAM
Definition: video.h:202
#define SYNC_STATIC_RAM_NO_REFRESH
Definition: video.h:90
#define GDC2_IO_o_PARAM
Definition: video.h:271
#define __FUNCTION__
Definition: types.h:112
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
static USHORT CursorPosition
Definition: pc98cons.c:20
#define GDC1_IO_o_COMMAND
Definition: video.h:235
unsigned short * PUSHORT
Definition: retypes.h:2
#define GDC_COMMAND_ZOOM
Definition: video.h:124
#define GRAPH_MODE_DISPLAY_ENABLE
Definition: video.h:254
#define GRAPH_IO_o_RELAY
Definition: video.h:368
#define PAGED_CODE()
UCHAR LinesPerRow
Definition: video.h:179
#define GDC2_MODE_ODD_RLINE_SHOW
Definition: video.h:247
#define GDC2_MODE_COLORS_16
Definition: video.h:282

Referenced by Pc98VidStartIO().

◆ Pc98VidSetPowerState()

VP_STATUS NTAPI Pc98VidSetPowerState ( _In_ PVOID  HwDeviceExtension,
_In_ ULONG  HwId,
_In_ PVIDEO_POWER_MANAGEMENT  VideoPowerControl 
)

Definition at line 321 of file hardware.c.

325 {
326  UCHAR Dpms;
327 
328  PAGED_CODE();
329 
330  VideoDebugPrint((Trace, "%s() Id %lX, State %x\n",
331  __FUNCTION__, HwId, VideoPowerControl->PowerState));
332 
333  if (HwId == MONITOR_HW_ID)
334  {
336 
337  switch (VideoPowerControl->PowerState)
338  {
339  case VideoPowerOn:
340  /* Turn on HS/VS signals */
343 
344  /* Unblank screen */
347  break;
348 
349  case VideoPowerStandBy:
350  /* Disable HS signal */
351  Dpms = (Dpms | GRAPH_DPMS_HSYNC_MASK) & ~GRAPH_DPMS_VSYNC_MASK;
353  break;
354 
355  case VideoPowerSuspend:
356  /* Disable VS signal */
357  Dpms = (Dpms | GRAPH_DPMS_VSYNC_MASK) & ~GRAPH_DPMS_HSYNC_MASK;
359  break;
360 
361  case VideoPowerOff:
362  case VideoPowerShutdown:
363  /* Turn off HS/VS signals */
366 
367  /* Blank screen */
370  break;
371  }
372  }
373 
374  return NO_ERROR;
375 }
#define GRAPH_MODE_DISPLAY_DISABLE
Definition: video.h:253
#define GRAPH_IO_o_DPMS
Definition: video.h:355
#define MONITOR_HW_ID
Definition: pc98vid.h:25
#define GDC1_IO_o_MODE_FLIPFLOP1
Definition: video.h:238
unsigned char * PUCHAR
Definition: retypes.h:3
#define GRAPH_DPMS_HSYNC_MASK
Definition: video.h:356
#define NO_ERROR
Definition: dderror.h:5
VPAPI UCHAR NTAPI VideoPortReadPortUchar(IN PUCHAR Port)
#define GRAPH_DPMS_VSYNC_MASK
Definition: video.h:357
unsigned char UCHAR
Definition: xmlstorage.h:181
#define GRAPH_IO_i_DPMS
Definition: video.h:354
#define Trace(x)
Definition: inflate.c:42
#define VideoDebugPrint(x)
Definition: video.h:75
#define __FUNCTION__
Definition: types.h:112
VPAPI VOID NTAPI VideoPortWritePortUchar(IN PUCHAR Port, IN UCHAR Value)
#define GRAPH_MODE_DISPLAY_ENABLE
Definition: video.h:254
#define PAGED_CODE()

Referenced by DriverEntry().

◆ Pc98VidStartIO()

BOOLEAN NTAPI Pc98VidStartIO ( _In_ PVOID  HwDeviceExtension,
_Inout_ PVIDEO_REQUEST_PACKET  RequestPacket 
)

Definition at line 212 of file ioctl.c.

215 {
217 
218  PAGED_CODE();
219 
220  VideoDebugPrint((Trace, "%s() IOCTL 0x%lX\n",
221  __FUNCTION__, RequestPacket->IoControlCode));
222 
223  switch (RequestPacket->IoControlCode)
224  {
226  {
227  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_NUM_MODES))
228  {
230  break;
231  }
232 
234  (PVIDEO_NUM_MODES)RequestPacket->OutputBuffer,
235  RequestPacket->StatusBlock);
236  break;
237  }
238 
240  {
241  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION) *
242  ((PHW_DEVICE_EXTENSION)HwDeviceExtension)->ModeCount)
243  {
245  break;
246  }
247 
249  (PVIDEO_MODE_INFORMATION)RequestPacket->OutputBuffer,
250  RequestPacket->StatusBlock);
251  break;
252  }
253 
255  {
256  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MODE))
257  {
259  break;
260  }
261 
263  (PVIDEO_MODE)RequestPacket->InputBuffer);
264  break;
265  }
266 
268  {
269  if (RequestPacket->OutputBufferLength < sizeof(VIDEO_MODE_INFORMATION))
270  {
272  break;
273  }
274 
276  (PVIDEO_MODE_INFORMATION)RequestPacket->OutputBuffer,
277  RequestPacket->StatusBlock);
278  break;
279  }
280 
282  {
283  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY) ||
284  RequestPacket->OutputBufferLength < sizeof(VIDEO_MEMORY_INFORMATION))
285  {
287  break;
288  }
289 
291  (PVIDEO_MEMORY)RequestPacket->InputBuffer,
292  (PVIDEO_MEMORY_INFORMATION)RequestPacket->OutputBuffer,
293  RequestPacket->StatusBlock);
294  break;
295  }
296 
298  {
299  if (RequestPacket->InputBufferLength < sizeof(VIDEO_MEMORY))
300  {
302  break;
303  }
304 
306  (PVIDEO_MEMORY)RequestPacket->InputBuffer);
307  break;
308  }
309 
311  {
313  break;
314  }
315 
317  {
318  if (RequestPacket->InputBufferLength < sizeof(VIDEO_CLUT))
319  {
321  break;
322  }
323 
324  Status = Pc98VidSetColorRegisters((PVIDEO_CLUT)RequestPacket->InputBuffer);
325  break;
326  }
327 
329  {
330  if (RequestPacket->InputBufferLength < sizeof(ULONG) ||
331  RequestPacket->OutputBufferLength < sizeof(ULONG))
332  {
334  break;
335  }
336 
337  Status = Pc98VidGetChildState((PHW_DEVICE_EXTENSION)HwDeviceExtension,
338  (PULONG)RequestPacket->InputBuffer,
339  (PULONG)RequestPacket->OutputBuffer,
340  RequestPacket->StatusBlock);
341  break;
342  }
343 
344  default:
346  }
347 
348  if (Status != NO_ERROR)
349  VideoDebugPrint((Trace, "%s() Failed 0x%lX\n", __FUNCTION__, Status));
350 
351  RequestPacket->StatusBlock->Status = Status;
352 
353  return TRUE;
354 }
#define ERROR_INVALID_FUNCTION
Definition: dderror.h:6
#define TRUE
Definition: types.h:120
static VP_STATUS FASTCALL Pc98VidMapVideoMemory(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_MEMORY RequestedAddress, _Out_ PVIDEO_MEMORY_INFORMATION MapInformation, _Out_ PSTATUS_BLOCK StatusBlock)
Definition: ioctl.c:121
#define IOCTL_VIDEO_RESET_DEVICE
Definition: ntddvdeo.h:137
#define IOCTL_VIDEO_MAP_VIDEO_MEMORY
Definition: ntddvdeo.h:104
#define NO_ERROR
Definition: dderror.h:5
VP_STATUS FASTCALL Pc98VidSetColorRegisters(_In_ PVIDEO_CLUT ColorLookUpTable)
Definition: hardware.c:261
#define IOCTL_VIDEO_QUERY_CURRENT_MODE
Definition: ntddvdeo.h:113
#define IOCTL_VIDEO_SET_CURRENT_MODE
Definition: ntddvdeo.h:152
VP_STATUS FASTCALL Pc98VidSetCurrentMode(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_MODE RequestedMode)
Definition: hardware.c:83
static VP_STATUS FASTCALL Pc98VidQueryCurrentMode(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _Out_ PVIDEO_MODE_INFORMATION VideoMode, _Out_ PSTATUS_BLOCK StatusBlock)
Definition: ioctl.c:100
#define IOCTL_VIDEO_UNMAP_VIDEO_MEMORY
Definition: ntddvdeo.h:179
Status
Definition: gdiplustypes.h:24
static VP_STATUS FASTCALL Pc98VidQueryAvailModes(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _Out_ PVIDEO_MODE_INFORMATION ModeInformation, _Out_ PSTATUS_BLOCK StatusBlock)
Definition: ioctl.c:51
static VP_STATUS FASTCALL Pc98VidUnmapVideoMemory(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _In_ PVIDEO_MEMORY VideoMemory)
Definition: ioctl.c:162
#define IOCTL_VIDEO_QUERY_NUM_AVAIL_MODES
Definition: ntddvdeo.h:122
#define Trace(x)
Definition: inflate.c:42
#define IOCTL_VIDEO_QUERY_AVAIL_MODES
Definition: ntddvdeo.h:107
#define VideoDebugPrint(x)
Definition: video.h:75
unsigned int * PULONG
Definition: retypes.h:1
#define IOCTL_VIDEO_GET_CHILD_STATE
Definition: ntddvdeo.h:95
unsigned int ULONG
Definition: retypes.h:1
LONG VP_STATUS
Definition: video.h:153
static VP_STATUS FASTCALL Pc98VidQueryNumAvailModes(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _Out_ PVIDEO_NUM_MODES Modes, _Out_ PSTATUS_BLOCK StatusBlock)
Definition: ioctl.c:79
#define __FUNCTION__
Definition: types.h:112
static VP_STATUS FASTCALL Pc98VidGetChildState(_In_ PHW_DEVICE_EXTENSION DeviceExtension, _In_ PULONG ChildIndex, _Out_ PULONG ChildState, _Out_ PSTATUS_BLOCK StatusBlock)
Definition: ioctl.c:192
static VP_STATUS FASTCALL Pc98VidResetDevice(VOID)
Definition: ioctl.c:179
#define IOCTL_VIDEO_SET_COLOR_REGISTERS
Definition: ntddvdeo.h:149
#define PAGED_CODE()
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10

Referenced by DriverEntry().

Variable Documentation

◆ VideoModes

const VIDEOMODE VideoModes[]

Definition at line 14 of file pc98vid.c.

Referenced by Pc98VidInitialize().