trunk/src/emu/bus/ql/cst_q_plus4.h
| r30927 | r30928 | |
| 15 | 15 | #define __CST_Q_PLUS4__ |
| 16 | 16 | |
| 17 | 17 | #include "exp.h" |
| 18 | #include "machine/6821pia.h" |
| 18 | 19 | |
| 19 | 20 | |
| 20 | 21 | |
| r30927 | r30928 | |
| 34 | 35 | |
| 35 | 36 | // optional information overrides |
| 36 | 37 | virtual const rom_entry *device_rom_region() const; |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; |
| 37 | 39 | |
| 40 | DECLARE_WRITE_LINE_MEMBER( exp1_extintl_w ) { m_exp1_extinl = state; update_extintl(); } |
| 41 | DECLARE_WRITE_LINE_MEMBER( exp2_extintl_w ) { m_exp2_extinl = state; update_extintl(); } |
| 42 | DECLARE_WRITE_LINE_MEMBER( exp3_extintl_w ) { m_exp3_extinl = state; update_extintl(); } |
| 43 | DECLARE_WRITE_LINE_MEMBER( exp4_extintl_w ) { m_exp4_extinl = state; update_extintl(); } |
| 44 | |
| 38 | 45 | protected: |
| 39 | 46 | // device-level overrides |
| 40 | 47 | virtual void device_start(); |
| r30927 | r30928 | |
| 44 | 51 | virtual void write(address_space &space, offs_t offset, UINT8 data); |
| 45 | 52 | |
| 46 | 53 | private: |
| 54 | void update_extintl() { m_slot->extintl_w(m_exp1_extinl || m_exp2_extinl || m_exp3_extinl || m_exp4_extinl); } |
| 55 | |
| 56 | required_device<ql_expansion_slot_t> m_exp1; |
| 57 | required_device<ql_expansion_slot_t> m_exp2; |
| 58 | required_device<ql_expansion_slot_t> m_exp3; |
| 59 | required_device<ql_expansion_slot_t> m_exp4; |
| 60 | required_memory_region m_rom; |
| 61 | |
| 62 | int m_exp1_extinl; |
| 63 | int m_exp2_extinl; |
| 64 | int m_exp3_extinl; |
| 65 | int m_exp4_extinl; |
| 47 | 66 | }; |
| 48 | 67 | |
| 49 | 68 | |
trunk/src/emu/bus/ql/cst_q_plus4.c
| r30927 | r30928 | |
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | //************************************************************************** |
| 17 | // MACROS/CONSTANTS |
| 18 | //************************************************************************** |
| 19 | |
| 20 | #define MC6821_TAG "mc6821" |
| 21 | |
| 22 | |
| 23 | |
| 24 | //************************************************************************** |
| 17 | 25 | // DEVICE DEFINITIONS |
| 18 | 26 | //************************************************************************** |
| 19 | 27 | |
| r30927 | r30928 | |
| 40 | 48 | } |
| 41 | 49 | |
| 42 | 50 | |
| 51 | //------------------------------------------------- |
| 52 | // MACHINE_CONFIG_FRAGMENT( cst_q_plus4 ) |
| 53 | //------------------------------------------------- |
| 43 | 54 | |
| 55 | static MACHINE_CONFIG_FRAGMENT( cst_q_plus4 ) |
| 56 | MCFG_DEVICE_ADD(MC6821_TAG, PIA6821, 0) |
| 57 | |
| 58 | MCFG_QL_EXPANSION_SLOT_ADD("exp1", ql_expansion_cards, NULL) |
| 59 | MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp1_extintl_w)) |
| 60 | |
| 61 | MCFG_QL_EXPANSION_SLOT_ADD("exp2", ql_expansion_cards, NULL) |
| 62 | MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp2_extintl_w)) |
| 63 | |
| 64 | MCFG_QL_EXPANSION_SLOT_ADD("exp3", ql_expansion_cards, NULL) |
| 65 | MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp3_extintl_w)) |
| 66 | |
| 67 | MCFG_QL_EXPANSION_SLOT_ADD("exp4", ql_expansion_cards, NULL) |
| 68 | MCFG_QL_EXPANSION_SLOT_EXTINTL_CALLBACK(WRITELINE(cst_q_plus4_t, exp4_extintl_w)) |
| 69 | MACHINE_CONFIG_END |
| 70 | |
| 71 | |
| 72 | //------------------------------------------------- |
| 73 | // machine_config_additions - device-specific |
| 74 | // machine configurations |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | machine_config_constructor cst_q_plus4_t::device_mconfig_additions() const |
| 78 | { |
| 79 | return MACHINE_CONFIG_NAME( cst_q_plus4 ); |
| 80 | } |
| 81 | |
| 82 | |
| 83 | |
| 44 | 84 | //************************************************************************** |
| 45 | 85 | // LIVE DEVICE |
| 46 | 86 | //************************************************************************** |
| r30927 | r30928 | |
| 51 | 91 | |
| 52 | 92 | cst_q_plus4_t::cst_q_plus4_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 53 | 93 | device_t(mconfig, CST_Q_PLUS4, "CST Q+4", tag, owner, clock, "ql_qplus4", __FILE__), |
| 54 | | device_ql_expansion_card_interface(mconfig, *this) |
| 94 | device_ql_expansion_card_interface(mconfig, *this), |
| 95 | m_exp1(*this, "exp1"), |
| 96 | m_exp2(*this, "exp2"), |
| 97 | m_exp3(*this, "exp3"), |
| 98 | m_exp4(*this, "exp4"), |
| 99 | m_rom(*this, "rom"), |
| 100 | m_exp1_extinl(CLEAR_LINE), |
| 101 | m_exp2_extinl(CLEAR_LINE), |
| 102 | m_exp3_extinl(CLEAR_LINE), |
| 103 | m_exp4_extinl(CLEAR_LINE) |
| 55 | 104 | { |
| 56 | 105 | } |
| 57 | 106 | |
| r30927 | r30928 | |
| 71 | 120 | |
| 72 | 121 | UINT8 cst_q_plus4_t::read(address_space &space, offs_t offset, UINT8 data) |
| 73 | 122 | { |
| 123 | if (offset >= 0xc000 && offset < 0xc200) |
| 124 | { |
| 125 | data = m_rom->base()[offset & 0x1fff]; |
| 126 | } |
| 127 | |
| 128 | data = m_exp1->read(space, offset, data); |
| 129 | data = m_exp2->read(space, offset, data); |
| 130 | data = m_exp3->read(space, offset, data); |
| 131 | data = m_exp4->read(space, offset, data); |
| 132 | |
| 74 | 133 | return data; |
| 75 | 134 | } |
| 76 | 135 | |
| r30927 | r30928 | |
| 81 | 140 | |
| 82 | 141 | void cst_q_plus4_t::write(address_space &space, offs_t offset, UINT8 data) |
| 83 | 142 | { |
| 143 | m_exp1->write(space, offset, data); |
| 144 | m_exp2->write(space, offset, data); |
| 145 | m_exp3->write(space, offset, data); |
| 146 | m_exp4->write(space, offset, data); |
| 84 | 147 | } |