summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2014-03-19 12:17:56 +0000
committer Curt Coder <curtcoder@mail.com>2014-03-19 12:17:56 +0000
commit9271b7e281e9ca701aadb96090f1851098cbcf98 (patch)
treedacdf9d5fcf256c8092b5aa3fcbff3a984309773 /src/mess
parent226b3a9d374fc00b1dc6486dd73ba38be23ff0e3 (diff)
(MESS) smartmed: devcb2. (nw)
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/mini2440.c5
-rw-r--r--src/mess/drivers/palmz22.c5
-rw-r--r--src/mess/machine/smartmed.c33
-rw-r--r--src/mess/machine/smartmed.h8
4 files changed, 27 insertions, 24 deletions
diff --git a/src/mess/drivers/mini2440.c b/src/mess/drivers/mini2440.c
index 8f4d1795db6..99e9d67af81 100644
--- a/src/mess/drivers/mini2440.c
+++ b/src/mess/drivers/mini2440.c
@@ -227,8 +227,7 @@ static S3C2440_INTERFACE( mini2440_s3c2440_intf )
static NAND_INTERFACE( mini2440_nand_intf )
{
- NAND_CHIP_K9F1G08U0B,
- DEVCB_DEVICE_LINE_MEMBER("s3c2440", s3c2440_device, frnb_w)
+ NAND_CHIP_K9F1G08U0B
};
static MACHINE_CONFIG_START( mini2440, mini2440_state )
@@ -246,7 +245,6 @@ static MACHINE_CONFIG_START( mini2440, mini2440_state )
MCFG_SCREEN_UPDATE_DEVICE("s3c2440", s3c2440_device, screen_update)
-
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("dac1", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
@@ -256,6 +254,7 @@ static MACHINE_CONFIG_START( mini2440, mini2440_state )
MCFG_S3C2440_ADD("s3c2440", 12000000, mini2440_s3c2440_intf, "palette")
MCFG_NAND_ADD("nand", mini2440_nand_intf)
+ MCFG_NAND_RNB_CALLBACK(DEVWRITELINE("s3c2440", s3c2440_device, frnb_w))
MACHINE_CONFIG_END
static INPUT_PORTS_START( mini2440 )
diff --git a/src/mess/drivers/palmz22.c b/src/mess/drivers/palmz22.c
index 2ac613e1998..491ff6fad22 100644
--- a/src/mess/drivers/palmz22.c
+++ b/src/mess/drivers/palmz22.c
@@ -295,8 +295,7 @@ static S3C2410_INTERFACE( palmz22_s3c2410_intf )
static NAND_INTERFACE( palmz22_nand_intf )
{
- NAND_CHIP_K9F5608U0D_J,
- DEVCB_DEVICE_LINE_MEMBER("s3c2410", s3c2410_device, frnb_w)
+ NAND_CHIP_K9F5608U0D_J
};
static MACHINE_CONFIG_START( palmz22, palmz22_state )
@@ -314,10 +313,10 @@ static MACHINE_CONFIG_START( palmz22, palmz22_state )
MCFG_SCREEN_UPDATE_DEVICE("s3c2410", s3c2410_device, screen_update)
-
MCFG_S3C2410_ADD("s3c2410", 12000000, palmz22_s3c2410_intf, "palette")
MCFG_NAND_ADD("nand", palmz22_nand_intf)
+ MCFG_NAND_RNB_CALLBACK(DEVWRITELINE("s3c2410", s3c2410_device, frnb_w))
MACHINE_CONFIG_END
static INPUT_PORTS_START( palmz22 )
diff --git a/src/mess/machine/smartmed.c b/src/mess/machine/smartmed.c
index e30c7599024..fc5b38e8712 100644
--- a/src/mess/machine/smartmed.c
+++ b/src/mess/machine/smartmed.c
@@ -75,11 +75,13 @@ enum
const device_type NAND = &device_creator<nand_device>;
nand_device::nand_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
- : device_t(mconfig, NAND, "NAND Flash Memory", tag, owner, clock, "nand", __FILE__)
+ : device_t(mconfig, NAND, "NAND Flash Memory", tag, owner, clock, "nand", __FILE__),
+ m_write_rnb(*this)
{
}
nand_device::nand_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source)
+ : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
+ m_write_rnb(*this)
{
}
@@ -105,7 +107,6 @@ void nand_device::device_config_complete()
else
{
memset(&m_chip, 0, sizeof(m_chip));
- memset(&m_devcb_write_line_cb, 0, sizeof(m_devcb_write_line_cb));
m_id_len = 0;
m_page_data_size = 0;
m_page_total_size = 0;
@@ -137,7 +138,7 @@ void nand_device::device_start()
#ifdef SMARTMEDIA_IMAGE_SAVE
m_image_format = 0;
#endif
- m_devcb_write_line_rnb.resolve( m_devcb_write_line_cb, *this);
+ m_write_rnb.resolve_safe();
}
/*
@@ -408,10 +409,10 @@ void nand_device::command_w(UINT8 data)
m_status = (m_status & 0x80) | 0x40;
m_accumulated_status = 0;
m_mode_3065 = 0;
- if (!m_devcb_write_line_rnb.isnull())
+ if (!m_write_rnb.isnull())
{
- m_devcb_write_line_rnb( 0);
- m_devcb_write_line_rnb( 1);
+ m_write_rnb( 0);
+ m_write_rnb( 1);
}
break;
case 0x00: // Read (1st cycle)
@@ -475,10 +476,10 @@ void nand_device::command_w(UINT8 data)
else
m_accumulated_status = 0;
m_mode = SM_M_INIT;
- if (!m_devcb_write_line_rnb.isnull())
+ if (!m_write_rnb.isnull())
{
- m_devcb_write_line_rnb( 0);
- m_devcb_write_line_rnb( 1);
+ m_write_rnb( 0);
+ m_write_rnb( 1);
}
}
break;
@@ -504,10 +505,10 @@ void nand_device::command_w(UINT8 data)
m_mode = SM_M_INIT;
if (m_pointer_mode == SM_PM_B)
m_pointer_mode = SM_PM_A;
- if (!m_devcb_write_line_rnb.isnull())
+ if (!m_write_rnb.isnull())
{
- m_devcb_write_line_rnb( 0);
- m_devcb_write_line_rnb( 1);
+ m_write_rnb( 0);
+ m_write_rnb( 1);
}
}
break;
@@ -541,10 +542,10 @@ void nand_device::command_w(UINT8 data)
}
else
{
- if (!m_devcb_write_line_rnb.isnull())
+ if (!m_write_rnb.isnull())
{
- m_devcb_write_line_rnb( 0);
- m_devcb_write_line_rnb( 1);
+ m_write_rnb( 0);
+ m_write_rnb( 1);
}
}
}
diff --git a/src/mess/machine/smartmed.h b/src/mess/machine/smartmed.h
index 6e8337b82b9..d7e2e8b6730 100644
--- a/src/mess/machine/smartmed.h
+++ b/src/mess/machine/smartmed.h
@@ -7,6 +7,9 @@
//#define SMARTMEDIA_IMAGE_SAVE
+#define MCFG_NAND_RNB_CALLBACK(_write) \
+ devcb = &nand_device::set_rnb_wr_callback(*device, DEVCB2_##_write);
+
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
@@ -64,7 +67,6 @@ struct nand_chip
struct nand_interface
{
nand_chip m_chip;
- devcb_write_line m_devcb_write_line_cb;
};
// ======================> nand_device
@@ -76,6 +78,8 @@ public:
nand_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
nand_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
+ template<class _Object> static devcb2_base &set_rnb_wr_callback(device_t &device, _Object object) { return downcast<nand_device &>(device).m_write_rnb.set_callback(object); }
+
int is_present();
int is_protected();
int is_busy();
@@ -130,7 +134,7 @@ protected:
int m_row_address_cycles;
int m_sequential_row_read;
- devcb_resolved_write_line m_devcb_write_line_rnb;
+ devcb2_write_line m_write_rnb;
#ifdef SMARTMEDIA_IMAGE_SAVE
int m_image_format;