Ejemplo n.º 1
0
 public sidemu(sidplayfp.sidbuilder builder)
 {
     m_builder      = (builder);
     eventScheduler = (null);
     m_buffer       = (null);
     m_bufferpos    = (0);
     m_status       = (true);
     isLocked       = (false);
     m_error        = ("N/A");
 }
Ejemplo n.º 2
0
        /**
         * Compare two config objects.
         *
         * @return true if different
         */
        //public bool compare(ref SidConfig config) { return false; }

        //public SidConfig() { }



        /*
         * This file is part of libsidplayfp, a SID player engine.
         *
         * Copyright 2011-2016 Leandro Nini <*****@*****.**>
         * Copyright 2007-2010 Antti Lankila
         * Copyright 2000-2001 Simon White
         *
         * This program is free software; you can redistribute it and/or modify
         * it under the terms of the GNU General Public License as published by
         * the Free Software Foundation; either version 2 of the License, or
         * (at your option) any later version.
         *
         * This program is distributed in the hope that it will be useful,
         * but WITHOUT ANY WARRANTY; without even the implied warranty of
         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
         * GNU General Public License for more details.
         *
         * You should have received a copy of the GNU General Public License
         * along with this program; if not, write to the Free Software
         * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
         */

        //# include "SidConfig.h"
        //# include "mixer.h"
        //# include "sidcxx11.h"

        public SidConfig()
        {
            defaultC64Model  = c64_model_t.PAL;
            forceC64Model    = false;
            defaultSidModel  = sid_model_t.MOS6581;
            forceSidModel    = false;
            playback         = playback_t.MONO;
            frequency        = DEFAULT_SAMPLING_FREQ;
            secondSidAddress = 0;
            thirdSidAddress  = 0;
            sidEmulation     = null;
            leftVolume       = libsidplayfp.Mixer.VOLUME_MAX;
            rightVolume      = libsidplayfp.Mixer.VOLUME_MAX;
            samplingMethod   = sampling_method_t.RESAMPLE_INTERPOLATE;
            fastSampling     = false;
        }
Ejemplo n.º 3
0
        private void sidCreate(sidplayfp.sidbuilder builder, sidplayfp.SidConfig.sid_model_t defaultModel,
                               bool forced, ref List <UInt32> extraSidAddresses)
        {
            if (builder != null)
            {
                sidplayfp.SidTuneInfo tuneInfo = m_tune.getInfo();

                // Setup base SID
                sidplayfp.SidConfig.sid_model_t userModel = getSidModel(tuneInfo.sidModel(0), defaultModel, forced);
                sidemu s = builder.lock_(m_c64.getEventScheduler(), userModel);
                if (!builder.getStatus())
                {
                    throw new configError(builder.error());
                }

                m_c64.setBaseSid(s);
                m_mixer.addSid(s);

                // Setup extra SIDs if needed
                if (extraSidAddresses.Count != 0)
                {
                    // If bits 6-7 are set to Unknown then the second SID will be set to the same SID
                    // model as the first SID.
                    defaultModel = userModel;

                    UInt32 extraSidChips = (UInt32)extraSidAddresses.Count;

                    for (UInt32 i = 0; i < extraSidChips; i++)
                    {
                        sidplayfp.SidConfig.sid_model_t userModel_1 = getSidModel(tuneInfo.sidModel(i + 1), defaultModel, forced);

                        sidemu s1 = builder.lock_(m_c64.getEventScheduler(), userModel_1);
                        if (!builder.getStatus())
                        {
                            throw new configError(builder.error());
                        }

                        if (!m_c64.addExtraSid(s1, (Int32)extraSidAddresses[(Int32)i]))
                        {
                            throw new configError(ERR_UNSUPPORTED_SID_ADDR);
                        }

                        m_mixer.addSid(s1);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void sidRelease()
        {
            m_c64.clearSids();

            for (UInt32 i = 0; ; i++)
            {
                sidemu s = m_mixer.getSid(i);
                if (s == null)
                {
                    break;
                }
                sidplayfp.sidbuilder b = s.builder();
                if (b != null)
                {
                    b.unlock(s);
                }
            }

            m_mixer.clearSids();
        }