--- uae/src/sd-af/sound.c 2018/04/24 16:40:30 1.1 +++ uae/src/sd-af/sound.c 2018/04/24 17:17:33 1.1.1.5 @@ -1,22 +1,20 @@ - /* + /* * UAE - The Un*x Amiga Emulator - * + * * Support for the AF sound system - * + * * Copyright 1996 Marcus Sundberg */ #include "sysconfig.h" #include "sysdeps.h" -#include "config.h" #include "options.h" #include "memory.h" #include "custom.h" #include "audio.h" #include "gensound.h" #include "sounddep/sound.h" -#include "events.h" AFAudioConn *aud; AC ac; @@ -37,13 +35,13 @@ int init_sound (void) AFSetACAttributes attributes; AFDeviceDescriptor *aDev; int device; - + aud = AFOpenAudioConn(NULL); have_sound = !(aud == NULL); if (!have_sound) { return 0; } - + for(device = 0; device < ANumberOfAudioDevices(aud); device++) { aDev = AAudioDeviceDescriptor(aud, device); rate = aDev->playSampleFreq; @@ -56,15 +54,15 @@ int init_sound (void) if (device == ANumberOfAudioDevices(aud)) { return 0; } - + attributes.type = LIN16; ac = AFCreateAC(aud, device, ACEncodingType, &attributes); aftime = AFGetTime(ac); init_sound_table16 (); - eventtab[ev_sample].handler = sample16_handler; - sample_evtime = (long)maxhpos * maxvpos * 50 / rate; - + sample_handler = sample16_handler; + obtained_freq = rate; + sndbufpt = sndbuffer; sound_available = 1; printf ("Sound driver found and configured for %d bits at %d Hz, buffer is %d bytes\n", 16, rate, sndbufsize);