private static int OPLWrite(int a,int v) { if ((a & 1) == 0) { OPL.address = (byte)(v & 0xff); } else { if (OPL.UpdateHandler != null) { OPL.UpdateHandler(0); } OPLWriteReg(OPL.address,v); } return(OPL.status >> 7); }
public static int OPLTimerOver(FM_OPL OPL, int c) { if (c != 0) { /* Timer B */ OPL_STATUS_SET(OPL, 0x20); } else { /* Timer A */ OPL_STATUS_SET(OPL, 0x40); /* CSM mode key,TL controll */ if ((OPL.mode & 0x80) != 0) { /* CSM mode total level latch and auto key on */ int ch; if (OPL.UpdateHandler != null) OPL.UpdateHandler(OPL.UpdateParam, 0); for (ch = 0; ch < 9; ch++) CSMKeyControll(OPL.P_CH[ch]); } } /* reload timer */ if (OPL.TimerHandler != null) OPL.TimerHandler(OPL.TimerParam + c, (double)OPL.T[c] * OPL.TimerBase); return OPL.status >> 7; }
public static int OPLWrite(FM_OPL OPL, int a, int v) { if( (a&1) ==0) { /* address port */ OPL.address = (byte)(v & 0xff); } else { /* data port */ if(OPL.UpdateHandler!=null) OPL.UpdateHandler(OPL.UpdateParam,0); OPLWriteReg(OPL,OPL.address,v); } return OPL.status>>7; }