Example #1
0
        public override bool init(byte[] vgmBuf, ChipRegister chipRegister, enmModel model, enmUseChip[] useChip, uint latency, uint waitTime)
        {
            this.vgmBuf       = vgmBuf;
            this.chipRegister = chipRegister;
            this.model        = model;
            this.useChip      = useChip;
            this.latency      = latency;
            this.waitTime     = waitTime;

            Counter         = 0;
            TotalCounter    = 0;
            LoopCounter     = 0;
            vgmCurLoop      = 0;
            Stopped         = false;
            vgmFrameCounter = -latency - waitTime;
            vgmSpeed        = 1;
            vgmSpeedCounter = 0;

            GD3 = getGD3Info(vgmBuf, 0);
            //if (GD3 == null) return false;

            if (!getInformationHeader())
            {
                return(false);
            }

            if (model == enmModel.RealModel)
            {
                chipRegister.setYM2612SyncWait(0, 1);
                chipRegister.setYM2612SyncWait(1, 1);
            }

            return(true);
        }
Example #2
0
        public override bool init(byte[] vgmBuf, ChipRegister chipRegister, enmModel model, enmUseChip[] useChip, uint latency, uint waitTime)
        {
            this.vgmBuf = vgmBuf;
            this.chipRegister = chipRegister;
            this.model = model;
            this.useChip = useChip;
            this.latency = latency;
            this.waitTime = waitTime;

            Counter = 0;
            TotalCounter = 0;
            LoopCounter = 0;
            vgmCurLoop = 0;
            Stopped = false;
            //コントロールを送信してからウェイトするためここでは0をセットする
            //vgmFrameCounter = -latency - waitTime;
            vgmFrameCounter = 0;
            vgmSpeed = 1;
            vgmSpeedCounter = 0;

            GD3 = getGD3Info(vgmBuf, 0);
            //if (GD3 == null) return false;

            if (!getInformationHeader()) return false;

            //ポートごとに事前に送信するコマンドを作成する
            if (!MakeBeforeSendCommand()) return false;

            if (model == enmModel.RealModel)
            {
                chipRegister.setYM2612SyncWait(0, 1);
                chipRegister.setYM2612SyncWait(1, 1);
            }

            return true;
        }
Example #3
0
        public override bool init(byte[] xgmBuf, ChipRegister chipRegister, enmModel model, enmUseChip[] useChip, uint latency, uint waitTime)
        {
            this.vgmBuf       = xgmBuf;
            this.chipRegister = chipRegister;
            this.model        = model;
            this.useChip      = useChip;
            this.latency      = latency;
            this.waitTime     = waitTime;

            Counter         = 0;
            TotalCounter    = 0;
            LoopCounter     = 0;
            vgmCurLoop      = 0;
            Stopped         = false;
            vgmFrameCounter = -latency - waitTime;
            vgmSpeed        = 1;
            vgmSpeedCounter = 0;

            if (!getXGMInfo(vgmBuf))
            {
                return(false);
            }

            if (model == enmModel.RealModel)
            {
                chipRegister.setYM2612SyncWait(0, 1);
                chipRegister.setYM2612SyncWait(1, 1);
            }

            //Driverの初期化
            musicPtr  = musicDataBlockAddr;
            xgmpcm    = new XGMPCM[] { new XGMPCM(), new XGMPCM(), new XGMPCM(), new XGMPCM() };
            DACEnable = 0;

            return(true);
        }