summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/spsound.c
diff options
context:
space:
mode:
authorAnton Romanov <theli@rockbox.org>2006-09-25 09:44:10 +0000
committerAnton Romanov <theli@rockbox.org>2006-09-25 09:44:10 +0000
commitec2a5cce1a4e3609535a9ae902a80933fbb0f341 (patch)
treebd2874b573d5b29ba695e1f13c7ee5d908a473e6 /apps/plugins/zxbox/spsound.c
parent52f4c4c82bb038f3704007016a5df1639c6af443 (diff)
downloadrockbox-ec2a5cce1a4e3609535a9ae902a80933fbb0f341.tar.gz
rockbox-ec2a5cce1a4e3609535a9ae902a80933fbb0f341.zip
yet more code cleanup, quick snapshot feature,sound should no longer crash,light optimizations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11041 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/zxbox/spsound.c')
-rw-r--r--apps/plugins/zxbox/spsound.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/apps/plugins/zxbox/spsound.c b/apps/plugins/zxbox/spsound.c
index 3ff2690d00..c99c1e6729 100644
--- a/apps/plugins/zxbox/spsound.c
+++ b/apps/plugins/zxbox/spsound.c
@@ -63,7 +63,7 @@ static int last_not_played=0;
63static int sndstate = SPS_CLOSED; 63static int sndstate = SPS_CLOSED;
64 64
65static void close_snd(int normal); 65static void close_snd(int normal);
66unsigned short my_buf[TMNUM*2*3*2] IBSS_ATTR; 66unsigned short my_buf[TMNUM*2*3*2];
67 67
68 68
69const byte lin8_ulaw[] = { 69const byte lin8_ulaw[] = {
@@ -128,8 +128,6 @@ void init_spect_sound(void)
128} 128}
129 129
130 130
131//#define VOLREDUCE settings.volume
132//
133#ifndef VOLREDUCE 131#ifndef VOLREDUCE
134#define VOLREDUCE 0 132#define VOLREDUCE 0
135#endif 133#endif
@@ -190,8 +188,9 @@ void autoclose_sound(void)
190void get_more(unsigned char** start, size_t* size) 188void get_more(unsigned char** start, size_t* size)
191{ 189{
192 doneplay = 1; 190 doneplay = 1;
193 *start = (unsigned char*)(my_buf); 191 rb->pcm_play_stop();
194 *size = TMNUM*4*3*2; 192 (void)*start;
193 (void)*size;
195} 194}
196 195
197/* sp_sound_buf is Unsigned 8 bit, Rate 8000 Hz, Mono */ 196/* sp_sound_buf is Unsigned 8 bit, Rate 8000 Hz, Mono */
@@ -216,7 +215,7 @@ void write_buf(void){
216 = my_buf[j+10] = my_buf[j+11] \ 215 = my_buf[j+10] = my_buf[j+11] \
217 = (((byte)sp_sound_buf[i])<<8) >> settings.volume; 216 = (((byte)sp_sound_buf[i])<<8) >> settings.volume;
218 217
219 rb->pcm_play_data(&get_more,NULL,0); 218 rb->pcm_play_data(&get_more,(unsigned char*)(my_buf),TMNUM*4*3*2);
220 219
221#if 0 220#if 0
222 /* can use to save and later analyze what we produce */ 221 /* can use to save and later analyze what we produce */