void DecideEffect(XGEffectBlockType type, XGEffect efct)
 {
     new XGEffectParams(Device, type).SetEffect(efct);
     ReCreateScreen();
 }
 public void SetEffect(XGEffect effect)
 {
     int v = effect.EffectValue;
     EffectType.Value = v & 0x7f | v >> 1 & 0x3f80;
     ReLink();
     for (int i = 0; i < 16; i++) { efctParams[i].Value = effect.InitialValues[i]; }
 }
 public void WriteEffect(XGEffect effect)
 {
     int v = effect.EffectValue;
     EffectType.WriteValue(v & 0x7f | v >> 1 & 0x3f80);
     ReLink();
     for (int i = 0; i < 16; i++) { efctParams[i].WriteValue(effect.InitialValues[i]); }
 }
        public void ReLink()
        {
            int v = EffectType.Value;
            XGEffect effect = XGEffect.GetEffectByTypeValue(v & 0x7f | v << 1 & 0x7f00);
            if (effect == null) { return; }

            this.effect_ = effect;

            if (this.BlockType >= XGEffectBlockType.Insertion1)
            {
                for (int i = 0; i < 10; i++)
                {
                    efctParams[i].Address = effect.ExDataUsed ? BaseAddress + 0x30 + i * 2 : BaseAddress + 0x02 + i * 1;
                    efctParams[i].Count = effect.ExDataUsed ? 2 : 1;
                }
            }

            XGEffect.XGEffectParam dummy = new XGEffect.XGEffectParam("---", 0, 0, 0, "", "---");
            for (int i = 0; i < 16; i++)
            {
                XGEffect.XGEffectParam param = effect.ParameterTypes[i] ?? dummy;
                efctParams[i].Name = this.Name + " " + param.Name;
                efctParams[i].Description = param.Description;
                efctParams[i].MinValue = param.MinValue;
                efctParams[i].MaxValue = param.MaxValue;
                efctParams[i].ToStringConverter = param.Conveter;
                efctParams[i].CenterValue = param.MinValue;
            }
        }