Previous 199869 Revisions Next

r32501 Thursday 2nd October, 2014 at 13:52:55 UTC by Dirk Best
Amiga: Connect Zorro interrupts in the Amiga 500 drivers and
reinitialize Zorro devices on reset to stop them from disappearing on
soft reset.
[src/emu/bus/amiga/zorro]zorro.h
[src/mess/drivers]amiga.c

trunk/src/emu/bus/amiga/zorro/zorro.h
r32500r32501
146146
147147#include "emu.h"
148148
149//**************************************************************************
150//  CONSTANTS / MACROS
151//**************************************************************************
149152
153#define EXP_SLOT_TAG "exp"
154#define ZORROBUS_TAG "zorrobus"
155
156
150157//**************************************************************************
151158//  INTERFACE CONFIGURATION MACROS
152159//**************************************************************************
r32500r32501
159166// ======================> expansion slot
160167
161168#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) \
163170   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)
165172
166173// callbacks
167174#define MCFG_EXPANSION_SLOT_OVR_HANDLER(_devcb) \
r32500r32501
179186// ======================> zorro 2 bus
180187
181188#define MCFG_ZORRO2_ADD(_cputag) \
182   MCFG_DEVICE_ADD("zorrobus", ZORRO2, 0) \
189   MCFG_DEVICE_ADD(ZORROBUS_TAG, ZORRO2, 0) \
183190   zorro_device::set_cputag(*device, _cputag);
184191
185192#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)
187194
188195#define MCFG_ZORRO2_OVR_HANDLER(_devcb) \
189196   devcb = &zorro_device::set_ovr_handler(*device, DEVCB_##_devcb);
trunk/src/mess/drivers/amiga.c
r32500r32501
6060   a2000_state(const machine_config &mconfig, device_type type, const char *tag) :
6161   amiga_state(mconfig, type, tag),
6262   m_rtc(*this, "u65"),
63   m_zorro(*this, ZORROBUS_TAG),
6364   m_zorro2_int2(0),
6465   m_zorro2_int6(0)
6566   { }
r32500r32501
7475   DECLARE_WRITE16_MEMBER( clock_w );
7576
7677protected:
78   virtual void machine_reset();
79
7780   // amiga_state overrides
7881   virtual bool int2_pending();
7982   virtual bool int6_pending();
r32500r32501
8184private:
8285   // devices
8386   required_device<msm6242_device> m_rtc;
87   required_device<zorro2_device> m_zorro;
8488
8589   // internal state
8690   int m_zorro2_int2;
r32500r32501
9195{
9296public:
9397   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)
97102   { }
98103
99104   DECLARE_DRIVER_INIT( pal );
100105   DECLARE_DRIVER_INIT( ntsc );
101106
102107protected:
108   virtual void machine_reset();
103109
110   // amiga_state overrides
111   virtual bool int2_pending();
112   virtual bool int6_pending();
113
104114private:
115   // devices
116   required_device<exp_slot_device> m_side;
117
105118   // internal state
106   //int m_side_int2;
107   //int m_side_int6;
119   int m_side_int2;
120   int m_side_int6;
108121};
109122
110123class cdtv_state : public amiga_state
r32500r32501
180193public:
181194   a500p_state(const machine_config &mconfig, device_type type, const char *tag) :
182195   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)
186200   { }
187201
188202   DECLARE_READ16_MEMBER( clock_r );
r32500r32501
192206   DECLARE_DRIVER_INIT( ntsc );
193207
194208protected:
209   virtual void machine_reset();
195210
211   // amiga_state overrides
212   virtual bool int2_pending();
213   virtual bool int6_pending();
214
196215private:
197216   // devices
198217   required_device<msm6242_device> m_rtc;
218   required_device<exp_slot_device> m_side;
199219
200220   // internal state
201   //int m_side_int2;
202   //int m_side_int6;
221   int m_side_int2;
222   int m_side_int6;
203223};
204224
205225class a600_state : public amiga_state
r32500r32501
557577   m_maincpu->space(AS_PROGRAM).nop_write(0xfc0000, 0xffffff);
558578}
559579
580void a2000_state::machine_reset()
581{
582   // base reset
583   amiga_state::machine_reset();
584
585   // reset zorro devices
586   m_zorro->reset();
587}
588
560589WRITE_LINE_MEMBER( a2000_state::zorro2_int2_w )
561590{
562591   m_zorro2_int2 = state;
r32500r32501
579608   return m_cia_1_irq || m_zorro2_int6;
580609}
581610
611void 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
620bool a500_state::int2_pending()
621{
622   return m_cia_0_irq || m_side_int2;
623}
624
625bool a500_state::int6_pending()
626{
627   return m_cia_1_irq || m_side_int6;
628}
629
582630void cdtv_state::machine_start()
583631{
584632   // start base machine
r32500r32501
623671   logerror("motherboard_w(%06x): %08x & %08x\n", offset, data, mem_mask);
624672}
625673
674void 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
683bool a500p_state::int2_pending()
684{
685   return m_cia_0_irq || m_side_int2;
686}
687
688bool a500p_state::int6_pending()
689{
690   return m_cia_1_irq || m_side_int6;
691}
692
626693bool a600_state::int2_pending()
627694{
628695   return m_cia_0_irq || m_gayle_int2;

Previous 199869 Revisions Next


© 1997-2024 The MAME Team