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

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

?? lightning.c

?? 廣州斯道2410普及版II的源代碼
?? C
字號(hào):
/* * $Id: lightning.c,v 1.13 2001/04/26 10:24:46 vojtech Exp $ * *  Copyright (c) 1998-2001 Vojtech Pavlik * *  Sponsored by SuSE *//* * PDPI Lightning 4 gamecard driver for Linux. *//* * 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 *  * Should you need to contact me, the author, you can do so either by * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail: * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic */#include <asm/io.h>#include <linux/delay.h>#include <linux/errno.h>#include <linux/ioport.h>#include <linux/kernel.h>#include <linux/module.h>#include <linux/init.h>#include <linux/gameport.h>#include <linux/slab.h>#define L4_PORT			0x201#define L4_SELECT_ANALOG	0xa4#define L4_SELECT_DIGITAL	0xa5#define L4_SELECT_SECONDARY	0xa6#define L4_CMD_ID		0x80#define L4_CMD_GETCAL		0x92#define L4_CMD_SETCAL		0x93#define L4_ID			0x04#define L4_BUSY			0x01#define L4_TIMEOUT		80	/* 80 us */MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");MODULE_LICENSE("GPL");struct l4 {	struct gameport gameport;	unsigned char port;} *l4_port[8];/* * l4_wait_ready() waits for the L4 to become ready. */static int l4_wait_ready(void){	unsigned int t;	t = L4_TIMEOUT;	while ((inb(L4_PORT) & L4_BUSY) && t > 0) t--;	return -(t<=0);}/* * l4_cooked_read() reads data from the Lightning 4. */static int l4_cooked_read(struct gameport *gameport, int *axes, int *buttons){	struct l4 *l4 = gameport->private;	unsigned char status;	int i, result = -1;	outb(L4_SELECT_ANALOG, L4_PORT);	outb(L4_SELECT_DIGITAL + (l4->port >> 2), L4_PORT);	if (inb(L4_PORT) & L4_BUSY) goto fail;	outb(l4->port & 3, L4_PORT);	if (l4_wait_ready()) goto fail;	status = inb(L4_PORT);	for (i = 0; i < 4; i++)		if (status & (1 << i)) {			if (l4_wait_ready()) goto fail;			axes[i] = inb(L4_PORT);			if (axes[i] > 252) axes[i] = -1;		}	if (status & 0x10) {		if (l4_wait_ready()) goto fail;		*buttons = inb(L4_PORT) & 0x0f;	}	result = 0;fail:	outb(L4_SELECT_ANALOG, L4_PORT);		return result;}static int l4_open(struct gameport *gameport, int mode){	struct l4 *l4 = gameport->private;        if (l4->port != 0 && mode != GAMEPORT_MODE_COOKED)		return -1;	outb(L4_SELECT_ANALOG, L4_PORT);	return 0;}/* * l4_getcal() reads the L4 with calibration values. */static int l4_getcal(int port, int *cal){	int i, result = -1;		outb(L4_SELECT_ANALOG, L4_PORT);	outb(L4_SELECT_DIGITAL + (port >> 2), L4_PORT);	if (inb(L4_PORT) & L4_BUSY) goto fail;	outb(L4_CMD_GETCAL, L4_PORT);	if (l4_wait_ready()) goto fail;	if (inb(L4_PORT) != L4_SELECT_DIGITAL + (port >> 2)) goto fail;	if (l4_wait_ready()) goto fail;        outb(port & 3, L4_PORT);	for (i = 0; i < 4; i++) {		if (l4_wait_ready()) goto fail;		cal[i] = inb(L4_PORT);	}	result = 0;fail:	outb(L4_SELECT_ANALOG, L4_PORT);	return result;}/* * l4_setcal() programs the L4 with calibration values. */static int l4_setcal(int port, int *cal){	int i, result = -1;	outb(L4_SELECT_ANALOG, L4_PORT);	outb(L4_SELECT_DIGITAL + (port >> 2), L4_PORT);	if (inb(L4_PORT) & L4_BUSY) goto fail;	outb(L4_CMD_SETCAL, L4_PORT);	if (l4_wait_ready()) goto fail;	if (inb(L4_PORT) != L4_SELECT_DIGITAL + (port >> 2)) goto fail;	if (l4_wait_ready()) goto fail;        outb(port & 3, L4_PORT);	for (i = 0; i < 4; i++) {		if (l4_wait_ready()) goto fail;		outb(cal[i], L4_PORT);	}	result = 0;fail:	outb(L4_SELECT_ANALOG, L4_PORT);	return result;}/* * l4_calibrate() calibrates the L4 for the attached device, so * that the device's resistance fits into the L4's 8-bit range. */static int l4_calibrate(struct gameport *gameport, int *axes, int *max){	int i, t;	int cal[4];	struct l4 *l4 = gameport->private;	if (l4_getcal(l4->port, cal))		return -1;	for (i = 0; i < 4; i++) {		t = (max[i] * cal[i]) / 200;		t = (t < 1) ? 1 : ((t > 255) ? 255 : t);		axes[i] = (axes[i] < 0) ? -1 : (axes[i] * cal[i]) / t;		axes[i] = (axes[i] > 252) ? 252 : axes[i];		cal[i] = t;	}	if (l4_setcal(l4->port, cal))		return -1;	return 0;}	int __init l4_init(void){	int cal[4] = {255,255,255,255};	int i, j, rev, cards = 0;	struct gameport *gameport;	struct l4 *l4;	if (!request_region(L4_PORT, 1, "lightning"))		return -1;	for (i = 0; i < 2; i++) {		outb(L4_SELECT_ANALOG, L4_PORT);		outb(L4_SELECT_DIGITAL + i, L4_PORT);		if (inb(L4_PORT) & L4_BUSY) continue;		outb(L4_CMD_ID, L4_PORT);		if (l4_wait_ready()) continue;		if (inb(L4_PORT) != L4_SELECT_DIGITAL + i) continue;		if (l4_wait_ready()) continue;		if (inb(L4_PORT) != L4_ID) continue;		if (l4_wait_ready()) continue;		rev = inb(L4_PORT);		if (!rev) continue;		if (!(l4_port[i * 4] = kmalloc(sizeof(struct l4) * 4, GFP_KERNEL))) {			printk(KERN_ERR "lightning: Out of memory allocating ports.\n");			continue;		}		memset(l4_port[i * 4], 0, sizeof(struct l4) * 4);		for (j = 0; j < 4; j++) {			l4 = l4_port[i * 4 + j] = l4_port[i * 4] + j;			l4->port = i * 4 + j;			gameport = &l4->gameport;			gameport->private = l4;			gameport->open = l4_open;			gameport->cooked_read = l4_cooked_read;			gameport->calibrate = l4_calibrate;			if (!i && !j)				gameport->io = L4_PORT;			if (rev > 0x28)		/* on 2.9+ the setcal command works correctly */				l4_setcal(l4->port, cal);						gameport_register_port(gameport);		}		printk(KERN_INFO "gameport%d,%d,%d,%d: PDPI Lightning 4 %s card v%d.%d at %#x\n",			l4_port[i * 4 + 0]->gameport.number, l4_port[i * 4 + 1]->gameport.number, 			l4_port[i * 4 + 2]->gameport.number, l4_port[i * 4 + 3]->gameport.number, 			i ? "secondary" : "primary", rev >> 4, rev, L4_PORT);		cards++;	}	outb(L4_SELECT_ANALOG, L4_PORT);	if (!cards) {		release_region(L4_PORT, 1);		return -1;	}	return 0;}void __init l4_exit(void){	int i;	int cal[4] = {59, 59, 59, 59};	for (i = 0; i < 8; i++)		if (l4_port[i]) {			l4_setcal(l4_port[i]->port, cal);			gameport_unregister_port(&l4_port[i]->gameport);		}	outb(L4_SELECT_ANALOG, L4_PORT);	release_region(L4_PORT, 1);}module_init(l4_init);module_exit(l4_exit);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区三区沐欲| 欧美激情艳妇裸体舞| 国产福利一区二区| 午夜精品久久久久久| 久久精品亚洲乱码伦伦中文| 欧美日韩高清在线播放| 99在线精品免费| 狠狠狠色丁香婷婷综合激情| 亚洲色图第一区| 欧美国产欧美综合| 日韩精品一区二区三区四区视频| 色综合久久久网| 国产91在线观看| 久久99久久久久久久久久久| 一二三区精品福利视频| 中文字幕亚洲一区二区va在线| 日韩手机在线导航| 欧美理论片在线| 欧美三级三级三级| 日本乱人伦aⅴ精品| 国产成人av电影在线| 久久国产麻豆精品| 日韩精品一二区| 五月天亚洲婷婷| 亚洲国产视频在线| 亚洲一区在线免费观看| 中文字幕字幕中文在线中不卡视频| 国产亚洲欧美日韩俺去了| 欧美一区二区三区啪啪| 欧美日韩国产高清一区| 欧美日韩国产一二三| 欧美色涩在线第一页| 在线亚洲+欧美+日本专区| 99视频精品免费视频| 91在线视频免费观看| 丰满亚洲少妇av| 成人黄色av电影| www..com久久爱| 97久久精品人人做人人爽| 99综合电影在线视频| 99久久综合国产精品| 91丨porny丨在线| 欧美在线视频日韩| 欧美日韩视频在线观看一区二区三区| 欧美日韩亚洲综合| 日韩午夜在线影院| 精品国产乱码久久久久久久久| 欧美r级电影在线观看| 久久夜色精品国产欧美乱极品| 精品国产凹凸成av人网站| 26uuu精品一区二区在线观看| 久久亚洲捆绑美女| 日本一区二区免费在线| 亚洲天堂精品在线观看| 亚洲国产精品久久久久秋霞影院| 亚洲v中文字幕| 久久精品国产精品亚洲综合| 国产一区二区三区四区在线观看 | 免费在线看一区| 久久狠狠亚洲综合| 成人精品电影在线观看| 欧美中文字幕一区| 精品免费视频一区二区| 国产精品久久久久久亚洲毛片 | 久久久久国产精品麻豆ai换脸| 国产欧美精品一区二区色综合| 国产精品不卡一区二区三区| 亚洲国产成人高清精品| 激情五月婷婷综合网| 成人性生交大片免费看中文| 欧美日韩中文另类| 精品国产三级电影在线观看| |精品福利一区二区三区| 亚洲成人综合在线| 国产成人自拍高清视频在线免费播放| 99在线精品一区二区三区| 欧美理论在线播放| 国产精品无码永久免费888| 亚洲国产日韩a在线播放| 国产福利电影一区二区三区| 欧美亚洲丝袜传媒另类| 久久久久久免费毛片精品| 亚洲黄色小视频| 国内精品免费在线观看| 欧美性色欧美a在线播放| 久久婷婷国产综合精品青草| 夜夜亚洲天天久久| 欧美精品一二三区| 国产午夜精品理论片a级大结局| 亚洲欧美国产77777| 亚洲成在人线免费| www.欧美色图| 欧美大胆一级视频| 亚洲黄色小说网站| 成人毛片老司机大片| 欧美一区二区私人影院日本| 国产精品免费久久久久| 免费成人在线影院| 欧美亚洲综合久久| 国产精品高潮呻吟久久| 美腿丝袜亚洲综合| 欧美日韩一区不卡| 亚洲欧美国产77777| 国产999精品久久久久久绿帽| 日韩一区二区在线观看| 一区二区成人在线| 97精品超碰一区二区三区| 久久久久国产成人精品亚洲午夜 | 久久99国产精品久久99果冻传媒| 日本福利一区二区| 国产精品理论片在线观看| 蓝色福利精品导航| 制服丝袜一区二区三区| 一区二区三区产品免费精品久久75| 国产传媒日韩欧美成人| 欧美tickling挠脚心丨vk| 日韩av网站免费在线| 欧美日韩国产首页| 亚洲国产欧美另类丝袜| 91成人国产精品| 中文字幕五月欧美| 91免费版在线看| 亚洲欧洲成人自拍| av网站一区二区三区| 中文字幕一区二区三区不卡在线| 国产福利视频一区二区三区| 久久男人中文字幕资源站| 国产美女娇喘av呻吟久久| 日韩丝袜情趣美女图片| 久久99精品久久久久久动态图 | 国产99一区视频免费| 久久中文娱乐网| 国产高清成人在线| 久久久久久久久久久久电影| 狠狠色丁香婷综合久久| 久久先锋资源网| 国产成人av电影| 最新国产の精品合集bt伙计| 一本色道久久综合亚洲aⅴ蜜桃 | 99久久精品国产麻豆演员表| 亚洲婷婷综合久久一本伊一区| 91在线丨porny丨国产| 一区二区三区在线免费| 欧美日韩综合在线| 日日夜夜一区二区| 欧美videos大乳护士334| 国产精一区二区三区| 国产精品色一区二区三区| 91麻豆123| 五月婷婷激情综合网| 精品奇米国产一区二区三区| 国产一区二区三区不卡在线观看| 国产清纯白嫩初高生在线观看91 | 91亚洲午夜精品久久久久久| 一区av在线播放| 日韩写真欧美这视频| 国产成人精品亚洲午夜麻豆| 国产精品高潮呻吟久久| 欧美日韩视频一区二区| 国产真实乱对白精彩久久| 国产精品网站一区| 在线一区二区三区四区五区| 男人的天堂亚洲一区| 欧美激情一区在线| 欧美影院一区二区三区| 麻豆成人在线观看| 亚洲欧美自拍偷拍| 欧美精品丝袜中出| 国产精品一区二区三区四区| 亚洲日本一区二区三区| 欧美一级视频精品观看| 成人午夜在线播放| 亚洲成av人片一区二区三区| 久久久久亚洲蜜桃| 欧美在线短视频| 久久精品av麻豆的观看方式| 国产欧美视频一区二区| 欧美日韩综合在线| 国产成人8x视频一区二区| 首页欧美精品中文字幕| 国产日产精品1区| 欧美精品久久99| 懂色av噜噜一区二区三区av| 亚洲国产综合人成综合网站| 国产午夜精品一区二区三区嫩草| 在线观看欧美黄色| 丰满少妇在线播放bd日韩电影| 亚洲成人你懂的| 中文字幕制服丝袜一区二区三区 | 亚洲免费观看在线视频| 日韩一区二区三区视频在线| 92精品国产成人观看免费| 极品尤物av久久免费看| 亚洲成在人线在线播放| 中文字幕一区二区日韩精品绯色| 日韩女优电影在线观看| 欧美综合一区二区| www.欧美色图| 国产经典欧美精品| 日本91福利区|