summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/mb8421.h
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-08-02 13:54:55 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-08-02 13:55:40 -0400
commita4d28396bf76069836db4800069ddb65d04d9223 (patch)
treeab67632ca3afd422f657240f3d4b53a691144f33 /src/devices/machine/mb8421.h
parentcdb956fd340e95fea1cc8b1648abaf37c5dd1b7f (diff)
mb8421: Convert callbacks to devcb3 and update to recent coding standards (nw)
Diffstat (limited to 'src/devices/machine/mb8421.h')
-rw-r--r--src/devices/machine/mb8421.h89
1 files changed, 66 insertions, 23 deletions
diff --git a/src/devices/machine/mb8421.h b/src/devices/machine/mb8421.h
index e0ac6edd610..35ece9738c0 100644
--- a/src/devices/machine/mb8421.h
+++ b/src/devices/machine/mb8421.h
@@ -5,6 +5,61 @@
Fujitsu MB8421/22/31/32-90/-90L/-90LL/-12/-12L/-12LL
CMOS 16K-bit (2KB) dual-port SRAM
+***********************************************************************
+ _____________
+ _CS(L) 1 |* \_/ | 52 Vcc
+ _WE(L) 2 | | 51 _CS(R)
+ _BUSY(L) 3 | | 50 _WE(R)
+ _INT(L) 4 | | 49 _BUSY(R)
+ NC 5 | | 48 _INT(R)
+ A10(L) 6 | | 47 NC
+ _OE(L) 7 | | 46 A10(R)
+ A0(L) 8 | | 45 _OE(R)
+ A1(L) 9 | | 44 A0(R)
+ A2(L) 10 | | 43 A1(R)
+ A3(L) 11 | | 42 A2(R)
+ A4(L) 12 | | 41 A3(R)
+ A5(L) 13 | MB8421 | 40 A4(R)
+ A6(L) 14 | MB8431 | 39 A5(R)
+ A7(L) 15 | | 38 A6(R)
+ A8(L) 16 | | 37 A7(R)
+ A9(L) 17 | | 36 A8(R)
+ I/O0(L) 18 | | 35 A9(R)
+ I/O1(L) 19 | | 34 I/O7(R)
+ I/O2(L) 20 | | 33 I/O6(R)
+ I/O3(L) 21 | | 32 I/O5(R)
+ I/O4(L) 22 | | 31 I/O4(R)
+ I/O5(L) 23 | | 30 I/O3(R)
+ I/O6(L) 24 | | 29 I/O2(R)
+ I/O7(L) 25 | | 28 I/O1(R)
+ Vss 26 |_____________| 27 I/O0(R)
+
+ _____________
+ _CS(L) 1 |* \_/ | 48 Vcc
+ _WE(L) 2 | | 47 _CS(R)
+ _BUSY(L) 3 | | 46 _WE(R)
+ A10(L) 4 | | 45 _BUSY(R)
+ _OE(L) 5 | | 44 A10(R)
+ A0(L) 6 | | 43 _OE(R)
+ A1(L) 7 | | 42 A0(R)
+ A2(L) 8 | | 41 A1(R)
+ A3(L) 9 | | 40 A2(R)
+ A4(L) 10 | | 39 A3(R)
+ A5(L) 11 | MB8422 | 38 A4(R)
+ A6(L) 12 | MB8432 | 37 A5(R)
+ A7(L) 13 | | 36 A6(R)
+ A8(L) 14 | | 35 A7(R)
+ A9(L) 15 | | 34 A8(R)
+ I/O0(L) 16 | | 33 A9(R)
+ I/O1(L) 17 | | 32 I/O7(R)
+ I/O2(L) 18 | | 31 I/O6(R)
+ I/O3(L) 19 | | 30 I/O5(R)
+ I/O4(L) 20 | | 29 I/O4(R)
+ I/O5(L) 21 | | 28 I/O3(R)
+ I/O6(L) 22 | | 27 I/O2(R)
+ I/O7(L) 23 | | 26 I/O1(R)
+ Vss 24 |_____________| 25 I/O0(R)
+
**********************************************************************/
#ifndef MAME_MACHINE_MB8421_H
@@ -14,19 +69,6 @@
//**************************************************************************
-// INTERFACE CONFIGURATION MACROS
-//**************************************************************************
-
-// note: INT pins are only available on MB84x1
-// INTL is for the CPU on the left side, INTR for the one on the right
-#define MCFG_MB8421_INTL_HANDLER(_devcb) \
- downcast<mb8421_master_device &>(*device).set_intl_handler(DEVCB_##_devcb);
-
-#define MCFG_MB8421_INTR_HANDLER(_devcb) \
- downcast<mb8421_master_device &>(*device).set_intr_handler(DEVCB_##_devcb);
-
-
-//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
@@ -35,9 +77,10 @@
class mb8421_master_device : public device_t
{
public:
- // configuration helpers
- template <class Object> devcb_base &set_intl_handler(Object &&cb) { return m_intl_handler.set_callback(std::forward<Object>(cb)); }
- template <class Object> devcb_base &set_intr_handler(Object &&cb) { return m_intr_handler.set_callback(std::forward<Object>(cb)); }
+ // note: INT pins are only available on MB84x1
+ // INTL is for the CPU on the left side, INTR for the one on the right
+ auto intl_callback() { return m_intl_callback.bind(); }
+ auto intr_callback() { return m_intr_callback.bind(); }
DECLARE_READ_LINE_MEMBER(busy_r) { return 0; } // _BUSY pin - not emulated
@@ -45,15 +88,15 @@ protected:
mb8421_master_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
// device-level overrides
- virtual void device_start() override;
+ virtual void device_resolve_objects() override;
virtual void device_reset() override;
// internal helpers
template<read_or_write row, bool is_right> void update_intr(offs_t offset);
private:
- devcb_write_line m_intl_handler;
- devcb_write_line m_intr_handler;
+ devcb_write_line m_intl_callback;
+ devcb_write_line m_intr_callback;
};
// ======================> mb8421_device
@@ -61,9 +104,9 @@ private:
class mb8421_device : public mb8421_master_device
{
public:
- mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ mb8421_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
- u8 peek(offs_t offset) { return m_ram[offset & 0x7ff]; }
+ u8 peek(offs_t offset) const { return m_ram[offset & 0x7ff]; }
DECLARE_WRITE8_MEMBER(left_w);
DECLARE_READ8_MEMBER(left_r);
@@ -83,9 +126,9 @@ private:
class mb8421_mb8431_16_device : public mb8421_master_device
{
public:
- mb8421_mb8431_16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
+ mb8421_mb8431_16_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
- u16 peek(offs_t offset) { return m_ram[offset & 0x7ff]; }
+ u16 peek(offs_t offset) const { return m_ram[offset & 0x7ff]; }
DECLARE_WRITE16_MEMBER(left_w);
DECLARE_READ16_MEMBER(left_r);