Example #1
0
        internal static void Init(byte songReverb)
        {
            DSMasterVolume = ROM.Instance.Game.Engine.Volume / (float)0xF;

            byte engineReverb = ROM.Instance.Game.Engine.Reverb;
            byte reverb       = (byte)(engineReverb >= 0x80 ? engineReverb & 0x7F : songReverb & 0x7F);

            for (int i = 0; i < MAX_TRACKS; i++)
            {
                byte numBuffers = (byte)(0x630 / (ROM.Instance.Game.Engine.Frequency / Engine.AGB_FPS));
                switch (ROM.Instance.Game.Engine.ReverbType)
                {
                default: reverbs[i] = new Reverb(reverb, numBuffers); break;

                case ReverbType.Camelot1: reverbs[i] = new ReverbCamelot1(reverb, numBuffers); break;

                case ReverbType.None: reverbs[i] = new Reverb(0, numBuffers); break;
                }
            }
        }
Example #2
0
        public void Init(byte reverbAmt)
        {
            DSMasterVolume = ROM.Instance.Game.Engine.Volume / (float)0xF;
            numTracks      = ROM.Instance.Game.Engine.TrackLimit + 1; // 1 for program use

            trackBuffers = new float[numTracks][];
            reverbs      = new Reverb[numTracks];

            int amt = SamplesPerBuffer * 2;

            for (int i = 0; i < numTracks; i++)
            {
                trackBuffers[i] = new float[amt];
            }

            ReverbType reverbType = ROM.Instance.Game.Engine.ReverbType;

            reverbType = ReverbType.None; // For now because of crashes

            byte engineReverb = ROM.Instance.Game.Engine.Reverb;
            byte reverb       = (byte)(engineReverb >= 0x80 ? engineReverb & 0x7F : reverbAmt & 0x7F);

            for (int i = 0; i < numTracks; i++)
            {
                byte numBuffers = (byte)(0x630 / (ROM.Instance.Game.Engine.Frequency / Engine.AGB_FPS));
                switch (reverbType)
                {
                default: reverbs[i] = new Reverb(reverb, numBuffers); break;

                case ReverbType.Camelot1: reverbs[i] = new ReverbCamelot1(reverb, numBuffers); break;

                case ReverbType.Camelot2: reverbs[i] = new ReverbCamelot2(reverb, numBuffers, 53 / 128f, -8 / 128f); break;

                case ReverbType.MGAT: reverbs[i] = new ReverbCamelot2(reverb, numBuffers, 32 / 128f, -6 / 128f); break;

                case ReverbType.None: reverbs[i] = null; break;
                }
            }
        }