Previous 199869 Revisions Next

r32426 Saturday 27th September, 2014 at 04:45:49 UTC by Robbbert
s3.c : More improvements to the sound.
[src/mame/drivers]s3.c

trunk/src/mame/drivers/s3.c
r32425r32426
2020Each game has its own switches, you need to know the outhole and slam-tilt ones.
2121Note that T is also a tilt, but it may take 3 hits to activate it.
2222
23Game          Tilt    Outhole
24-----------------------------
25Hot Tip       S       A
26Lucky Seven   =       M
27World Cup     J       H
28Contact       ,       V
29Disco         Enter   N
30Phoenix       M       Left
31Pokerino      ,       X
23Game          Outhole   Tilt
24------------------------------------
25Hot Tip       A         S
26Lucky Seven   M         =
27World Cup     H         J
28Contact       V         ,
29Disco         N         Enter - =
30Phoenix       Left      M
31Pokerino      X         ,
3232
3333
3434ToDo:
r32425r32426
7373   DECLARE_WRITE8_MEMBER(switch_w);
7474   DECLARE_READ_LINE_MEMBER(pia28_ca1_r);
7575   DECLARE_READ_LINE_MEMBER(pia28_cb1_r);
76   DECLARE_READ_LINE_MEMBER(pias_cb1_r);
7776   DECLARE_WRITE_LINE_MEMBER(pia22_ca2_w) { }; //ST5
7877   DECLARE_WRITE_LINE_MEMBER(pia22_cb2_w) { }; //ST-solenoids enable
7978   DECLARE_WRITE_LINE_MEMBER(pia24_ca2_w) { }; //ST2
r32425r32426
9291   UINT8 m_sound_data;
9392   UINT8 m_strobe;
9493   UINT8 m_kbdrow;
95   bool m_cb1;
9694   bool m_data_ok;
9795   bool m_chimes;
9896   required_device<cpu_device> m_maincpu;
r32425r32426
307305   }
308306   else
309307   {
310      m_sound_data = ioport("SND")->read(); // 0xff or 0xbf
308      UINT8 sound_data = ioport("SND")->read(); // 0xff or 0xbf
311309      if (BIT(data, 0))
312         m_sound_data &= 0xfe;
310         sound_data &= 0xfe;
313311
314312      if (BIT(data, 1))
315         m_sound_data &= 0xfd;
313         sound_data &= 0xfd;
316314
317315      if (BIT(data, 2))
318         m_sound_data &= 0xfb;
316         sound_data &= 0xfb;
319317
320318      if (BIT(data, 3))
321         m_sound_data &= 0xf7;
319         sound_data &= 0xf7;
322320
323321      if (BIT(data, 4))
324         m_sound_data &= 0x7f;
322         sound_data &= 0xef;
325323
324      bool cb1 = ((sound_data & 0xbf) != 0xbf);
326325
327      m_cb1 = ((m_sound_data & 0x9f) != 0x9f);
326      if (cb1)
327         m_sound_data = sound_data;
328328
329      m_pias->cb1_w(m_cb1);
329      m_pias->cb1_w(cb1);
330330   }
331331
332332   if (BIT(data, 5))
r32425r32426
375375{
376376   m_strobe = data & 15;
377377   m_data_ok = true;
378   output_set_value("led0", BIT(data, 4));
379   output_set_value("led1", BIT(data, 5));
378   output_set_value("led0", !BIT(data, 4));
379   output_set_value("led1", !BIT(data, 5));
380380}
381381
382382WRITE8_MEMBER( s3_state::dig1_w )
r32425r32426
402402   m_kbdrow = data;
403403}
404404
405READ_LINE_MEMBER( s3_state::pias_cb1_r )
406{
407   return m_cb1;
408}
409
410405READ8_MEMBER( s3_state::dac_r )
411406{
412407   return m_sound_data;
r32425r32426
417412   m_dac->write_unsigned8(data);
418413}
419414
420TIMER_DEVICE_CALLBACK_MEMBER( s3_state::irq)
415TIMER_DEVICE_CALLBACK_MEMBER( s3_state::irq )
421416{
422417   if (m_t_c > 0x70)
423418      m_maincpu->set_input_line(M6800_IRQ_LINE, ASSERT_LINE);
r32425r32426
488483
489484   MCFG_DEVICE_ADD("pias", PIA6821, 0)
490485   MCFG_PIA_READPB_HANDLER(READ8(s3_state, dac_r))
491   MCFG_PIA_READCB1_HANDLER(READLINE(s3_state, pias_cb1_r))
492486   MCFG_PIA_WRITEPA_HANDLER(WRITE8(s3_state, dac_w))
493487   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("audiocpu", m6800_cpu_device, irq_line))
494488   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("audiocpu", m6800_cpu_device, irq_line))

Previous 199869 Revisions Next


© 1997-2024 The MAME Team