src/mess/machine/vic20exp.h
| r15839 | r15840 | |
| 92 | 92 | vic20_expansion_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 93 | 93 | virtual ~vic20_expansion_slot_device(); |
| 94 | 94 | |
| 95 | // computer interface |
| 95 | 96 | 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); |
| 96 | 97 | 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 ); |
| 97 | 100 | |
| 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 |
| 117 | 102 | DECLARE_WRITE_LINE_MEMBER( irq_w ); |
| 118 | 103 | DECLARE_WRITE_LINE_MEMBER( nmi_w ); |
| 119 | 104 | DECLARE_WRITE_LINE_MEMBER( res_w ); |
| 120 | 105 | |
| 121 | | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 122 | | |
| 123 | 106 | protected: |
| 124 | 107 | // device-level overrides |
| 125 | 108 | virtual void device_config_complete(); |
| 126 | 109 | virtual void device_start(); |
| 110 | virtual void device_reset(); |
| 127 | 111 | |
| 128 | 112 | // image-level overrides |
| 129 | 113 | virtual bool call_load(); |
| r15839 | r15840 | |
| 176 | 160 | 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; }; |
| 177 | 161 | 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) { }; |
| 178 | 162 | virtual UINT32 vic20_screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { return 0; } |
| 163 | virtual void vic20_res_w(int state) { }; |
| 179 | 164 | |
| 180 | 165 | vic20_expansion_slot_device *m_slot; |
| 181 | 166 | |
src/mess/machine/vic1010.c
| r15839 | r15840 | |
| 130 | 130 | m_expansion_slot[i]->cd_w(space, offset, data, ram1, ram2, ram3, blk1, blk2, blk3, blk5, io2, io3); |
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | |
| 134 | |
| 135 | //------------------------------------------------- |
| 136 | // vic20_screen_update - screen update |
| 137 | //------------------------------------------------- |
| 138 | |
| 139 | UINT32 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 | |
| 156 | void 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
| r15839 | r15840 | |
| 56 | 56 | // device_vic20_expansion_card_interface overrides |
| 57 | 57 | 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); |
| 58 | 58 | 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); |
| 59 | 61 | |
| 60 | 62 | private: |
| 61 | 63 | vic20_expansion_slot_device *m_expansion_slot[MAX_SLOTS]; |
src/mess/includes/vic20.h
| r15839 | r15840 | |
| 64 | 64 | required_device<timer_device> m_cassette_timer; |
| 65 | 65 | |
| 66 | 66 | virtual void machine_start(); |
| 67 | virtual void machine_reset(); |
| 67 | 68 | |
| 68 | 69 | DECLARE_READ8_MEMBER( read ); |
| 69 | 70 | DECLARE_WRITE8_MEMBER( write ); |
| r15839 | r15840 | |
| 71 | 72 | DECLARE_READ8_MEMBER( via0_pa_r ); |
| 72 | 73 | DECLARE_WRITE8_MEMBER( via0_pa_w ); |
| 73 | 74 | DECLARE_WRITE_LINE_MEMBER( via0_ca2_w ); |
| 75 | |
| 74 | 76 | DECLARE_READ8_MEMBER( via1_pa_r ); |
| 75 | 77 | DECLARE_READ8_MEMBER( via1_pb_r ); |
| 76 | 78 | DECLARE_WRITE8_MEMBER( via1_pb_w ); |
| 77 | 79 | DECLARE_WRITE_LINE_MEMBER( via1_ca2_w ); |
| 78 | 80 | DECLARE_WRITE_LINE_MEMBER( via1_cb2_w ); |
| 79 | 81 | |
| 82 | DECLARE_WRITE_LINE_MEMBER( exp_reset_w ); |
| 83 | |
| 80 | 84 | // memory state |
| 81 | 85 | UINT8 *m_basic; |
| 82 | 86 | UINT8 *m_kernal; |
src/mess/drivers/vic20.c
| r15839 | r15840 | |
| 732 | 732 | // VIC20_EXPANSION_INTERFACE( expansion_intf ) |
| 733 | 733 | //------------------------------------------------- |
| 734 | 734 | |
| 735 | WRITE_LINE_MEMBER( vic20_state::exp_reset_w ) |
| 736 | { |
| 737 | if (state == ASSERT_LINE) |
| 738 | { |
| 739 | machine_reset(); |
| 740 | } |
| 741 | } |
| 742 | |
| 735 | 743 | static VIC20_EXPANSION_INTERFACE( expansion_intf ) |
| 736 | 744 | { |
| 737 | 745 | DEVCB_CPU_INPUT_LINE(M6502_TAG, INPUT_LINE_IRQ0), |
| 738 | 746 | 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) |
| 740 | 748 | }; |
| 741 | 749 | |
| 742 | 750 | |
| r15839 | r15840 | |
| 748 | 756 | { |
| 749 | 757 | DEVCB_DEVICE_LINE_MEMBER(M6522_0_TAG, via6522_device, write_cb1), |
| 750 | 758 | 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) |
| 752 | 760 | }; |
| 753 | 761 | |
| 754 | 762 | |
| r15839 | r15840 | |
| 776 | 784 | } |
| 777 | 785 | |
| 778 | 786 | |
| 787 | //------------------------------------------------- |
| 788 | // MACHINE_RESET( vic20 ) |
| 789 | //------------------------------------------------- |
| 779 | 790 | |
| 791 | void 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 | |
| 780 | 802 | //************************************************************************** |
| 781 | 803 | // MACHINE DRIVERS |
| 782 | 804 | //************************************************************************** |