diff options
Diffstat (limited to 'uisimulator')
-rw-r--r-- | uisimulator/sdl/sound.c | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/uisimulator/sdl/sound.c b/uisimulator/sdl/sound.c index 428983a1b8..aa689b921d 100644 --- a/uisimulator/sdl/sound.c +++ b/uisimulator/sdl/sound.c | |||
@@ -27,11 +27,15 @@ | |||
27 | #include "debug.h" | 27 | #include "debug.h" |
28 | #include "kernel.h" | 28 | #include "kernel.h" |
29 | #include "sound.h" | 29 | #include "sound.h" |
30 | #include "audiohw.h" | ||
30 | 31 | ||
31 | #include "pcm.h" | 32 | #include "pcm.h" |
32 | #include "pcm_sampr.h" | 33 | #include "pcm_sampr.h" |
33 | #include "SDL.h" | 34 | #include "SDL.h" |
34 | 35 | ||
36 | static int sim_volume = 0; | ||
37 | |||
38 | #if CONFIG_CODEC == SWCODEC | ||
35 | static int cvt_status = -1; | 39 | static int cvt_status = -1; |
36 | 40 | ||
37 | static Uint8* pcm_data; | 41 | static Uint8* pcm_data; |
@@ -347,3 +351,58 @@ void pcm_play_dma_init(void) | |||
347 | void pcm_postinit(void) | 351 | void pcm_postinit(void) |
348 | { | 352 | { |
349 | } | 353 | } |
354 | |||
355 | #endif /* CONFIG_CODEC == SWCODEC */ | ||
356 | |||
357 | /** | ||
358 | * Audio Hardware api. Make them do nothing as we cannot properly simulate with | ||
359 | * SDL. if we used DSP we would run code that doesn't actually run on the target | ||
360 | **/ | ||
361 | void audiohw_set_volume(int volume) | ||
362 | { | ||
363 | sim_volume = SDL_MIX_MAXVOLUME * ((volume - VOLUME_MIN) / 10) / (VOLUME_RANGE / 10); | ||
364 | } | ||
365 | #if defined(AUDIOHW_HAVE_PRESCALER) | ||
366 | void audiohw_set_prescaler(int value) { (void)value; } | ||
367 | #endif | ||
368 | #if defined(AUDIOHW_HAVE_BALANCE) | ||
369 | void audiohw_set_balance(int value) { (void)value; } | ||
370 | #endif | ||
371 | #if defined(AUDIOHW_HAVE_BASS) | ||
372 | void audiohw_set_bass(int value) { (void)value; } | ||
373 | #endif | ||
374 | #if defined(AUDIOHW_HAVE_TREBLE) | ||
375 | void audiohw_set_treble(int value) { (void)value; } | ||
376 | #endif | ||
377 | #if CONFIG_CODEC != SWCODEC | ||
378 | void audiohw_set_channel(int value) { (void)value; } | ||
379 | void audiohw_set_stereo_width(int value){ (void)value; } | ||
380 | #endif | ||
381 | #if defined(AUDIOHW_HAVE_BASS_CUTOFF) | ||
382 | void audiohw_set_bass_cutoff(value) { (void)value; } | ||
383 | #endif | ||
384 | #if defined(AUDIOHW_HAVE_TREBLE_CUTOFF) | ||
385 | void audiohw_set_treble_cutoff(value) { (void)value; } | ||
386 | #endif | ||
387 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | ||
388 | int mas_codec_readreg(int reg) | ||
389 | { | ||
390 | (void)reg; | ||
391 | return 0; | ||
392 | } | ||
393 | |||
394 | int mas_codec_writereg(int reg, unsigned int val) | ||
395 | { | ||
396 | (void)reg; | ||
397 | (void)val; | ||
398 | return 0; | ||
399 | } | ||
400 | int mas_writemem(int bank, int addr, const unsigned long* src, int len) | ||
401 | { | ||
402 | (void)bank; | ||
403 | (void)addr; | ||
404 | (void)src; | ||
405 | (void)len; | ||
406 | return 0; | ||
407 | } | ||
408 | #endif | ||