Previous 199869 Revisions Next

r31569 Saturday 9th August, 2014 at 12:48:27 UTC by Robbbert
gp_1: Sound for vegasgp, famlyfun, startrip. Marked as working.
[src/mame/drivers]gp_1.c

trunk/src/mame/drivers/gp_1.c
r31568r31569
1313
1414
1515ToDo:
16- Family Fun / Star Trip / Vegas, the chimes have been replaced by a SN76477,
17  not yet emulated.
16- Mechanical
1817
1918********************************************************************************/
2019
r31568r31569
2322#include "cpu/z80/z80daisy.h"
2423#include "machine/i8255.h"
2524#include "machine/z80ctc.h"
25#include "sound/sn76477.h"
2626#include "gp_1.lh"
2727
2828class gp_1_state : public genpin_class
r31568r31569
3232      : genpin_class(mconfig, type, tag)
3333      , m_maincpu(*this, "maincpu")
3434      , m_ctc(*this, "ctc")
35      , m_sn(*this, "snsnd")
3536      , m_io_dsw0(*this, "DSW0")
3637      , m_io_dsw1(*this, "DSW1")
3738      , m_io_dsw2(*this, "DSW2")
r31568r31569
4546
4647   DECLARE_DRIVER_INIT(gp_1);
4748   DECLARE_WRITE8_MEMBER(porta_w);
49   DECLARE_WRITE8_MEMBER(portas_w);
4850   DECLARE_WRITE8_MEMBER(portc_w);
4951   DECLARE_READ8_MEMBER(portb_r);
5052   TIMER_DEVICE_CALLBACK_MEMBER(zero_timer);
r31568r31569
5557   virtual void machine_reset();
5658   required_device<cpu_device> m_maincpu;
5759   required_device<z80ctc_device> m_ctc;
60   optional_device<sn76477_device> m_sn;
5861   required_ioport m_io_dsw0;
5962   required_ioport m_io_dsw1;
6063   required_ioport m_io_dsw2;
r31568r31569
197200   PORT_DIPSETTING(    0x80, DEF_STR( On ))
198201
199202   PORT_START("DSW3")
200   PORT_DIPNAME( 0x07, 0x07, "Max number of credits")
203   PORT_DIPNAME( 0x07, 0x02, "Max number of credits")
201204   PORT_DIPSETTING(    0x00, "5" )
202205   PORT_DIPSETTING(    0x01, "10")
203206   PORT_DIPSETTING(    0x02, "15")
r31568r31569
206209   PORT_DIPSETTING(    0x05, "30")
207210   PORT_DIPSETTING(    0x06, "35")
208211   PORT_DIPSETTING(    0x07, "40")
209   PORT_DIPNAME( 0x08, 0x08, "Balls")
212   PORT_DIPNAME( 0x08, 0x00, "Balls")
210213   PORT_DIPSETTING(    0x00, "3")
211214   PORT_DIPSETTING(    0x08, "5")
212215   PORT_DIPNAME( 0x10, 0x10, "Award")
r31568r31569
294297      switch (data)
295298      {
296299         case 0x10: // chime c
297            m_samples->start(0, 3);
300            m_samples->start(3, 3);
298301            break;
299302         case 0x11: // chime b
300            m_samples->start(0, 2);
303            m_samples->start(2, 2);
301304            break;
302305         case 0x12: // knocker
303306            m_samples->start(0, 6);
r31568r31569
306309         case 0x14: // not used
307310            break;
308311         case 0x15: // chime a
309            m_samples->start(0, 1);
312            m_samples->start(1, 1);
310313            break;
311314         case 0x16: // chime d
312315            m_samples->start(0, 4);
r31568r31569
349352   }
350353}
351354
355WRITE8_MEMBER( gp_1_state::portas_w )
356{
357   m_u14 = data >> 4;
358   if (m_u14 == 1) switch (data)
359   {
360      case 0x10: // chime c
361         m_sn->vco_voltage_w(0.45);
362         m_sn->enable_w(0);
363         data = 0x1f;
364         break;
365      case 0x11: // chime b
366         m_sn->vco_voltage_w(0.131);
367         m_sn->enable_w(0);
368         data = 0x1f;
369         break;
370      case 0x15: // chime a
371         m_sn->vco_voltage_w(0.07);
372         m_sn->enable_w(0);
373         data = 0x1f;
374         break;
375      case 0x16: // chime d
376         m_sn->vco_voltage_w(2.25);
377         m_sn->enable_w(0);
378         data = 0x1f;
379         break;
380      default:
381         m_sn->enable_w(1);
382   }
383
384   porta_w(space, offset, data);
385}
386
352387WRITE8_MEMBER( gp_1_state::portc_w )
353388{
354389   output_set_value("led0", !BIT(data, 3));
r31568r31569
400435   MCFG_TIMER_DRIVER_ADD_PERIODIC("gp1", gp_1_state, zero_timer, attotime::from_hz(120)) // mains freq*2
401436MACHINE_CONFIG_END
402437
438static const sn76477_interface sn76477_intf =
439{
440   0,          /*  4 noise_res (N/C)        */
441   0,          /*  5 filter_res (N/C)       */
442   0,          /*  6 filter_cap (N/C)       */
443   0,          /*  7 decay_res (N/C)        */
444   0,          /*  8 attack_decay_cap (N/C) */
445   0,          /* 10 attack_res (nc)        */
446   RES_K(220), /* 11 amplitude_res          */
447   RES_K(47),  /* 12 feedback_res           */
448   0,          /* 16 vco_voltage (N/C)      */
449   CAP_U(0.1), /* 17 vco_cap                */
450   RES_K(56),  /* 18 vco_res                */
451   5.0,        /* 19 pitch_voltage          */
452   RES_K(220), /* 20 slf_res                */
453   CAP_U(1.0), /* 21 slf_cap                */
454   0,          /* 23 oneshot_cap (N/C)      */
455   0,          /* 24 oneshot_res (N/C)      */
456   0,          /* 22 vco (nc)               */
457   0,          /* 26 mixer A (nc)           */
458   0,          /* 25 mixer B (nc)           */
459   0,          /* 27 mixer C (nc)           */
460   0,          /* 1  envelope 1 (nc)        */
461   1,          /* 28 envelope 2             */
462   1           /* 9  enable (variable) 1=off */
463};
403464
465static MACHINE_CONFIG_DERIVED( gp_1s, gp_1 )
466   MCFG_SPEAKER_STANDARD_MONO("mono")
467   MCFG_SOUND_ADD("snsnd", SN76477, 0)
468   MCFG_SOUND_CONFIG(sn76477_intf)
469   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
470
471   MCFG_DEVICE_REMOVE("ppi")
472   MCFG_DEVICE_ADD("ppi", I8255A, 0 )
473   MCFG_I8255_OUT_PORTA_CB(WRITE8(gp_1_state, portas_w))
474   MCFG_I8255_IN_PORTB_CB(READ8(gp_1_state, portb_r))
475   MCFG_I8255_OUT_PORTC_CB(WRITE8(gp_1_state, portc_w))
476MACHINE_CONFIG_END
477
478
404479ROM_START( gp_110 )
405480   ROM_REGION(0x1000, "roms", 0)
406481   ROM_LOAD( "a-110.u12", 0x0000, 0x0800, CRC(ed0d518b) SHA1(8f3ca8792ad907c660d9149a1aa3a3528c7573e3))
r31568r31569
468543GAME(1978, real,     gp_110,   gp_1,     gp_1,     driver_device, 0,   ROT0, "Game Plan", "Real",         GAME_MECHANICAL)
469544GAME(1978, rio,      gp_110,   gp_1,     gp_1,     driver_device, 0,   ROT0, "Game Plan", "Rio",          GAME_MECHANICAL)
470545GAME(1978, chucklck, gp_110,   gp_1,     gp_1,     driver_device, 0,   ROT0, "Game Plan", "Chuck-A-Luck", GAME_MECHANICAL)
471GAME(1979, famlyfun, 0,        gp_1,     gp_1,     driver_device, 0,   ROT0, "Game Plan", "Family Fun!",  GAME_MECHANICAL | GAME_IMPERFECT_SOUND )
472GAME(1979, startrip, 0,        gp_1,     gp_1,     driver_device, 0,   ROT0, "Game Plan", "Star Trip",    GAME_MECHANICAL | GAME_IMPERFECT_SOUND )
473GAME(1979, vegasgp,  0,        gp_1,     gp_1,     driver_device, 0,   ROT0, "Game Plan", "Vegas (Game Plan)", GAME_MECHANICAL | GAME_IMPERFECT_SOUND )
546GAME(1979, famlyfun, 0,        gp_1s,    gp_1,     driver_device, 0,   ROT0, "Game Plan", "Family Fun!",  GAME_MECHANICAL)
547GAME(1979, startrip, 0,        gp_1s,    gp_1,     driver_device, 0,   ROT0, "Game Plan", "Star Trip",    GAME_MECHANICAL)
548GAME(1979, vegasgp,  0,        gp_1s,    gp_1,     driver_device, 0,   ROT0, "Game Plan", "Vegas (Game Plan)", GAME_MECHANICAL)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team