vbe.c revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
654N/A// ============================================================================================ 654N/A// Copyright (C) 2002 Jeroen Janssen 654N/A// This library is free software; you can redistribute it and/or 654N/A// modify it under the terms of the GNU Lesser General Public 654N/A// License as published by the Free Software Foundation; either 654N/A// version 2 of the License, or (at your option) any later version. 654N/A// This library is distributed in the hope that it will be useful, 654N/A// but WITHOUT ANY WARRANTY; without even the implied warranty of 654N/A// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 654N/A// Lesser General Public License for more details. 654N/A// You should have received a copy of the GNU Lesser General Public 654N/A// License along with this library; if not, write to the Free Software 654N/A// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 654N/A// ============================================================================================ 654N/A// This VBE is part of the VGA Bios specific to the plex86/bochs Emulated VGA card. 654N/A// You can NOT drive any physical vga card with it. 654N/A// ============================================================================================ 654N/A// This VBE Bios is based on information taken from : 698N/A// - VESA BIOS EXTENSION (VBE) Core Functions Standard Version 3.0 located at www.vesa.org 654N/A// ============================================================================================ 654N/A//#define VBE2_NO_VESA_CHECK 654N/A// dynamicly generate a mode_info list 654N/A// use bytewise i/o by default (Longhorn issue) 654N/A// Use VBE new dynamic mode list. Note that without this option, no 654N/A// checks are currently done to make sure that modes fit into the 654N/A// The current OEM Software Revision of this VBE Bios 654N/A//.ascii "Bochs VBE Display Adapter enabled" 654N/A.
ascii "InnoTek VirtualBox VBE Display Adapter enabled" 654N/A// FIXME: for each new mode add a statement here 654N/A// at least until dynamic list creation is working // ModeInfo helper function /* Read VBE Extra Data signature */ /** Function 00h - Return VBE Controller Information * ES:DI = Pointer to buffer in which to place VbeInfoBlock structure * (VbeSignature should be VBE2 when VBE 2.0 information is desired and * the info block is 512 bytes in size) /* Read VBE Extra Data signature */ printf(
"Signature NOT found\n");
// get vbe_info_block into local variable // check for VBE2 signature // VBE Video Mode Pointer (dynamicly generated from the mode_info_list) // VBE Video Mode Pointer (staticly in rom) // VBE Total Memory (in 64b blocks) // copy updates in vbe_info_block back // copy updates in vbe_info_block back (VBE 1.x compatibility) // Add vesa mode list terminator // Add vesa mode list terminator #
endif // VBE_NEW_DYN_LIST/** Function 01h - Return VBE Mode Information * ES:DI = Pointer to buffer in which to place ModeInfoBlock structure printf(
"VBE vbe_biosfn_return_mode_information ES%x DI%x CX%x\n",
ES,
DI,
CX);
// copy updates in mode_info_block back /** Function 02h - Set VBE Mode * BX = Desired Mode to set * ES:DI = Pointer to CRTCInfoBlock structure //result=read_word(ss,AX); // check for non vesa mode // call the vgabios in order to set the video mode // this allows for going back to textmode with a VBE call (some applications expect that to work) printf(
"VBE found mode %x, setting:\n",
BX);
printf(
"\txres%x yres%x bpp%x\n", x, y,
bpp);
printf(
"VBE found mode %x, setting:\n",
BX);
printf(
"\txres%x yres%x bpp%x\n",
#
endif // VBE_NEW_DYN_LIST // first disable current mode (when switching between vesa modi) printf(
"VBE *NOT* found mode %x\n" ,
BX);
/** Function 03h - Return Current VBE Mode * ES:BX = Pointer to buffer (if DL <> 00h) * BX = Number of 64-byte blocks to hold the state buffer (if DL=00h) /** Function 05h - Display Window Control * (16-bit) BH = 00h Set memory window * = 01h Get memory window * DX = Window number in video memory in window * granularity units (Set Memory Window only) * If this function is called while in a linear frame buffer mode, * this function must fail with completion code AH=03h * DX = Window number in window granularity units * (Get Memory Window only) /** Function 06h - Set/Get Logical Scan Line Length * BL = 00h Set Scan Line Length in Pixels * = 01h Get Scan Line Length * = 02h Set Scan Line Length in Bytes * = 03h Get Maximum Scan Line Length * CX = If BL=00h Desired Width in Pixels * If BL=02h Desired Width in Bytes * (Ignored for Get Functions) * BX = Bytes Per Scan Line * CX = Actual Pixels Per Scan Line * (truncated to nearest complete pixel) * DX = Maximum Number of Scan Lines /** Function 07h - Set/Get Display Start * BH = 00h Reserved and must be 00h * BL = 00h Set Display Start * = 01h Get Display Start * = 02h Schedule Display Start (Alternate) * = 03h Schedule Stereoscopic Display Start * = 04h Get Scheduled Display Start Status * = 05h Enable Stereoscopic Mode * = 06h Disable Stereoscopic Mode * = 80h Set Display Start during Vertical Retrace * = 82h Set Display Start during Vertical Retrace (Alternate) * = 83h Set Stereoscopic Display Start during Vertical Retrace * ECX = If BL=02h/82h Display Start Address in bytes * If BL=03h/83h Left Image Start Address in bytes * EDX = If BL=03h/83h Right Image Start Address in bytes * CX = If BL=00h/80h First Displayed Pixel In Scan Line * DX = If BL=00h/80h First Displayed Scan Line * BH = If BL=01h Reserved and will be 0 * CX = If BL=01h First Displayed Pixel In Scan Line * If BL=04h 0 if flip has not occurred, not 0 if it has * DX = If BL=01h First Displayed Scan Line * BH = 00h Reserved and must be 00h * BL = 00h Set Display Start * = 80h Set Display Start during Vertical Retrace * CX = Bits 0-15 of display start address * DX = Bits 16-31 of display start address * ES = Selector for memory mapped registers /** Function 08h - Set/Get Dac Palette Format * BL = 00h set DAC palette width * = 01h get DAC palette width * BH = If BL=00h: desired number of bits per primary color * BH = current number of bits per primary color (06h = standard VGA) /** Function 09h - Set/Get Palette Data * FIXME: incomplete API description, Input & Output /** Function 0Ah - Return VBE Protected Mode Interface * FIXME: incomplete API description, Input & Output