--- uae/src/sd-file/sound.c 2018/04/24 16:40:30 1.1.1.1 +++ uae/src/sd-file/sound.c 2018/04/24 17:20:44 1.1.1.5 @@ -1,22 +1,20 @@ - /* + /* * UAE - The Un*x Amiga Emulator - * + * * Support for Linux/USS sound - * + * * Copyright 1997 Bernd Schmidt */ #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" #include #include @@ -44,10 +42,10 @@ void close_sound(void) int t; uae_u32 v; char buf[4]; - + if (!have_sound) return; - + t = 0; v = sndbuf_written; buf[t] = v & 255; @@ -95,7 +93,7 @@ int init_sound (void) buf[t+2] = (v>>16) & 255; buf[t+3] = (v>>24) & 255; - t = 20; v = 0x00010001 + (currprefs.stereo ? 0x10000 : 0); + t = 20; v = 0x00010001 + (/* currprefs.stereo */ 1 ? 0x10000 : 0); buf[t] = v & 255; buf[t+1] = (v>>8) & 255; buf[t+2] = (v>>16) & 255; @@ -106,33 +104,26 @@ int init_sound (void) buf[t+1] = (v>>8) & 255; buf[t+2] = (v>>16) & 255; buf[t+3] = (v>>24) & 255; - t = 32; v = ((currprefs.sound_bits == 8 ? 1 : 2) - * (currprefs.stereo ? 2 : 1)) + 65536*currprefs.sound_bits; + t = 32; v = (2 * 2) + 65536 * 16; buf[t] = v & 255; buf[t+1] = (v>>8) & 255; buf[t+2] = (v>>16) & 255; buf[t+3] = (v>>24) & 255; - t = 28; v = (currprefs.sound_freq * (currprefs.sound_bits == 8 ? 1 : 2) - * (currprefs.stereo ? 2 : 1)); + t = 28; v = (currprefs.sound_freq * 2 * 2); buf[t] = v & 255; buf[t+1] = (v>>8) & 255; buf[t+2] = (v>>16) & 255; buf[t+3] = (v>>24) & 255; write (sound_fd, buf, 44); - sample_evtime = (long)maxhpos * maxvpos * 50 / currprefs.sound_freq; + obtained_freq = currprefs.sound_freq; - if (currprefs.sound_bits == 16) { - init_sound_table16 (); - eventtab[ev_sample].handler = currprefs.stereo ? sample16s_handler : sample16_handler; - } else { - init_sound_table8 (); - eventtab[ev_sample].handler = currprefs.stereo ? sample8s_handler : sample8_handler; - } + init_sound_table16 (); + sample_handler = sample16s_handler; sound_available = 1; sndbufsize = 44100; - printf ("Writing sound into \"sound.output\"; %d bits at %d Hz\n", - currprefs.sound_bits, currprefs.sound_freq, sndbufsize); + printf ("Writing sound into \"sound.output\"; 16 bits at %d Hz\n", + currprefs.sound_freq, sndbufsize); sndbufpt = sndbuffer; return 1; }