Previous 199869 Revisions Next

r26456 Saturday 30th November, 2013 at 19:26:33 UTC by hap
document global regs
[src/emu/sound]ymz770.c ymz770.h

trunk/src/emu/sound/ymz770.c
r26455r26456
2020
2121ymz770_device::ymz770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
2222   : device_t(mconfig, YMZ770, "Yamaha YMZ770", tag, owner, clock, "ymz770", __FILE__),
23      device_sound_interface(mconfig, *this)
23      device_sound_interface(mconfig, *this),
24      m_cur_reg(0),
25      m_mute(0),
26      m_doen(0),
27      m_vlma(0),
28      m_bsl(0),
29      m_cpl(0)
2430{
2531}
2632
r26455r26456
4551
4652   // register for save states
4753   save_item(NAME(m_cur_reg));
54   save_item(NAME(m_mute));
55   save_item(NAME(m_doen));
56   save_item(NAME(m_vlma));
57   save_item(NAME(m_bsl));
58   save_item(NAME(m_cpl));
59
4860   for (int i = 0; i < 8; i++)
4961   {
5062      save_item(NAME(m_channels[i].phrase), i);
r26455r26456
94106void ymz770_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples)
95107{
96108   stream_sample_t *outL, *outR;
97   int i, ch;
98109
99110   outL = outputs[0];
100111   outR = outputs[1];
101112
102   for (i = 0; i < samples; i++)
113   for (int i = 0; i < samples; i++)
103114   {
104      INT32 mix;
115      INT32 mix = 0;
105116
106      mix = 0;
107
108      for (ch = 0; ch < 8; ch++)
117      for (int ch = 0; ch < 8; ch++)
109118      {
110119         if (m_channels[ch].is_seq_playing)
111120         {
r26455r26456
212221
213222void ymz770_device::internal_reg_write(UINT8 reg, UINT8 data)
214223{
215   if (reg >= 0x40 && reg <= 0x5f)
224   // global registers
225   if (reg < 0x40)
216226   {
227      switch (reg)
228      {
229         case 0x00:
230            m_mute = data & 1;
231            m_doen = data >> 1 & 1;
232            break;
233         
234         case 0x01:
235            m_vlma = data;
236            break;
237         
238         case 0x02:
239            m_bsl = data & 7;
240            m_cpl = data >> 4 & 7;
241            break;
242
243         // unused
244         default:
245            break;
246      }
247   }
248
249   // playback registers
250   else if (reg < 0x60)
251   {
217252      int voice = reg >> 2 & 0x07;
218253
219254      switch (reg & 0x03)
r26455r26456
250285            break;
251286      }
252287   }
253   else if (reg >= 0x80)
288   
289   // sequencer registers
290   else
254291   {
255292      int voice = reg >> 4 & 0x07;
256293
trunk/src/emu/sound/ymz770.h
r26455r26456
7878
7979   // data
8080   UINT8 m_cur_reg;
81   UINT8 m_mute;         // mute chip
82   UINT8 m_doen;         // digital output enable
83   UINT8 m_vlma;         // overall AAM volume
84   UINT8 m_bsl;          // boost level
85   UINT8 m_cpl;          // clip limiter
8186   UINT8 *m_rom_base;
8287   int m_rom_size;
8388

Previous 199869 Revisions Next


© 1997-2024 The MAME Team