optimizations, fixes, hacks, psp, ...
[picodrive.git] / platform / linux / 940ctl_ym2612.c
index 915ac0a..ee63458 100644 (file)
@@ -13,7 +13,7 @@
 #include "../gp2x/emu.h"
 #include "../gp2x/menu.h"
 #include "../gp2x/code940/940shared.h"
-#include "../gp2x/helix/pub/mp3dec.h"
+#include "../common/helix/pub/mp3dec.h"
 #include "../../Pico/PicoInt.h"
 
 
@@ -24,7 +24,7 @@ YM2612 *ym2612_940 = &ym2612;
 // static _940_data_t  shared_data_;
 static _940_ctl_t   shared_ctl_;
 // static _940_data_t *shared_data = &shared_data_;
-static _940_ctl_t  *shared_ctl = &shared_ctl_;
+_940_ctl_t  *shared_ctl = &shared_ctl_;
 
 unsigned char *mp3_mem = 0;
 
@@ -32,15 +32,6 @@ unsigned char *mp3_mem = 0;
 
 /***********************************************************/
 
-#define MAXOUT         (+32767)
-#define MINOUT         (-32768)
-
-/* limitter */
-#define Limit(val, max,min) { \
-       if ( val > max )      val = max; \
-       else if ( val < min ) val = min; \
-}
-
 
 int YM2612Write_940(unsigned int a, unsigned int v)
 {
@@ -49,19 +40,6 @@ int YM2612Write_940(unsigned int a, unsigned int v)
        return 0; // cause the engine to do updates once per frame only
 }
 
-UINT8 YM2612Read_940(void)
-{
-       return YM2612Read_();
-}
-
-
-int YM2612PicoTick_940(int n)
-{
-       YM2612PicoTick_(n);
-
-       return 0;
-}
-
 
 void YM2612PicoStateLoad_940(void)
 {
@@ -80,10 +58,18 @@ void YM2612PicoStateLoad_940(void)
 }
 
 
-void YM2612Init_940(int baseclock, int rate)
+void sharedmem_init(void)
 {
        mp3_mem = malloc(MP3_SIZE_MAX);
+}
+
+void sharedmem_deinit(void)
+{
+       free(mp3_mem);
+}
 
+void YM2612Init_940(int baseclock, int rate)
+{
        YM2612Init_(baseclock, rate);
 }
 
@@ -184,6 +170,12 @@ int YM2612UpdateOne_940(int *buffer, int length, int stereo, int is_buf_empty)
 }
 
 
+void mp3_update(int *buffer, int length, int stereo)
+{
+       // nothing..
+}
+
+
 /***********************************************************/
 
 void mp3_start_play(FILE *f, int pos) // pos is 0-1023
@@ -218,3 +210,4 @@ int mp3_get_offset(void)
        return 0;
 }
 
+