diff --git a/src/emu/sound/ymz770.c b/src/emu/sound/ymz770.c index 8b1dbcce196..fc85adf61bc 100644 --- a/src/emu/sound/ymz770.c +++ b/src/emu/sound/ymz770.c @@ -412,7 +412,7 @@ const double amm::synthesis_filter[513] = { +0.000442505, +0.000396729, +0.000366211, +0.000320435, +0.000289917, +0.000259399, +0.000244141, +0.000213623, +0.000198364, +0.000167847, +0.000152588, +0.000137329, +0.000122070, +0.000106812, +0.000106812, +0.000091553, +0.000076294, +0.000076294, +0.000061035, +0.000061035, +0.000045776, +0.000045776, +0.000030518, +0.000030518, - +0.000030518, +0.000030518, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259, + +0.000030518, +0.000030518, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259, +0.000015259, 0.0 }; int amm::get_band_param(int &pos, int band) @@ -665,7 +665,7 @@ void amm::handle_block(int &pos) int base_offset = rsize; for(int chan=0; chan 0) { - mix += (channels[ch].output_data[channels[ch].output_ptr++]*256); + mix += (channels[ch].output_data[channels[ch].output_ptr++]*2*channels[ch].volume); channels[ch].output_remaining--; } else @@ -791,7 +816,7 @@ void ymz770_device::sound_stream_update(sound_stream &stream, stream_sample_t ** channels[ch].output_remaining = (channels[ch].decoder->get_rsize()/2)-1; channels[ch].output_ptr = 1; - mix += (channels[ch].output_data[0]*256); + mix += (channels[ch].output_data[0]*2*channels[ch].volume); } } } @@ -844,7 +869,7 @@ WRITE8_MEMBER( ymz770_device::write ) break; case 3: - if ((data & 6) && !(channels[voice].is_playing)) + if (data & 6) { UINT8 phrase = channels[voice].phrase; UINT32 pptr = rom_base[(4*phrase)+1]<<16 | rom_base[(4*phrase)+2]<<8 | rom_base[(4*phrase)+3]; @@ -866,4 +891,30 @@ WRITE8_MEMBER( ymz770_device::write ) break; } } + else if (cur_reg >= 0x80 && cur_reg <= 0xff) + { + int voice = (cur_reg & 0x70)>>4; + int reg = cur_reg & 0x0f; + switch (reg) + { + case 0: + channels[voice].sequence = data; + break; + case 1: + if (data & 6) + { + UINT8 sqn = channels[voice].sequence; + UINT32 pptr = rom_base[(4*sqn)+1+0x400]<<16 | rom_base[(4*sqn)+2+0x400]<<8 | rom_base[(4*sqn)+3+0x400]; + channels[voice].seqdata = &rom_base[pptr]; + channels[voice].is_seq_playing = true; + channels[voice].seqdelay = 0; + } + else + { + channels[voice].is_seq_playing = false; + } + channels[voice].sqncontrol = data; + break; + } + } } diff --git a/src/emu/sound/ymz770.h b/src/emu/sound/ymz770.h index 5ae00f34189..98058ad4333 100644 --- a/src/emu/sound/ymz770.h +++ b/src/emu/sound/ymz770.h @@ -49,6 +49,12 @@ class ymz770_device : public device_t, public device_sound_interface int output_remaining; int output_ptr; + UINT8 sequence; + UINT8 sqncontrol; + UINT8 seqdelay; + UINT8 *seqdata; + bool is_seq_playing; + } ymz_channel;