コード例 #1
0
ファイル: interrupt.cs プロジェクト: hiroshica/mml2vgm_mase
        public void _ff_mute_return()
        {
            mm.Write(reg.a6 + dw.MUTE, 0xff);
            reg spReg = new reg();

            spReg.D0_L = reg.D0_L;
            spReg.D3_L = reg.D3_L;
            reg.D0_L   = 0;
            mm.Write(reg.a6 + dw.MASTER_VOL_FM, (byte)reg.D0_B);
            mm.Write(reg.a6 + dw.MASTER_VOL_PCM, (byte)reg.D0_B);
            mm.Write(reg.a6 + dw.MASTER_VOL_RHY, (byte)reg.D0_B);
            mm.Write(reg.a6 + dw.MASTER_VOL_PSG, (byte)reg.D0_B);
            _ch_fade();
            reg.D0_L = spReg.D0_L;
            reg.D3_L = spReg.D3_L;
        }
コード例 #2
0
ファイル: interrupt.cs プロジェクト: hiroshica/mml2vgm_mase
        public void _ff_mute()
        {
            if ((mm.ReadByte(reg.a6 + dw.DRV_STATUS) & 0x10) != 0)
            {
                return;
            }

            mm.Write(reg.a6 + dw.MUTE, 0);

            reg spReg = new reg();

            spReg.D0_L = reg.D0_L;
            spReg.D3_L = reg.D3_L;

            mm.Write(reg.a6 + dw.MASTER_VOL_FM, 14);
            mm.Write(reg.a6 + dw.MASTER_VOL_PCM, 40);
            mm.Write(reg.a6 + dw.MASTER_VOL_RHY, 25);
            mm.Write(reg.a6 + dw.MASTER_VOL_PSG, 5);
            _ch_fade();

            reg.D0_L = spReg.D0_L;
            reg.D3_L = spReg.D3_L;
        }
コード例 #3
0
ファイル: interrupt.cs プロジェクト: hiroshica/mml2vgm_mase
        //─────────────────────────────────────
        //	OPN timer
        //
        //public void _opn_entry_short_exit()
        //{
        //    //reg.a6=spA6;
        //}

        public void _opn_entry()
        {
            reg.SR |= 0x700;

            uint spA6 = reg.a6;

            reg.a6 = mndrv._work_top;// mm.ReadUInt32(mndrv._work_top);//
            byte f = (byte)(mm.ReadByte(reg.a6 + dw.DRV_STATUS) & 1);

            mm.Write(reg.a6 + dw.DRV_STATUS, (byte)(mm.ReadByte(reg.a6 + dw.DRV_STATUS) | 1));
            if (f != 0)
            {
                //	_opn_entry_short_exit
                reg.a6 = spA6;
                return;
            }

            reg spReg = new reg();

            spReg.D0_L = reg.D0_L;
            spReg.D1_L = reg.D1_L;
            spReg.D2_L = reg.D2_L;
            spReg.D3_L = reg.D3_L;
            spReg.D4_L = reg.D4_L;
            spReg.D5_L = reg.D5_L;
            spReg.D6_L = reg.D6_L;
            spReg.D7_L = reg.D7_L;
            spReg.a0   = reg.a0;
            spReg.a1   = reg.a1;
            spReg.a2   = reg.a2;
            spReg.a3   = reg.a3;
            spReg.a4   = reg.a4;
            spReg.a5   = reg.a5;

            reg.a0   = 0xecc0c1;
            reg.D0_L = 3;
            do
            {
                //reg.D3_B = mm.ReadByte(reg.a0);
                reg.D3_B = (byte)timerOPN.ReadStatus();
            } while ((sbyte)reg.D3_B < 0);

            reg.D3_W &= reg.D0_W;

            reg.D0_L  = 7;
            reg.D0_L &= 0;// reg.Arg[0];//4*15(sp) -> 割り込みレベルの調整(下げている)を行っている(再現不要箇所)
            reg.D0_W += (UInt32)(Int16)reg.D0_W;
            reg.D4_W  = reg.SR_W;
            reg.D4_W &= 0xf8ff;
            reg.D4_W |= _opn_intmask[reg.D0_W / 2];

_opn_recall:

            reg.D7_L  = 0;
            reg.D1_L  = 0x27;
            reg.D0_B  = _opn_irq[reg.D3_W];
            reg.D0_B |= mm.ReadByte(reg.a6 + dw.CH3MODEM);
            mndrv._OPN_WRITE();
            reg.SR_W = reg.D4_W;

            UInt32 sp = reg.D4_W;

            reg.D3_W += (UInt32)(Int16)reg.D3_W;
            switch (reg.D3_W)
            {
            case 0:
                goto _opn_entry_exit;

            case 2:
                _timer_a_job();
                break;

            case 4:
                _timer_b_job();
                break;

            case 6:
                _timer_ab_job();
                break;
            }
            reg.D4_W = sp;

            reg.D0_B = mm.ReadByte(reg.a6 + dw.TEMPO3);
            if (mm.ReadByte(reg.a6 + dw.TEMPO2) - reg.D0_B != 0)
            {
                mm.Write(reg.a6 + dw.TEMPO2, (byte)reg.D0_B);
                reg.D7_L = 0;
                reg.D1_L = 0x26;
                mndrv._OPN_WRITE();
            }

            reg.SR  |= 0x700;
            reg.a0   = 0xecc0c1;
            reg.D0_L = 3;
            do
            {
                //reg.D3_B = mm.ReadByte(reg.a0);
                reg.D3_B = (byte)timerOPN.ReadStatus();
            } while ((sbyte)reg.D3_B < 0);
            reg.D3_W &= reg.D0_W;
            if (reg.D3_W != 0)
            {
                goto _opn_recall;
            }

            mm.Write(reg.a6 + dw.DRV_STATUS, (byte)(mm.ReadByte(reg.a6 + dw.DRV_STATUS) & 0xfe));
            reg.SR = reg.D4_W;

            reg.D7_W = mm.ReadUInt16(reg.a6 + dw.INTEXECNUM);
            if (reg.D7_W != 0)
            {
                reg.a0 = reg.a6 + dw.INTEXECBUF;
                mm.Write(reg.a6 + dw.INTEXECNUM, (UInt16)0);
                reg.D7_W -= 1;
                do
                {
                    reg.a1 = mm.ReadUInt32(reg.a0); reg.a0 += 4;
                    reg spReg2 = new reg();
                    spReg2.D7_L = reg.D7_L;
                    spReg2.a0   = reg.a0;
                    spReg2.a6   = reg.a6;
                    ab.hlINTEXECBUF[reg.a1]();
                    reg.D7_L = spReg2.D7_L;
                    reg.a0   = spReg2.a0;
                    reg.a6   = spReg2.a6;
                } while (reg.D7_W-- != 0);
            }

_opn_entry_exit:

            reg.D0_L = spReg.D0_L;
            reg.D1_L = spReg.D1_L;
            reg.D2_L = spReg.D2_L;
            reg.D3_L = spReg.D3_L;
            reg.D4_L = spReg.D4_L;
            reg.D5_L = spReg.D5_L;
            reg.D6_L = spReg.D6_L;
            reg.D7_L = spReg.D7_L;
            reg.a0   = spReg.a0;
            reg.a1   = spReg.a1;
            reg.a2   = spReg.a2;
            reg.a3   = spReg.a3;
            reg.a4   = spReg.a4;
            reg.a5   = spReg.a5;
        }