trunk/src/emu/bus/amiga/zorro/zorro.h
r32500 | r32501 | |
146 | 146 | |
147 | 147 | #include "emu.h" |
148 | 148 | |
| 149 | //************************************************************************** |
| 150 | // CONSTANTS / MACROS |
| 151 | //************************************************************************** |
149 | 152 | |
| 153 | #define EXP_SLOT_TAG "exp" |
| 154 | #define ZORROBUS_TAG "zorrobus" |
| 155 | |
| 156 | |
150 | 157 | //************************************************************************** |
151 | 158 | // INTERFACE CONFIGURATION MACROS |
152 | 159 | //************************************************************************** |
r32500 | r32501 | |
159 | 166 | // ======================> expansion slot |
160 | 167 | |
161 | 168 | #define MCFG_EXPANSION_SLOT_ADD(_cputag, _slot_intf, _def_slot) \ |
162 | | MCFG_DEVICE_ADD("exp", EXP_SLOT, 0) \ |
| 169 | MCFG_DEVICE_ADD(EXP_SLOT_TAG, EXP_SLOT, 0) \ |
163 | 170 | zorro_device::set_cputag(*device, _cputag); \ |
164 | | MCFG_ZORRO_SLOT_ADD("exp", "slot", _slot_intf, _def_slot) |
| 171 | MCFG_ZORRO_SLOT_ADD(EXP_SLOT_TAG, "slot", _slot_intf, _def_slot) |
165 | 172 | |
166 | 173 | // callbacks |
167 | 174 | #define MCFG_EXPANSION_SLOT_OVR_HANDLER(_devcb) \ |
r32500 | r32501 | |
179 | 186 | // ======================> zorro 2 bus |
180 | 187 | |
181 | 188 | #define MCFG_ZORRO2_ADD(_cputag) \ |
182 | | MCFG_DEVICE_ADD("zorrobus", ZORRO2, 0) \ |
| 189 | MCFG_DEVICE_ADD(ZORROBUS_TAG, ZORRO2, 0) \ |
183 | 190 | zorro_device::set_cputag(*device, _cputag); |
184 | 191 | |
185 | 192 | #define MCFG_ZORRO2_SLOT_ADD(_tag, _slot_intf, _def_slot) \ |
186 | | MCFG_ZORRO_SLOT_ADD("zorrobus", _tag, _slot_intf, _def_slot) |
| 193 | MCFG_ZORRO_SLOT_ADD(ZORROBUS_TAG, _tag, _slot_intf, _def_slot) |
187 | 194 | |
188 | 195 | #define MCFG_ZORRO2_OVR_HANDLER(_devcb) \ |
189 | 196 | devcb = &zorro_device::set_ovr_handler(*device, DEVCB_##_devcb); |
trunk/src/mess/drivers/amiga.c
r32500 | r32501 | |
60 | 60 | a2000_state(const machine_config &mconfig, device_type type, const char *tag) : |
61 | 61 | amiga_state(mconfig, type, tag), |
62 | 62 | m_rtc(*this, "u65"), |
| 63 | m_zorro(*this, ZORROBUS_TAG), |
63 | 64 | m_zorro2_int2(0), |
64 | 65 | m_zorro2_int6(0) |
65 | 66 | { } |
r32500 | r32501 | |
74 | 75 | DECLARE_WRITE16_MEMBER( clock_w ); |
75 | 76 | |
76 | 77 | protected: |
| 78 | virtual void machine_reset(); |
| 79 | |
77 | 80 | // amiga_state overrides |
78 | 81 | virtual bool int2_pending(); |
79 | 82 | virtual bool int6_pending(); |
r32500 | r32501 | |
81 | 84 | private: |
82 | 85 | // devices |
83 | 86 | required_device<msm6242_device> m_rtc; |
| 87 | required_device<zorro2_device> m_zorro; |
84 | 88 | |
85 | 89 | // internal state |
86 | 90 | int m_zorro2_int2; |
r32500 | r32501 | |
91 | 95 | { |
92 | 96 | public: |
93 | 97 | a500_state(const machine_config &mconfig, device_type type, const char *tag) : |
94 | | amiga_state(mconfig, type, tag) |
95 | | //m_side_int2(0), |
96 | | //m_side_int6(0) |
| 98 | amiga_state(mconfig, type, tag), |
| 99 | m_side(*this, EXP_SLOT_TAG), |
| 100 | m_side_int2(0), |
| 101 | m_side_int6(0) |
97 | 102 | { } |
98 | 103 | |
99 | 104 | DECLARE_DRIVER_INIT( pal ); |
100 | 105 | DECLARE_DRIVER_INIT( ntsc ); |
101 | 106 | |
102 | 107 | protected: |
| 108 | virtual void machine_reset(); |
103 | 109 | |
| 110 | // amiga_state overrides |
| 111 | virtual bool int2_pending(); |
| 112 | virtual bool int6_pending(); |
| 113 | |
104 | 114 | private: |
| 115 | // devices |
| 116 | required_device<exp_slot_device> m_side; |
| 117 | |
105 | 118 | // internal state |
106 | | //int m_side_int2; |
107 | | //int m_side_int6; |
| 119 | int m_side_int2; |
| 120 | int m_side_int6; |
108 | 121 | }; |
109 | 122 | |
110 | 123 | class cdtv_state : public amiga_state |
r32500 | r32501 | |
180 | 193 | public: |
181 | 194 | a500p_state(const machine_config &mconfig, device_type type, const char *tag) : |
182 | 195 | amiga_state(mconfig, type, tag), |
183 | | m_rtc(*this, "u9") |
184 | | //m_side_int2(0), |
185 | | //m_side_int6(0) |
| 196 | m_rtc(*this, "u9"), |
| 197 | m_side(*this, EXP_SLOT_TAG), |
| 198 | m_side_int2(0), |
| 199 | m_side_int6(0) |
186 | 200 | { } |
187 | 201 | |
188 | 202 | DECLARE_READ16_MEMBER( clock_r ); |
r32500 | r32501 | |
192 | 206 | DECLARE_DRIVER_INIT( ntsc ); |
193 | 207 | |
194 | 208 | protected: |
| 209 | virtual void machine_reset(); |
195 | 210 | |
| 211 | // amiga_state overrides |
| 212 | virtual bool int2_pending(); |
| 213 | virtual bool int6_pending(); |
| 214 | |
196 | 215 | private: |
197 | 216 | // devices |
198 | 217 | required_device<msm6242_device> m_rtc; |
| 218 | required_device<exp_slot_device> m_side; |
199 | 219 | |
200 | 220 | // internal state |
201 | | //int m_side_int2; |
202 | | //int m_side_int6; |
| 221 | int m_side_int2; |
| 222 | int m_side_int6; |
203 | 223 | }; |
204 | 224 | |
205 | 225 | class a600_state : public amiga_state |
r32500 | r32501 | |
557 | 577 | m_maincpu->space(AS_PROGRAM).nop_write(0xfc0000, 0xffffff); |
558 | 578 | } |
559 | 579 | |
| 580 | void a2000_state::machine_reset() |
| 581 | { |
| 582 | // base reset |
| 583 | amiga_state::machine_reset(); |
| 584 | |
| 585 | // reset zorro devices |
| 586 | m_zorro->reset(); |
| 587 | } |
| 588 | |
560 | 589 | WRITE_LINE_MEMBER( a2000_state::zorro2_int2_w ) |
561 | 590 | { |
562 | 591 | m_zorro2_int2 = state; |
r32500 | r32501 | |
579 | 608 | return m_cia_1_irq || m_zorro2_int6; |
580 | 609 | } |
581 | 610 | |
| 611 | void a500_state::machine_reset() |
| 612 | { |
| 613 | // base reset |
| 614 | amiga_state::machine_reset(); |
| 615 | |
| 616 | // reset side expansion slot device |
| 617 | m_side->reset(); |
| 618 | } |
| 619 | |
| 620 | bool a500_state::int2_pending() |
| 621 | { |
| 622 | return m_cia_0_irq || m_side_int2; |
| 623 | } |
| 624 | |
| 625 | bool a500_state::int6_pending() |
| 626 | { |
| 627 | return m_cia_1_irq || m_side_int6; |
| 628 | } |
| 629 | |
582 | 630 | void cdtv_state::machine_start() |
583 | 631 | { |
584 | 632 | // start base machine |
r32500 | r32501 | |
623 | 671 | logerror("motherboard_w(%06x): %08x & %08x\n", offset, data, mem_mask); |
624 | 672 | } |
625 | 673 | |
| 674 | void a500p_state::machine_reset() |
| 675 | { |
| 676 | // base reset |
| 677 | amiga_state::machine_reset(); |
| 678 | |
| 679 | // reset side expansion slot device |
| 680 | m_side->reset(); |
| 681 | } |
| 682 | |
| 683 | bool a500p_state::int2_pending() |
| 684 | { |
| 685 | return m_cia_0_irq || m_side_int2; |
| 686 | } |
| 687 | |
| 688 | bool a500p_state::int6_pending() |
| 689 | { |
| 690 | return m_cia_1_irq || m_side_int6; |
| 691 | } |
| 692 | |
626 | 693 | bool a600_state::int2_pending() |
627 | 694 | { |
628 | 695 | return m_cia_0_irq || m_gayle_int2; |