From 1373432248d234cec355f77d4b4eaa2269580eb8 Mon Sep 17 00:00:00 2001 From: Scott Stone Date: Thu, 11 Jun 2015 15:34:26 -0400 Subject: [PATCH] Moved device constructors from the header to the driver in an effort to keep things uniform (part 1) (nw) --- src/emu/sound/sn76496.c | 32 ++++++++++++++++++++++++++++++++ src/emu/sound/sn76496.h | 40 ++++++++++------------------------------ src/emu/video/tms9928a.c | 28 ++++++++++++++++++++++++++++ src/emu/video/tms9928a.h | 21 +++++++-------------- 4 files changed, 77 insertions(+), 44 deletions(-) diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c index a06997e02fd..7d0ccf50319 100644 --- a/src/emu/sound/sn76496.c +++ b/src/emu/sound/sn76496.c @@ -142,6 +142,38 @@ sn76496_base_device::sn76496_base_device(const machine_config &mconfig, device_t { } +sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, SN76496, "SN76496", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76496", __FILE__) + { } +u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, U8106, "U8106", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "u8106", __FILE__) + { } +y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, Y2404, "Y2404", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "y2404", __FILE__) + { } +sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, SN76489, "SN76489", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "sn76489", __FILE__) + { } +sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, SN76489A, "SN76489A", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76489a", __FILE__) + { } +sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, SN76494, "SN76494", tag, 0x10000, 0x04, 0x08, false, false, 1, true, owner, clock, "sn76494", __FILE__) + { } +sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, SN94624, "SN94624", tag, 0x4000, 0x01, 0x02, true, false, 1, true, owner, clock, "sn94624", __FILE__) + { } +ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, NCR7496, "NCR7496", tag, 0x8000, 0x02, 0x20, false, false, 8, true, owner, clock, "ncr7496", __FILE__) + { } +gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, 0x8000, 0x01, 0x08, true, true, 8, false, owner, clock, "gamegear_psg", __FILE__) + { } +segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : sn76496_base_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, 0x8000, 0x01, 0x08, true, false, 8, false, owner, clock, "segapsg", __FILE__) + { } + + void sn76496_base_device::device_start() { int sample_rate = clock()/2; diff --git a/src/emu/sound/sn76496.h b/src/emu/sound/sn76496.h index 8cb9e69f85f..3d1c5f4592b 100644 --- a/src/emu/sound/sn76496.h +++ b/src/emu/sound/sn76496.h @@ -74,90 +74,70 @@ private: class sn76496_device : public sn76496_base_device { public: - sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, SN76496, "SN76496", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76496", __FILE__) - { } + sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // U8106 not verified yet. todo: verify; (a custom marked sn76489? only used on mr. do and maybe other universal games) class u8106_device : public sn76496_base_device { public: - u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, U8106, "U8106", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "u8106", __FILE__) - { } + u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // Y2404 not verified yet. todo: verify; (don't be fooled by the Y, it's a TI chip, not Yamaha) class y2404_device : public sn76496_base_device { public: - y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, Y2404, "Y2404", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "y2404", __FILE__) - { } + y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // SN76489 not verified yet. todo: verify; class sn76489_device : public sn76496_base_device { public: - sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, SN76489, "SN76489", tag, 0x4000, 0x01, 0x02, true, false, 8, true, owner, clock, "sn76489", __FILE__) - { } + sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // SN76489A: whitenoise verified, phase verified, periodic verified (by plgdavid) class sn76489a_device : public sn76496_base_device { public: - sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, SN76489A, "SN76489A", tag, 0x10000, 0x04, 0x08, false, false, 8, true, owner, clock, "sn76489a", __FILE__) - { } + sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // SN76494 not verified, (according to datasheet: same as sn76489a but without the /8 divider) class sn76494_device : public sn76496_base_device { public: - sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, SN76494, "SN76494", tag, 0x10000, 0x04, 0x08, false, false, 1, true, owner, clock, "sn76494", __FILE__) - { } + sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // SN94624 whitenoise verified, phase verified, period verified; verified by PlgDavid class sn94624_device : public sn76496_base_device { public: - sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, SN94624, "SN94624", tag, 0x4000, 0x01, 0x02, true, false, 1, true, owner, clock, "sn94624", __FILE__) - { } + sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // NCR7496 not verified; info from smspower wiki class ncr7496_device : public sn76496_base_device { public: - ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, NCR7496, "NCR7496", tag, 0x8000, 0x02, 0x20, false, false, 8, true, owner, clock, "ncr7496", __FILE__) - { } + ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // Verified by Justin Kerk class gamegear_device : public sn76496_base_device { public: - gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, 0x8000, 0x01, 0x08, true, true, 8, false, owner, clock, "gamegear_psg", __FILE__) - { } + gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; // todo: verify; from smspower wiki, assumed to have same invert as gamegear class segapsg_device : public sn76496_base_device { public: - segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : sn76496_base_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, 0x8000, 0x01, 0x08, true, false, 8, false, owner, clock, "segapsg", __FILE__) - { } + segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; #endif /* __SN76496_H__ */ diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c index 23ee5998b8d..8e8b672f8e4 100644 --- a/src/emu/video/tms9928a.c +++ b/src/emu/video/tms9928a.c @@ -82,6 +82,34 @@ tms9928a_device::tms9928a_device( const machine_config &mconfig, const char *tag // static_set_addrmap(*this, AS_DATA, ADDRESS_MAP_NAME(memmap)); } +tms9129_device::tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true, false, "tms9129", __FILE__) +{ } + +tms9918_device::tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false, true, "tms9918", __FILE__) +{ } + +tms9918a_device::tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9918A, "TMS9918A", tag, owner, clock, false, true, true, "tms9918a", __FILE__) +{ } + +tms9118_device::tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9118, "TMS9118 VDP", tag, owner, clock, false, true, false, "tms9118", __FILE__) +{ } + +tms9128_device::tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9128, "TMS9128 VDP", tag, owner, clock, false, true, false, "tms9128", __FILE__) +{ } + +tms9929_device::tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false, true, "tms9929", __FILE__) +{ } + +tms9929a_device::tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true, "tms9929a", __FILE__) +{ } + READ8_MEMBER( tms9928a_device::vram_read ) { diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h index db47dffcf40..b87807782d1 100644 --- a/src/emu/video/tms9928a.h +++ b/src/emu/video/tms9928a.h @@ -158,56 +158,49 @@ private: class tms9918_device : public tms9928a_device { public: - tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9918, "TMS9918", tag, owner, clock, false, false, true, "tms9918", __FILE__) { } + tms9918_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; class tms9918a_device : public tms9928a_device { public: - tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9918A, "TMS9918A", tag, owner, clock, false, true, true, "tms9918a", __FILE__) { } + tms9918a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; class tms9118_device : public tms9928a_device { public: - tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9118, "TMS9118 VDP", tag, owner, clock, false, true, false, "tms9118", __FILE__) { } + tms9118_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; class tms9128_device : public tms9928a_device { public: - tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9128, "TMS9128 VDP", tag, owner, clock, false, true, false, "tms9128", __FILE__) { } + tms9128_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; class tms9929_device : public tms9928a_device { public: - tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9929, "TMS9929", tag, owner, clock, true, false, true, "tms9929", __FILE__) { } + tms9929_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; class tms9929a_device : public tms9928a_device { public: - tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9929A, "TMS9929A", tag, owner, clock, true, true, true, "tms9929a", __FILE__) { } + tms9929a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); }; class tms9129_device : public tms9928a_device { public: - tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : tms9928a_device( mconfig, TMS9129, "TMS9129", tag, owner, clock, true, true, false, "tms9129", __FILE__) { } + tms9129_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); };