Example #1
0
        public SChipType Copy()
        {
            SChipType ct = new SChipType();

            ct.UseEmu        = this.UseEmu;
            ct.UseEmu2       = this.UseEmu2;
            ct.UseEmu3       = this.UseEmu3;
            ct.UseScci       = this.UseScci;
            ct.SoundLocation = this.SoundLocation;

            ct.BusID           = this.BusID;
            ct.InterfaceName   = this.InterfaceName;
            ct.SoundChip       = this.SoundChip;
            ct.ChipName        = this.ChipName;
            ct.UseScci2        = this.UseScci2;
            ct.SoundLocation2A = this.SoundLocation2A;

            ct.InterfaceName2A = this.InterfaceName2A;
            ct.BusID2A         = this.BusID2A;
            ct.SoundChip2A     = this.SoundChip2A;
            ct.ChipName2A      = this.ChipName2A;
            ct.SoundLocation2B = this.SoundLocation2B;

            ct.InterfaceName2B = this.InterfaceName2B;
            ct.BusID2B         = this.BusID2B;
            ct.SoundChip2B     = this.SoundChip2B;
            ct.ChipName2B      = this.ChipName2B;

            ct.UseWait             = this.UseWait;
            ct.UseWaitBoost        = this.UseWaitBoost;
            ct.OnlyPCMEmulation    = this.OnlyPCMEmulation;
            ct.LatencyForEmulation = this.LatencyForEmulation;
            ct.LatencyForScci      = this.LatencyForScci;

            return(ct);
        }
Example #2
0
        private static RSoundChip CheckDevice()
        {
            SChipType ct     = null;
            int       iCount = 0;

            switch (device)
            {
            case 1:    //GIMIC存在チェック
                nc86ctl = new Nc86ctl.Nc86ctl();
                nc86ctl.initialize();
                iCount = nc86ctl.getNumberOfChip();
                if (iCount == 0)
                {
                    nc86ctl.deinitialize();
                    nc86ctl = null;
                    Log.WriteLine(LogLevel.ERROR, "Not found G.I.M.I.C.");
                    device = 0;
                    break;
                }
                for (int i = 0; i < iCount; i++)
                {
                    NIRealChip rc  = nc86ctl.getChipInterface(i);
                    NIGimic2   gm  = rc.QueryInterface();
                    ChipType   cct = gm.getModuleType();
                    int        o   = -1;
                    if (cct == ChipType.CHIP_YM2608 || cct == ChipType.CHIP_YMF288 || cct == ChipType.CHIP_YM2203)
                    {
                        ct = new SChipType();
                        ct.SoundLocation = -1;
                        ct.BusID         = i;
                        string seri = gm.getModuleInfo().Serial;
                        if (!int.TryParse(seri, out o))
                        {
                            o  = -1;
                            ct = null;
                            continue;
                        }
                        ct.SoundChip     = o;
                        ct.ChipName      = gm.getModuleInfo().Devname;
                        ct.InterfaceName = gm.getMBInfo().Devname;
                        break;
                    }
                }
                RC86ctlSoundChip rsc = null;
                if (ct == null)
                {
                    nc86ctl.deinitialize();
                    nc86ctl = null;
                    Log.WriteLine(LogLevel.ERROR, "Not found G.I.M.I.C.(OPNA module)");
                    device = 0;
                }
                else
                {
                    rsc        = new RC86ctlSoundChip(-1, ct.BusID, ct.SoundChip);
                    rsc.c86ctl = nc86ctl;
                    rsc.init();

                    rsc.SetMasterClock(7987200); //SoundBoardII
                    rsc.setSSGVolume(63);        //PC-8801
                }
                return(rsc);

            case 2:    //SCCI存在チェック
                nScci  = new NScci.NScci();
                iCount = nScci.NSoundInterfaceManager_.getInterfaceCount();
                if (iCount == 0)
                {
                    nScci.Dispose();
                    nScci = null;
                    Log.WriteLine(LogLevel.ERROR, "Not found SCCI.");
                    device = 0;
                    break;
                }
                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 == 1)
                        {
                            ct = new SChipType();
                            ct.SoundLocation = 0;
                            ct.BusID         = i;
                            ct.SoundChip     = s;
                            ct.ChipName      = sc.getSoundChipInfo().cSoundChipName;
                            ct.InterfaceName = iInfo.cInterfaceName;
                            goto scciExit;
                        }
                    }
                }
                scciExit :;
                RScciSoundChip rssc = null;
                if (ct == null)
                {
                    nScci.Dispose();
                    nScci = null;
                    Log.WriteLine(LogLevel.ERROR, "Not found SCCI(OPNA module).");
                    device = 0;
                }
                else
                {
                    rssc      = new RScciSoundChip(0, ct.BusID, ct.SoundChip);
                    rssc.scci = nScci;
                    rssc.init();
                }
                return(rssc);
            }

            return(null);
        }