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

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

?? id_sd.c

?? Wolf 3D official source code.
?? C
?? 第 1 頁 / 共 4 頁
字號:

			// Turn SB Pro stereo DAC off
			sbOut(sbpMixerAddr,sbpmControl);
			sbOut(sbpMixerData,0);				// 0=off,2=on
		}
	}
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_ShutSB() - Turns off the SoundBlaster
//
///////////////////////////////////////////////////////////////////////////
static void
SDL_ShutSB(void)
{
	SDL_SBStopSample();

	if (SBProPresent)
	{
		// Restore FM output levels (SB Pro)
		sbOut(sbpMixerAddr,sbpmFMVol);
		sbOut(sbpMixerData,sbpOldFMMix);

		// Restore Voice output levels (SB Pro)
		sbOut(sbpMixerAddr,sbpmVoiceVol);
		sbOut(sbpMixerData,sbpOldVOCMix);
	}

	setvect(sbIntVec,sbOldIntHand);		// Set vector back
}

//	Sound Source Code

///////////////////////////////////////////////////////////////////////////
//
//	SDL_SSStopSample() - Stops a sample playing on the Sound Source
//
///////////////////////////////////////////////////////////////////////////
#ifdef	_MUSE_
void
#else
static void
#endif
SDL_SSStopSample(void)
{
asm	pushf
asm	cli

	(long)ssSample = 0;

asm	popf
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_SSService() - Handles playing the next sample on the Sound Source
//
///////////////////////////////////////////////////////////////////////////
static void
SDL_SSService(void)
{
	boolean	gotit;
	byte	v;

	while (ssSample)
	{
	asm	mov		dx,[ssStatus]	// Check to see if FIFO is currently empty
	asm	in		al,dx
	asm	test	al,0x40
	asm	jnz		done			// Nope - don't push any more data out

		v = *ssSample++;
		if (!(--ssLengthLeft))
		{
			(long)ssSample = 0;
			SDL_DigitizedDone();
		}

	asm	mov		dx,[ssData]		// Pump the value out
	asm	mov		al,[v]
	asm	out		dx,al

	asm	mov		dx,[ssControl]	// Pulse printer select
	asm	mov		al,[ssOff]
	asm	out		dx,al
	asm	push	ax
	asm	pop		ax
	asm	mov		al,[ssOn]
	asm	out		dx,al

	asm	push	ax				// Delay a short while
	asm	pop		ax
	asm	push	ax
	asm	pop		ax
	}
done:;
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_SSPlaySample() - Plays the specified sample on the Sound Source
//
///////////////////////////////////////////////////////////////////////////
#ifdef	_MUSE_
void
#else
static void
#endif
SDL_SSPlaySample(byte huge *data,longword len)
{
asm	pushf
asm	cli

	ssLengthLeft = len;
	ssSample = (volatile byte far *)data;

asm	popf
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_StartSS() - Sets up for and turns on the Sound Source
//
///////////////////////////////////////////////////////////////////////////
static void
SDL_StartSS(void)
{
	if (ssPort == 3)
		ssControl = 0x27a;	// If using LPT3
	else if (ssPort == 2)
		ssControl = 0x37a;	// If using LPT2
	else
		ssControl = 0x3be;	// If using LPT1
	ssStatus = ssControl - 1;
	ssData = ssStatus - 1;

	ssOn = 0x04;
	if (ssIsTandy)
		ssOff = 0x0e;				// Tandy wierdness
	else
		ssOff = 0x0c;				// For normal machines

	outportb(ssControl,ssOn);		// Enable SS
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_ShutSS() - Turns off the Sound Source
//
///////////////////////////////////////////////////////////////////////////
static void
SDL_ShutSS(void)
{
	outportb(ssControl,ssOff);
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_CheckSS() - Checks to see if a Sound Source is present at the
//		location specified by the sound source variables
//
///////////////////////////////////////////////////////////////////////////
static boolean
SDL_CheckSS(void)
{
	boolean		present = false;
	longword	lasttime;

	// Turn the Sound Source on and wait awhile (4 ticks)
	SDL_StartSS();

	lasttime = TimeCount;
	while (TimeCount < lasttime + 4)
		;

asm	mov		dx,[ssStatus]	// Check to see if FIFO is currently empty
asm	in		al,dx
asm	test	al,0x40
asm	jnz		checkdone		// Nope - Sound Source not here

asm	mov		cx,32			// Force FIFO overflow (FIFO is 16 bytes)
outloop:
asm	mov		dx,[ssData]		// Pump a neutral value out
asm	mov		al,0x80
asm	out		dx,al

asm	mov		dx,[ssControl]	// Pulse printer select
asm	mov		al,[ssOff]
asm	out		dx,al
asm	push	ax
asm	pop		ax
asm	mov		al,[ssOn]
asm	out		dx,al

asm	push	ax				// Delay a short while before we do this again
asm	pop		ax
asm	push	ax
asm	pop		ax

asm	loop	outloop

asm	mov		dx,[ssStatus]	// Is FIFO overflowed now?
asm	in		al,dx
asm	test	al,0x40
asm	jz		checkdone		// Nope, still not - Sound Source not here

	present = true;			// Yes - it's here!

checkdone:
	SDL_ShutSS();
	return(present);
}

static boolean
SDL_DetectSoundSource(void)
{
	for (ssPort = 1;ssPort <= 3;ssPort++)
		if (SDL_CheckSS())
			return(true);
	return(false);
}

//
//	PC Sound code
//

///////////////////////////////////////////////////////////////////////////
//
//	SDL_PCPlaySample() - Plays the specified sample on the PC speaker
//
///////////////////////////////////////////////////////////////////////////
#ifdef	_MUSE_
void
#else
static void
#endif
SDL_PCPlaySample(byte huge *data,longword len)
{
asm	pushf
asm	cli

	SDL_IndicatePC(true);

	pcLengthLeft = len;
	pcSound = (volatile byte far *)data;

asm	popf
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_PCStopSample() - Stops a sample playing on the PC speaker
//
///////////////////////////////////////////////////////////////////////////
#ifdef	_MUSE_
void
#else
static void
#endif
SDL_PCStopSample(void)
{
asm	pushf
asm	cli

	(long)pcSound = 0;

	SDL_IndicatePC(false);

asm	in	al,0x61		  	// Turn the speaker off
asm	and	al,0xfd			// ~2
asm	out	0x61,al

asm	popf
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_PCPlaySound() - Plays the specified sound on the PC speaker
//
///////////////////////////////////////////////////////////////////////////
#ifdef	_MUSE_
void
#else
static void
#endif
SDL_PCPlaySound(PCSound far *sound)
{
asm	pushf
asm	cli

	pcLastSample = -1;
	pcLengthLeft = sound->common.length;
	pcSound = sound->data;

asm	popf
}

///////////////////////////////////////////////////////////////////////////
//
//	SDL_PCStopSound() - Stops the current sound playing on the PC Speaker
//
///////////////////////////////////////////////////////////////////////////
#ifdef	_MUSE_
void
#else
static void
#endif
SDL_PCStopSound(void)
{
asm	pushf
asm	cli

	(long)pcSound = 0;

asm	in	al,0x61		  	// Turn the speaker off
asm	and	al,0xfd			// ~2
asm	out	0x61,al

asm	popf
}

#if 0
///////////////////////////////////////////////////////////////////////////
//
//	SDL_PCService() - Handles playing the next sample in a PC sound
//
///////////////////////////////////////////////////////////////////////////
static void
SDL_PCService(void)
{
	byte	s;
	word	t;

	if (pcSound)
	{
		s = *pcSound++;
		if (s != pcLastSample)
		{
		asm	pushf
		asm	cli

			pcLastSample = s;
			if (s)					// We have a frequency!
			{
				t = pcSoundLookup[s];
			asm	mov	bx,[t]

			asm	mov	al,0xb6			// Write to channel 2 (speaker) timer
			asm	out	43h,al
			asm	mov	al,bl
			asm	out	42h,al			// Low byte
			asm	mov	al,bh
			asm	out	42h,al			// High byte

			asm	in	al,0x61			// Turn the speaker & gate on
			asm	or	al,3
			asm	out	0x61,al
			}
			else					// Time for some silence
			{
			asm	in	al,0x61		  	// Turn the speaker & gate off
			asm	and	al,0xfc			// ~3
			asm	out	0x61,al
			}

		asm	popf
		}

		if (!(--pcLengthLeft))
		{
			SDL_PCStopSound();
			SDL_SoundFinished();
		}
	}
}
#endif

///////////////////////////////////////////////////////////////////////////
//
//	SDL_ShutPC() - Turns off the pc speaker
//
///////////////////////////////////////////////////////////////////////////
static void
SDL_ShutPC(void)
{
asm	pushf
asm	cli

	pcSound = 0;

asm	in	al,0x61		  	// Turn the speaker & gate off
asm	and	al,0xfc			// ~3
asm	out	0x61,al

asm	popf
}

//
//	Stuff for digitized sounds
//
memptr
SDL_LoadDigiSegment(word page)
{
	memptr	addr;

#if 0	// for debugging
asm	mov	dx,STATUS_REGISTER_1
asm	in	al,dx
asm	mov	dx,ATR_INDEX
asm	mov	al,ATR_OVERSCAN
asm	out	dx,al
asm	mov	al,10	// bright green
asm	out	dx,al
#endif

	addr = PM_GetSoundPage(page);
	PM_SetPageLock(PMSoundStart + page,pml_Locked);

#if 0	// for debugging
asm	mov	dx,STATUS_REGISTER_1
asm	in	al,dx
asm	mov	dx,ATR_INDEX
asm	mov	al,ATR_OVERSCAN
asm	out	dx,al
asm	mov	al,3	// blue
asm	out	dx,al
asm	mov	al,0x20	// normal
asm	out	dx,al
#endif

	return(addr);
}

void
SDL_PlayDigiSegment(memptr addr,word len)
{
	switch (DigiMode)
	{
	case sds_PC:
    	SDL_PCPlaySample(addr,len);
		break;
	case sds_SoundSource:
		SDL_SSPlaySample(addr,len);
		break;
	case sds_SoundBlaster:
		SDL_SBPlaySample(addr,len);
		break;
	}
}

void
SD_StopDigitized(void)
{
	int	i;

asm	pushf
asm	cli

	DigiLeft = 0;
	DigiNextAddr = nil;
	DigiNextLen = 0;
	DigiMissed = false;
	DigiPlaying = false;
	DigiNumber = DigiPriority = 0;
	SoundPositioned = false;
	if ((DigiMode == sds_PC) && (SoundMode == sdm_PC))
		SDL_SoundFinished();

	switch (DigiMode)
	{
	case sds_PC:
		SDL_PCStopSample();
		break;
	case sds_SoundSource:
		SDL_SSStopSample();
		break;
	case sds_SoundBlaster:
		SDL_SBStopSample();
		break;
	}

asm	popf

	for (i = DigiLastStart;i < DigiLastEnd;i++)
		PM_SetPageLock(i + PMSoundStart,pml_Unlocked);
	DigiLastStart = 1;
	DigiLastEnd = 0;
}

void
SD_Poll(void)
{
	if (DigiLeft && !DigiNextAddr)
	{
		DigiNextLen = (DigiLeft >= PMPageSize)? PMPageSize : (DigiLeft % PMPageSize);
		DigiLeft -= DigiNextLen;
		if (!DigiLeft)
			DigiLastSegment = true;
		DigiNextAddr = SDL_LoadDigiSegment(DigiPage++);
	}
	if (DigiMissed && DigiNextAddr)
	{
		SDL_PlayDigiSegment(DigiNextAddr,DigiNextLen);
		DigiNextAddr = nil;
		DigiMissed = false;
		if (DigiLastSegment)
		{
			DigiPlaying = false;
			DigiLastSegment = false;
		}
	}
	SDL_SetTimerSpeed();
}

void
SD_SetPosition(int leftpos,int rightpos)
{
	if
	(
		(leftpos < 0)
	||	(leftpos > 15)
	||	(rightpos < 0)
	||	(rightpos > 15)
	||	((leftpos == 15) && (rightpos == 15))
	)
		Quit("SD_SetPosition: Illegal position");

	switch (DigiMode)
	{
	case sds_SoundBlaster:
		SDL_PositionSBP(leftpos,rightpos);
		break;
	}
}

void
SD_PlayDigitized(word which,int leftpos,int rightpos)
{
	word	len;
	memptr	addr;

	if (!DigiMode)
		return;

	SD_StopDigitized();
	if (which >= NumDigi)
		Quit("SD_PlayDigitized: bad sound number");

	SD_SetPosition(leftpos,rightpos);

	DigiPage = DigiList[(which * 2) + 0];
	DigiLeft = DigiList[(which * 2) + 1];

	DigiLastStart = DigiPage;
	DigiLastEnd = DigiPage + ((DigiLeft + (PMPageSize - 1)) / PMPageSize);

	len = (DigiLeft >= PMPageSize)? PMPageSize : (DigiLeft % PMPageSize);
	addr = SDL_LoadDigiSegment(DigiPage++);

	DigiPlaying = true;
	DigiLastSegment = false;

	SDL_PlayDigiSegment(addr,len);
	DigiLeft -= len;
	if (!DigiLeft)
		DigiLastSegment = true;

	SD_Poll();
}

void
SDL_DigitizedDone(void)
{
	if (DigiNextAddr)
	{
		SDL_PlayDigiSegment(DigiNextAddr,DigiNextLen);
		DigiNextAddr = nil;
		DigiMissed = false;
	}
	else
	{
		if (DigiLastSegment)
		{
			DigiPlaying = false;
			DigiLastSegment = false;
			if ((DigiMode == sds_PC) && (SoundMode == sdm_PC))
			{
				SDL_SoundFinished();
			}
			else
				DigiNumber = DigiPriority = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图制服丝袜| 国产精品亚洲а∨天堂免在线| 麻豆国产一区二区| 91网站在线观看视频| 日韩欧美亚洲一区二区| 樱桃国产成人精品视频| 精品一区二区免费看| 日本高清无吗v一区| 欧美国产欧美综合| 强制捆绑调教一区二区| 一本色道**综合亚洲精品蜜桃冫| 久久视频一区二区| 乱一区二区av| 777午夜精品视频在线播放| 亚洲欧美aⅴ...| 成人三级伦理片| 久久久国产精品午夜一区ai换脸| 亚洲午夜羞羞片| 欧美伊人久久久久久久久影院| 中文字幕不卡一区| 国产成人精品在线看| ww久久中文字幕| 另类的小说在线视频另类成人小视频在线 | 久久精品国产亚洲高清剧情介绍 | 不卡电影一区二区三区| 2017欧美狠狠色| 老司机免费视频一区二区| 在线不卡免费av| 蜜臀久久99精品久久久画质超高清 | 国产成人精品免费一区二区| 日韩你懂的电影在线观看| 免费观看久久久4p| 日韩三级免费观看| 国产真实精品久久二三区| 欧美tickling挠脚心丨vk| 免费成人av在线播放| 91精品国产色综合久久不卡电影| 亚洲自拍欧美精品| 欧美色国产精品| 免费看欧美美女黄的网站| 日韩一区二区免费电影| 精品一区二区三区香蕉蜜桃| 精品电影一区二区| 国产精品一区一区三区| 国产精品另类一区| 91麻豆精品秘密| 香蕉久久一区二区不卡无毒影院| 欧美欧美午夜aⅴ在线观看| 免费成人在线视频观看| 精品国产一区二区三区久久影院 | 99天天综合性| 亚洲国产视频直播| 日韩女优av电影| 成人一区在线观看| 亚洲精品中文在线| 在线播放中文字幕一区| 国产原创一区二区| 亚洲丝袜美腿综合| 欧美性色黄大片| 裸体在线国模精品偷拍| 国产日本欧美一区二区| 91成人免费电影| 国产一区二区三区精品欧美日韩一区二区三区 | 色综合色综合色综合 | 91精品国产手机| 国产成人综合在线播放| 亚洲自拍偷拍av| 久久久久国产免费免费| 在线观看视频91| 国产精品一区二区视频| 夜夜揉揉日日人人青青一国产精品 | 欧美日韩久久久| 国产美女精品人人做人人爽| 亚洲免费观看在线视频| 日韩欧美国产电影| 在线观看成人小视频| 国产一区二区三区免费| 亚洲伊人伊色伊影伊综合网| 久久综合色8888| 欧美一区二区三区免费在线看| 99国内精品久久| 麻豆国产精品官网| 亚洲成人福利片| 亚洲日本乱码在线观看| 久久精品网站免费观看| 欧美日韩国产高清一区二区 | 国产乱码字幕精品高清av | 日韩午夜小视频| 在线国产亚洲欧美| 波多野结衣精品在线| 狠狠色综合播放一区二区| 亚洲丰满少妇videoshd| 亚洲四区在线观看| 国产精品国产馆在线真实露脸 | 亚洲国产精品一区二区尤物区| 中文一区一区三区高中清不卡| 日韩欧美国产小视频| 欧美亚洲丝袜传媒另类| a亚洲天堂av| 白白色 亚洲乱淫| 国产精品一色哟哟哟| 国产美女视频91| 国产综合一区二区| 精品无人码麻豆乱码1区2区 | 久久综合九色欧美综合狠狠| 欧美日韩中文精品| 欧美午夜片在线看| 色视频一区二区| 99综合电影在线视频| aaa亚洲精品一二三区| 国产精品99久久久久久久女警| 久草精品在线观看| 老司机精品视频导航| 久久精品国产色蜜蜜麻豆| 蜜桃一区二区三区在线观看| 日韩电影免费在线| 玖玖九九国产精品| 国产尤物一区二区在线| 国产精品一区二区视频| 成人综合在线观看| 97成人超碰视| 精品视频一区二区不卡| 日韩一区二区在线看| 精品黑人一区二区三区久久| wwwwxxxxx欧美| 国产欧美日韩不卡免费| 亚洲欧洲日韩在线| 一区二区三区不卡在线观看| 亚洲一区二区三区三| 日本va欧美va精品发布| 国产美女在线观看一区| www.日本不卡| 欧美精品一级二级| 欧美xxxxxxxxx| 中文字幕在线不卡视频| 亚洲一区二三区| 久久精品av麻豆的观看方式| 国产精品一线二线三线精华| 99在线精品视频| 91精品欧美福利在线观看| 久久精品视频在线免费观看| 亚洲日韩欧美一区二区在线| 天天影视网天天综合色在线播放| 老司机精品视频线观看86| 成人美女在线视频| 欧美日韩一区二区欧美激情| 久久综合色天天久久综合图片| 国产精品伦理在线| 日韩二区在线观看| 成人精品在线视频观看| 欧美日韩大陆在线| 久久久久国产精品厨房| 一区av在线播放| 国产精品一区二区不卡| 精品视频一区二区三区免费| 久久久激情视频| 性做久久久久久久免费看| 成人晚上爱看视频| 欧美一区二区三区小说| 亚洲欧美一区二区在线观看| 男男gaygay亚洲| 色综合色狠狠天天综合色| xnxx国产精品| 日本午夜一区二区| 色婷婷综合久色| 久久久国际精品| 日本一道高清亚洲日美韩| 91免费看片在线观看| 久久综合色综合88| 日本不卡一二三| 日本韩国一区二区三区视频| 国产色婷婷亚洲99精品小说| 日韩**一区毛片| 欧美日韩性生活| 久久狠狠亚洲综合| 在线精品亚洲一区二区不卡| 日本一区二区成人| 国产自产高清不卡| 欧美一级黄色片| 午夜精品久久久久久久蜜桃app| av激情亚洲男人天堂| 久久久久亚洲蜜桃| 久久国产夜色精品鲁鲁99| 7777精品伊人久久久大香线蕉的 | 亚洲国产经典视频| 激情偷乱视频一区二区三区| 欧美浪妇xxxx高跟鞋交| 亚洲综合网站在线观看| 91在线播放网址| 国产精品久久久久久久岛一牛影视| 麻豆精品在线看| 日韩三级视频在线看| 日本成人在线看| 欧美一区二区精美| 日本美女一区二区三区视频| 欧美日韩国产另类不卡| 日韩精品欧美精品| 日韩精品自拍偷拍| 久久99精品久久久久| 精品国产乱码久久久久久久久 |