Ejemplo n.º 1
0
        public AdLibMusic(Mixer mixer, Disk disk)
            : base(mixer, disk)
        {
            _driverFileBase = 60202;
            _sampleRate     = mixer.OutputRate;

            _opl = new DosBoxOPL(OplType.Opl2);
            _opl.Init(_sampleRate);

            _soundHandle = _mixer.PlayStream(SoundType.Music, this, -1, Mixer.MaxChannelVolume, 0, false, true);
        }
Ejemplo n.º 2
0
        public OPL2(int baseAddress)
        {
            this.BaseAddress = baseAddress;

            switch (oPLSystem)
            {
            case OPLSystem.DOSBox:
                DosBoxOPL o = new DosBoxOPL(OPLType.Opl2);
                o.Init(44100);
                this.oPL = o;

                WaveFormat = new WaveFormat(44100, 16, 1);
                Thread t = new Thread(SampleReader);
                //t.Start();
                soundOutput = new WaveOutEvent();

                //soundOutput.Init(this);
                soundOutput.Init(o);

                soundOutput.Play();
                break;

            case OPLSystem.Nuked:
                // not yet ready
                break;

            case OPLSystem.OPL2LPT:
                oPL = new OPLXLPT(OPLType.Opl2, (LPTport)0xC020);
                break;

            case OPLSystem.OPL3LPT:
                oPL = new OPLXLPT(OPLType.Opl3, (LPTport)0xC020);
                break;

            default:
                // Maybe throw tantrum
                break;
            }



            oPL.Init(44100);
        }