Fix the debug build and compile warnings.
[picodrive.git] / pico / sound / ym2612.c
index efe5054..b06007b 100644 (file)
@@ -139,6 +139,10 @@ void memset32(int *dest, int c, int count);
 #define INLINE static __inline\r
 #endif\r
 \r
+#ifndef STRICTINLINE\r
+#define STRICTINLINE static inline\r
+#endif\r
+\r
 #ifndef M_PI\r
 #define M_PI    3.14159265358979323846\r
 #endif\r
@@ -531,7 +535,7 @@ static int g_lfo_ampm = 0;
 \r
 \r
 /* OPN Mode Register Write */\r
-INLINE void set_timers( int v )\r
+static INLINE void set_timers( int v )\r
 {\r
        /* b7 = CSM MODE */\r
        /* b6 = 3 slot mode */\r
@@ -586,13 +590,13 @@ INLINE void set_det_mul(FM_CH *CH, FM_SLOT *SLOT, int v)
 }\r
 \r
 /* set total level */\r
-INLINE void set_tl(FM_SLOT *SLOT, int v)\r
+static INLINE void set_tl(FM_SLOT *SLOT, int v)\r
 {\r
        SLOT->tl = (v&0x7f)<<(ENV_BITS-7); /* 7bit TL */\r
 }\r
 \r
 /* set attack rate & key scale  */\r
-INLINE void set_ar_ksr(FM_CH *CH, FM_SLOT *SLOT, int v)\r
+static INLINE void set_ar_ksr(FM_CH *CH, FM_SLOT *SLOT, int v)\r
 {\r
        UINT8 old_KSR = SLOT->KSR;\r
 \r
@@ -624,7 +628,7 @@ INLINE void set_ar_ksr(FM_CH *CH, FM_SLOT *SLOT, int v)
 }\r
 \r
 /* set decay rate */\r
-INLINE void set_dr(FM_SLOT *SLOT, int v)\r
+static INLINE void set_dr(FM_SLOT *SLOT, int v)\r
 {\r
        int eg_sh_d1r, eg_sel_d1r;\r
 \r
@@ -637,7 +641,7 @@ INLINE void set_dr(FM_SLOT *SLOT, int v)
 }\r
 \r
 /* set sustain rate */\r
-INLINE void set_sr(FM_SLOT *SLOT, int v)\r
+static INLINE void set_sr(FM_SLOT *SLOT, int v)\r
 {\r
        int eg_sh_d2r, eg_sel_d2r;\r
 \r
@@ -650,7 +654,7 @@ INLINE void set_sr(FM_SLOT *SLOT, int v)
 }\r
 \r
 /* set release rate */\r
-INLINE void set_sl_rr(FM_SLOT *SLOT, int v)\r
+static INLINE void set_sl_rr(FM_SLOT *SLOT, int v)\r
 {\r
        int eg_sh_rr, eg_sel_rr;\r
 \r
@@ -664,8 +668,6 @@ INLINE void set_sl_rr(FM_SLOT *SLOT, int v)
        SLOT->eg_pack_rr = eg_inc_pack[eg_sel_rr] | (eg_sh_rr<<24);\r
 }\r
 \r
-\r
-\r
 INLINE signed int op_calc(UINT32 phase, unsigned int env, signed int pm)\r
 {\r
        int ret, sin = (phase>>16) + (pm>>1);\r
@@ -742,7 +744,7 @@ INLINE int advance_lfo(int lfo_ampm, UINT32 lfo_cnt_old, UINT32 lfo_cnt)
 #define EG_INC_VAL() \\r
        ((1 << ((pack >> ((eg_cnt>>shift)&7)*3)&7)) >> 1)\r
 \r
-INLINE UINT32 update_eg_phase(FM_SLOT *SLOT, UINT32 eg_cnt)\r
+STRICTINLINE UINT32 update_eg_phase(FM_SLOT *SLOT, UINT32 eg_cnt)\r
 {\r
        INT32 volume = SLOT->volume;\r
 \r
@@ -1201,7 +1203,7 @@ static int chan_render(int *buffer, int length, int c, UINT32 flags) // flags: s
 }\r
 \r
 /* update phase increment and envelope generator */\r
-INLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc)\r
+STRICTINLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc)\r
 {\r
        int ksr, fdt;\r
 \r
@@ -1250,7 +1252,7 @@ INLINE void refresh_fc_eg_slot(FM_SLOT *SLOT, int fc, int kc)
 }\r
 \r
 /* update phase increment counters */\r
-INLINE void refresh_fc_eg_chan(FM_CH *CH)\r
+void refresh_fc_eg_chan(FM_CH *CH)\r
 {\r
        if( CH->SLOT[SLOT1].Incr==-1){\r
                int fc = CH->fc;\r
@@ -1262,7 +1264,7 @@ INLINE void refresh_fc_eg_chan(FM_CH *CH)
        }\r
 }\r
 \r
-INLINE void refresh_fc_eg_chan_sl3(void)\r
+void refresh_fc_eg_chan_sl3(void)\r
 {\r
        if( ym2612.CH[2].SLOT[SLOT1].Incr==-1)\r
        {\r