summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2014-05-13 19:15:37 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2014-05-13 19:15:37 +0000
commit309d625420a8ded84a825e40fb90d78cf083019b (patch)
treef2d9481c4e9ef1d8bee093246c7a73e4b25d7e5a /src/mess
parentc819c9ab3fc46ec41316f73138ea0ba82a68cd0c (diff)
sam6883: converted to use inline configs. nw.
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/coco12.c3
-rw-r--r--src/mess/drivers/dragon.c2
-rw-r--r--src/mess/includes/coco12.h2
-rw-r--r--src/mess/machine/6883sam.c6
-rw-r--r--src/mess/machine/6883sam.h22
-rw-r--r--src/mess/machine/coco12.c12
6 files changed, 17 insertions, 30 deletions
diff --git a/src/mess/drivers/coco12.c b/src/mess/drivers/coco12.c
index 0b9b0ab0261..c1853213e96 100644
--- a/src/mess/drivers/coco12.c
+++ b/src/mess/drivers/coco12.c
@@ -297,8 +297,9 @@ static MACHINE_CONFIG_START( coco, coco12_state )
MCFG_PIA_IRQA_HANDLER(WRITELINE(coco_state, pia1_firq_a))
MCFG_PIA_IRQB_HANDLER(WRITELINE(coco_state, pia1_firq_b))
- MCFG_SAM6883_ADD(SAM_TAG, XTAL_3_579545MHz, coco12_state::sam6883_config)
+ MCFG_SAM6883_ADD(SAM_TAG, XTAL_3_579545MHz, MAINCPU_TAG, AS_PROGRAM)
MCFG_SAM6883_RES_CALLBACK(READ8(coco12_state, sam_read))
+
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_FORMATS(coco_cassette_formats)
MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED)
diff --git a/src/mess/drivers/dragon.c b/src/mess/drivers/dragon.c
index 74c02c8883c..aca628d42e4 100644
--- a/src/mess/drivers/dragon.c
+++ b/src/mess/drivers/dragon.c
@@ -154,7 +154,7 @@ static MACHINE_CONFIG_START( dragon_base, dragon_state )
MCFG_PIA_IRQA_HANDLER(WRITELINE(coco_state, pia1_firq_a))
MCFG_PIA_IRQB_HANDLER(WRITELINE(coco_state, pia1_firq_b))
- MCFG_SAM6883_ADD(SAM_TAG, XTAL_4_433619MHz, dragon_state::sam6883_config)
+ MCFG_SAM6883_ADD(SAM_TAG, XTAL_4_433619MHz, MAINCPU_TAG, AS_PROGRAM)
MCFG_SAM6883_RES_CALLBACK(READ8(dragon_state, sam_read))
MCFG_CASSETTE_ADD("cassette")
MCFG_CASSETTE_FORMATS(coco_cassette_formats)
diff --git a/src/mess/includes/coco12.h b/src/mess/includes/coco12.h
index 98f2a86ae17..d7c10d8ddb8 100644
--- a/src/mess/includes/coco12.h
+++ b/src/mess/includes/coco12.h
@@ -45,8 +45,6 @@ public:
required_device<sam6883_device> m_sam;
required_device<mc6847_base_device> m_vdg;
- static const sam6883_interface sam6883_config;
-
DECLARE_READ8_MEMBER( sam_read );
DECLARE_WRITE_LINE_MEMBER( horizontal_sync );
diff --git a/src/mess/machine/6883sam.c b/src/mess/machine/6883sam.c
index 165ada1fb71..e006f7ebe6f 100644
--- a/src/mess/machine/6883sam.c
+++ b/src/mess/machine/6883sam.c
@@ -92,11 +92,9 @@ sam6883_device::sam6883_device(const machine_config &mconfig, const char *tag, d
void sam6883_device::device_start()
{
- const sam6883_interface *config = (const sam6883_interface *) static_config();
-
// find the CPU
- m_cpu = machine().device<cpu_device>(config->m_cpu_tag);
- m_cpu_space = &m_cpu->space(config->m_cpu_space);
+ m_cpu = machine().device<cpu_device>(m_cpu_tag);
+ m_cpu_space = &m_cpu->space(m_cpu_space_ref);
// resolve callbacks
m_read_res.resolve_safe(0);
diff --git a/src/mess/machine/6883sam.h b/src/mess/machine/6883sam.h
index ca637c5fa72..f8a734c17d4 100644
--- a/src/mess/machine/6883sam.h
+++ b/src/mess/machine/6883sam.h
@@ -13,21 +13,13 @@
#include "emu.h"
-#define MCFG_SAM6883_ADD(_tag, _clock, _config) \
+#define MCFG_SAM6883_ADD(_tag, _clock, _cputag, _cpuspace) \
MCFG_DEVICE_ADD(_tag, SAM6883, _clock) \
- MCFG_DEVICE_CONFIG(_config)
+ sam6883_device::configure_cpu(*device, _cputag, _cpuspace);
#define MCFG_SAM6883_RES_CALLBACK(_read) \
devcb = &sam6883_device::set_res_rd_callback(*device, DEVCB2_##_read);
-/* interface */
-struct sam6883_interface
-{
- /* the CPU/space from which the SAM reads data */
- const char * m_cpu_tag;
- address_spacenum m_cpu_space;
-};
-
//**************************************************************************
// SAM6883 CORE
@@ -97,6 +89,13 @@ public:
template<class _Object> static devcb2_base &set_res_rd_callback(device_t &device, _Object object) { return downcast<sam6883_device &>(device).m_read_res.set_callback(object); }
+ static void configure_cpu(device_t &device, const char *tag, address_spacenum space)
+ {
+ sam6883_device &dev = downcast<sam6883_device &>(device);
+ dev.m_cpu_tag = tag;
+ dev.m_cpu_space_ref = space;
+ }
+
// called to configure banks
void configure_bank(int bank, UINT8 *memory, UINT32 memory_size, bool is_read_only);
void configure_bank(int bank, read8_delegate rhandler, write8_delegate whandler);
@@ -168,6 +167,9 @@ private:
void point_specific_bank(const sam_bank *bank, UINT16 offset, UINT16 mask, memory_bank *&memory_bank, INT32 addrstart, INT32 addrend, bool is_write);
};
+ const char * m_cpu_tag;
+ address_spacenum m_cpu_space_ref;
+
// incidentals
address_space * m_cpu_space;
devcb2_read8 m_read_res;
diff --git a/src/mess/machine/coco12.c b/src/mess/machine/coco12.c
index 49c6bf17ae6..4bdf46f538a 100644
--- a/src/mess/machine/coco12.c
+++ b/src/mess/machine/coco12.c
@@ -116,15 +116,3 @@ void coco12_state::update_cart_base(UINT8 *cart_base)
{
m_sam->configure_bank(3, cart_base, 0x4000, true); // $C000-$FEFF
}
-
-
-
-//-------------------------------------------------
-// sam6883_config
-//-------------------------------------------------
-
-const sam6883_interface coco12_state::sam6883_config =
-{
- MAINCPU_TAG,
- AS_PROGRAM,
-};