Exemplo n.º 1
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;

            _freq1 = 0x02D0;
            _step1 = -0x000A;
            _freq2 = 0x0122;
            _step2 = 0x000A;
            _freq3 = 0x02BC;
            _step3 = -0x0005;
            _freq4 = 0x010E;
            _step4 = 0x0007;

            var tmp_data1 = new byte[_size1];
            var tmp_data2 = new byte[_size2];
            var tmp_data3 = new byte[_size1];
            var tmp_data4 = new byte[_size2];

            Array.Copy(data, _offset1, tmp_data1, 0, _size1);
            Array.Copy(data, _offset2, tmp_data2, 0, _size2);
            Array.Copy(data, _offset1, tmp_data3, 0, _size1);
            Array.Copy(data, _offset2, tmp_data4, 0, _size2);
            Player.StartChannel(Id | 0x000, tmp_data1, _size1, BASE_FREQUENCY / _freq1, _vol, 0, _size1, -127);
            Player.StartChannel(Id | 0x100, tmp_data2, _size2, BASE_FREQUENCY / _freq2, _vol, 0, _size2, 127);
            Player.StartChannel(Id | 0x200, tmp_data3, _size1, BASE_FREQUENCY / _freq3, _vol, 0, _size1, 127);
            Player.StartChannel(Id | 0x300, tmp_data4, _size2, BASE_FREQUENCY / _freq4, _vol, 0, _size2, -127);
        }
Exemplo n.º 2
0
        public Player_V3A(ScummEngine scumm, IPlayerMod mod)
        {
            _vm = scumm;
            for (var i = 0; i < V3A_MAXMUS; i++)
            {
                _mus[i].id = 0;
                _mus[i].dur = 0;
            }
            for (var i = 0; i < V3A_MAXSFX; i++)
            {
                _sfx[i].id = 0;
                _sfx[i].dur = 0;
            }

            _curSong = 0;
            _songData = null;
            _songPtr = 0;
            _songDelay = 0;

            _music_timer = 0;

            _isinit = false;

            _mod = mod;
            _mod.SetUpdateProc(playMusic, 60);
        }
Exemplo n.º 3
0
        public Player_V2A(ScummEngine scumm, IPlayerMod modPlayer)
        {
            _vm = scumm;

            _mod = modPlayer;
            _mod.SetUpdateProc(UpdateSound, 60);
        }
Exemplo n.º 4
0
        public Player_V3A(ScummEngine scumm, IPlayerMod mod)
        {
            _vm = scumm;
            for (var i = 0; i < V3A_MAXMUS; i++)
            {
                _mus[i].id  = 0;
                _mus[i].dur = 0;
            }
            for (var i = 0; i < V3A_MAXSFX; i++)
            {
                _sfx[i].id  = 0;
                _sfx[i].dur = 0;
            }

            _curSong   = 0;
            _songData  = null;
            _songPtr   = 0;
            _songDelay = 0;

            _music_timer = 0;

            _isinit = false;

            _mod = mod;
            _mod.SetUpdateProc(playMusic, 60);
        }
Exemplo n.º 5
0
        public Player_V2A(ScummEngine scumm, IPlayerMod modPlayer)
        {
            _vm = scumm;

            _mod = modPlayer;
            _mod.SetUpdateProc(UpdateSound, 60);
        }
Exemplo n.º 6
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id = id;

            _freq1 = 0x02D0;
            _step1 = -0x000A;
            _freq2 = 0x0122;
            _step2 = 0x000A;
            _freq3 = 0x02BC;
            _step3 = -0x0005;
            _freq4 = 0x010E;
            _step4 = 0x0007;

            var tmp_data1 = new byte[_size1];
            var tmp_data2 = new byte[_size2];
            var tmp_data3 = new byte[_size1];
            var tmp_data4 = new byte[_size2];
            Array.Copy(data, _offset1, tmp_data1, 0, _size1);
            Array.Copy(data, _offset2, tmp_data2, 0, _size2);
            Array.Copy(data, _offset1, tmp_data3, 0, _size1);
            Array.Copy(data, _offset2, tmp_data4, 0, _size2);
            Player.StartChannel(Id | 0x000, tmp_data1, _size1, BASE_FREQUENCY / _freq1, _vol, 0, _size1, -127);
            Player.StartChannel(Id | 0x100, tmp_data2, _size2, BASE_FREQUENCY / _freq2, _vol, 0, _size2, 127);
            Player.StartChannel(Id | 0x200, tmp_data3, _size1, BASE_FREQUENCY / _freq3, _vol, 0, _size1, 127);
            Player.StartChannel(Id | 0x300, tmp_data4, _size2, BASE_FREQUENCY / _freq4, _vol, 0, _size2, -127);
        }
Exemplo n.º 7
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     var tmp_data = new byte[_size];
     Array.Copy(data, _offset, tmp_data, 0, _size);
     int vol = (_vol << 2) | (_vol >> 4);
     Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _freq, vol, _loopoffset, _loopoffset + _loopsize);
 }
Exemplo n.º 8
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     _data = new byte[BitConverter.ToUInt16(data, 0)];
     Array.Copy(data, _data, _data.Length);
     Soundon();
     _loop = 0;
     _loopctr = 0;
 }
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     var tmp_data = new byte[_size];
     Array.Copy(data, _offset, tmp_data, 0, _size);
     _curvol = 1;
     _dir = 0;
     Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _freq, _curvol, 0, _size);
 }
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     var tmp_data = new byte[_size];
     Array.Copy(data, _offset, tmp_data, 0, _size);
     _curfreq = _freq1;
     _curvol = 0x3F;
     Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _curfreq, (_curvol << 2) | (_curvol >> 4), 0, _size);
 }
Exemplo n.º 11
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id     = id;
     _data  = new byte[BitConverter.ToUInt16(data, 0)];
     Array.Copy(data, _data, _data.Length);
     Soundon();
     _loop    = 0;
     _loopctr = 0;
 }
Exemplo n.º 12
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id     = id;
     _data  = new byte[BitConverter.ToUInt16(data, 0)];
     Array.Copy(data, _data, _data.Length);
     Soundon();
     _curdur = 0;
     _ticks  = _durations[_curdur++];
 }
Exemplo n.º 13
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     var tmp_data = new byte[_size];
     Array.Copy(data, _offset, tmp_data, 0, _size);
     _curvol = (ushort)((_vol << 3) | (_vol >> 3));
     _curfreq = _freq;
     Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _curfreq, _curvol >> 1, 0, _size);
 }
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     _data = new byte[BitConverter.ToUInt16(data, 0)];
     Array.Copy(data, _data, _data.Length);
     Soundon();
     _curdur = 0;
     _ticks = _durations[_curdur++];
 }
Exemplo n.º 15
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     var size = Math.Min(_size, data.Length - _offset);
     var tmp_data = new byte[size];
     Array.Copy(data, _offset, tmp_data, 0, size);
     int vol = (_vol << 2) | (_vol >> 4);
     Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _freq, vol);
     _ticks = 1 + (60 * _size * _freq) / BASE_FREQUENCY;
 }
Exemplo n.º 16
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            var tmp_data = new byte[_size];

            Array.Copy(data, _offset, tmp_data, 0, _size);
            int vol = (_vol << 2) | (_vol >> 4);

            Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _freq, vol, _loopoffset, _loopoffset + _loopsize);
        }
Exemplo n.º 17
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            var tmp_data = new byte[_size];

            Array.Copy(data, _offset, tmp_data, 0, _size);
            _curvol  = (ushort)((_vol << 3) | (_vol >> 3));
            _curfreq = _freq;
            Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _curfreq, _curvol >> 1, 0, _size);
        }
Exemplo n.º 18
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            var tmp_data = new byte[_size];

            Array.Copy(data, _offset, tmp_data, 0, _size);
            _curvol = 1;
            _dir    = 0;
            Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _freq, _curvol, 0, _size);
        }
Exemplo n.º 19
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            var tmp_data = new byte[_size];

            Array.Copy(data, _offset, tmp_data, 0, _size);
            _curfreq = _freq1;
            _curvol  = 0x3F;
            Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _curfreq, (_curvol << 2) | (_curvol >> 4), 0, _size);
        }
Exemplo n.º 20
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     Player = mod;
     Id = id;
     var tmp_data1 = new byte[_size];
     var tmp_data2 = new byte[_size];
     Array.Copy(data, _offset, tmp_data1, 0, _size);
     Array.Copy(data, _offset, tmp_data2, 0, _size);
     int vol1 = (_vol1 << 1) | (_vol1 >> 5);
     int vol2 = (_vol2 << 1) | (_vol2 >> 5);
     Player.StartChannel(Id | 0x000, tmp_data1, _size, BASE_FREQUENCY / _freq1, vol1, 0, _size, -127);
     Player.StartChannel(Id | 0x100, tmp_data2, _size, BASE_FREQUENCY / _freq2, vol2, 0, _size, 127);
 }
Exemplo n.º 21
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            _data  = new byte[BitConverter.ToUInt16(data, 0)];
            Array.Copy(data, _data, _data.Length);

            _loopnum = 1;
            _step    = 2;
            _curfreq = _freq1;

            Soundon(_data, _offset1, _size1);
        }
Exemplo n.º 22
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id = id;
            _data = new byte[BitConverter.ToUInt16(data, 0)];
            Array.Copy(data, _data, _data.Length);

            _loopnum = 1;
            _step = 2;
            _curfreq = _freq1;

            Soundon(_data, _offset1, _size1);
        }
Exemplo n.º 23
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            var size     = Math.Min(_size, data.Length - _offset);
            var tmp_data = new byte[size];

            Array.Copy(data, _offset, tmp_data, 0, size);
            int vol = (_vol << 2) | (_vol >> 4);

            Player.StartChannel(Id, tmp_data, _size, BASE_FREQUENCY / _freq, vol);
            _ticks = 1 + (60 * _size * _freq) / BASE_FREQUENCY;
        }
Exemplo n.º 24
0
        public override void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;
            var tmp_data1 = new byte[_size];
            var tmp_data2 = new byte[_size];

            Array.Copy(data, _offset, tmp_data1, 0, _size);
            Array.Copy(data, _offset, tmp_data2, 0, _size);
            int vol1 = (_vol1 << 1) | (_vol1 >> 5);
            int vol2 = (_vol2 << 1) | (_vol2 >> 5);

            Player.StartChannel(Id | 0x000, tmp_data1, _size, BASE_FREQUENCY / _freq1, vol1, 0, _size, -127);
            Player.StartChannel(Id | 0x100, tmp_data2, _size, BASE_FREQUENCY / _freq2, vol2, 0, _size, 127);
        }
Exemplo n.º 25
0
        public void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id     = id;

            _data = new byte[BitConverter.ToUInt16(data, 0)];
            Array.Copy(data, _data, _data.Length);

            _chan[0].dataptr_i = _chan1off;
            _chan[1].dataptr_i = _chan2off;
            _chan[2].dataptr_i = _chan3off;
            _chan[3].dataptr_i = _chan4off;
            for (int i = 0; i < 4; i++)
            {
                _chan[i].dataptr = _chan[i].dataptr_i;
                _chan[i].volbase = 0;
                _chan[i].volptr  = 0;
                _chan[i].chan    = 0;
                _chan[i].dur     = 0;
                _chan[i].ticks   = 0;
            }
            Update();
        }
Exemplo n.º 26
0
        public void Start(IPlayerMod mod, int id, byte[] data)
        {
            Player = mod;
            Id = id;

            _data = new byte[BitConverter.ToUInt16(data, 0)];
            Array.Copy(data, _data, _data.Length);

            _chan[0].dataptr_i = _chan1off;
            _chan[1].dataptr_i = _chan2off;
            _chan[2].dataptr_i = _chan3off;
            _chan[3].dataptr_i = _chan4off;
            for (int i = 0; i < 4; i++)
            {
                _chan[i].dataptr = _chan[i].dataptr_i;
                _chan[i].volbase = 0;
                _chan[i].volptr = 0;
                _chan[i].chan = 0;
                _chan[i].dur = 0;
                _chan[i].ticks = 0;
            }
            Update();
        }
Exemplo n.º 27
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     base.Start(mod, id, data);
     _ticks = 0;
 }
Exemplo n.º 28
0
 public override void Start(IPlayerMod mod, int id, byte[] data)
 {
     base.Start(mod, id, data);
     _ticks = 0;
 }
Exemplo n.º 29
0
 public abstract void Start(IPlayerMod mod, int id, byte[] data);