Mercurial > sdl-ios-xcode
comparison src/audio/mint/SDL_mintaudio.h @ 961:185acc07127a
Date: Fri, 29 Oct 2004 11:47:09 +0200
From: Patrice Mandin
Subject: Reworked audio drivers for Atari platform
These are reworked audio drivers for the Atari platform.
Previous drivers were missing some features:
- Test external clock plugged to DSP port on Atari Falcon 030.
- Ability to select internal or external clock.
So now, I generate a list of frequencies available, with the master clock
and predivisor to use. One big caveat to this: I do not have an external
clock, so I hope it works.
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Fri, 29 Oct 2004 09:56:53 +0000 |
parents | b8d311d90021 |
children | 39b5606fa543 |
comparison
equal
deleted
inserted
replaced
960:eec28a5278be | 961:185acc07127a |
---|---|
33 #include "SDL_mintaudio_stfa.h" | 33 #include "SDL_mintaudio_stfa.h" |
34 | 34 |
35 /* Hidden "this" pointer for the audio functions */ | 35 /* Hidden "this" pointer for the audio functions */ |
36 #define _THIS SDL_AudioDevice *this | 36 #define _THIS SDL_AudioDevice *this |
37 | 37 |
38 /* 16 predivisors with 3 clocks max. */ | |
39 #define MINTAUDIO_maxfreqs (16*3) | |
40 | |
41 typedef struct { | |
42 Uint32 frequency; | |
43 Uint32 masterclock; | |
44 Uint32 predivisor; | |
45 } mint_frequency_t; | |
46 | |
38 struct SDL_PrivateAudioData { | 47 struct SDL_PrivateAudioData { |
39 Uint32 hardfreq[16]; /* Array of replay freqs of the hardware */ | 48 mint_frequency_t frequencies[MINTAUDIO_maxfreqs]; |
40 int sfreq; /* First number of freq to use in the array */ | 49 int freq_count; /* Number of frequencies in the array */ |
41 int nfreq; /* Number of freqs to use in the array */ | |
42 int numfreq; /* Number of selected frequency */ | 50 int numfreq; /* Number of selected frequency */ |
43 }; | 51 }; |
44 | 52 |
45 /* Old variable names */ | 53 /* Old variable names */ |
46 #define MINTAUDIO_hardfreq (this->hidden->hardfreq) | 54 |
47 #define MINTAUDIO_sfreq (this->hidden->sfreq) | 55 #define MINTAUDIO_frequencies (this->hidden->frequencies) |
48 #define MINTAUDIO_nfreq (this->hidden->nfreq) | 56 #define MINTAUDIO_freqcount (this->hidden->freq_count) |
49 #define MINTAUDIO_numfreq (this->hidden->numfreq) | 57 #define MINTAUDIO_numfreq (this->hidden->numfreq) |
50 | 58 |
51 /* _MCH cookie (values>>16) */ | 59 /* _MCH cookie (values>>16) */ |
52 enum { | 60 enum { |
53 MCH_ST=0, | 61 MCH_ST=0, |
108 extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ | 116 extern Uint8 *SDL_MintAudio_audiobuf[2]; /* Pointers to buffers */ |
109 extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ | 117 extern unsigned long SDL_MintAudio_audiosize; /* Length of audio buffer=spec->size */ |
110 extern unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ | 118 extern unsigned short SDL_MintAudio_numbuf; /* Buffer to play */ |
111 extern unsigned short SDL_MintAudio_mutex; | 119 extern unsigned short SDL_MintAudio_mutex; |
112 extern cookie_stfa_t *SDL_MintAudio_stfa; | 120 extern cookie_stfa_t *SDL_MintAudio_stfa; |
121 extern unsigned long SDL_MintAudio_clocktics; | |
113 | 122 |
114 /* Functions */ | 123 /* Functions */ |
115 void SDL_MintAudio_Callback(void); | 124 void SDL_MintAudio_Callback(void); |
116 int SDL_MintAudio_SearchFrequency(_THIS, int falcon_codec, int desired_freq); | 125 void SDL_MintAudio_AddFrequency(_THIS, Uint32 frequency, Uint32 clock, Uint32 prediv); |
126 int SDL_MintAudio_SearchFrequency(_THIS, int desired_freq); | |
117 | 127 |
118 /* ASM interrupt functions */ | 128 /* ASM interrupt functions */ |
119 void SDL_MintAudio_GsxbInterrupt(void); | 129 void SDL_MintAudio_GsxbInterrupt(void); |
120 void SDL_MintAudio_EmptyGsxbInterrupt(void); | 130 void SDL_MintAudio_EmptyGsxbInterrupt(void); |
131 void SDL_MintAudio_XbiosInterruptMeasureClock(void); | |
121 void SDL_MintAudio_XbiosInterrupt(void); | 132 void SDL_MintAudio_XbiosInterrupt(void); |
122 void SDL_MintAudio_Dma8Interrupt(void); | 133 void SDL_MintAudio_Dma8Interrupt(void); |
123 void SDL_MintAudio_StfaInterrupt(void); | 134 void SDL_MintAudio_StfaInterrupt(void); |
124 | 135 |
125 #endif /* _SDL_mintaudio_h */ | 136 #endif /* _SDL_mintaudio_h */ |