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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? fbvideo.c

?? mini gui 1.6.8 lib and source
?? C
?? 第 1 頁 / 共 3 頁
字號:
/***  $Id: fbvideo.c,v 1.36 2005/09/04 05:07:30 weiym Exp $**  **  Port to MiniGUI by Wei Yongming (2001/10/03).**  Copyright (C) 2001 ~ 2002 Wei Yongming.**  Copyright (C) 2003 Feynman Software.****  SDL - Simple DirectMedia Layer**  Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga*//*** This program is free software; you can redistribute it and/or modify** it under the terms of the GNU General Public License as published by** the Free Software Foundation; either version 2 of the License, or** (at your option) any later version.**** This program is distributed in the hope that it will be useful,** but WITHOUT ANY WARRANTY; without even the implied warranty of** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the** GNU General Public License for more details.**** You should have received a copy of the GNU General Public License** along with this program; if not, write to the Free Software** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*//* Framebuffer console based video driver implementation.*/#include <stdlib.h>#include <stdio.h>#include <string.h>#include <fcntl.h>#include <unistd.h>#include <sys/ioctl.h>#include <sys/mman.h>#include <asm/page.h>        /* For definition of PAGE_SIZE */#include <linux/vt.h>#include <linux/kd.h>#include <linux/keyboard.h>#include "common.h"#include "minigui.h"#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)#include "client.h"#endif#include "newgal.h"#include "sysvideo.h"#include "pixels_c.h"#include "fbvideo.h"#include "fb3dfx.h"#include "fbmatrox.h"#include "fbneomagic.h"/*#define FBACCEL_DEBUG   1#define FBCON_DEBUG   1*/#if defined(i386) && defined(FB_TYPE_VGA_PLANES)#if 0#define VGA16_FBCON_SUPPORT#include <sys/io.h>#ifndef FB_AUX_VGA_PLANES_VGA4#define FB_AUX_VGA_PLANES_VGA4    0#endifinline static void outb (unsigned char value, unsigned short port){  __asm__ __volatile__ ("outb %b0,%w1"::"a" (value), "Nd" (port));} #endif#endif /* FB_TYPE_VGA_PLANES *//* Initialization/Query functions */static int FB_VideoInit(_THIS, GAL_PixelFormat *vformat);static GAL_Rect **FB_ListModes(_THIS, GAL_PixelFormat *format, Uint32 flags);static GAL_Surface *FB_SetVideoMode(_THIS, GAL_Surface *current, int width, int height, int bpp, Uint32 flags);#ifdef VGA16_FBCON_SUPPORTstatic GAL_Surface *FB_SetVGA16Mode(_THIS, GAL_Surface *current, int width, int height, int bpp, Uint32 flags);#endifstatic int FB_SetColors(_THIS, int firstcolor, int ncolors, GAL_Color *colors);static void FB_VideoQuit(_THIS);/* Hardware surface functions */static int FB_InitHWSurfaces(_THIS, GAL_Surface *screen, char *base, int size);static void FB_FreeHWSurfaces(_THIS);static void FB_RequestHWSurface (_THIS, const REQ_HWSURFACE* request, REP_HWSURFACE* reply);static int FB_AllocHWSurface(_THIS, GAL_Surface *surface);static void FB_FreeHWSurface(_THIS, GAL_Surface *surface);static void FB_WaitVBL(_THIS);static void FB_WaitIdle(_THIS);#if 0static int FB_LockHWSurface(_THIS, GAL_Surface *surface);static void FB_UnlockHWSurface(_THIS, GAL_Surface *surface);static int FB_FlipHWSurface(_THIS, GAL_Surface *surface);#endif/* Internal palette functions */static void FB_SavePalette(_THIS, struct fb_fix_screeninfo *finfo,                                  struct fb_var_screeninfo *vinfo);static void FB_RestorePalette(_THIS);/* FB driver bootstrap functions */static int FB_Available(void){    int console;    const char *GAL_fbdev;    GAL_fbdev = getenv("FRAMEBUFFER");    if ( GAL_fbdev == NULL ) {        GAL_fbdev = "/dev/fb0";    }    console = open(GAL_fbdev, O_RDWR, 0);    if ( console >= 0 ) {        close(console);    }    return(console >= 0);}static void FB_DeleteDevice(GAL_VideoDevice *device){    free(device->hidden);    free(device);}static GAL_VideoDevice *FB_CreateDevice(int devindex){    GAL_VideoDevice *this;    /* Initialize all variables that we clean on shutdown */    this = (GAL_VideoDevice *)malloc(sizeof(GAL_VideoDevice));    if ( this ) {        memset(this, 0, (sizeof *this));        this->hidden = (struct GAL_PrivateVideoData *)                malloc((sizeof *this->hidden));    }    if ( (this == NULL) || (this->hidden == NULL) ) {        GAL_OutOfMemory();        if ( this ) {            free(this);        }        return(0);    }    memset(this->hidden, 0, (sizeof *this->hidden));    wait_vbl = FB_WaitVBL;    wait_idle = FB_WaitIdle;    mouse_fd = -1;    keyboard_fd = -1;    /* Set the function pointers */    this->VideoInit = FB_VideoInit;    this->ListModes = FB_ListModes;    this->SetVideoMode = FB_SetVideoMode;    this->SetColors = FB_SetColors;    this->VideoQuit = FB_VideoQuit;#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    this->RequestHWSurface = FB_RequestHWSurface;#endif    this->AllocHWSurface = FB_AllocHWSurface;    this->CheckHWBlit = NULL;    this->FillHWRect = NULL;    this->SetHWColorKey = NULL;    this->SetHWAlpha = NULL;    this->UpdateRects = NULL;#if 0    this->LockHWSurface = FB_LockHWSurface;    this->UnlockHWSurface = FB_UnlockHWSurface;    this->FlipHWSurface = FB_FlipHWSurface;#endif    this->FreeHWSurface = FB_FreeHWSurface;    this->free = FB_DeleteDevice;    return this;}VideoBootStrap FBCON_bootstrap = {    "fbcon", "Linux Framebuffer Console",    FB_Available, FB_CreateDevice};static int ttyfd = -1;static void FB_LeaveGraphicsMode (_THIS){#ifdef _HAVE_TEXT_MODE#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    if (mgIsServer) {#endif        /* enter text mode*/        if (ttyfd >= 0) {            ioctl (ttyfd, KDSETMODE, KD_TEXT);            close (ttyfd);            ttyfd = -1;        }#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    }#endif#endif}static int FB_EnterGraphicsMode (_THIS){#ifdef _HAVE_TEXT_MODE#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    if (mgIsServer) {#endif        char* tty_dev;        if (geteuid() == 0)            tty_dev = "/dev/tty0";        else    /* not a super user, so try to open the control terminal */            tty_dev = "/dev/tty";        /* open tty, enter graphics mode */        ttyfd = open (tty_dev, O_RDWR);        if (ttyfd < 0) {            fprintf (stderr,"GAL ENGINE: Can't open %s: %m\n", tty_dev);            goto fail;        }        if (ioctl (ttyfd, KDSETMODE, KD_GRAPHICS) == -1) {            fprintf (stderr,"GAL ENGINE: Error when setting the terminal to graphics mode: %m\n");            fprintf (stderr,"GAL ENGINE: Maybe is not a console.\n");            goto fail;        }#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    }    else {        ttyfd = 0;    }#endif    return ttyfd;fail:    FB_LeaveGraphicsMode (this);    return -1;#else    return 0;#endif}static int FB_OpenKeyboard(_THIS){#if 1    return 0;#else    /* Open only if not already opened */     if ( keyboard_fd < 0 ) {        static const char * const tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };        static const char * const vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };        int i, tty0_fd;        /* Try to query for a free virtual terminal */        tty0_fd = -1;        for ( i=0; tty0[i] && (tty0_fd < 0); ++i ) {            tty0_fd = open(tty0[i], O_WRONLY, 0);        }        if ( tty0_fd < 0 ) {            tty0_fd = dup(0); /* Maybe stdin is a VT? */        }        ioctl(tty0_fd, VT_OPENQRY, &current_vt);        close(tty0_fd);        if ( (geteuid() == 0) && (current_vt > 0) ) {            for ( i=0; vcs[i] && (keyboard_fd < 0); ++i ) {                char vtpath[12];                sprintf(vtpath, vcs[i], current_vt);                keyboard_fd = open(vtpath, O_RDWR, 0);#ifdef DEBUG_KEYBOARD                fprintf(stderr, "vtpath = %s, fd = %d\n",                    vtpath, keyboard_fd);#endif /* DEBUG_KEYBOARD */                /* This needs to be our controlling tty                   so that the kernel ioctl() calls work                */                if ( keyboard_fd >= 0 ) {                    tty0_fd = open("/dev/tty", O_RDWR, 0);                    if ( tty0_fd >= 0 ) {                        ioctl(tty0_fd, TIOCNOTTY, 0);                        close(tty0_fd);                    }                }            }        }         if ( keyboard_fd < 0 ) {            /* Last resort, maybe our tty is a usable VT */            current_vt = 0;            keyboard_fd = open("/dev/tty", O_RDWR);         }#ifdef DEBUG_KEYBOARD        fprintf(stderr, "Current VT: %d\n", current_vt);#endif        /* Make sure that our input is a console terminal */        { int dummy;          if ( ioctl(keyboard_fd, KDGKBMODE, &dummy) < 0 ) {            close(keyboard_fd);            keyboard_fd = -1;            GAL_SetError("FBCON NEWGAL Engine: Unable to open a console terminal\n");          }        }     }#endif     return(keyboard_fd);}static int FB_VideoInit(_THIS, GAL_PixelFormat *vformat){    struct fb_fix_screeninfo finfo;    struct fb_var_screeninfo vinfo;    int i;    int current_index;    unsigned int current_w;    unsigned int current_h;    const char *GAL_fbdev;    /* Initialize the library */    GAL_fbdev = getenv("FRAMEBUFFER");    if ( GAL_fbdev == NULL ) {        GAL_fbdev = "/dev/fb0";    }    console_fd = open(GAL_fbdev, O_RDWR, 0);    if ( console_fd < 0 ) {        GAL_SetError("FBCON NEWGAL Engine: Unable to open %s\n", GAL_fbdev);        return(-1);    }    /* Get the type of video hardware */    if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) {        GAL_SetError("FBCON NEWGAL Engine: Couldn't get console hardware info\n");        FB_VideoQuit(this);        return(-1);    }    switch (finfo.type) {        case FB_TYPE_PACKED_PIXELS:            /* Supported, no worries.. */            break;#ifdef VGA16_FBCON_SUPPORT        case FB_TYPE_VGA_PLANES:            /* VGA16 is supported, but that's it */            if ( finfo.type_aux == FB_AUX_VGA_PLANES_VGA4 ) {                if ( ioperm(0x3b4, 0x3df - 0x3b4 + 1, 1) < 0 ) {                    GAL_SetError("FBCON NEWGAL Engine: No I/O port permissions\n");                    FB_VideoQuit(this);                    return(-1);                }                this->SetVideoMode = FB_SetVGA16Mode;                break;            }            /* Fall through to unsupported case */#endif /* VGA16_FBCON_SUPPORT */        default:            GAL_SetError("FBCON NEWGAL Engine: Unsupported console hardware\n");            FB_VideoQuit(this);            return(-1);    }    switch (finfo.visual) {        case FB_VISUAL_TRUECOLOR:        case FB_VISUAL_PSEUDOCOLOR:        case FB_VISUAL_STATIC_PSEUDOCOLOR:        case FB_VISUAL_DIRECTCOLOR:            break;        default:            GAL_SetError("FBCON NEWGAL Engine: Unsupported console hardware\n");            FB_VideoQuit(this);            return(-1);    }#if 0    /* Check if the user wants to disable hardware acceleration */    { const char *fb_accel;        fb_accel = getenv("GAL_FBACCEL");        if ( fb_accel ) {            finfo.accel = atoi(fb_accel);        }    }#endif    /* Memory map the device, compensating for buggy PPC mmap() */    mapped_offset = (((long)finfo.smem_start) -                    (((long)finfo.smem_start)&~(PAGE_SIZE-1)));    mapped_memlen = finfo.smem_len+mapped_offset;#ifdef __uClinux__    mapped_mem = mmap(NULL, mapped_memlen,                      PROT_READ|PROT_WRITE, 0, console_fd, 0);#else    mapped_mem = mmap(NULL, mapped_memlen,                      PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);#endif    if ( mapped_mem == (char *)-1 ) {        GAL_SetError("FBCON NEWGAL Engine: Unable to memory map the video hardware\n");        mapped_mem = NULL;        FB_VideoQuit(this);        return(-1);    }    /* Determine the current screen depth */    if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) {        GAL_SetError("FBCON NEWGAL Engine: Couldn't get console pixel format\n");        FB_VideoQuit(this);        return(-1);    }    vformat->BitsPerPixel = vinfo.bits_per_pixel;    if ( vformat->BitsPerPixel < 8 ) {        /* Assuming VGA16, we handle this via a shadow framebuffer */        vformat->BitsPerPixel = 8;    }    for ( i=0; i<vinfo.red.length; ++i ) {        vformat->Rmask <<= 1;        vformat->Rmask |= (0x00000001<<vinfo.red.offset);    }    for ( i=0; i<vinfo.green.length; ++i ) {        vformat->Gmask <<= 1;        vformat->Gmask |= (0x00000001<<vinfo.green.offset);    }    for ( i=0; i<vinfo.blue.length; ++i ) {        vformat->Bmask <<= 1;        vformat->Bmask |= (0x00000001<<vinfo.blue.offset);    }    saved_vinfo = vinfo;    /* Save hardware palette, if needed */    FB_SavePalette(this, &finfo, &vinfo);    /* If the I/O registers are available, memory map them so we       can take advantage of any supported hardware acceleration.     */    if ( finfo.accel && finfo.mmio_len ) {        mapped_iolen = finfo.mmio_len;        mapped_io = mmap(NULL, mapped_iolen, PROT_READ|PROT_WRITE,                         MAP_SHARED, console_fd, mapped_memlen);        if ( mapped_io == (char *)-1 ) {            /* Hmm, failed to memory map I/O registers */            mapped_io = NULL;        }    }#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    if (mgIsServer) {#endif        /* Query for the list of available video modes */        current_w = vinfo.xres;        current_h = vinfo.yres;        current_index = ((vinfo.bits_per_pixel+7)/8)-1;#if defined(_LITE_VERSION) && !defined(_STAND_ALONE)    }#endif    /* Fill in our hardware acceleration capabilities */    this->info.hw_available = 1;    this->info.video_mem = finfo.smem_len/1024;    if ( mapped_io ) {        switch (finfo.accel) {            case FB_ACCEL_MATROX_MGA2064W:            case FB_ACCEL_MATROX_MGA1064SG:            case FB_ACCEL_MATROX_MGA2164W:            case FB_ACCEL_MATROX_MGA2164W_AGP:            case FB_ACCEL_MATROX_MGAG100:            /*case FB_ACCEL_MATROX_MGAG200: G200 acceleration broken! */            case FB_ACCEL_MATROX_MGAG400:#ifdef FBACCEL_DEBUG            fprintf(stderr, "FBCON NEWGAL Engine: Matrox hardware accelerator!\n");#endif            FB_MatroxAccel(this, finfo.accel);            break;            case FB_ACCEL_3DFX_BANSHEE:#ifdef FBACCEL_DEBUG            fprintf(stderr, "FBCON NEWGAL Engine: 3DFX hardware accelerator!\n");#endif            FB_3DfxAccel (this, finfo.accel);            break;#ifdef FB_ACCEL_NEOMAGIC_NM2070            case FB_ACCEL_NEOMAGIC_NM2200:            case FB_ACCEL_NEOMAGIC_NM2230:            case FB_ACCEL_NEOMAGIC_NM2360:            case FB_ACCEL_NEOMAGIC_NM2380:#ifdef FBACCEL_DEBUG            fprintf(stderr, "FBCON NEWGAL Engine: NeoMagic hardware accelerator!\n");#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品无人区| 国内成人精品2018免费看| 中文字幕免费观看一区| 精品久久久久久久一区二区蜜臀| 国产一区在线精品| 精品一区二区三区视频在线观看 | 国产成人免费视| 麻豆成人在线观看| 97se亚洲国产综合在线| 91精品黄色片免费大全| 成年人网站91| eeuss鲁片一区二区三区在线观看| 日韩精品一级中文字幕精品视频免费观看 | 日韩亚洲欧美成人一区| 国产精品一区在线观看你懂的| 一区二区三区中文字幕精品精品| 日本一区二区视频在线观看| 国产精品拍天天在线| 亚洲三级电影全部在线观看高清| 亚洲色图清纯唯美| 亚洲国产va精品久久久不卡综合| 亚洲精品国产视频| 一二三区精品福利视频| 亚洲最大成人综合| 青青草精品视频| 国产成人免费网站| 99精品一区二区| 欧美肥妇free| 久久在线免费观看| 国产精品久久久久永久免费观看 | 欧美一级专区免费大片| 日韩欧美一区二区视频| 国产欧美精品一区二区三区四区| 色综合视频在线观看| 色婷婷国产精品久久包臀| 日本午夜精品视频在线观看 | 粉嫩一区二区三区在线看| 亚洲国产视频直播| 久久综合九色综合欧美98 | 成人av资源网站| 国产精品原创巨作av| 97国产一区二区| 欧美一级在线观看| 国产精品另类一区| 亚洲h在线观看| 日韩在线一区二区| 国产区在线观看成人精品| 亚洲色图在线播放| 青青草国产精品97视觉盛宴| 亚洲电影一级片| 欧美精品一区二区久久婷婷| 国产色综合久久| 爽爽淫人综合网网站 | 日韩一级二级三级| 精品国产一区二区国模嫣然| 在线免费观看一区| 国产精品视频线看| 美女视频免费一区| 欧美性大战久久久久久久蜜臀| 欧美一级一级性生活免费录像| 国产精品不卡一区| 久久av中文字幕片| 欧美日韩专区在线| 亚洲男女一区二区三区| 国产乱码一区二区三区| 欧美精品在线观看播放| 国产精品视频yy9299一区| 黄一区二区三区| av网站免费线看精品| 欧美一区中文字幕| 日韩精品五月天| 色播五月激情综合网| 国产精品久久久久久亚洲伦| 国产精品2024| 亚洲精品在线观看网站| 精品一区二区日韩| 精品日产卡一卡二卡麻豆| 一区二区三区精品在线观看| 国产综合色产在线精品| 精品福利av导航| 久久99久久99小草精品免视看| 欧美精品在欧美一区二区少妇| 亚洲网友自拍偷拍| 91久久人澡人人添人人爽欧美 | 免费av成人在线| 欧美人动与zoxxxx乱| 亚洲一区二区三区精品在线| 99re66热这里只有精品3直播| 亚洲欧洲日产国码二区| 国产一区中文字幕| 精品国产露脸精彩对白| 国内偷窥港台综合视频在线播放| 欧美成人在线直播| 免费在线观看成人| 精品成人一区二区| 国产一区二区网址| 欧美国产日产图区| 一本久久a久久精品亚洲| 一区二区三区在线观看国产| 欧美日韩高清在线播放| 日本欧美韩国一区三区| 久久亚洲一级片| 成人激情免费视频| 亚洲在线中文字幕| 在线播放91灌醉迷j高跟美女 | 一区二区三区色| 51精品国自产在线| 韩国理伦片一区二区三区在线播放 | 欧美伦理影视网| 精品综合久久久久久8888| 国产视频亚洲色图| 欧美视频一区二区三区在线观看| 亚瑟在线精品视频| 亚洲人成7777| 56国语精品自产拍在线观看| 国产乱色国产精品免费视频| 亚洲欧美日韩一区| 欧美一区二区三区精品| 国产麻豆一精品一av一免费 | 欧美日韩国产成人在线91| 精品无人区卡一卡二卡三乱码免费卡| 国产视频一区二区在线| 欧美午夜理伦三级在线观看| 国产综合色精品一区二区三区| 亚洲精品成人天堂一二三| 日韩网站在线看片你懂的| 99久久精品一区二区| 美女网站色91| 亚洲综合在线电影| 日韩欧美色电影| 91丨九色丨尤物| 狠狠色综合色综合网络| 亚洲最新在线观看| 国产精品久久久久久久浪潮网站 | 99re这里都是精品| 另类中文字幕网| 一个色综合av| 日韩一区欧美小说| 国产亚洲欧美日韩日本| 91精品国产综合久久精品图片 | 懂色av中文一区二区三区| 樱桃国产成人精品视频| 久久久国产精品麻豆| 欧美日韩国产高清一区| 成人国产精品免费观看视频| 久久av资源网| 日本不卡一二三区黄网| 亚洲三级小视频| 精品少妇一区二区三区视频免付费 | 欧美sm美女调教| 欧洲人成人精品| 99视频在线精品| 国产自产高清不卡| 亚洲一区二区三区在线看| 亚洲同性同志一二三专区| 欧美激情一区二区三区不卡| 精品久久久久久久久久久久包黑料| 欧美日韩黄视频| 色老汉av一区二区三区| 一本到高清视频免费精品| 成人不卡免费av| 国产久卡久卡久卡久卡视频精品| 六月丁香综合在线视频| 激情综合网av| 国产精品一区不卡| 精品在线视频一区| 国产一区二区0| 亚洲国产成人av网| 亚洲欧美欧美一区二区三区| 国产欧美一区二区精品性色超碰| 中文字幕+乱码+中文字幕一区| 欧美经典三级视频一区二区三区| 中文字幕中文乱码欧美一区二区| 中文字幕一区二区三区乱码在线| 久久精品欧美日韩精品| 久久中文字幕电影| 久久人人97超碰com| 中文字幕日韩欧美一区二区三区| 亚洲自拍偷拍网站| 欧美aⅴ一区二区三区视频| 国产在线播放一区三区四| 粉嫩在线一区二区三区视频| 欧美四级电影网| 欧美日韩另类一区| 亚洲激情自拍偷拍| 亚洲a一区二区| 国产精品一区二区黑丝| 色综合久久久久综合99| 3751色影院一区二区三区| 在线视频欧美精品| 在线播放中文一区| 久久九九全国免费| 久久九九久久九九| 国产精品美女久久久久av爽李琼| 亚洲成人黄色小说| 九九视频精品免费| 国产一区二区调教| 久久精品国产精品亚洲综合| 色综合天天综合网国产成人综合天| 不卡高清视频专区|