亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vesavbe.c

?? gumstiz u-boot loader in linux
?? C
?? 第 1 頁 / 共 3 頁
字號:
/******************************************************************************           The SuperVGA Kit - UniVBE Software Development Kit**  ========================================================================**    The contents of this file are subject to the SciTech MGL Public*    License Version 1.0 (the "License"); you may not use this file*    except in compliance with the License. You may obtain a copy of*    the License at http://www.scitechsoft.com/mgl-license.txt**    Software distributed under the License is distributed on an*    "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or*    implied. See the License for the specific language governing*    rights and limitations under the License.**    The Original Code is Copyright (C) 1991-1998 SciTech Software, Inc.**    The Initial Developer of the Original Code is SciTech Software, Inc.*    All Rights Reserved.**  ========================================================================** Language:     ANSI C* Environment:  IBM PC Real Mode and 16/32 bit Protected Mode.** Description:  Module to implement a C callable interface to the standard*               VESA VBE routines. You should rip out this module and use it*               directly in your own applications, or you can use the*               high level SDK functions.**               MUST be compiled in the LARGE or FLAT models.*****************************************************************************/#include <stdio.h>#include <stdlib.h>#include <string.h>#include "vesavbe.h"#include "pmapi.h"#include "drvlib/os/os.h"/*---------------------------- Global Variables ---------------------------*/#define VBE_SUCCESS     0x004F#define MAX_LIN_PTRS    10static uint         VESABuf_len = 1024;/* Length of the VESABuf buffer  */static ibool        haveRiva128;    /* True if we have a Riva128        */static VBE_state    defState = {0}; /* Default state buffer             */static VBE_state    *state = &defState; /* Pointer to current buffer    */static int          VBE_shared = 0;#ifndef REALMODEstatic char         localBuf[512];  /* Global PM string translate buf   */#define MAX_LOCAL_BUF &localBuf[511]#endif/*----------------------------- Implementation ----------------------------*//* static function in WinDirect for passing 32-bit registers to BIOS */int PMAPI WD_int386(int intno, RMREGS *in, RMREGS *out);void VBEAPI VBE_init(void)/****************************************************************************** Function:     VBE_init** Description:  Initialises the VBE transfer buffer in real mode DC.memory.*               This routine is called by the VESAVBE module every time*               it needs to use the transfer buffer, so we simply allocate*               it once and then return.*****************************************************************************/{    if (!state->VESABuf_ptr) {	/* Allocate a global buffer for communicating with the VESA VBE */	if ((state->VESABuf_ptr = PM_getVESABuf(&VESABuf_len, &state->VESABuf_rseg, &state->VESABuf_roff)) == NULL)	    PM_fatalError("VESAVBE.C: Real mode memory allocation failed!");	}}void * VBEAPI VBE_getRMBuf(uint *len,uint *rseg,uint *roff)/****************************************************************************** Function:     VBE_getRMBuf** Description:  This function returns the location and length of the real*               mode memory buffer for calling real mode functions.*****************************************************************************/{    *len = VESABuf_len;    *rseg = state->VESABuf_rseg;    *roff = state->VESABuf_roff;    return state->VESABuf_ptr;}void VBEAPI VBE_setStateBuffer(VBE_state *s)/****************************************************************************** Function:     VBE_setStateBuffer** Description:  This functions sets the internal state buffer for the*               VBE module to the passed in buffer. By default the internal*               global buffer is used, but you must use separate buffers*               for each device in a multi-controller environment.*****************************************************************************/{    state = s;}void VBEAPI VBE_callESDI(RMREGS *regs, void *buffer, int size)/****************************************************************************** Function:     VBE_callESDI* Parameters:   regs    - Registers to load when calling VBE*               buffer  - Buffer to copy VBE info block to*               size    - Size of buffer to fill** Description:  Calls the VESA VBE and passes in a buffer for the VBE to*               store information in, which is then copied into the users*               buffer space. This works in protected mode as the buffer*               passed to the VESA VBE is allocated in conventional*               memory, and is then copied into the users memory block.*****************************************************************************/{    RMSREGS sregs;    if (!state->VESABuf_ptr)	PM_fatalError("You *MUST* call VBE_init() before you can call the VESAVBE.C module!");    sregs.es = (ushort)state->VESABuf_rseg;    regs->x.di = (ushort)state->VESABuf_roff;    memcpy(state->VESABuf_ptr, buffer, size);    PM_int86x(0x10, regs, regs, &sregs);    memcpy(buffer, state->VESABuf_ptr, size);}#ifndef REALMODEstatic char *VBE_copyStrToLocal(char *p,char *realPtr,char *max)/****************************************************************************** Function:     VBE_copyStrToLocal* Parameters:   p       - Flat model buffer to copy to*               realPtr - Real mode pointer to copy* Returns:      Pointer to the next byte after string** Description:  Copies the string from the real mode location pointed to*               by 'realPtr' into the flat model buffer pointed to by*               'p'. We return a pointer to the next byte past the copied*               string.*****************************************************************************/{    uchar   *v;    v = PM_mapRealPointer((uint)((ulong)realPtr >> 16), (uint)((ulong)realPtr & 0xFFFF));    while (*v != 0 && p < max)	*p++ = *v++;    *p++ = 0;    return p;}static void VBE_copyShortToLocal(ushort *p,ushort *realPtr)/****************************************************************************** Function:     VBE_copyShortToLocal* Parameters:   p       - Flat model buffer to copy to*               realPtr - Real mode pointer to copy** Description:  Copies the mode table from real mode memory to the flat*               model buffer.*****************************************************************************/{    ushort  *v;    v = PM_mapRealPointer((uint)((ulong)realPtr >> 16),(uint)((ulong)realPtr & 0xFFFF));    while (*v != 0xFFFF)	*p++ = *v++;    *p = 0xFFFF;}#endifint VBEAPI VBE_detectEXT(VBE_vgaInfo *vgaInfo,ibool forceUniVBE)/****************************************************************************** Function:     VBE_detect* Parameters:   vgaInfo - Place to store the VGA information block* Returns:      VBE version number, or 0 if not detected.** Description:  Detects if a VESA VBE is out there and functioning*               correctly. If we detect a VBE interface we return the*               VGAInfoBlock returned by the VBE and the VBE version number.*****************************************************************************/{    RMREGS  regs;    regs.x.ax = 0x4F00;     /* Get SuperVGA information */    if (forceUniVBE) {	regs.x.bx = 0x1234;	regs.x.cx = 0x4321;	}    else {	regs.x.bx = 0;	regs.x.cx = 0;	}    strncpy(vgaInfo->VESASignature,"VBE2",4);    VBE_callESDI(&regs, vgaInfo, sizeof(*vgaInfo));    if (regs.x.ax != VBE_SUCCESS)	return 0;    if (strncmp(vgaInfo->VESASignature,"VESA",4) != 0)	return 0;    /* Check for bogus BIOSes that return a VBE version number that is     * not correct, and fix it up. We also check the OemVendorNamePtr for a     * valid value, and if it is invalid then we also reset to VBE 1.2.     */    if (vgaInfo->VESAVersion >= 0x200 && vgaInfo->OemVendorNamePtr == 0)	vgaInfo->VESAVersion = 0x102;#ifndef REALMODE    /* Relocate all the indirect information (mode tables, OEM strings     * etc) from the low 1Mb memory region into a static buffer in     * our default data segment. We do this to insulate the application     * from mapping the strings from real mode to protected mode.     */    {	char *p,*p2;     p2 = VBE_copyStrToLocal(localBuf,vgaInfo->OemStringPtr,MAX_LOCAL_BUF);     vgaInfo->OemStringPtr = localBuf;     if (vgaInfo->VESAVersion >= 0x200) {	 p = VBE_copyStrToLocal(p2,vgaInfo->OemVendorNamePtr,MAX_LOCAL_BUF);	 vgaInfo->OemVendorNamePtr = p2;	 p2 = VBE_copyStrToLocal(p,vgaInfo->OemProductNamePtr,MAX_LOCAL_BUF);	 vgaInfo->OemProductNamePtr = p;	 p = VBE_copyStrToLocal(p2,vgaInfo->OemProductRevPtr,MAX_LOCAL_BUF);	 vgaInfo->OemProductRevPtr = p2;	 VBE_copyShortToLocal((ushort*)p,vgaInfo->VideoModePtr);	 vgaInfo->VideoModePtr = (ushort*)p;	 }     else {	 VBE_copyShortToLocal((ushort*)p2,vgaInfo->VideoModePtr);	 vgaInfo->VideoModePtr = (ushort*)p2;	 }    }#endif    state->VBEMemory = vgaInfo->TotalMemory * 64;    /* Check for Riva128 based cards since they have broken triple buffering     * and stereo support.     */    haveRiva128 = false;    if (vgaInfo->VESAVersion >= 0x300 &&	   (strstr(vgaInfo->OemStringPtr,"NVidia") != NULL ||	    strstr(vgaInfo->OemStringPtr,"Riva") != NULL)) {	haveRiva128 = true;	}    /* Check for Matrox G400 cards which claim to be VBE 3.0     * compliant yet they don't implement the refresh rate control     * functions.     */    if (vgaInfo->VESAVersion >= 0x300 && (strcmp(vgaInfo->OemProductNamePtr,"Matrox G400") == 0))	vgaInfo->VESAVersion = 0x200;    return (state->VBEVersion = vgaInfo->VESAVersion);}int VBEAPI VBE_detect(VBE_vgaInfo *vgaInfo)/****************************************************************************** Function:     VBE_detect* Parameters:   vgaInfo - Place to store the VGA information block* Returns:      VBE version number, or 0 if not detected.** Description:  Detects if a VESA VBE is out there and functioning*               correctly. If we detect a VBE interface we return the*               VGAInfoBlock returned by the VBE and the VBE version number.*****************************************************************************/{    return VBE_detectEXT(vgaInfo,false);}ibool VBEAPI VBE_getModeInfo(int mode,VBE_modeInfo *modeInfo)/****************************************************************************** Function:     VBE_getModeInfo* Parameters:   mode        - VBE mode to get information for*               modeInfo    - Place to store VBE mode information* Returns:      True on success, false if function failed.** Description:  Obtains information about a specific video mode from the*               VBE. You should use this function to find the video mode*               you wish to set, as the new VBE 2.0 mode numbers may be*               completely arbitrary.*****************************************************************************/{    RMREGS  regs;    int     bits;    regs.x.ax = 0x4F01;             /* Get mode information         */    regs.x.cx = (ushort)mode;    VBE_callESDI(&regs, modeInfo, sizeof(*modeInfo));    if (regs.x.ax != VBE_SUCCESS)	return false;    if ((modeInfo->ModeAttributes & vbeMdAvailable) == 0)	return false;    /* Map out triple buffer and stereo flags for NVidia Riva128     * chips.     */    if (haveRiva128) {	modeInfo->ModeAttributes &= ~vbeMdTripleBuf;	modeInfo->ModeAttributes &= ~vbeMdStereo;	}    /* Support old style RGB definitions for VBE 1.1 BIOSes */    bits = modeInfo->BitsPerPixel;    if (modeInfo->MemoryModel == vbeMemPK && bits > 8) {	modeInfo->MemoryModel = vbeMemRGB;	switch (bits) {	    case 15:		modeInfo->RedMaskSize = 5;		modeInfo->RedFieldPosition = 10;		modeInfo->GreenMaskSize = 5;		modeInfo->GreenFieldPosition = 5;		modeInfo->BlueMaskSize = 5;		modeInfo->BlueFieldPosition = 0;		modeInfo->RsvdMaskSize = 1;		modeInfo->RsvdFieldPosition = 15;		break;	    case 16:		modeInfo->RedMaskSize = 5;		modeInfo->RedFieldPosition = 11;		modeInfo->GreenMaskSize = 5;		modeInfo->GreenFieldPosition = 5;		modeInfo->BlueMaskSize = 5;		modeInfo->BlueFieldPosition = 0;		modeInfo->RsvdMaskSize = 0;		modeInfo->RsvdFieldPosition = 0;		break;	    case 24:		modeInfo->RedMaskSize = 8;		modeInfo->RedFieldPosition = 16;		modeInfo->GreenMaskSize = 8;		modeInfo->GreenFieldPosition = 8;		modeInfo->BlueMaskSize = 8;		modeInfo->BlueFieldPosition = 0;		modeInfo->RsvdMaskSize = 0;		modeInfo->RsvdFieldPosition = 0;		break;	    }	}    /* Convert the 32k direct color modes of VBE 1.2+ BIOSes to     * be recognised as 15 bits per pixel modes.     */    if (bits == 16 && modeInfo->RsvdMaskSize == 1)	modeInfo->BitsPerPixel = 15;    /* Fix up bogus BIOS'es that report incorrect reserved pixel masks     * for 32K color modes. Quite a number of BIOS'es have this problem,     * and this affects our OS/2 drivers in VBE fallback mode.     */    if (bits == 15 && (modeInfo->RsvdMaskSize != 1 || modeInfo->RsvdFieldPosition != 15)) {	modeInfo->RsvdMaskSize = 1;	modeInfo->RsvdFieldPosition = 15;	}    return true;}long VBEAPI VBE_getPageSize(VBE_modeInfo *mi)/****************************************************************************** Function:     VBE_getPageSize* Parameters:   mi  - Pointer to mode information block* Returns:      Caculated page size in bytes rounded to correct boundary** Description:  Computes the page size in bytes for the specified mode*               information block, rounded up to the appropriate boundary*               (8k, 16k, 32k or 64k). Pages >= 64k in size are always*               rounded to the nearest 64k boundary (so the start of a*               page is always bank aligned).*****************************************************************************/{    long size;    size = (long)mi->BytesPerScanLine * (long)mi->YResolution;    if (mi->BitsPerPixel == 4) {	/* We have a 16 color video mode, so round up the page size to	 * 8k, 16k, 32k or 64k boundaries depending on how large it is.	 */	size = (size + 0x1FFFL) & 0xFFFFE000L;	if (size != 0x2000) {	    size = (size + 0x3FFFL) & 0xFFFFC000L;	    if (size != 0x4000) {		size = (size + 0x7FFFL) & 0xFFFF8000L;		if (size != 0x8000)		    size = (size + 0xFFFFL) & 0xFFFF0000L;		}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本成人在线电影网| 久草这里只有精品视频| 欧美一级生活片| 成人蜜臀av电影| 亚洲成人在线免费| 国产亚洲一二三区| 欧美图区在线视频| 国产成人日日夜夜| 日韩国产欧美在线观看| 亚洲美腿欧美偷拍| 久久久精品免费网站| 亚洲成人1区2区| 国产精品乱码一区二三区小蝌蚪| 欧美一区二区在线观看| 91久久免费观看| 国产精品午夜在线观看| 日韩一区二区麻豆国产| 欧美午夜片在线看| 99久久国产综合精品麻豆| 国产最新精品精品你懂的| 婷婷开心激情综合| 一区二区三区中文在线观看| 欧美国产禁国产网站cc| 欧美变态tickling挠脚心| 欧美美女喷水视频| 欧美日韩专区在线| 色av成人天堂桃色av| 国产精品高潮久久久久无| 久久久久国产精品麻豆ai换脸| 欧美妇女性影城| 在线观看欧美黄色| 91一区二区在线观看| 成人午夜短视频| 风间由美一区二区三区在线观看| 国模大尺度一区二区三区| 免费在线欧美视频| 免费在线观看日韩欧美| 五月婷婷激情综合网| 亚洲丰满少妇videoshd| 亚洲第一会所有码转帖| 亚洲国产一区二区a毛片| 亚洲午夜久久久久中文字幕久| 亚洲精品老司机| 一区二区三区精品视频| 最近日韩中文字幕| 国产精品成人在线观看| 中文字幕一区二区三| 欧美日韩一区二区三区四区| 精品污污网站免费看| 欧美三级视频在线观看| 欧美视频中文一区二区三区在线观看| 一本到一区二区三区| 色综合咪咪久久| 欧美日韩精品电影| 欧美疯狂性受xxxxx喷水图片| 制服丝袜在线91| 欧美大度的电影原声| www国产精品av| 国产人成一区二区三区影院| 国产精品卡一卡二| 亚洲另类春色国产| 五月激情综合色| 激情综合网天天干| 欧美日韩久久一区二区| 欧美福利视频导航| 久久久久久久网| 中文字幕一区免费在线观看| 亚洲男人的天堂一区二区| 婷婷久久综合九色综合伊人色| 久久精品国产精品亚洲综合| 国产成人综合自拍| 91久久久免费一区二区| 欧美v亚洲v综合ⅴ国产v| 欧美极品xxx| 亚洲欧美日韩一区二区| 日韩激情av在线| 懂色av一区二区在线播放| 欧美在线三级电影| 日韩精品一区二区三区中文精品| 久久久午夜精品| 亚洲码国产岛国毛片在线| 日本女优在线视频一区二区| 国产99精品在线观看| 欧美性猛片aaaaaaa做受| 亚洲精品一区二区三区福利| 国产精品国产三级国产aⅴ中文| 亚洲精品综合在线| 狠狠色综合日日| 色婷婷久久99综合精品jk白丝| 欧美午夜精品免费| 日韩久久久久久| 中文字幕五月欧美| 欧美aⅴ一区二区三区视频| 国产不卡视频一区二区三区| 欧美色倩网站大全免费| 国产日韩欧美精品电影三级在线| 亚洲午夜电影在线| 豆国产96在线|亚洲| 日韩一区二区精品在线观看| 亚洲视频电影在线| 国产一区二区三区在线观看免费视频 | 麻豆91免费看| 亚洲成人激情综合网| 国产成人自拍网| 欧美一卡2卡三卡4卡5免费| 亚洲啪啪综合av一区二区三区| 日本不卡一区二区| 91丨porny丨首页| 99天天综合性| 亚洲精品一区二区精华| 天堂在线一区二区| 91一区二区在线观看| 久久综合九色综合欧美就去吻 | 亚洲精品成人在线| 国产精品一二三四五| 777a∨成人精品桃花网| 亚洲视频每日更新| 不卡影院免费观看| 精品国产污污免费网站入口 | 亚洲18影院在线观看| 99久久综合色| 久久久www成人免费毛片麻豆| 亚洲午夜免费视频| 在线观看不卡视频| 亚洲视频1区2区| 成人动漫视频在线| 国产婷婷色一区二区三区 | 成人精品一区二区三区中文字幕| 日韩网站在线看片你懂的| 亚洲制服欧美中文字幕中文字幕| www.成人网.com| 国产精品免费观看视频| 国产成人综合亚洲网站| 久久免费视频一区| 国产一区二区三区四区五区入口| 欧美一级免费观看| 日韩成人精品在线观看| 欧美精品亚洲二区| 亚洲.国产.中文慕字在线| 欧美亚洲一区二区在线| 亚洲一区二区三区三| 欧美综合天天夜夜久久| 亚洲愉拍自拍另类高清精品| 日本道精品一区二区三区| 亚洲自拍另类综合| 欧美日韩国产大片| 日韩在线卡一卡二| 欧美日韩免费观看一区二区三区 | 欧美日韩在线播| 香蕉加勒比综合久久| 欧美精品在线一区二区| 婷婷亚洲久悠悠色悠在线播放| 欧美日韩精品欧美日韩精品| 日韩激情一二三区| 欧美精品一区二区三区高清aⅴ| 国产激情一区二区三区| 欧美韩日一区二区三区四区| av亚洲精华国产精华精华| 亚洲欧美偷拍另类a∨色屁股| 色香色香欲天天天影视综合网| 亚洲一二三区视频在线观看| 91精品国产综合久久福利| 国内精品国产成人| 亚洲色图丝袜美腿| 欧美精品免费视频| 国产伦精品一区二区三区视频青涩| 国产精品免费观看视频| 欧美日韩国产高清一区| 麻豆国产精品一区二区三区| 国产欧美日韩视频一区二区| 91小视频在线免费看| 日本不卡一区二区三区高清视频| 久久视频一区二区| 91在线精品秘密一区二区| 日日夜夜免费精品| 久久精品人人做| 欧美日韩一区二区电影| 韩国v欧美v亚洲v日本v| 亚洲精品免费在线| 精品日产卡一卡二卡麻豆| 色偷偷久久人人79超碰人人澡| 日本中文一区二区三区| 国产精品久久久久影院色老大 | 国产人妖乱国产精品人妖| 在线视频观看一区| 韩国欧美国产一区| 亚洲国产精品人人做人人爽| 久久免费偷拍视频| 69av一区二区三区| 99精品一区二区| 六月丁香婷婷色狠狠久久| 亚洲欧美一区二区久久| 欧美精品一区二区三区蜜桃视频 | 国产女主播在线一区二区| 久久97超碰色| 亚洲欧美另类图片小说| 久久综合九色欧美综合狠狠 | 日本一区二区三区国色天香| 欧美日韩高清一区二区不卡| 亚洲成在线观看|