]> Git Repo - qemu.git/blobdiff - hw/audio/fmopl.c
xen: use libxendevice model to restrict operations
[qemu.git] / hw / audio / fmopl.c
index 290a224edc0d7fcb172344989339f873d0493298..731110fe86ab1a167115d175332fb8eedddcd6fd 100644 (file)
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#define INLINE         static inline
 #define HAS_YM3812     1
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
+#include "qemu/osdep.h"
 #include <math.h>
 //#include "driver.h"          /* use M.A.M.E. */
 #include "fmopl.h"
@@ -247,7 +243,7 @@ static INT32 feedback2;             /* connect for SLOT 2 */
 
 /* --------------------- subroutines  --------------------- */
 
-INLINE int Limit( int val, int max, int min ) {
+static inline int Limit( int val, int max, int min ) {
        if ( val > max )
                val = max;
        else if ( val < min )
@@ -257,7 +253,7 @@ INLINE int Limit( int val, int max, int min ) {
 }
 
 /* status set and IRQ handling */
-INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag)
+static inline void OPL_STATUS_SET(FM_OPL *OPL,int flag)
 {
        /* set status flag */
        OPL->status |= flag;
@@ -273,7 +269,7 @@ INLINE void OPL_STATUS_SET(FM_OPL *OPL,int flag)
 }
 
 /* status reset and IRQ handling */
-INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag)
+static inline void OPL_STATUS_RESET(FM_OPL *OPL,int flag)
 {
        /* reset status flag */
        OPL->status &=~flag;
@@ -289,7 +285,7 @@ INLINE void OPL_STATUS_RESET(FM_OPL *OPL,int flag)
 }
 
 /* IRQ mask set */
-INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag)
+static inline void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag)
 {
        OPL->statusmask = flag;
        /* IRQ handling check */
@@ -298,7 +294,7 @@ INLINE void OPL_STATUSMASK_SET(FM_OPL *OPL,int flag)
 }
 
 /* ----- key on  ----- */
-INLINE void OPL_KEYON(OPL_SLOT *SLOT)
+static inline void OPL_KEYON(OPL_SLOT *SLOT)
 {
        /* sin wave restart */
        SLOT->Cnt = 0;
@@ -309,7 +305,7 @@ INLINE void OPL_KEYON(OPL_SLOT *SLOT)
        SLOT->eve = EG_AED;
 }
 /* ----- key off ----- */
-INLINE void OPL_KEYOFF(OPL_SLOT *SLOT)
+static inline void OPL_KEYOFF(OPL_SLOT *SLOT)
 {
        if( SLOT->evm > ENV_MOD_RR)
        {
@@ -325,7 +321,7 @@ INLINE void OPL_KEYOFF(OPL_SLOT *SLOT)
 
 /* ---------- calcrate Envelope Generator & Phase Generator ---------- */
 /* return : envelope output */
-INLINE UINT32 OPL_CALC_SLOT( OPL_SLOT *SLOT )
+static inline UINT32 OPL_CALC_SLOT( OPL_SLOT *SLOT )
 {
        /* calcrate envelope generator */
        if( (SLOT->evc+=SLOT->evs) >= SLOT->eve )
@@ -371,7 +367,7 @@ static void set_algorithm( OPL_CH *CH)
 }
 
 /* ---------- frequency counter for operater update ---------- */
-INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT)
+static inline void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT)
 {
        int ksr;
 
@@ -391,7 +387,7 @@ INLINE void CALC_FCSLOT(OPL_CH *CH,OPL_SLOT *SLOT)
 }
 
 /* set multi,am,vib,EG-TYP,KSR,mul */
-INLINE void set_mul(FM_OPL *OPL,int slot,int v)
+static inline void set_mul(FM_OPL *OPL,int slot,int v)
 {
        OPL_CH   *CH   = &OPL->P_CH[slot/2];
        OPL_SLOT *SLOT = &CH->SLOT[slot&1];
@@ -405,7 +401,7 @@ INLINE void set_mul(FM_OPL *OPL,int slot,int v)
 }
 
 /* set ksl & tl */
-INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v)
+static inline void set_ksl_tl(FM_OPL *OPL,int slot,int v)
 {
        OPL_CH   *CH   = &OPL->P_CH[slot/2];
        OPL_SLOT *SLOT = &CH->SLOT[slot&1];
@@ -421,7 +417,7 @@ INLINE void set_ksl_tl(FM_OPL *OPL,int slot,int v)
 }
 
 /* set attack rate & decay rate  */
-INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v)
+static inline void set_ar_dr(FM_OPL *OPL,int slot,int v)
 {
        OPL_CH   *CH   = &OPL->P_CH[slot/2];
        OPL_SLOT *SLOT = &CH->SLOT[slot&1];
@@ -438,7 +434,7 @@ INLINE void set_ar_dr(FM_OPL *OPL,int slot,int v)
 }
 
 /* set sustain level & release rate */
-INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v)
+static inline void set_sl_rr(FM_OPL *OPL,int slot,int v)
 {
        OPL_CH   *CH   = &OPL->P_CH[slot/2];
        OPL_SLOT *SLOT = &CH->SLOT[slot&1];
@@ -455,7 +451,7 @@ INLINE void set_sl_rr(FM_OPL *OPL,int slot,int v)
 /* operator output calcrator */
 #define OP_OUT(slot,env,con)   slot->wavetable[((slot->Cnt+con)/(0x1000000/SIN_ENT))&(SIN_ENT-1)][env]
 /* ---------- calcrate one of channel ---------- */
-INLINE void OPL_CALC_CH( OPL_CH *CH )
+static inline void OPL_CALC_CH( OPL_CH *CH )
 {
        UINT32 env_out;
        OPL_SLOT *SLOT;
@@ -500,7 +496,7 @@ INLINE void OPL_CALC_CH( OPL_CH *CH )
 
 /* ---------- calcrate rhythm block ---------- */
 #define WHITE_NOISE_db 6.0
-INLINE void OPL_CALC_RH( OPL_CH *CH )
+static inline void OPL_CALC_RH( OPL_CH *CH )
 {
        UINT32 env_tam,env_sd,env_top,env_hh;
        int whitenoise = (rand()&1)*(WHITE_NOISE_db/EG_STEP);
@@ -716,7 +712,7 @@ static void OPLCloseTable( void )
 }
 
 /* CSM Key Control */
-INLINE void CSMKeyControll(OPL_CH *CH)
+static inline void CSMKeyControll(OPL_CH *CH)
 {
        OPL_SLOT *slot1 = &CH->SLOT[SLOT1];
        OPL_SLOT *slot2 = &CH->SLOT[SLOT2];
@@ -1178,7 +1174,7 @@ void OPLResetChip(FM_OPL *OPL)
        OPLWriteReg(OPL,0x03,0); /* Timer2 */
        OPLWriteReg(OPL,0x04,0); /* IRQ mask clear */
        for(i = 0xff ; i >= 0x20 ; i-- ) OPLWriteReg(OPL,i,0);
-       /* reset OPerator paramater */
+       /* reset operator parameter */
        for( c = 0 ; c < OPL->max_ch ; c++ )
        {
                OPL_CH *CH = &OPL->P_CH[c];
This page took 0.031762 seconds and 4 git commands to generate.