Previous 199869 Revisions Next

r31972 Sunday 7th September, 2014 at 19:08:56 UTC by hap
get rid of static int irq1,irq2
[src/mame/audio]seibu.c seibu.h

trunk/src/mame/audio/seibu.c
r31971r31972
7777seibu_sound_device::seibu_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
7878   : device_t(mconfig, SEIBU_SOUND, "Seibu Sound System", tag, owner, clock, "seibu_sound", __FILE__),
7979      m_main2sub_pending(0),
80      m_sub2main_pending(0)
80      m_sub2main_pending(0),
81      m_rst10_irq(0xff),
82      m_rst18_irq(0xff)
8183{
8284}
8385
r31971r31972
9092   m_main2sub[0] = m_main2sub[1] = 0;
9193   m_sub2main[0] = m_sub2main[1] = 0;
9294
95   save_item(NAME(m_main2sub));
96   save_item(NAME(m_sub2main));
9397   save_item(NAME(m_main2sub_pending));
9498   save_item(NAME(m_sub2main_pending));
95
96   save_item(NAME(m_main2sub));
97   save_item(NAME(m_sub2main));
98
99   for (int i = 0; i < 2; i++)
100   {
101      save_item(NAME(m_main2sub[i]), i);
102      save_item(NAME(m_sub2main[i]), i);
103   }
99   save_item(NAME(m_rst10_irq));
100   save_item(NAME(m_rst18_irq));
104101}
105102
106103//-------------------------------------------------
r31971r31972
179176
180177void seibu_sound_device::update_irq_lines(int param)
181178{
182   static int irq1,irq2;
179   // note: we use 0xff here for inactive irq
183180
184   switch(param)
181   switch (param)
185182   {
186183      case VECTOR_INIT:
187         irq1 = irq2 = 0xff;
184         m_rst10_irq = m_rst18_irq = 0xff;
188185         break;
189186
190187      case RST10_ASSERT:
191         irq1 = 0xd7;
188         m_rst10_irq = 0xd7;
192189         break;
193190
194191      case RST10_CLEAR:
195         irq1 = 0xff;
192         m_rst10_irq = 0xff;
196193         break;
197194
198195      case RST18_ASSERT:
199         irq2 = 0xdf;
196         m_rst18_irq = 0xdf;
200197         break;
201198
202199      case RST18_CLEAR:
203         irq2 = 0xff;
200         m_rst18_irq = 0xff;
204201         break;
205202   }
206203
207204   if (m_sound_cpu != NULL)
208         if ((irq1 & irq2) == 0xff)  /* no IRQs pending */
209            m_sound_cpu->execute().set_input_line(0,CLEAR_LINE);
210         else    /* IRQ pending */
211            m_sound_cpu->execute().set_input_line_and_vector(0,ASSERT_LINE,irq1 & irq2);
205   {
206      if ((m_rst10_irq & m_rst18_irq) == 0xff) /* no IRQs pending */
207         m_sound_cpu->execute().set_input_line(0, CLEAR_LINE);
208      else /* IRQ pending */
209         m_sound_cpu->execute().set_input_line_and_vector(0, ASSERT_LINE, m_rst10_irq & m_rst18_irq);
210   }
212211   else
213   return;
214   }
212      return;
213}
215214
216215
217216WRITE8_MEMBER( seibu_sound_device::irq_clear_w )
r31971r31972
252251
253252WRITE8_MEMBER( seibu_sound_device::coin_w )
254253{
255   coin_counter_w(space.machine(), 0,data & 1);
256   coin_counter_w(space.machine(), 1,data & 2);
254   coin_counter_w(space.machine(), 0, data & 1);
255   coin_counter_w(space.machine(), 1, data & 2);
257256}
258257
259258READ8_MEMBER( seibu_sound_device::soundlatch_r )
r31971r31972
333332
334333WRITE16_MEMBER( seibu_sound_device::main_mustb_w )
335334{
336   m_main2sub[0] = data&0xff;
337   m_main2sub[1] = data>>8;
335   if (ACCESSING_BITS_0_7)
336      m_main2sub[0] = data & 0xff;
337   if (ACCESSING_BITS_8_15)
338      m_main2sub[1] = data >> 8;
338339
339340//  logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]);
340341
r31971r31972
490491      m_end(0),
491492      m_nibble(0),
492493      m_playing(0),
493      //m_allocated(0),
494494      m_rom_tag(NULL),
495495      m_base(NULL)
496496{
r31971r31972
527527{
528528   if (m_stream)
529529      m_stream->update();
530
530531   if (offset)
531532   {
532533      m_end = data<<8;
r31971r31972
543544   // sequence is 00 02 01 each time.
544545   if (m_stream)
545546      m_stream->update();
547
546548   switch (data)
547549   {
548550      case 0:
r31971r31972
553555      case 1:
554556         m_playing = 1;
555557         break;
556
557558   }
558559}
559560
trunk/src/mame/audio/seibu.h
r31971r31972
7777   UINT8 m_sub2main[2];
7878   int m_main2sub_pending;
7979   int m_sub2main_pending;
80   UINT8 m_rst10_irq;
81   UINT8 m_rst18_irq;
8082
8183   enum
8284   {
r31971r31972
9395
9496// Seibu ADPCM device
9597
96struct seibu_adpcm_interface
97{
98};
99
10098class seibu_adpcm_device : public device_t,
10199                           public device_sound_interface
102100{
r31971r31972
125123   UINT32 m_end;
126124   UINT8 m_nibble;
127125   UINT8 m_playing;
128   //UINT8 m_allocated;
129126   const char *m_rom_tag;
130127   UINT8 *m_base;
131128};

Previous 199869 Revisions Next


© 1997-2024 The MAME Team