diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/talk.c | 32 |
1 files changed, 8 insertions, 24 deletions
diff --git a/apps/talk.c b/apps/talk.c index c7e2e035fd..bb074a5254 100644 --- a/apps/talk.c +++ b/apps/talk.c | |||
@@ -130,20 +130,6 @@ int talk_get_bufsize(void) | |||
130 | return voicefile_size; | 130 | return voicefile_size; |
131 | } | 131 | } |
132 | 132 | ||
133 | #ifdef SIMULATOR | ||
134 | static unsigned short BSWAP16(unsigned short value) | ||
135 | { | ||
136 | return (value >> 8) | (value << 8); | ||
137 | } | ||
138 | |||
139 | static unsigned long BSWAP32(unsigned long value) | ||
140 | { | ||
141 | unsigned long hi = BSWAP16(value >> 16); | ||
142 | unsigned long lo = BSWAP16(value & 0xffff); | ||
143 | return (lo << 16) | hi; | ||
144 | } | ||
145 | #endif | ||
146 | |||
147 | /* load the voice file into the mp3 buffer */ | 133 | /* load the voice file into the mp3 buffer */ |
148 | static void load_voicefile(void) | 134 | static void load_voicefile(void) |
149 | { | 135 | { |
@@ -173,13 +159,13 @@ static void load_voicefile(void) | |||
173 | if (got_size != load_size /* failure */) | 159 | if (got_size != load_size /* failure */) |
174 | goto load_err; | 160 | goto load_err; |
175 | 161 | ||
176 | #ifdef SIMULATOR | 162 | #ifdef ROCKBOX_LITTLE_ENDIAN |
177 | logf("Byte swapping voice file"); | 163 | logf("Byte swapping voice file"); |
178 | p_voicefile = (struct voicefile*)audiobuf; | 164 | p_voicefile = (struct voicefile*)audiobuf; |
179 | p_voicefile->version = BSWAP32(p_voicefile->version); | 165 | p_voicefile->version = swap32(p_voicefile->version); |
180 | p_voicefile->table = BSWAP32(p_voicefile->table); | 166 | p_voicefile->table = swap32(p_voicefile->table); |
181 | p_voicefile->id1_max = BSWAP32(p_voicefile->id1_max); | 167 | p_voicefile->id1_max = swap32(p_voicefile->id1_max); |
182 | p_voicefile->id2_max = BSWAP32(p_voicefile->id2_max); | 168 | p_voicefile->id2_max = swap32(p_voicefile->id2_max); |
183 | p_voicefile = NULL; | 169 | p_voicefile = NULL; |
184 | #endif | 170 | #endif |
185 | 171 | ||
@@ -196,13 +182,13 @@ static void load_voicefile(void) | |||
196 | else | 182 | else |
197 | goto load_err; | 183 | goto load_err; |
198 | 184 | ||
199 | #ifdef SIMULATOR | 185 | #ifdef ROCKBOX_LITTLE_ENDIAN |
200 | for (i = 0; i < p_voicefile->id1_max + p_voicefile->id2_max; i++) | 186 | for (i = 0; i < p_voicefile->id1_max + p_voicefile->id2_max; i++) |
201 | { | 187 | { |
202 | struct clip_entry *ce; | 188 | struct clip_entry *ce; |
203 | ce = &p_voicefile->index[i]; | 189 | ce = &p_voicefile->index[i]; |
204 | ce->offset = BSWAP32(ce->offset); | 190 | ce->offset = swap32(ce->offset); |
205 | ce->size = BSWAP32(ce->size); | 191 | ce->size = swap32(ce->size); |
206 | } | 192 | } |
207 | #endif | 193 | #endif |
208 | 194 | ||
@@ -691,8 +677,6 @@ int talk_value(long n, int unit, bool enqueue) | |||
691 | VOICE_KHZ, | 677 | VOICE_KHZ, |
692 | VOICE_DB, | 678 | VOICE_DB, |
693 | VOICE_PERCENT, | 679 | VOICE_PERCENT, |
694 | VOICE_MEGABYTE, | ||
695 | VOICE_GIGABYTE, | ||
696 | VOICE_MILLIAMPHOURS, | 680 | VOICE_MILLIAMPHOURS, |
697 | VOICE_PIXEL, | 681 | VOICE_PIXEL, |
698 | VOICE_PER_SEC, | 682 | VOICE_PER_SEC, |