EBX: Contains the Windows VM Handle.
ECX and Client ECX: Contain the byte offset of the start of the 32K or 64K VGA 4 plane virtualization area.
EBP: Contains the Windows VM's Client Registers.
AH contains the page offset from the start of the VDD bank of the virtualization area. ECX must be preserved. EDX contains the amount of video memory that is devoted to the VGA 4 plane virtualization area. If not allowing VGA 4 plane virtualization, set EDX = ECX or Client_ECX. If allowing VGA 4 plane virtualization, set EDX to either the value 64K or 32K.
This function allows the mini-VDD to prepare to implement 4 plane VGA virtualization in a window or in background VM's. In order to allow running VGA 4 plane graphics in a window, your hardware must allow the VGA data pathway while you are in your hi-res packed pixel configuration. The Main VDD sets the hardware up so that the CPU communicates to a 64K piece of memory located below the Windows visible screen just as it would to a 4 plane VGA at address A000h. The VGA 4 plane program draws to this off-screen memory using the VGA's rudimentary BLTer (that is, the VGA write modes and set/reset support). The VDD then reads back the 4 planes and sends the video data back to the Grabber which converts the 4 plane image to a device-independent bitmap and sends it to GDI for display in a window.
Because the off-screen piece of memory is mapped to its A000h segment, the VGA 4 plane application communicates with it just as it would to a real VGA. The Main VDD decides when to map the memory in and out and when to change from the 4 plane state back to packed pixel state. The only thing that the mini-VDD must do is to set to the 64K bank when requested to by the Main VDD and set any hardware registers to their necessary configuration to simulate 4 plane VGA graphics to the program while displaying packed pixel graphics on the monitor.
This functionality is very important to Far East DBCS Windows implementations since they use VGA mode 12h (640x480x4 planes) to implement their DBCS text mode MS-DOS window. This functionality also allows VGA games to run windowed under Windows 95.
The following scenario describes how the Main VDD determines when to do VGA virtualization.
Currently, your card must be able to map in a 32K or 64K bank of video memory at A000h. The mini-VDD, in response to this call, should determine if it has enough memory to do this, and setup the hardware register states to accomplish this. The sample mini-VDDs provide examples of how to do this. If your video card uses a flat linear address space and cannot bank its video memory in at A000h, you cannot do VGA 4 plane graphics in a window or in the background. In case you decide that your current configuration cannot do VGA 4 plane graphics in a window, you should set EDX equal to the entry value of ECX (or Client_ECX) and return. This will indicate to the Main VDD not to allow VGA 4 plane graphics in a window. You can however, still do text (although not DBCS text) in a window and the non-planar graphics modes (such as mode 13H) in a window.
You should allocate the 32K or 64K block of virtualization memory on an even bank boundary. However, the VDD allows you to allocate it on 16K page boundaries (4K per page * 4 planes) by returning a page offset value in AH. For example, if a mini-VDD wants to allocate the last 32K of bank 12 to VGA virtualization, it would return a 2 in AH. This would tell the Main VDD to start halfway down the bank when it maps video memory into the VGA 4 plane VM.
The Main VDD calls this function in response to the display driver calling VDD_DRIVER_REGISTER. It is not called if the display driver passed Client_EDX == -1 (indicating that the display driver decided not to allow VGA 4 plane virtualization).