⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libfbx-3dfx-misc.c

📁 libfxb是linux下只写操作framebuffer的一个轻量级的库。
💻 C
字号:
/* *  libfbx-3dfx-misc.c -- Miscellaneous routines for 3dfx optimizations *  (C)opyright 2001 U4X Labs * *  Written by: Michael Bourgeous <nitrogen@u4xlabs.com> *  		Paul Mundt        <lethal@u4xlabs.com> *  *  $Id: libfbx-3dfx-misc.c,v 1.7 2001/03/03 01:34:43 lethal Exp $ * *  	This is the place for all the 3dfx hardware specific *  optimizations for the libfbx system to go. * *  See ChangeLog for modifications, CREDITS for credits. * *  All source herein is copyright U4X Labs and its original author.  *  Any code modifications or additions are (C)opyright the original  *  author and U4X Labs respectively. * *  libfbx is free software; you can redistribute it and/or modify it  *  under the terms of the GNU Lesser General Public License as  *  published by the Free Software Foundation; either version 2.1 of  *  the License, or (at your option) any later version. * *  libfbx 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 Lesser General Public License for more details. * *  You should have received a copy of the GNU Lesser General Public *  License along with libfbx; if not, write to the Free Software  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *  USA */#include <libfbx/libfbx-drivers.h>#include <libfbx/drivers/libfbx-3dfx.h>#include <sched.h>inline void seq_outb(__u32 idx, __u8 val){	fb_outb(SEQ_I - 0x300, idx);	fb_outb(SEQ_D - 0x300, val);}inline __u8 seq_inb(__u32 idx){	fb_outb(SEQ_I - 0x300, idx);	return fb_inb(SEQ_D - 0x300);}/* * Banshee specific? */inline void tdfx_make_room(int size){	while ((fb_inl(STATUS) & 0x1f) < size);}inline void tdfx_wait_idle(){	int i = 0;	tdfx_make_room(1);	fb_outl(COMMAND_3D, COMMAND_3D_NOP);	while (1) {		i = (fb_inl(STATUS) & STATUS_BUSY) ? 0 : i + 1;		if (i == 3)			break;		sched_yield();	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -