include vflatd.inc
mov dl, VflatD_Create_Virtual_Frame_Buffer ; Function number
mov dh, Flags ; Must be zero
mov eax, FrameBufSize ; Size of frame buffer in bytes
mov ebx, BankSize ; Size of bank, in bytes
mov esi, BankLocation ; Location of bank
push ds
pop es
lea di, BankSwitchProc ; Bank switch code
movzx edi, di
mov cx, BankSwitchProcLength ; Length of bank switch code
call VFlatDApiProcAdr
jc errorhandler
mov VideoSelector, ax
mov VideoAddress, edx
Registers a display driver's bank-switch function and retrieves a selector for a logical frame buffer. Uses Flags.
The bank-switch procedure must be written using 32-bit code and must be a maximum of 100 bytes in length. When the procedure is called, EAX will identify the new bank to be swapped into the physical frame buffer. The procedure must save all registers except EAX, EDX, and Flags, and it must not have a ret instruction (since the code is copied inline).