|
|
1.1.1.2 root 1: /*
1.1 root 2: * UAE - The Un*x Amiga Emulator
3: *
4: * Support for Acorn RISC-OS sound
5: *
6: * Copyright 1996, 1997 Peter Teichmann
7: */
8:
9: #include "sysconfig.h"
10: #include "sysdeps.h"
11:
12: #include "config.h"
13: #include "options.h"
14: #include "memory.h"
1.1.1.3 ! root 15: #include "events.h"
1.1 root 16: #include "custom.h"
17: #include "audio.h"
18: #include "gensound.h"
19: #include "sounddep/sound.h"
20:
21: #include <math.h>
22:
23: extern int sratecode;
24: uae_u16 sndbuffer[44100];
25: uae_u16 *sndbufpt;
26: int sndbufsize;
27:
28: int init_sound (void)
29: {
1.1.1.2 root 30: int rate, dspbits;
1.1 root 31:
1.1.1.2 root 32: dspbits = sound_desired_bits;
33: rate = sound_desired_freq;
34: sratecode = 4096.0*log(rate/4096.0)/log(2.0);
35: sndbufsize = sound_desired_maxbsiz;
1.1 root 36:
1.1.1.3 ! root 37: scaled_sample_evtime = (unsigned long)maxhpos * maxvpos * vblank_hz * CYCLE_UNIT / rate;
! 38: scaled_sample_evtime_ok = 1;
! 39:
1.1.1.2 root 40: if (dspbits == 16)
41: {
42: init_sound_table16 ();
43: sample_handler = sample16_handler;
44: } else {
45: init_sound_table8 ();
46: sample_handler = sample8_handler;
47: }
48:
49: sound_available=1;
50: sndbufpt=sndbuffer;
1.1 root 51:
1.1.1.2 root 52: return 1;
1.1 root 53: }
54:
55: void close_sound(void)
56: {
57: }
58:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.