setPos() public method

解析位置を指定する
エイリアスを毎回展開しながら位置を算出するためとても効率が悪い
public setPos ( int tCol ) : void
tCol int 解析位置
return void
Beispiel #1
0
        private void partInit()
        {
            foreach (clsChip chip in chips)
            {

                chip.use = false;
                chip.lstPartWork = new List<partWork>();

                for (int i = 0; i < chip.ChMax; i++)
                {
                    partWork pw = new partWork();
                    pw.chip = chip;
                    pw.isSecondary = (chip.ChipID == 1);
                    pw.ch = i;// + 1;
                    if (partData.ContainsKey(chip.Ch[i].Name))
                    {
                        pw.pData = partData[chip.Ch[i].Name];
                    }
                    pw.aData = aliesData;
                    pw.setPos(0);
                    pw.Type = chip.Ch[i].Type;
                    pw.slots = 0;
                    pw.volume = 32767;

                    if (chip is YM2612)
                    {
                        pw.slots = (byte)(((pw.Type == enmChannelType.FMOPN || pw.Type == enmChannelType.FMPCM) || i == 2) ? 0xf : 0x0);
                        pw.volume = 127;
                        pw.MaxVolume = 127;
                        pw.port0 = (byte)(0x2 | (pw.isSecondary ? 0xa0 : 0x50));
                        pw.port1 = (byte)(0x3 | (pw.isSecondary ? 0xa0 : 0x50));
                    }
                    else if (chip is SN76489)
                    {
                        pw.MaxVolume = 15;
                        pw.volume = pw.MaxVolume;
                        pw.port0 = 0x50;
                    }
                    else if (chip is RF5C164)
                    {
                        pw.MaxVolume = 255;
                        pw.volume = pw.MaxVolume;
                        pw.port0 = 0xb1;
                    }
                    else if (chip is YM2610B)
                    {
                        pw.slots = (byte)((pw.Type == enmChannelType.FMOPN || i == 2) ? 0xf : 0x0);
                        pw.volume = 127;
                        pw.MaxVolume = 127;
                        if (pw.Type == enmChannelType.SSG)
                        {
                            //pw.volume = 32767;
                            pw.MaxVolume = 15;
                            pw.volume = pw.MaxVolume;
                        }
                        else if (pw.Type == enmChannelType.ADPCMA)
                        {
                            //pw.volume = 32767;
                            pw.MaxVolume = 31;//5bit
                            pw.volume = pw.MaxVolume;
                        }
                        else if (pw.Type == enmChannelType.ADPCMB)
                        {
                            //pw.volume = 32767;
                            pw.MaxVolume = 255;
                            pw.volume = pw.MaxVolume;
                        }
                        pw.port0 = (byte)(0x8 | (pw.isSecondary ? 0xa0 : 0x50));
                        pw.port1 = (byte)(0x9 | (pw.isSecondary ? 0xa0 : 0x50));
                    }

                    pw.PartName = chip.Ch[i].Name;
                    pw.waitKeyOnCounter = -1;
                    pw.waitCounter = 0;
                    pw.freq = -1;

                    pw.dataEnd = false;
                    if (pw.pData == null || pw.pData.Count < 1)
                    {
                        pw.dataEnd = true;
                    }
                    else
                    {
                        chip.use = true;
                    }

                    chip.lstPartWork.Add(pw);

                }
            }
        }
Beispiel #2
0
 private void cmdRepeatEnd(partWork pw)
 {
     int n;
     pw.incPos();
     if (!pw.getNum(out n))
     {
         n = 2;
     }
     n = checkRange(n, 1, 255);
     try
     {
         clsRepeat re = pw.stackRepeat.Pop();
         if (re.repeatCount == -1)
         {
             //初回
             re.repeatCount = n;
         }
         re.repeatCount--;
         if (re.repeatCount > 0)
         {
             pw.stackRepeat.Push(re);
             pw.setPos(re.pos);
         }
     }
     catch
     {
         msgBox.setWrnMsg("[と]の数があいません。", lineNumber);
     }
 }