//798-847 //;============================================================================== //; PPZ FNUM SET //;============================================================================== private void fnumsetz() { r.ah = r.al; r.ah &= 0xf; if (r.ah == 0xf) { fnrestz();//; 休符の場合 return; } pw.partWk[r.di].onkai = r.al; r.bh = 0; r.bl = r.ah;//; bx=onkai r.al = r.ror(r.al, 1); r.al = r.ror(r.al, 1); r.al = r.ror(r.al, 1); r.al = r.ror(r.al, 1); r.al &= 0xf; r.cl = r.al; //; cl=octarb //r.bx += r.bx; r.ax = pw.ppz_tune_data[r.bx]; //;o5標準 r.dx = 0; r.cl -= 4; if ((r.cl & 0x80) == 0) { goto ppz_over_o5; } r.cl = (byte)-r.cl; r.ax = (ushort)(r.ax >> r.cl); goto ppz_fnumset; ppz_over_o5 :; if (r.cl == 0) { goto ppz_fnumset; } r.ch = 0; ppz_over_o5_loop :; r.carry = (r.ax + r.ax) > 0xffff; r.ax += r.ax; r.dx += (ushort)(r.dx + (r.carry ? 1 : 0)); r.cx--; if (r.cx != 0) { goto ppz_over_o5_loop; } ppz_fnumset :; pw.partWk[r.di].fnum = r.ax; pw.partWk[r.di].fnum2 = r.dx; }
private Func <object> pansetm_main() { r.al = r.ror(r.al, 1); r.al = r.ror(r.al, 1); r.al &= 0b1100_0000; pw.partWk[r.di].fmpan = r.al; return(null); }
private void eff_main() { //r.ds = r.cs; if (pw.effflag == 0) { goto eg_00; } return;//; 効果音を使用しないモード eg_00 :; if (pw.ppsdrv_flag == 0) { goto eg_nonppsdrv; } r.al |= r.al; if ((r.al & 0x80) == 0) { goto eg_nonppsdrv; } //; ppsdrv if (pw.effon >= 2) { return; // goto effret;// ; 通常効果音発音時は発声させない } r.bx = (ushort)pw.part9; //; PSG 3ch pw.partWk[r.bx].partmask |= 2; //; Part Mask pw.effon = 1; //; 優先度1(ppsdrv) pw.psgefcnum = r.al; //; 音色番号設定(80H~) r.bx = 15; r.ah = pw.hosei_flag; r.ah = r.ror(r.ah, 1); if (!r.carry) { goto not_tone_hosei; } r.bx = pw.partWk[r.di].detune; r.bh = r.bl;//; BH = Detuneの下位 8bit r.bl = 15; not_tone_hosei :; r.ah = r.ror(r.ah, 1); if (!r.carry) { goto not_volume_hosei; } r.ah = pw.partWk[r.di].volume; if (r.ah >= 15) { goto fade_hosei; } r.bl = r.ah;//; BL = volume値(0~15) fade_hosei :; r.ah = pw.fadeout_volume; if (r.ah == 0) { goto not_volume_hosei; } r.stack.Push(r.ax); r.al = r.bl; r.ah = (byte)-r.ah; r.ax = (ushort)(r.al * r.ah); r.bl = r.ah; r.ax = r.stack.Pop(); not_volume_hosei :; if (r.bl == 0) { goto ppsdrm_ret; } r.bl ^= 0b0000_1111; //volume r.ah = 1; //command r.al &= 0x7f; //num? ChipDatum cd = new ChipDatum(-1, -1, -1); cd.addtionalData = pw.cmd; pmd.WriteOPNARegister(cd); if (pw.cmd != null && pw.cmd.args != null && pw.cmd.args.Count > 2 && pw.cmd.args[2] is MmlDatum[]) { foreach (MmlDatum md in (MmlDatum[])pw.cmd.args[2]) { pmd.ExecIDESpecialCommand(md); } } cd = new ChipDatum(0x01, (r.al << 8) | r.bh, r.bl); ppsdrv(cd);//.Play(r.al, r.bh, r.bl);//; ppsdrv keyon ppsdrm_ret :; return; //; TimerA eg_nonppsdrv :; pw.psgefcnum = r.al; r.ah = 0; r.bx = r.ax; //r.bx += r.bx; //r.bx = r.ax; //r.bx += 0;//offset efftbl r.al = pw.effon; if (r.al > pw.efftbl[r.bx].Item1) // cmp al,[bx]; 優先順位 { return; // goto eg_ret; } if (pw.ppsdrv_flag == 0) { goto eok_nonppsdrv; } r.ah = 0; cd = new ChipDatum(0x02, 0, 0); ppsdrv(cd);//.Stop();//; ppsdrv 強制keyoff eok_nonppsdrv :; cd = new ChipDatum(-1, -1, -1); cd.addtionalData = pw.cmd; pmd.WriteOPNARegister(cd); if (pw.cmd != null && pw.cmd.args != null && pw.cmd.args.Count > 2 && pw.cmd.args[2] is MmlDatum[]) { foreach (MmlDatum md in (MmlDatum[])pw.cmd.args[2]) { pmd.ExecIDESpecialCommand(md); } } r.si = 0; // pw.efftbl[r.bx].Item2; r.si += 0; //offset efftbl pw.crtEfcDat = pw.efftbl[r.bx].Item2; r.al = pw.efftbl[r.bx].Item1; //; AL = 優先順位 r.stack.Push(r.ax); r.bx = (ushort)pw.part9; //; PSG 3ch pw.partWk[r.bx].partmask |= 2; //; Part Mask efffor(); //;1発目を発音 r.ax = r.stack.Pop(); pw.effon = r.al; //; 優先順位を設定(発音開始) eg_ret :; return; }