예제 #1
0
파일: nsf.cs 프로젝트: hiroshica/MDPlayer
        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;

            if (model == enmModel.RealModel)
            {
                Stopped    = true;
                vgmCurLoop = 9999;
                return(true);
            }

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

            GD3 = getGD3Info(vgmBuf, 0);

            nsfInit();

            return(true);
        }
예제 #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;
            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);
        }
예제 #3
0
        /// <summary>
        /// イニシャライズ
        /// </summary>
        /// <param name="buf"></param>
        /// <param name="chipRegister"></param>
        /// <param name="model"></param>
        /// <param name="useChip"></param>
        /// <param name="latency"></param>
        /// <param name="waitTime"></param>
        /// <returns></returns>
        public override bool init(byte[] buf, ChipRegister chipRegister, enmModel model, enmUseChip[] useChip, uint latency, uint waitTime)
        {
            this.vgmBuf       = buf;
            this.chipRegister = chipRegister;
            this.model        = model;
            this.useChip      = useChip;
            this.latency      = latency;
            this.waitTime     = waitTime;
            pc88.ChipRegister = chipRegister;
            pc88.fmTimer      = timerOPN;
            pc88.model        = model;

            //デバッグ向け
            //if (model == enmModel.RealModel) return true;

            GD3 = getGD3Info(buf, 0);

            fnVoicedat = string.IsNullOrEmpty(fnVoicedat) ? "voice.dat" : fnVoicedat;
            LoadFMVoice(fnVoicedat);

            fnPcm   = string.IsNullOrEmpty(fnPcm) ? "mucompcm.bin" : fnPcm;
            pcmdata = LoadPCM(fnPcm);

            //Compile
            ushort basicsize = StoreBasicSource(buf, 1, 1);

            //MUCOM88 初期化
            muc88.CINT();//0x9600

            //コンパイルコマンドのセット
            z80.HL = 0xf010;
            mem.LD_8(0xf010, 0x41);// 'A'
            mem.LD_8(0xf011, 0x00);
            mem.LD_8(0xf012, 0x00);

            //↓コンパイルが実施される
            int ret = muc88.COMPIL();//vector 0xeea8

            //エラー発生時は0以外が返る
            if (ret != 0)
            {
                int errLine = mem.LD_16(0x0f32e);//ワークアドレスのERRLINE
                log.Write(string.Format("コンパイル時にエラーが発生したみたい(errLine:{0})", errLine));
                return(false);
            }

            SaveMub(basicsize);

            setPCMData(pcmdata);
            music2.initMusic2();
            music2.MSTART();

            return(true);
        }
예제 #4
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;

            if (model == enmModel.RealModel)
            {
                Stopped    = true;
                vgmCurLoop = 9999;
                return(true);
            }

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

            ld = new HESDetector();
            ld.Reset();

            GD3 = getGD3Info(vgmBuf, 0);

            m_hes = new m_hes();
            m_hes.chipRegister = chipRegister;
            m_hes.ld           = ld;
            nez_play           = new m_hes.NEZ_PLAY();
            if (m_hes.HESLoad(nez_play, vgmBuf, (UInt32)vgmBuf.Length) != 0)
            {
                return(false);
            }
            nez_play.song.songno = (UInt32)(this.song + 1);
            m_hes.HESHESReset(nez_play);
            return(true);
        }
예제 #5
0
파일: MID.cs 프로젝트: hiroshica/MDPlayer
        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;
        }
예제 #6
0
파일: xgm.cs 프로젝트: hiroshica/MDPlayer
        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);
        }
예제 #7
0
 public abstract bool init(byte[] vgmBuf, ChipRegister chipRegister, enmModel model, enmUseChip[] useChip, uint latency, uint waitTime);