Exemplo n.º 1
0
        public List <Setting.ChipType> GetRealChipList()
        {
            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();
                        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;
                    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;
                    ret.Add(ct);
                }
            }

            return(ret);
        }
Exemplo n.º 2
0
        public RSoundChip GetRealChip(Setting.ChipType chipType, int ind = 0)
        {
            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);

                        switch (ind)
                        {
                        case 0:
                            if (0 == chipType.SoundLocation &&
                                i == chipType.BusID &&
                                s == chipType.SoundChip)
                            {
                                RScciSoundChip rsc = new RScciSoundChip(0, i, s, chipType.Type);
                                rsc.scci = nScci;
                                return(rsc);
                            }
                            break;

                        case 1:
                            if (0 == chipType.SoundLocation2A &&
                                i == chipType.BusID2A &&
                                s == chipType.SoundChip2A)
                            {
                                RScciSoundChip rsc = new RScciSoundChip(0, i, s, chipType.Type2A);
                                rsc.scci = nScci;
                                return(rsc);
                            }
                            break;

                        case 2:
                            if (0 == chipType.SoundLocation2B &&
                                i == chipType.BusID2B &&
                                s == chipType.SoundChip2B)
                            {
                                RScciSoundChip rsc = new RScciSoundChip(0, i, s, chipType.Type2B);
                                rsc.scci = nScci;
                                return(rsc);
                            }
                            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();
                    int        o    = -1;
                    string     seri = gm.getModuleInfo().Serial;
                    if (!int.TryParse(seri, out o))
                    {
                        o = -1;
                    }

                    switch (ind)
                    {
                    case 0:
                        if (-1 == chipType.SoundLocation &&
                            i == chipType.BusID &&
                            o == chipType.SoundChip)
                        {
                            RC86ctlSoundChip rsc = new RC86ctlSoundChip(-1, i, o, chipType.Type);
                            rsc.c86ctl = nc86ctl;
                            return(rsc);
                        }
                        break;

                    case 1:
                        if (-1 == chipType.SoundLocation2A &&
                            i == chipType.BusID2A &&
                            o == chipType.SoundChip2A)
                        {
                            RC86ctlSoundChip rsc = new RC86ctlSoundChip(-1, i, o, chipType.Type2A);
                            rsc.c86ctl = nc86ctl;
                            return(rsc);
                        }
                        break;

                    case 2:
                        if (-1 == chipType.SoundLocation2B &&
                            i == chipType.BusID2B &&
                            o == chipType.SoundChip2B)
                        {
                            RC86ctlSoundChip rsc = new RC86ctlSoundChip(-1, i, o, chipType.Type2B);
                            rsc.c86ctl = nc86ctl;
                            return(rsc);
                        }
                        break;
                    }
                }
            }

            return(null);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }