some readme and general cleanups
[picodrive.git] / platform / linux / emu.c
index 591db8a..9e45fb1 100644 (file)
 \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
+#include "../common/version.h"\r
 \r
 #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
@@ -33,7 +31,7 @@ void pemu_validate_config(void)
 {\r
        extern int PicoOpt;\r
 //     PicoOpt &= ~POPT_EXT_FM;\r
-       PicoOpt &= ~POPT_EN_SVP_DRC;\r
+       PicoOpt &= ~POPT_EN_DRC;\r
 }\r
 \r
 // FIXME: dupes from GP2X, need cleanup\r
@@ -144,17 +142,8 @@ static void apply_renderer(void)
                break;\r
        }\r
 \r
-       if (PicoAHW & PAHW_32X) {\r
-               int only_32x = 0;\r
-               if (currentConfig.renderer == RT_16BIT)\r
-                       only_32x = 1;\r
-               else\r
-                       PicoDrawSetOutFormat(PDF_NONE, 0);\r
-               PicoDraw32xSetFrameMode(1, only_32x);\r
+       if (PicoAHW & PAHW_32X)\r
                PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
-       }\r
-       //PicoDraw32xSetFrameMode(0, 0);\r
-       //PicoDrawSetOutFormat(PDF_RGB555, 1);\r
 }\r
 \r
 void plat_video_toggle_renderer(int change, int is_menu)\r
@@ -200,7 +189,6 @@ void plat_update_volume(int has_changed, int is_up)
 void pemu_forced_frame(int no_scale, int do_emu)\r
 {\r
        PicoDrawSetOutBuf(g_screen_ptr, g_screen_width * 2);\r
-       PicoDraw32xSetFrameMode(0, 0);\r
        PicoDrawSetCallbacks(NULL, NULL);\r
        Pico.m.dirtyPal = 1;\r
 \r
@@ -209,43 +197,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 +216,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