示例#1
0
        public List <Setting.ChipType> GetRealChipList(EnmRealChipType realChipType)
        {
            List <Setting.ChipType> ret = new List <Setting.ChipType>();

            if (nScci != null)
            {
                int iCount = nScci.NSoundInterfaceManager_.getInterfaceCount();
                for (int i = 0; i < iCount; i++)
                {
                    NSoundInterface      iIntfc = nScci.NSoundInterfaceManager_.getInterface(i);
                    NSCCI_INTERFACE_INFO iInfo  = nScci.NSoundInterfaceManager_.getInterfaceInfo(i);
                    int sCount = iIntfc.getSoundChipCount();
                    for (int s = 0; s < sCount; s++)
                    {
                        NSoundChip sc = iIntfc.getSoundChip(s);
                        int        t  = sc.getSoundChipType();
                        if (t == (int)realChipType)
                        {
                            Setting.ChipType ct = new Setting.ChipType();
                            ct.SoundLocation = 0;
                            ct.BusID         = i;
                            ct.SoundChip     = s;
                            ct.ChipName      = sc.getSoundChipInfo().cSoundChipName;
                            ct.InterfaceName = iInfo.cInterfaceName;
                            ret.Add(ct);
                        }
                        else
                        {
                            //互換指定をチェック
                            NSCCI_SOUND_CHIP_INFO chipInfo = sc.getSoundChipInfo();
                            for (int n = 0; n < chipInfo.iCompatibleSoundChip.Length; n++)
                            {
                                if ((int)realChipType != chipInfo.iCompatibleSoundChip[n])
                                {
                                    continue;
                                }

                                Setting.ChipType ct = new Setting.ChipType();
                                ct.SoundLocation = 0;
                                ct.BusID         = i;
                                ct.SoundChip     = s;
                                ct.ChipName      = sc.getSoundChipInfo().cSoundChipName;
                                ct.InterfaceName = iInfo.cInterfaceName;
                                ret.Add(ct);
                                break;
                            }
                        }
                    }
                }
            }

            if (nc86ctl != null)
            {
                int iCount = nc86ctl.getNumberOfChip();
                for (int i = 0; i < iCount; i++)
                {
                    NIRealChip       rc  = nc86ctl.getChipInterface(i);
                    NIGimic2         gm  = rc.QueryInterface();
                    ChipType         cct = gm.getModuleType();
                    Setting.ChipType ct  = null;
                    int o = -1;
                    switch (realChipType)
                    {
                    case EnmRealChipType.AY8910:
                        if (cct == ChipType.CHIP_UNKNOWN || cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288 || cct == ChipType.CHIP_YM2203)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM2203:
                    case EnmRealChipType.YM2608:
                        if (cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288 || cct == ChipType.CHIP_YM2203)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM2413:
                        if (cct == ChipType.CHIP_YM2413 || cct == ChipType.CHIP_UNKNOWN)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                        }
                        break;

                    case EnmRealChipType.YM2610:
                        if (cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM2151:
                        if (cct == ChipType.CHIP_YM2151)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM3526:
                    case EnmRealChipType.YM3812:
                    case EnmRealChipType.YMF262:
                        if (cct == ChipType.CHIP_OPL3)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;
                    }

                    if (ct != null)
                    {
                        ret.Add(ct);
                    }
                }
            }

            return(ret);
        }
示例#2
0
        public List <Setting.ChipType> GetRealChipList(EnmRealChipType realChipType)
        {
            List <Setting.ChipType> ret = new List <Setting.ChipType>();

            if (nScci != null)
            {
                int iCount = nScci.NSoundInterfaceManager_.getInterfaceCount();
                for (int i = 0; i < iCount; i++)
                {
                    NSoundInterface      iIntfc = nScci.NSoundInterfaceManager_.getInterface(i);
                    NSCCI_INTERFACE_INFO iInfo  = nScci.NSoundInterfaceManager_.getInterfaceInfo(i);
                    int sCount = iIntfc.getSoundChipCount();
                    for (int s = 0; s < sCount; s++)
                    {
                        NSoundChip sc = iIntfc.getSoundChip(s);
                        int        t  = sc.getSoundChipType();
                        if (t == (int)realChipType ||
                            (realChipType == EnmRealChipType.YM2203 && t == (int)EnmRealChipType.YM2608) ||
                            (realChipType == EnmRealChipType.YM2610 && t == (int)EnmRealChipType.YM2608) ||
                            (realChipType == EnmRealChipType.AY8910 && t == (int)EnmRealChipType.YM2203) ||
                            (realChipType == EnmRealChipType.AY8910 && t == (int)EnmRealChipType.YM2608) ||
                            (realChipType == EnmRealChipType.AY8910 && t == (int)EnmRealChipType.YM2610)
                            )
                        {
                            Setting.ChipType ct = new Setting.ChipType();
                            ct.SoundLocation = 0;
                            ct.BusID         = i;
                            ct.SoundChip     = s;
                            ct.ChipName      = sc.getSoundChipInfo().cSoundChipName;
                            ct.Type          = t;
                            ct.InterfaceName = iInfo.cInterfaceName;
                            ret.Add(ct);
                        }
                    }
                }
            }

            if (nc86ctl != null)
            {
                int iCount = nc86ctl.getNumberOfChip();
                for (int i = 0; i < iCount; i++)
                {
                    NIRealChip       rc  = nc86ctl.getChipInterface(i);
                    NIGimic2         gm  = rc.QueryInterface();
                    ChipType         cct = gm.getModuleType();
                    Setting.ChipType ct  = null;
                    int o = -1;
                    switch (realChipType)
                    {
                    case EnmRealChipType.AY8910:
                        if (cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288 || cct == ChipType.CHIP_YM2203)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM2203:
                    case EnmRealChipType.YM2608:
                        if (cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288 || cct == ChipType.CHIP_YM2203)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM2610:
                        if (cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;

                    case EnmRealChipType.YM2151:
                        if (cct == ChipType.CHIP_YM2151)
                        {
                            ct = new Setting.ChipType();
                            ct.SoundLocation = -1;
                            ct.BusID         = i;
                            string seri = gm.getModuleInfo().Serial;
                            if (!int.TryParse(seri, out o))
                            {
                                o = -1;
                            }
                            ct.SoundChip     = o;
                            ct.ChipName      = gm.getModuleInfo().Devname;
                            ct.InterfaceName = gm.getMBInfo().Devname;
                            ct.Type          = (int)cct;
                        }
                        break;
                    }

                    if (ct != null)
                    {
                        ret.Add(ct);
                    }
                }
            }

            return(ret);
        }