Beispiel #1
0
bool setsounddevice(int base, int irq, int dma, uint16_t samprate, uint16_t bufsize)
{
	SDL_AudioSpec wanted;
	bool result = false;
	
	wanted.freq = samprate;
	wanted.samples = bufsize;
	wanted.channels = 1;
	wanted.format = AUDIO_U8;
	wanted.userdata = NULL;
	wanted.callback = fill_audio;

#ifdef _VGL
	restorekeyb();
#endif

	if ((SDL_Init(SDL_INIT_AUDIO)) >= 0)
		if ((SDL_OpenAudio(&wanted, NULL)) >= 0)
			result = true;
	if (result == false)
		fprintf(stderr, "Couldn't open audio: %s\n", SDL_GetError());
	else {
		buf = malloc(bufsize);
		bsize = bufsize;
		wave_device_available = true;
	}

#ifdef _VGL
	initkeyb();
#endif

	return(result);
}
Beispiel #2
0
void UIAPI uispawnend()
/**********************/
{
    restorekeyb();
    if( MouseInstalled ) initmouse( TRUE );
    uiswap();
    _ui_refresh(1);
}
Beispiel #3
0
void finish(void)
{
  killsound();
  soundoff();
  soundkillglob();
  restorekeyb();
  graphicsoff();
}
Beispiel #4
0
void catcher(int num) {
	fprintf(stderr, "Signal %d catched, exitting\n", num);
	graphicsoff();
	restorekeyb();
	exit(0);
}