Previous 199869 Revisions Next

r32520 Saturday 4th October, 2014 at 05:47:50 UTC by Robbbert
s6,s6a : fixed diagnostic mode, fixed dips.
[src/mame/drivers]s6.c s6a.c
[src/mame/layout]s6.lay

trunk/src/mame/layout/s6.lay
r32519r32520
7676      </bezel>
7777
7878      <!-- Player 3 Score -->
79      <bezel name="digit16" element="digit">
79      <bezel name="digit20" element="digit">
8080         <bounds left="10" top="165" right="44" bottom="204" />
8181      </bezel>
82      <bezel name="digit17" element="digit">
82      <bezel name="digit21" element="digit">
8383         <bounds left="54" top="165" right="88" bottom="204" />
8484      </bezel>
85      <bezel name="digit18" element="digit">
85      <bezel name="digit22" element="digit">
8686         <bounds left="98" top="165" right="132" bottom="204" />
8787      </bezel>
88      <bezel name="digit19" element="digit">
88      <bezel name="digit23" element="digit">
8989         <bounds left="142" top="165" right="176" bottom="204" />
9090      </bezel>
91      <bezel name="digit20" element="digit">
91      <bezel name="digit24" element="digit">
9292         <bounds left="186" top="165" right="220" bottom="204" />
9393      </bezel>
94      <bezel name="digit21" element="digit">
94      <bezel name="digit25" element="digit">
9595         <bounds left="230" top="165" right="264" bottom="204" />
9696      </bezel>
9797
9898      <!-- Player 4 Score -->
99      <bezel name="digit24" element="digit">
99      <bezel name="digit28" element="digit">
100100         <bounds left="10" top="225" right="44" bottom="264" />
101101      </bezel>
102      <bezel name="digit25" element="digit">
102      <bezel name="digit29" element="digit">
103103         <bounds left="54" top="225" right="88" bottom="264" />
104104      </bezel>
105      <bezel name="digit26" element="digit">
105      <bezel name="digit30" element="digit">
106106         <bounds left="98" top="225" right="132" bottom="264" />
107107      </bezel>
108      <bezel name="digit27" element="digit">
108      <bezel name="digit31" element="digit">
109109         <bounds left="142" top="225" right="176" bottom="264" />
110110      </bezel>
111      <bezel name="digit28" element="digit">
111      <bezel name="digit32" element="digit">
112112         <bounds left="186" top="225" right="220" bottom="264" />
113113      </bezel>
114      <bezel name="digit29" element="digit">
114      <bezel name="digit33" element="digit">
115115         <bounds left="230" top="225" right="264" bottom="264" />
116116      </bezel>
117117
r32519r32520
122122      <bezel name="digit15" element="digit">
123123         <bounds left="54" top="345" right="88" bottom="384" />
124124      </bezel>
125      <bezel name="digit8" element="digit">
125      <bezel name="digit6" element="digit">
126126         <bounds left="186" top="345" right="220" bottom="384" />
127127      </bezel>
128128      <bezel name="digit7" element="digit">
trunk/src/mame/drivers/s6.c
r32519r32520
55  PINBALL
66  Williams System 6
77
8Diagnostic actions:
9- You must be in game over mode. All buttons are in the number-pad. When you are
10  finished, you must reboot.
11
12- Setup: 6 must be in auto/up position. Press 5 to enter setup mode, press 6 to
13         change direction.
14
15- Tests: 6 must be in manual/down position. Press 5 twice and tests will begin.
16         Press 5 and 6 together to get from test 1 to test 2. Press 6 to switch
17         between auto/manual stepping.
18
19- Auto Diag Test: Set Dips to SW6. Press 4. Press 9. Press 5. Tests will begin.
20
21- Other: Set Dips to SW7 or SW8. Press 4. Press 9.
22
23
824Each game has its own switches, you need to know the outhole and slam-tilt ones.
925Note that T is also a tilt, but it may take 3 hits to activate it.
1026
r32519r32520
2339
2440
2541ToDo:
26- Diagnostic mode freezes
2742- Mechanical sounds
2843- Blackout: slow response at times
2944- Firepower: unable to start / unknown key combo?
r32519r32520
4661   s6_state(const machine_config &mconfig, device_type type, const char *tag)
4762      : genpin_class(mconfig, type, tag)
4863      , m_maincpu(*this, "maincpu")
49      , m_audiocpu(*this, "audioroms")
64      , m_audiocpu(*this, "audiocpu")
5065      , m_dac(*this, "dac")
5166      , m_hc55516(*this, "hc55516")
5267      , m_pias(*this, "pias")
r32519r32520
6681   DECLARE_WRITE8_MEMBER(sol1_w);
6782   DECLARE_READ8_MEMBER(switch_r);
6883   DECLARE_WRITE8_MEMBER(switch_w);
69   DECLARE_WRITE8_MEMBER(pias_pb_w) { }; // dummy to stop log filling up
70   DECLARE_READ_LINE_MEMBER(pia28_ca1_r);
71   DECLARE_READ_LINE_MEMBER(pia28_cb1_r);
7284   DECLARE_WRITE_LINE_MEMBER(pia22_ca2_w) { }; //ST5
7385   DECLARE_WRITE_LINE_MEMBER(pia22_cb2_w) { }; //ST-solenoids enable
7486   DECLARE_WRITE_LINE_MEMBER(pia24_ca2_w) { }; //ST2
r32519r32520
7789   DECLARE_WRITE_LINE_MEMBER(pia28_cb2_w) { }; //ST6
7890   DECLARE_WRITE_LINE_MEMBER(pia30_ca2_w) { }; //ST4
7991   DECLARE_WRITE_LINE_MEMBER(pia30_cb2_w) { }; //ST3
80   TIMER_DEVICE_CALLBACK_MEMBER(irq);
92   DECLARE_WRITE_LINE_MEMBER(pia_irq);
8193   DECLARE_INPUT_CHANGED_MEMBER(main_nmi);
8294   DECLARE_INPUT_CHANGED_MEMBER(audio_nmi);
8395   DECLARE_MACHINE_RESET(s6);
96   DECLARE_DRIVER_INIT(s6);
8497private:
85   UINT8 m_t_c;
8698   UINT8 m_sound_data;
8799   UINT8 m_strobe;
88100   UINT8 m_kbdrow;
89101   bool m_data_ok;
102   emu_timer* m_irq_timer;
103   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
104   static const device_timer_id TIMER_IRQ = 0;
90105   required_device<cpu_device> m_maincpu;
91106   required_device<cpu_device> m_audiocpu;
92107   required_device<dac_device> m_dac;
r32519r32520
207222   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Manual/Auto") PORT_CODE(KEYCODE_6_PAD) PORT_TOGGLE
208223   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter") PORT_CODE(KEYCODE_9_PAD)
209224
210   PORT_START("DSW0")
211   PORT_DIPNAME( 0x01, 0x01, "SW01" )
212   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
213   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
214   PORT_DIPNAME( 0x02, 0x02, "SW02" )
215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
216   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
217   PORT_DIPNAME( 0x04, 0x04, "SW03" )
218   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
219   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
220   PORT_DIPNAME( 0x08, 0x08, "SW04" )
221   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
222   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
223   PORT_DIPNAME( 0x10, 0x10, "SW05" )
224   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
225   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
226   PORT_DIPNAME( 0x20, 0x20, "SW06" )
227   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
228   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
229   PORT_DIPNAME( 0x40, 0x40, "SW07" )
230   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
231   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
232   PORT_DIPNAME( 0x80, 0x80, "SW08" )
233   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
234   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
225   PORT_START("DS1") // DS1 only 3 switches do anything
226   PORT_DIPNAME( 0x70, 0x70, "Diagnostic" )
227   PORT_DIPSETTING(    0x70, "Off" )
228   PORT_DIPSETTING(    0x60, "SW8 - Zero Audit Tables" )
229   PORT_DIPSETTING(    0x50, "SW7 - Reset to Defaults" )
230   PORT_DIPSETTING(    0x30, "SW6 - Auto Diagnostic Test" )
231   PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNUSED )
235232
236   PORT_START("DSW1")
237   PORT_DIPNAME( 0x01, 0x01, "SW11" )
238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
240   PORT_DIPNAME( 0x02, 0x02, "SW12" )
241   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
242   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
243   PORT_DIPNAME( 0x04, 0x04, "SW13" )
244   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
245   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
246   PORT_DIPNAME( 0x08, 0x08, "SW14" )
247   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
248   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
249   PORT_DIPNAME( 0x10, 0x10, "SW15" )
250   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
251   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
252   PORT_DIPNAME( 0x20, 0x20, "SW16" )
253   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
254   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
255   PORT_DIPNAME( 0x40, 0x40, "SW17" )
256   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
257   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
258   PORT_DIPNAME( 0x80, 0x80, "SW18" )
259   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
260   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
233   PORT_START("DS2") // DS2 switches exist but do nothing
234   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
261235INPUT_PORTS_END
262236
263MACHINE_RESET_MEMBER( s6_state, s6 )
264{
265   m_t_c = 0;
266}
267
268237INPUT_CHANGED_MEMBER( s6_state::main_nmi )
269238{
270239   // Diagnostic button sends a pulse to NMI pin
r32519r32520
316285
317286WRITE8_MEMBER( s6_state::lamp0_w )
318287{
319   m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
320288}
321289
322290WRITE8_MEMBER( s6_state::lamp1_w )
323291{
324292}
325293
326READ_LINE_MEMBER( s6_state::pia28_ca1_r )
327{
328   return BIT(ioport("DIAGS")->read(), 2); // advance button
329}
330
331READ_LINE_MEMBER( s6_state::pia28_cb1_r )
332{
333   return BIT(ioport("DIAGS")->read(), 3); // auto/manual switch
334}
335
336294READ8_MEMBER( s6_state::dips_r )
337295{
338296   if (BIT(ioport("DIAGS")->read(), 4) )
r32519r32520
340298      switch (m_strobe)
341299      {
342300      case 0:
343         return ioport("DSW0")->read() & 15;
301         return ioport("DS2")->read();
344302      case 1:
345         return ioport("DSW0")->read() << 4;
303         return ioport("DS2")->read() << 4;
346304      case 2:
347         return ioport("DSW1")->read() & 15;
305         return ioport("DS1")->read();
348306      case 3:
349         return ioport("DSW1")->read() << 4;
307         return ioport("DS1")->read() << 4;
350308      }
351309   }
352310   return 0xff;
r32519r32520
354312
355313WRITE8_MEMBER( s6_state::dig0_w )
356314{
357   m_strobe = data;
315   m_strobe = data & 15;
358316   m_data_ok = true;
359317   output_set_value("led0", !BIT(data, 4));
360318   output_set_value("led1", !BIT(data, 5));
r32519r32520
365323   static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // MC14558
366324   if (m_data_ok)
367325   {
368      output_set_digit_value(m_strobe+16, patterns[data&15]);
326      output_set_digit_value(m_strobe+20, patterns[data&15]);
369327      output_set_digit_value(m_strobe, patterns[data>>4]);
370328   }
371329   m_data_ok = false;
r32519r32520
375333{
376334   char kbdrow[8];
377335   sprintf(kbdrow,"X%X",m_kbdrow);
378   return ~ioport(kbdrow)->read();
336   return ioport(kbdrow)->read() ^ 0xff;
379337}
380338
381339WRITE8_MEMBER( s6_state::switch_w )
r32519r32520
388346   return m_sound_data;
389347}
390348
391TIMER_DEVICE_CALLBACK_MEMBER( s6_state::irq)
349WRITE_LINE_MEMBER( s6_state::pia_irq )
392350{
393   if (m_t_c > 0x70)
394      m_maincpu->set_input_line(M6800_IRQ_LINE, ASSERT_LINE);
351   if(state == CLEAR_LINE)
352   {
353      // restart IRQ timer
354      m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
355   }
395356   else
396      m_t_c++;
357   {
358      // disable IRQ timer while other IRQs are being handled
359      // (counter is reset every 32 cycles while a PIA IRQ is handled)
360      m_irq_timer->adjust(attotime::zero);
361   }
397362}
398363
364void s6_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
365{
366   switch(id)
367   {
368   case TIMER_IRQ:
369      if(param == 1)
370      {
371         m_maincpu->set_input_line(M6800_IRQ_LINE,ASSERT_LINE);
372         m_irq_timer->adjust(attotime::from_ticks(32,3580000/4),0);
373         m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2));  // Advance
374         m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3));  // Up/Down
375      }
376      else
377      {
378         m_maincpu->set_input_line(M6800_IRQ_LINE,CLEAR_LINE);
379         m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
380         m_pia28->ca1_w(1);
381         m_pia28->cb1_w(1);
382      }
383      break;
384   }
385}
386
387MACHINE_RESET_MEMBER( s6_state, s6 )
388{
389}
390
391DRIVER_INIT_MEMBER( s6_state, s6 )
392{
393   m_irq_timer = timer_alloc(TIMER_IRQ);
394   m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
395}
396
399397static MACHINE_CONFIG_START( s6, s6_state )
400398   /* basic machine hardware */
401   MCFG_CPU_ADD("maincpu", M6800, 3580000) // 6802 or 6808 could be used here
399   MCFG_CPU_ADD("maincpu", M6808, 3580000) // 6802 or 6808 could be used here
402400   MCFG_CPU_PROGRAM_MAP(s6_main_map)
403   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq", s6_state, irq, attotime::from_hz(250))
404401   MCFG_MACHINE_RESET_OVERRIDE(s6_state, s6)
405402
406403   /* Video */
r32519r32520
415412   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6_state, sol1_w))
416413   MCFG_PIA_CA2_HANDLER(WRITELINE(s6_state, pia22_ca2_w))
417414   MCFG_PIA_CB2_HANDLER(WRITELINE(s6_state, pia22_cb2_w))
418   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
419   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
415   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6_state, pia_irq))
416   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6_state, pia_irq))
420417
421418   MCFG_DEVICE_ADD("pia24", PIA6821, 0)
422419   MCFG_PIA_WRITEPA_HANDLER(WRITE8(s6_state, lamp0_w))
423420   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6_state, lamp1_w))
424421   MCFG_PIA_CA2_HANDLER(WRITELINE(s6_state, pia24_ca2_w))
425422   MCFG_PIA_CB2_HANDLER(WRITELINE(s6_state, pia24_cb2_w))
426   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
427   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
423   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6_state, pia_irq))
424   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6_state, pia_irq))
428425
429426   MCFG_DEVICE_ADD("pia28", PIA6821, 0)
430427   MCFG_PIA_READPA_HANDLER(READ8(s6_state, dips_r))
431   MCFG_PIA_READCA1_HANDLER(READLINE(s6_state, pia28_ca1_r))
432   MCFG_PIA_READCB1_HANDLER(READLINE(s6_state, pia28_cb1_r))
433428   MCFG_PIA_WRITEPA_HANDLER(WRITE8(s6_state, dig0_w))
434429   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6_state, dig1_w))
435430   MCFG_PIA_CA2_HANDLER(WRITELINE(s6_state, pia28_ca2_w))
436431   MCFG_PIA_CB2_HANDLER(WRITELINE(s6_state, pia28_cb2_w))
437   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
438   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
432   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6_state, pia_irq))
433   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6_state, pia_irq))
439434
440435   MCFG_DEVICE_ADD("pia30", PIA6821, 0)
441436   MCFG_PIA_READPA_HANDLER(READ8(s6_state, switch_r))
442437   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6_state, switch_w))
443438   MCFG_PIA_CA2_HANDLER(WRITELINE(s6_state, pia30_ca2_w))
444439   MCFG_PIA_CB2_HANDLER(WRITELINE(s6_state, pia30_cb2_w))
445   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
446   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line))
440   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6_state, pia_irq))
441   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6_state, pia_irq))
447442
448   MCFG_NVRAM_ADD_1FILL("nvram")
443   MCFG_NVRAM_ADD_0FILL("nvram")
449444
450445   /* Add the soundcard */
451   MCFG_CPU_ADD("audioroms", M6802, 3580000)
446   MCFG_CPU_ADD("audiocpu", M6802, 3580000)
452447   MCFG_CPU_PROGRAM_MAP(s6_audio_map)
453448   MCFG_SPEAKER_STANDARD_MONO("mono")
454449   MCFG_SOUND_ADD("dac", DAC, 0)
r32519r32520
460455   MCFG_DEVICE_ADD("pias", PIA6821, 0)
461456   MCFG_PIA_READPB_HANDLER(READ8(s6_state, dac_r))
462457   MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
463   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6_state, pias_pb_w))
464458   MCFG_PIA_CA2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, digit_w))
465459   MCFG_PIA_CB2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, clock_w))
466   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("audioroms", m6802_cpu_device, irq_line))
467   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("audioroms", m6802_cpu_device, irq_line))
460   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("audiocpu", m6802_cpu_device, irq_line))
461   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("audiocpu", m6802_cpu_device, irq_line))
468462MACHINE_CONFIG_END
469463
470464
r32519r32520
640634ROM_END
641635
642636
643GAME( 1979, lzbal_l2, 0,        s6, s6, driver_device, 0, ROT0, "Williams", "Laser Ball (L-2)", GAME_MECHANICAL )
644GAME( 1980, lzbal_t2, lzbal_l2, s6, s6, driver_device, 0, ROT0, "Williams", "Laser Ball (T-2)", GAME_MECHANICAL )
645GAME( 1980, scrpn_l1, 0,        s6, s6, driver_device, 0, ROT0, "Williams", "Scorpion (L-1)", GAME_MECHANICAL )
646GAME( 1980, scrpn_t1, scrpn_l1, s6, s6, driver_device, 0, ROT0, "Williams", "Scorpion (T-1)", GAME_MECHANICAL )
647GAME( 1979, blkou_l1, 0,        s6, s6, driver_device, 0, ROT0, "Williams", "Blackout (L-1)", GAME_MECHANICAL )
648GAME( 1979, blkou_t1, blkou_l1, s6, s6, driver_device, 0, ROT0, "Williams", "Blackout (T-1)", GAME_MECHANICAL )
649GAME( 1979, blkou_f1, blkou_l1, s6, s6, driver_device, 0, ROT0, "Williams", "Blackout (L-1, French Speech)", GAME_MECHANICAL )
650GAME( 1979, grgar_l1, 0,        s6, s6, driver_device, 0, ROT0, "Williams", "Gorgar (L-1)", GAME_MECHANICAL )
651GAME( 1979, grgar_t1, grgar_l1, s6, s6, driver_device, 0, ROT0, "Williams", "Gorgar (T-1)", GAME_MECHANICAL )
652GAME( 1980, frpwr_l6, 0,        s6, s6, driver_device, 0, ROT0, "Williams", "Firepower (L-6)", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_NO_SOUND)
653GAME( 1980, frpwr_t6, frpwr_l6, s6, s6, driver_device, 0, ROT0, "Williams", "Firepower (T-6)", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_NO_SOUND)
654GAME( 1980, frpwr_l2, frpwr_l6, s6, s6, driver_device, 0, ROT0, "Williams", "Firepower (L-2)", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_NO_SOUND)
637GAME( 1979, lzbal_l2, 0,        s6, s6, s6_state, s6, ROT0, "Williams", "Laser Ball (L-2)", GAME_MECHANICAL )
638GAME( 1980, lzbal_t2, lzbal_l2, s6, s6, s6_state, s6, ROT0, "Williams", "Laser Ball (T-2)", GAME_MECHANICAL )
639GAME( 1980, scrpn_l1, 0,        s6, s6, s6_state, s6, ROT0, "Williams", "Scorpion (L-1)", GAME_MECHANICAL )
640GAME( 1980, scrpn_t1, scrpn_l1, s6, s6, s6_state, s6, ROT0, "Williams", "Scorpion (T-1)", GAME_MECHANICAL )
641GAME( 1979, blkou_l1, 0,        s6, s6, s6_state, s6, ROT0, "Williams", "Blackout (L-1)", GAME_MECHANICAL )
642GAME( 1979, blkou_t1, blkou_l1, s6, s6, s6_state, s6, ROT0, "Williams", "Blackout (T-1)", GAME_MECHANICAL )
643GAME( 1979, blkou_f1, blkou_l1, s6, s6, s6_state, s6, ROT0, "Williams", "Blackout (L-1, French Speech)", GAME_MECHANICAL )
644GAME( 1979, grgar_l1, 0,        s6, s6, s6_state, s6, ROT0, "Williams", "Gorgar (L-1)", GAME_MECHANICAL )
645GAME( 1979, grgar_t1, grgar_l1, s6, s6, s6_state, s6, ROT0, "Williams", "Gorgar (T-1)", GAME_MECHANICAL )
646GAME( 1980, frpwr_l6, 0,        s6, s6, s6_state, s6, ROT0, "Williams", "Firepower (L-6)", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_NO_SOUND)
647GAME( 1980, frpwr_t6, frpwr_l6, s6, s6, s6_state, s6, ROT0, "Williams", "Firepower (T-6)", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_NO_SOUND)
648GAME( 1980, frpwr_l2, frpwr_l6, s6, s6, s6_state, s6, ROT0, "Williams", "Firepower (L-2)", GAME_MECHANICAL | GAME_NOT_WORKING | GAME_NO_SOUND)
trunk/src/mame/drivers/s6a.c
r32519r32520
66  Williams System 6a
77  The only difference to System 6 is that the display is 7 digits instead of 6.
88
9Diagnostic actions:
10- You must be in game over mode. All buttons are in the number-pad. When you are
11  finished, you must reboot.
12
13- Setup: 6 must be in auto/up position. Press 5 to enter setup mode, press 6 to
14         change direction.
15
16- Tests: 6 must be in manual/down position. Press 5 twice and tests will begin.
17         Press 5 and 6 together to get from test 1 to test 2. Press 6 to switch
18         between auto/manual stepping.
19
20- Auto Diag Test: Set Dips to SW6. Press 4. Press 9. Press 5. Tests will begin.
21
22- Other: Set Dips to SW7 or SW8. Press 4. Press 9.
23
24
925Each game has its own switches, you need to know the outhole and slam-tilt ones.
1026Note that T is also a tilt, but it may take 3 hits to activate it.
1127
r32519r32520
1834Alien Poker: wait for the background sound before attempting to score.
1935
2036ToDo:
21- Diagnostic mode freezes
2237- Mechanical sounds
2338
2439
r32519r32520
5974   DECLARE_READ8_MEMBER(dips_r);
6075   DECLARE_READ8_MEMBER(switch_r);
6176   DECLARE_WRITE8_MEMBER(switch_w);
62   DECLARE_READ_LINE_MEMBER(pia28_ca1_r);
63   DECLARE_READ_LINE_MEMBER(pia28_cb1_r);
6477   DECLARE_WRITE_LINE_MEMBER(pia22_ca2_w) { }; //ST5
6578   DECLARE_WRITE_LINE_MEMBER(pia22_cb2_w) { }; //ST-solenoids enable
6679   DECLARE_WRITE_LINE_MEMBER(pia24_ca2_w) { }; //ST2
r32519r32520
6982   DECLARE_WRITE_LINE_MEMBER(pia28_cb2_w) { }; //ST6
7083   DECLARE_WRITE_LINE_MEMBER(pia30_ca2_w) { }; //ST4
7184   DECLARE_WRITE_LINE_MEMBER(pia30_cb2_w) { }; //ST3
72   TIMER_DEVICE_CALLBACK_MEMBER(irq);
85   DECLARE_WRITE_LINE_MEMBER(pia_irq);
7386   DECLARE_INPUT_CHANGED_MEMBER(main_nmi);
7487   DECLARE_INPUT_CHANGED_MEMBER(audio_nmi);
7588   DECLARE_MACHINE_RESET(s6a);
89   DECLARE_DRIVER_INIT(s6a);
7690private:
77   UINT8 m_t_c;
7891   UINT8 m_sound_data;
7992   UINT8 m_strobe;
8093   UINT8 m_kbdrow;
8194   bool m_data_ok;
95   emu_timer* m_irq_timer;
96   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
97   static const device_timer_id TIMER_IRQ = 0;
8298   required_device<cpu_device> m_maincpu;
8399   required_device<cpu_device> m_audiocpu;
84100   required_device<dac_device> m_dac;
r32519r32520
189205   PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Manual/Auto") PORT_CODE(KEYCODE_6_PAD) PORT_TOGGLE
190206   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter") PORT_CODE(KEYCODE_9_PAD)
191207
192   PORT_START("DSW0")
193   PORT_DIPNAME( 0x01, 0x01, "SW01" )
194   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
195   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
196   PORT_DIPNAME( 0x02, 0x02, "SW02" )
197   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
198   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
199   PORT_DIPNAME( 0x04, 0x04, "SW03" )
200   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
201   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
202   PORT_DIPNAME( 0x08, 0x08, "SW04" )
203   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
204   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
205   PORT_DIPNAME( 0x10, 0x10, "SW05" )
206   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
207   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
208   PORT_DIPNAME( 0x20, 0x20, "SW06" )
209   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
210   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
211   PORT_DIPNAME( 0x40, 0x40, "SW07" )
212   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
213   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
214   PORT_DIPNAME( 0x80, 0x80, "SW08" )
215   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
216   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
208   PORT_START("DS1") // DS1 only 3 switches do anything
209   PORT_DIPNAME( 0x70, 0x70, "Diagnostic" )
210   PORT_DIPSETTING(    0x70, "Off" )
211   PORT_DIPSETTING(    0x60, "SW8 - Zero Audit Tables" )
212   PORT_DIPSETTING(    0x50, "SW7 - Reset to Defaults" )
213   PORT_DIPSETTING(    0x30, "SW6 - Auto Diagnostic Test" )
214   PORT_BIT( 0x8f, IP_ACTIVE_LOW, IPT_UNUSED )
217215
218   PORT_START("DSW1")
219   PORT_DIPNAME( 0x01, 0x01, "SW11" )
220   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
221   PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
222   PORT_DIPNAME( 0x02, 0x02, "SW12" )
223   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
224   PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
225   PORT_DIPNAME( 0x04, 0x04, "SW13" )
226   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
227   PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
228   PORT_DIPNAME( 0x08, 0x08, "SW14" )
229   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
230   PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
231   PORT_DIPNAME( 0x10, 0x10, "SW15" )
232   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
233   PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
234   PORT_DIPNAME( 0x20, 0x20, "SW16" )
235   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
236   PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
237   PORT_DIPNAME( 0x40, 0x40, "SW17" )
238   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
239   PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
240   PORT_DIPNAME( 0x80, 0x80, "SW18" )
241   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
242   PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
216   PORT_START("DS2") // DS2 switches exist but do nothing
217   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
243218INPUT_PORTS_END
244219
245MACHINE_RESET_MEMBER( s6a_state, s6a )
246{
247   m_t_c = 0;
248}
249
250220INPUT_CHANGED_MEMBER( s6a_state::main_nmi )
251221{
252222   // Diagnostic button sends a pulse to NMI pin
r32519r32520
298268
299269WRITE8_MEMBER( s6a_state::lamp0_w )
300270{
301   m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE);
302271}
303272
304273WRITE8_MEMBER( s6a_state::lamp1_w )
305274{
306275}
307276
308READ_LINE_MEMBER( s6a_state::pia28_ca1_r )
309{
310   return BIT(ioport("DIAGS")->read(), 2); // advance button
311}
312
313READ_LINE_MEMBER( s6a_state::pia28_cb1_r )
314{
315   return BIT(ioport("DIAGS")->read(), 3); // auto/manual switch
316}
317
318277READ8_MEMBER( s6a_state::dips_r )
319278{
320279   if (BIT(ioport("DIAGS")->read(), 4) )
r32519r32520
322281      switch (m_strobe)
323282      {
324283      case 0:
325         return ioport("DSW0")->read() & 15;
284         return ioport("DS2")->read();
326285      case 1:
327         return ioport("DSW0")->read() << 4;
286         return ioport("DS2")->read() << 4;
328287      case 2:
329         return ioport("DSW1")->read() & 15;
288         return ioport("DS1")->read();
330289      case 3:
331         return ioport("DSW1")->read() << 4;
290         return ioport("DS1")->read() << 4;
332291      }
333292   }
334293   return 0xff;
r32519r32520
357316{
358317   char kbdrow[8];
359318   sprintf(kbdrow,"X%X",m_kbdrow);
360   return ~ioport(kbdrow)->read();
319   return ioport(kbdrow)->read() ^ 0xff;
361320}
362321
363322WRITE8_MEMBER( s6a_state::switch_w )
r32519r32520
370329   return m_sound_data;
371330}
372331
373TIMER_DEVICE_CALLBACK_MEMBER( s6a_state::irq)
332WRITE_LINE_MEMBER( s6a_state::pia_irq )
374333{
375   if (m_t_c > 0x70)
376      m_maincpu->set_input_line(M6800_IRQ_LINE, ASSERT_LINE);
334   if(state == CLEAR_LINE)
335   {
336      // restart IRQ timer
337      m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
338   }
377339   else
378      m_t_c++;
340   {
341      // disable IRQ timer while other IRQs are being handled
342      // (counter is reset every 32 cycles while a PIA IRQ is handled)
343      m_irq_timer->adjust(attotime::zero);
344   }
379345}
380346
347void s6a_state::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
348{
349   switch(id)
350   {
351   case TIMER_IRQ:
352      if(param == 1)
353      {
354         m_maincpu->set_input_line(M6800_IRQ_LINE,ASSERT_LINE);
355         m_irq_timer->adjust(attotime::from_ticks(32,3580000/4),0);
356         m_pia28->ca1_w(BIT(ioport("DIAGS")->read(), 2));  // Advance
357         m_pia28->cb1_w(BIT(ioport("DIAGS")->read(), 3));  // Up/Down
358      }
359      else
360      {
361         m_maincpu->set_input_line(M6800_IRQ_LINE,CLEAR_LINE);
362         m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
363         m_pia28->ca1_w(1);
364         m_pia28->cb1_w(1);
365      }
366      break;
367   }
368}
369
370MACHINE_RESET_MEMBER( s6a_state, s6a )
371{
372}
373
374DRIVER_INIT_MEMBER( s6a_state, s6a )
375{
376   m_irq_timer = timer_alloc(TIMER_IRQ);
377   m_irq_timer->adjust(attotime::from_ticks(980,3580000/4),1);
378}
379
381380static MACHINE_CONFIG_START( s6a, s6a_state )
382381   /* basic machine hardware */
383   MCFG_CPU_ADD("maincpu", M6802, 3580000)
382   MCFG_CPU_ADD("maincpu", M6808, 3580000)
384383   MCFG_CPU_PROGRAM_MAP(s6a_main_map)
385   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq", s6a_state, irq, attotime::from_hz(250))
386384   MCFG_MACHINE_RESET_OVERRIDE(s6a_state, s6a)
387385
388386   /* Video */
r32519r32520
397395   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6a_state, sol1_w))
398396   MCFG_PIA_CA2_HANDLER(WRITELINE(s6a_state, pia22_ca2_w))
399397   MCFG_PIA_CB2_HANDLER(WRITELINE(s6a_state, pia22_cb2_w))
400   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
401   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
398   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6a_state, pia_irq))
399   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6a_state, pia_irq))
402400
403401   MCFG_DEVICE_ADD("pia24", PIA6821, 0)
404402   MCFG_PIA_WRITEPA_HANDLER(WRITE8(s6a_state, lamp0_w))
405403   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6a_state, lamp1_w))
406404   MCFG_PIA_CA2_HANDLER(WRITELINE(s6a_state, pia24_ca2_w))
407405   MCFG_PIA_CB2_HANDLER(WRITELINE(s6a_state, pia24_cb2_w))
408   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
409   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
406   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6a_state, pia_irq))
407   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6a_state, pia_irq))
410408
411409   MCFG_DEVICE_ADD("pia28", PIA6821, 0)
412410   MCFG_PIA_READPA_HANDLER(READ8(s6a_state, dips_r))
413   MCFG_PIA_READCA1_HANDLER(READLINE(s6a_state, pia28_ca1_r))
414   MCFG_PIA_READCB1_HANDLER(READLINE(s6a_state, pia28_cb1_r))
415411   MCFG_PIA_WRITEPA_HANDLER(WRITE8(s6a_state, dig0_w))
416412   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6a_state, dig1_w))
417413   MCFG_PIA_CA2_HANDLER(WRITELINE(s6a_state, pia28_ca2_w))
418414   MCFG_PIA_CB2_HANDLER(WRITELINE(s6a_state, pia28_cb2_w))
419   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
420   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
415   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6a_state, pia_irq))
416   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6a_state, pia_irq))
421417
422418   MCFG_DEVICE_ADD("pia30", PIA6821, 0)
423419   MCFG_PIA_READPA_HANDLER(READ8(s6a_state, switch_r))
424420   MCFG_PIA_WRITEPB_HANDLER(WRITE8(s6a_state, switch_w))
425421   MCFG_PIA_CA2_HANDLER(WRITELINE(s6a_state, pia30_ca2_w))
426422   MCFG_PIA_CB2_HANDLER(WRITELINE(s6a_state, pia30_cb2_w))
427   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
428   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6802_cpu_device, irq_line))
423   MCFG_PIA_IRQA_HANDLER(WRITELINE(s6a_state, pia_irq))
424   MCFG_PIA_IRQB_HANDLER(WRITELINE(s6a_state, pia_irq))
429425
430   MCFG_NVRAM_ADD_1FILL("nvram")
426   MCFG_NVRAM_ADD_0FILL("nvram")
431427
432428   /* Add the soundcard */
433   MCFG_CPU_ADD("audiocpu", M6808, 3580000)
429   MCFG_CPU_ADD("audiocpu", M6802, 3580000)
434430   MCFG_CPU_PROGRAM_MAP(s6a_audio_map)
435431   MCFG_SPEAKER_STANDARD_MONO("mono")
436432   MCFG_SOUND_ADD("dac", DAC, 0)
r32519r32520
444440   MCFG_PIA_WRITEPA_HANDLER(DEVWRITE8("dac", dac_device, write_unsigned8))
445441   MCFG_PIA_CA2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, digit_w))
446442   MCFG_PIA_CB2_HANDLER(DEVWRITELINE("hc55516", hc55516_device, clock_w))
447   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("audiocpu", m6808_cpu_device, irq_line))
448   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("audiocpu", m6808_cpu_device, irq_line))
443   MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("audiocpu", m6802_cpu_device, irq_line))
444   MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("audiocpu", m6802_cpu_device, irq_line))
449445MACHINE_CONFIG_END
450446
451447
r32519r32520
506502ROM_END
507503
508504
509GAME(1980,algar_l1, 0,       s6a, s6a, driver_device, 0, ROT0, "Williams", "Algar (L-1)", GAME_MECHANICAL )
510GAME(1980,alpok_l6, 0,       s6a, s6a, driver_device, 0, ROT0, "Williams", "Alien Poker (L-6)", GAME_MECHANICAL )
511GAME(1980,alpok_l2, alpok_l6,s6a, s6a, driver_device, 0, ROT0, "Williams", "Alien Poker (L-2)", GAME_MECHANICAL )
512GAME(1980,alpok_f6, alpok_l6,s6a, s6a, driver_device, 0, ROT0, "Williams", "Alien Poker (L-6 French speech)", GAME_MECHANICAL )
505GAME(1980,algar_l1, 0,       s6a, s6a, s6a_state, s6a, ROT0, "Williams", "Algar (L-1)", GAME_MECHANICAL )
506GAME(1980,alpok_l6, 0,       s6a, s6a, s6a_state, s6a, ROT0, "Williams", "Alien Poker (L-6)", GAME_MECHANICAL )
507GAME(1980,alpok_l2, alpok_l6,s6a, s6a, s6a_state, s6a, ROT0, "Williams", "Alien Poker (L-2)", GAME_MECHANICAL )
508GAME(1980,alpok_f6, alpok_l6,s6a, s6a, s6a_state, s6a, ROT0, "Williams", "Alien Poker (L-6 French speech)", GAME_MECHANICAL )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team