Previous 15994 Revisions Next

r15840 Friday 10th August, 2012 at 14:42:45 UTC by Curt Coder
[VIC20] Fixed external reset. (nw)
[src/mess/drivers]vic20.c
[src/mess/includes]vic20.h
[src/mess/machine]vic1010.c vic1010.h vic20exp.c vic20exp.h vic20user.c vic20user.h

src/mess/machine/vic20exp.c
r15839r15840
224224
225225
226226//-------------------------------------------------
227//  device_reset - device-specific reset
228//-------------------------------------------------
229
230void vic20_expansion_slot_device::device_reset()
231{
232   port_res_w(ASSERT_LINE);
233   port_res_w(CLEAR_LINE);
234}
235
236
237//-------------------------------------------------
227238//  call_load -
228239//-------------------------------------------------
229240
r15839r15840
357368   return value;
358369}
359370
371WRITE_LINE_MEMBER( vic20_expansion_slot_device::port_res_w ) { if (m_cart != NULL) m_cart->vic20_res_w(state); }
372
360373WRITE_LINE_MEMBER( vic20_expansion_slot_device::irq_w ) { m_out_irq_func(state); }
361374WRITE_LINE_MEMBER( vic20_expansion_slot_device::nmi_w ) { m_out_nmi_func(state); }
362375WRITE_LINE_MEMBER( vic20_expansion_slot_device::res_w ) { m_out_res_func(state); }
src/mess/machine/vic20exp.h
r15839r15840
9292   vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
9393   virtual ~vic20_expansion_slot_device();
9494
95   // computer interface
9596   UINT8 cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
9697   void cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
98   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
99   DECLARE_WRITE_LINE_MEMBER( port_res_w );
97100
98   DECLARE_READ8_MEMBER( ram1_r );
99   DECLARE_WRITE8_MEMBER( ram1_w );
100   DECLARE_READ8_MEMBER( ram2_r );
101   DECLARE_WRITE8_MEMBER( ram2_w );
102   DECLARE_READ8_MEMBER( ram3_r );
103   DECLARE_WRITE8_MEMBER( ram3_w );
104   DECLARE_READ8_MEMBER( blk1_r );
105   DECLARE_WRITE8_MEMBER( blk1_w );
106   DECLARE_READ8_MEMBER( blk2_r );
107   DECLARE_WRITE8_MEMBER( blk2_w );
108   DECLARE_READ8_MEMBER( blk3_r );
109   DECLARE_WRITE8_MEMBER( blk3_w );
110   DECLARE_READ8_MEMBER( blk5_r );
111   DECLARE_WRITE8_MEMBER( blk5_w );
112   DECLARE_READ8_MEMBER( io2_r );
113   DECLARE_WRITE8_MEMBER( io2_w );
114   DECLARE_READ8_MEMBER( io3_r );
115   DECLARE_WRITE8_MEMBER( io3_w );
116
101   // cartridge interface
117102   DECLARE_WRITE_LINE_MEMBER( irq_w );
118103   DECLARE_WRITE_LINE_MEMBER( nmi_w );
119104   DECLARE_WRITE_LINE_MEMBER( res_w );
120105
121   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
122
123106protected:
124107   // device-level overrides
125108   virtual void device_config_complete();
126109   virtual void device_start();
110   virtual void device_reset();
127111
128112   // image-level overrides
129113   virtual bool call_load();
r15839r15840
176160   virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { return 0; };
177161   virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3) { };
178162   virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; }
163   virtual void vic20_res_w(int state) { };
179164
180165   vic20_expansion_slot_device *m_slot;
181166
src/mess/machine/vic1010.c
r15839r15840
130130      m_expansion_slot[i]->cd_w(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3);
131131   }
132132}
133
134
135//-------------------------------------------------
136//  vic20_screen_update - screen update
137//-------------------------------------------------
138
139UINT32 vic1010_device::vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
140{
141   UINT32 data = 0;
142
143   for (int i = 0; i < MAX_SLOTS; i++)
144   {
145      data |= m_expansion_slot[i]->screen_update(screen, bitmap, cliprect);
146   }
147
148   return data;
149}
150
151
152//-------------------------------------------------
153//  vic20_res_w - reset write
154//-------------------------------------------------
155
156void vic1010_device::vic20_res_w(int state)
157{
158   for (int i = 0; i < MAX_SLOTS; i++)
159   {
160      m_expansion_slot[i]->port_res_w(state);
161   }
162}
src/mess/machine/vic1010.h
r15839r15840
5656   // device_vic20_expansion_card_interface overrides
5757   virtual UINT8 vic20_cd_r(address_space &space, offs_t offset, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
5858   virtual void vic20_cd_w(address_space &space, offs_t offset, UINT8 data, int ram1, int ram2, int ram3, int blk1, int blk2, int blk3, int blk5, int io2, int io3);
59   virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   virtual void vic20_res_w(int state);
5961
6062private:
6163   vic20_expansion_slot_device *m_expansion_slot[MAX_SLOTS];
src/mess/machine/vic20user.c
r15839r15840
114114 
115115void vic20_user_port_device::device_reset()
116116{
117   port_reset_w(ASSERT_LINE);
118   port_reset_w(CLEAR_LINE);
117119}
118120 
119121 
r15839r15840
127129WRITE_LINE_MEMBER( vic20_user_port_device::cb1_w ) { if (m_cart != NULL) m_cart->vic20_cb1_w(state); }
128130WRITE_LINE_MEMBER( vic20_user_port_device::cb2_w ) { if (m_cart != NULL) m_cart->vic20_cb2_w(state); }
129131WRITE_LINE_MEMBER( vic20_user_port_device::atn_w ) { if (m_cart != NULL) m_cart->vic20_atn_w(state); }
132WRITE_LINE_MEMBER( vic20_user_port_device::port_reset_w ) { if (m_cart != NULL) m_cart->vic20_reset_w(state); }
130133 
131134WRITE_LINE_MEMBER( vic20_user_port_device::via_cb1_w ) { m_out_cb1_func(state); }
132135WRITE_LINE_MEMBER( vic20_user_port_device::via_cb2_w ) { m_out_cb2_func(state); }
src/mess/machine/vic20user.h
r15839r15840
9292   DECLARE_WRITE_LINE_MEMBER( cb1_w );
9393   DECLARE_WRITE_LINE_MEMBER( cb2_w );
9494   DECLARE_WRITE_LINE_MEMBER( atn_w );
95   DECLARE_WRITE_LINE_MEMBER( port_reset_w );
9596 
9697   // cartridge interface
9798   DECLARE_WRITE_LINE_MEMBER( via_cb1_w );
src/mess/includes/vic20.h
r15839r15840
6464   required_device<timer_device> m_cassette_timer;
6565
6666   virtual void machine_start();
67   virtual void machine_reset();
6768
6869   DECLARE_READ8_MEMBER( read );
6970   DECLARE_WRITE8_MEMBER( write );
r15839r15840
7172   DECLARE_READ8_MEMBER( via0_pa_r );
7273   DECLARE_WRITE8_MEMBER( via0_pa_w );
7374   DECLARE_WRITE_LINE_MEMBER( via0_ca2_w );
75
7476   DECLARE_READ8_MEMBER( via1_pa_r );
7577   DECLARE_READ8_MEMBER( via1_pb_r );
7678   DECLARE_WRITE8_MEMBER( via1_pb_w );
7779   DECLARE_WRITE_LINE_MEMBER( via1_ca2_w );
7880   DECLARE_WRITE_LINE_MEMBER( via1_cb2_w );
7981
82   DECLARE_WRITE_LINE_MEMBER( exp_reset_w );
83
8084   // memory state
8185   UINT8 *m_basic;
8286   UINT8 *m_kernal;
src/mess/drivers/vic20.c
r15839r15840
732732//  VIC20_EXPANSION_INTERFACE( expansion_intf )
733733//-------------------------------------------------
734734
735WRITE_LINE_MEMBER( vic20_state::exp_reset_w )
736{
737   if (state == ASSERT_LINE)
738   {
739      machine_reset();
740   }
741}
742
735743static VIC20_EXPANSION_INTERFACE( expansion_intf )
736744{
737745   DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_IRQ0),
738746   DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_NMI),
739   DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_RESET)
747   DEVCB_DRIVER_LINE_MEMBER(vic20_state, exp_reset_w)
740748};
741749
742750
r15839r15840
748756{
749757   DEVCB_DEVICE_LINE_MEMBER(M6522_0_TAG, via6522_device, write_cb1),
750758   DEVCB_DEVICE_LINE_MEMBER(M6522_0_TAG, via6522_device, write_cb2),
751   DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_RESET)
759   DEVCB_DRIVER_LINE_MEMBER(vic20_state, exp_reset_w)
752760};
753761
754762
r15839r15840
776784}
777785
778786
787//-------------------------------------------------
788//  MACHINE_RESET( vic20 )
789//-------------------------------------------------
779790
791void vic20_state::machine_reset()
792{
793   m_maincpu->reset();
794
795   m_iec->reset();
796   m_exp->reset();
797   m_user->reset();
798}
799
800
801
780802//**************************************************************************
781803//  MACHINE DRIVERS
782804//**************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team