trunk/src/mame/etc/template_device.h
| r17808 | r17809 | |
| 6 | 6 | |
| 7 | 7 | #pragma once |
| 8 | 8 | |
| 9 | | #ifndef __xxxDEV_H__ |
| 10 | | #define __xxxDEV_H__ |
| 9 | #ifndef __seibu_copDEV_H__ |
| 10 | #define __seibu_copDEV_H__ |
| 11 | 11 | |
| 12 | 12 | |
| 13 | 13 | |
| r17808 | r17809 | |
| 15 | 15 | // INTERFACE CONFIGURATION MACROS |
| 16 | 16 | //************************************************************************** |
| 17 | 17 | |
| 18 | | #define MCFG_XXX_ADD(_tag,_freq) \ |
| 19 | | MCFG_DEVICE_ADD(_tag, xxx, _freq) \ |
| 18 | #define MCFG_SEIBU_COP_ADD(_tag,_freq) \ |
| 19 | MCFG_DEVICE_ADD(_tag, SEIBU_COP, _freq) \ |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | //************************************************************************** |
| 23 | 23 | // TYPE DEFINITIONS |
| 24 | 24 | //************************************************************************** |
| 25 | 25 | |
| 26 | | // ======================> xxx_device |
| 26 | // ======================> seibu_cop_device |
| 27 | 27 | |
| 28 | | class xxx_device : public device_t |
| 28 | class seibu_cop_device : public device_t |
| 29 | 29 | { |
| 30 | 30 | public: |
| 31 | 31 | // construction/destruction |
| 32 | | xxx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 32 | seibu_cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 33 | 33 | |
| 34 | 34 | // I/O operations |
| 35 | 35 | DECLARE_WRITE8_MEMBER( write ); |
| r17808 | r17809 | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | // device type definition |
| 47 | | extern const device_type XXX; |
| 47 | extern const device_type SEIBU_COP; |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | |
trunk/src/emu/machine/seibu_cop.c
| r0 | r17809 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Template for skeleton device |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "machine/seibu_cop.h" |
| 9 | |
| 10 | |
| 11 | |
| 12 | //************************************************************************** |
| 13 | // GLOBAL VARIABLES |
| 14 | //************************************************************************** |
| 15 | |
| 16 | // device type definition |
| 17 | const device_type SEIBU_COP = &device_creator<seibu_cop_device>; |
| 18 | |
| 19 | |
| 20 | //************************************************************************** |
| 21 | // LIVE DEVICE |
| 22 | //************************************************************************** |
| 23 | |
| 24 | //------------------------------------------------- |
| 25 | // seibu_cop_device - constructor |
| 26 | //------------------------------------------------- |
| 27 | |
| 28 | seibu_cop_device::seibu_cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 29 | : device_t(mconfig, SEIBU_COP, "seibu_cop", tag, owner, clock) |
| 30 | { |
| 31 | |
| 32 | } |
| 33 | |
| 34 | |
| 35 | //------------------------------------------------- |
| 36 | // device_config_complete - perform any |
| 37 | // operations now that the configuration is |
| 38 | // complete |
| 39 | //------------------------------------------------- |
| 40 | |
| 41 | void seibu_cop_device::device_config_complete() |
| 42 | { |
| 43 | // inherit a copy of the static data |
| 44 | const seibu_cop_interface *intf = reinterpret_cast<const seibu_cop_interface *>(static_config()); |
| 45 | if (intf != NULL) |
| 46 | *static_cast<seibu_cop_interface *>(this) = *intf; |
| 47 | |
| 48 | // or initialize to defaults if none provided |
| 49 | else |
| 50 | { |
| 51 | memset(&m_in_mreq_cb, 0, sizeof(m_in_mreq_cb)); |
| 52 | memset(&m_out_mreq_cb, 0, sizeof(m_out_mreq_cb)); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | //------------------------------------------------- |
| 57 | // device_validity_check - perform validity checks |
| 58 | // on this device |
| 59 | //------------------------------------------------- |
| 60 | |
| 61 | void seibu_cop_device::device_validity_check(validity_checker &valid) const |
| 62 | { |
| 63 | } |
| 64 | |
| 65 | |
| 66 | //------------------------------------------------- |
| 67 | // device_start - device-specific startup |
| 68 | //------------------------------------------------- |
| 69 | |
| 70 | void seibu_cop_device::device_start() |
| 71 | { |
| 72 | |
| 73 | } |
| 74 | |
| 75 | |
| 76 | //------------------------------------------------- |
| 77 | // device_reset - device-specific reset |
| 78 | //------------------------------------------------- |
| 79 | |
| 80 | void seibu_cop_device::device_reset() |
| 81 | { |
| 82 | } |
| 83 | |
| 84 | |
| 85 | //************************************************************************** |
| 86 | // READ/WRITE HANDLERS |
| 87 | //************************************************************************** |
| 88 | |
| 89 | READ8_MEMBER( seibu_cop_device::read ) |
| 90 | { |
| 91 | return 0; |
| 92 | } |
| 93 | |
| 94 | WRITE8_MEMBER( seibu_cop_device::write ) |
| 95 | { |
| 96 | } |
trunk/src/emu/machine/seibu_cop.h
| r0 | r17809 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Template for skeleton device |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #pragma once |
| 8 | |
| 9 | #ifndef __SEIBU_COPDEV_H__ |
| 10 | #define __SEIBU_COPDEV_H__ |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // INTERFACE CONFIGURATION MACROS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define MCFG_SEIBU_COP_ADD(_tag,_freq) \ |
| 19 | MCFG_DEVICE_ADD(_tag, SEIBU_COP, _freq) \ |
| 20 | |
| 21 | #define SEIBU_COP_INTERFACE(_name) \ |
| 22 | const seibu_cop_interface (_name) = |
| 23 | |
| 24 | |
| 25 | struct seibu_cop_interface |
| 26 | { |
| 27 | // memory accessors |
| 28 | devcb_read8 m_in_mreq_cb; |
| 29 | devcb_write8 m_out_mreq_cb; |
| 30 | }; |
| 31 | |
| 32 | |
| 33 | //************************************************************************** |
| 34 | // TYPE DEFINITIONS |
| 35 | //************************************************************************** |
| 36 | |
| 37 | // ======================> seibu_cop_device |
| 38 | |
| 39 | class seibu_cop_device : public device_t, |
| 40 | public seibu_cop_interface |
| 41 | { |
| 42 | public: |
| 43 | // construction/destruction |
| 44 | seibu_cop_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 45 | |
| 46 | // I/O operations |
| 47 | DECLARE_WRITE8_MEMBER( write ); |
| 48 | DECLARE_READ8_MEMBER( read ); |
| 49 | |
| 50 | protected: |
| 51 | // device-level overrides |
| 52 | virtual void device_config_complete(); |
| 53 | virtual void device_validity_check(validity_checker &valid) const; |
| 54 | virtual void device_start(); |
| 55 | virtual void device_reset(); |
| 56 | |
| 57 | private: |
| 58 | devcb_resolved_read8 m_in_mreq_func; |
| 59 | devcb_resolved_write8 m_out_mreq_func; |
| 60 | }; |
| 61 | |
| 62 | |
| 63 | // device type definition |
| 64 | extern const device_type SEIBU_COP; |
| 65 | |
| 66 | |
| 67 | |
| 68 | //************************************************************************** |
| 69 | // GLOBAL VARIABLES |
| 70 | //************************************************************************** |
| 71 | |
| 72 | |
| 73 | |
| 74 | #endif |