VDD_Register_Extra_Screen_Selector

Call With

EAX contains the Selector Number to register.

Return Values

All registers except EBX are destroyed. CY returned if the Main VDD's extra selector array is filled that is, if more than 8 different selectors have been registered.

Remarks

VDD_Register_Extra_Screen_Selector allows the display driver to register extra selectors that it might use to draw onto the display hardware. Some modern display cards use memory mapped registers that are accessed using a different screen selector than the one provided by VFLATD. Other display cards do not use VFLATD to obtain a selector; they either use DPMI or have the mini-VDD obtain a selector for them. In this case, they access the display memory as a flat, linear frame buffer whose physical address may be mapped in by the hardware at very high addresses such as above 2 gigabytes. See the ATI mini-VDD's routine MiniVDD_RegisterDisplayDriver for an example of how to do this.

A display driver may also use the screen selectors provided by the Windows 95 Kernel. These selectors are often called KernelsScreenSelector or __A000H in display driver code. Whenever the display driver uses a screen selector other than the one that is provided by VFLATD, it must be registered with the Main VDD so that the Main VDD knows when to switch the MemC state back to that required by the Windows VM when virtualizing VGA 4 plane graphics in a window. FRAMEBUF.DRV is an example of a display driver that uses KernelsScreenSelector

This function is called by the mini-VDD on behalf of the display driver. Typically, the sequence of events is as follows: At physical enable time, the display driver calls VDD_REGISTER_DISPLAY_DRIVER_INFO which in turn calls the mini-VDD function REGISTER_DISPLAY_DRIVER. The mini-VDD may allocate an LDT selector on behalf of the display driver or it may pass an LDT selector (such as KernelsScreenSelector) to the VDD_Register_Extra_Screen_Selector service. At the correct time, the Main VDD uses this registered information to correctly set the MemC state and does not need the mini-VDD or display driver to intervene.

The selector passed in EAX (actually in AX, the top word of EAX should be zero) must be a GDT or LDT selector which is used only by the Windows VM. It should only be registered once per Windows session (in other words, if the display driver calls the mini-VDD function REGISTER_DISPLAY_DRIVER whenever the display driver runs through Enable, it should try to not register the same selector twice). Up to 8 selectors can be registered using this function.

For background information on how the VDD handles virtualization of VGA planar modes in the background or in a window, see the service VDD_Register_Virtual_Port. See the ATI mini-VDD for an example of how to allocate an LDT selector and call VDD_Register_Extra_Screen_Selector to register it with the Main VDD.