support multiple sound drivers
[picodrive.git] / platform / linux / emu.c
index 591db8a..25bb05c 100644 (file)
@@ -11,7 +11,6 @@
 \r
 #include "../libpicofe/menu.h"\r
 #include "../libpicofe/plat.h"\r
-#include "../libpicofe/linux/sndout_oss.h"\r
 #include "../common/emu.h"\r
 #include "../common/arm_utils.h"\r
 #include "version.h"\r
@@ -19,7 +18,6 @@
 #include <pico/pico_int.h>\r
 \r
 \r
-static short __attribute__((aligned(4))) sndBuffer[2*44100/50];\r
 const char *renderer_names[] = { "16bit accurate", " 8bit accurate", " 8bit fast", NULL };\r
 const char *renderer_names32x[] = { "accurate", "faster", "fastest", NULL };\r
 enum renderer_types { RT_16BIT, RT_8BIT_ACC, RT_8BIT_FAST, RT_COUNT };\r
@@ -209,43 +207,9 @@ void pemu_forced_frame(int no_scale, int do_emu)
        g_menubg_src_ptr = g_screen_ptr;\r
 }\r
 \r
-static void oss_write_nonblocking(int len)\r
-{\r
-       // sndout_oss_can_write() is not reliable, only use with no_frmlimit\r
-       if ((currentConfig.EmuOpt & EOPT_NO_FRMLIMIT) && !sndout_oss_can_write(len))\r
-               return;\r
-\r
-       sndout_oss_write_nb(PsndOut, len);\r
-}\r
-\r
 void pemu_sound_start(void)\r
 {\r
-       PsndOut = NULL;\r
-\r
-       if (currentConfig.EmuOpt & EOPT_EN_SOUND)\r
-       {\r
-               int is_stereo = (PicoOpt & POPT_EN_STEREO) ? 1 : 0;\r
-\r
-               PsndRerate(Pico.m.frame_count ? 1 : 0);\r
-\r
-               printf("starting audio: %i len: %i stereo: %i, pal: %i\n",\r
-                       PsndRate, PsndLen, is_stereo, Pico.m.pal);\r
-               sndout_oss_start(PsndRate, is_stereo, 1);\r
-               sndout_oss_setvol(currentConfig.volume, currentConfig.volume);\r
-               PicoWriteSound = oss_write_nonblocking;\r
-               plat_update_volume(0, 0);\r
-               memset(sndBuffer, 0, sizeof(sndBuffer));\r
-               PsndOut = sndBuffer;\r
-       }\r
-}\r
-\r
-void pemu_sound_stop(void)\r
-{\r
-}\r
-\r
-void pemu_sound_wait(void)\r
-{\r
-       // don't need to do anything, writes will block by themselves\r
+       emu_sound_start();\r
 }\r
 \r
 void plat_debug_cat(char *str)\r
@@ -262,14 +226,10 @@ void pemu_loop_prep(void)
 {\r
        apply_renderer();\r
        osd_text = osd_text16;\r
-\r
-       pemu_sound_start();\r
 }\r
 \r
 void pemu_loop_end(void)\r
 {\r
-       pemu_sound_stop();\r
-\r
        /* do one more frame for menu bg */\r
        pemu_forced_frame(0, 1);\r
 }\r