mirror of
https://github.com/holub/mame
synced 2025-04-24 17:30:55 +03:00
Converted some pinball systems to derived classes. (nw)
This commit is contained in:
parent
b8f3ccd722
commit
538cc2b1af
@ -46,14 +46,13 @@ ToDo:
|
||||
#define NMI_INT DMA_INT / 16
|
||||
//#define BIT6_CLK NMI_INT / 4
|
||||
|
||||
class atari_s1_state : public driver_device
|
||||
class atari_s1_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
atari_s1_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_p_ram(*this, "ram"),
|
||||
m_samples(*this, "samples")
|
||||
m_p_ram(*this, "ram")
|
||||
{ }
|
||||
|
||||
DECLARE_READ8_MEMBER(switch_r);
|
||||
@ -68,7 +67,6 @@ protected:
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_shared_ptr<UINT8> m_p_ram;
|
||||
required_device<samples_device> m_samples;
|
||||
|
||||
// driver_device overrides
|
||||
virtual void machine_reset();
|
||||
|
@ -17,13 +17,12 @@
|
||||
#include "atari_s2.lh"
|
||||
|
||||
|
||||
class atari_s2_state : public driver_device
|
||||
class atari_s2_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
atari_s2_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_samples(*this, "samples")
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu")
|
||||
{ }
|
||||
|
||||
DECLARE_WRITE8_HANDLER(sound0_w) { };
|
||||
@ -40,7 +39,6 @@ protected:
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<samples_device> m_samples;
|
||||
|
||||
// driver_device overrides
|
||||
virtual void machine_reset();
|
||||
|
@ -22,13 +22,12 @@
|
||||
#include "machine/nvram.h"
|
||||
#include "flicker.lh"
|
||||
|
||||
class flicker_state : public driver_device
|
||||
class flicker_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
flicker_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_samples(*this, "samples")
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu")
|
||||
{ }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(port00_w);
|
||||
@ -40,7 +39,6 @@ protected:
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<samples_device> m_samples;
|
||||
|
||||
private:
|
||||
UINT8 m_out_data;
|
||||
|
@ -45,13 +45,12 @@ ToDo:
|
||||
#include "g627.lh"
|
||||
|
||||
|
||||
class g627_state : public driver_device
|
||||
class g627_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
g627_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_samples(*this, "samples")
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu")
|
||||
{ }
|
||||
|
||||
DECLARE_READ8_MEMBER(porta_r);
|
||||
@ -64,7 +63,6 @@ protected:
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<samples_device> m_samples;
|
||||
|
||||
private:
|
||||
UINT8 m_seg[6];
|
||||
@ -289,6 +287,7 @@ static MACHINE_CONFIG_START( g627, g627_state )
|
||||
|
||||
/* Sound */
|
||||
MCFG_FRAGMENT_ADD( genpin_audio )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SOUND_ADD("astrocade", ASTROCADE, 14138000/8) // 0066-117XX audio chip
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
|
||||
|
@ -24,15 +24,14 @@
|
||||
#include "spectra.lh"
|
||||
|
||||
|
||||
class spectra_state : public driver_device
|
||||
class spectra_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
spectra_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_snsnd(*this, "snsnd"),
|
||||
m_p_ram(*this, "ram"),
|
||||
m_samples(*this, "samples")
|
||||
m_p_ram(*this, "ram")
|
||||
{ }
|
||||
|
||||
DECLARE_READ8_MEMBER(porta_r);
|
||||
@ -47,7 +46,6 @@ protected:
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<sn76477_device> m_snsnd;
|
||||
required_shared_ptr<UINT8> m_p_ram;
|
||||
required_device<samples_device> m_samples;
|
||||
|
||||
// driver_device overrides
|
||||
virtual void machine_reset();
|
||||
@ -252,6 +250,7 @@ static MACHINE_CONFIG_START( spectra, spectra_state )
|
||||
|
||||
/* Sound */
|
||||
MCFG_FRAGMENT_ADD( genpin_audio )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SOUND_ADD("snsnd", SN76477, 0)
|
||||
MCFG_SOUND_CONFIG(sn76477_intf)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
|
||||
|
@ -34,15 +34,14 @@ ToDo:
|
||||
#include "wico.lh"
|
||||
|
||||
|
||||
class wico_state : public driver_device
|
||||
class wico_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
wico_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_ccpu(*this, "ccpu"),
|
||||
m_hcpu(*this, "hcpu"),
|
||||
m_shared_ram(*this, "sharedram"),
|
||||
m_samples(*this, "samples")
|
||||
m_shared_ram(*this, "sharedram")
|
||||
{ }
|
||||
|
||||
DECLARE_READ8_MEMBER(lampst_r);
|
||||
@ -62,7 +61,6 @@ protected:
|
||||
required_device<cpu_device> m_ccpu;
|
||||
required_device<cpu_device> m_hcpu;
|
||||
required_shared_ptr<UINT8> m_shared_ram;
|
||||
required_device<samples_device> m_samples;
|
||||
|
||||
// driver_device overrides
|
||||
virtual void machine_reset();
|
||||
@ -421,6 +419,7 @@ static MACHINE_CONFIG_START( wico, wico_state )
|
||||
|
||||
/* Sound */
|
||||
MCFG_FRAGMENT_ADD( genpin_audio )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SOUND_ADD("sn76494", SN76494, 10000000 / 64)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75)
|
||||
MCFG_SOUND_CONFIG(psg_intf)
|
||||
|
@ -32,14 +32,13 @@ ToDo:
|
||||
#include "machine/nvram.h"
|
||||
#include "zac_1.lh"
|
||||
|
||||
class zac_1_state : public driver_device
|
||||
class zac_1_state : public genpin_class
|
||||
{
|
||||
public:
|
||||
zac_1_state(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
: genpin_class(mconfig, type, tag),
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_p_ram(*this, "ram"),
|
||||
m_samples(*this, "samples")
|
||||
m_p_ram(*this, "ram")
|
||||
{ }
|
||||
|
||||
DECLARE_READ8_MEMBER(ctrl_r);
|
||||
@ -48,20 +47,19 @@ public:
|
||||
DECLARE_WRITE8_MEMBER(serial_w);
|
||||
DECLARE_READ8_MEMBER(reset_int_r);
|
||||
DECLARE_WRITE8_MEMBER(reset_int_w);
|
||||
UINT8 m_t_c;
|
||||
UINT8 m_out_offs;
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_shared_ptr<UINT8> m_p_ram;
|
||||
required_device<samples_device> m_samples;
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(zac_1_inttimer);
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(zac_1_outtimer);
|
||||
protected:
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_shared_ptr<UINT8> m_p_ram;
|
||||
|
||||
// driver_device overrides
|
||||
virtual void machine_reset();
|
||||
private:
|
||||
UINT8 m_t_c;
|
||||
UINT8 m_out_offs;
|
||||
UINT8 m_input_line;
|
||||
};
|
||||
|
||||
|
@ -9,9 +9,9 @@ This is for common pinball machine coding.
|
||||
#include "genpin.h"
|
||||
|
||||
MACHINE_CONFIG_FRAGMENT( genpin_audio )
|
||||
MCFG_SPEAKER_STANDARD_MONO("mono")
|
||||
MCFG_SPEAKER_STANDARD_MONO("mechmono")
|
||||
MCFG_SAMPLES_ADD("samples", genpin_samples_intf)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
|
||||
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mechmono", 1.0)
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
|
@ -30,4 +30,16 @@ static const samples_interface genpin_samples_intf =
|
||||
MACHINE_CONFIG_EXTERN( genpin_audio );
|
||||
|
||||
|
||||
class genpin_class : public driver_device
|
||||
{
|
||||
public:
|
||||
genpin_class(const machine_config &mconfig, device_type type, const char *tag)
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_samples(*this, "samples")
|
||||
{ }
|
||||
|
||||
required_device<samples_device> m_samples;
|
||||
};
|
||||
|
||||
|
||||
#endif /* GENPIN_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user