| Previous | 199869 Revisions | Next |
| r30651 Sunday 25th May, 2014 at 09:21:41 UTC by Dirk Best |
|---|
| Amiga: Move Zorro slots to amiga/zorro/ in preparation to support more other slots. |
| [src/emu/bus] | bus.mak |
| [src/emu/bus/amiga] | zorro* |
| [src/mess/drivers] | amiga.c |
| r30650 | r30651 | |
|---|---|---|
| 1120 | 1120 | |
| 1121 | 1121 | #------------------------------------------------- |
| 1122 | 1122 | # |
| 1123 | #@src/emu/bus/zorro/zorro.h,BUSES += ZORRO | |
| 1123 | #@src/emu/bus/amiga/zorro/zorro.h,BUSES += ZORRO | |
| 1124 | 1124 | #------------------------------------------------- |
| 1125 | 1125 | |
| 1126 | 1126 | ifneq ($(filter ZORRO,$(BUSES)),) |
| 1127 | OBJDIRS += $(BUSOBJ)/zorro | |
| 1128 | BUSOBJS += $(BUSOBJ)/zorro/zorro.o | |
| 1129 | BUSOBJS += $(BUSOBJ)/zorro/cards.o | |
| 1130 | BUSOBJS += $(BUSOBJ)/zorro/a2052.o | |
| 1131 | BUSOBJS += $(BUSOBJ)/zorro/a2232.o | |
| 1132 | BUSOBJS += $(BUSOBJ)/zorro/a590.o | |
| 1133 | BUSOBJS += $(BUSOBJ)/zorro/action_replay.o | |
| 1134 | BUSOBJS += $(BUSOBJ)/zorro/buddha.o | |
| 1127 | OBJDIRS += $(BUSOBJ)/amiga/zorro | |
| 1128 | BUSOBJS += $(BUSOBJ)/amiga/zorro/zorro.o | |
| 1129 | BUSOBJS += $(BUSOBJ)/amiga/zorro/cards.o | |
| 1130 | BUSOBJS += $(BUSOBJ)/amiga/zorro/a2052.o | |
| 1131 | BUSOBJS += $(BUSOBJ)/amiga/zorro/a2232.o | |
| 1132 | BUSOBJS += $(BUSOBJ)/amiga/zorro/a590.o | |
| 1133 | BUSOBJS += $(BUSOBJ)/amiga/zorro/action_replay.o | |
| 1134 | BUSOBJS += $(BUSOBJ)/amiga/zorro/buddha.o | |
| 1135 | 1135 | endif |
| 1136 | 1136 | |
| 1137 | 1137 | #------------------------------------------------- |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Commodore A2052 | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Zorro-II RAM Expansion (0.5, 1 or 2 MB) | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "a2052.h" | |
| 13 | ||
| 14 | ||
| 15 | //************************************************************************** | |
| 16 | // CONSTANTS / MACROS | |
| 17 | //************************************************************************** | |
| 18 | ||
| 19 | #define VERBOSE 1 | |
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // DEVICE DEFINITIONS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | const device_type A2052 = &device_creator<a2052_device>; | |
| 27 | ||
| 28 | //------------------------------------------------- | |
| 29 | // input_ports - device-specific input ports | |
| 30 | //------------------------------------------------- | |
| 31 | ||
| 32 | static INPUT_PORTS_START( a2052 ) | |
| 33 | PORT_START("config") | |
| 34 | PORT_CONFNAME(0x03, 0x02, "A2052 Installed RAM") | |
| 35 | PORT_CONFSETTING(0x00, "512 KB") | |
| 36 | PORT_CONFSETTING(0x01, "1 MB") | |
| 37 | PORT_CONFSETTING(0x02, "2 MB") | |
| 38 | INPUT_PORTS_END | |
| 39 | ||
| 40 | ioport_constructor a2052_device::device_input_ports() const | |
| 41 | { | |
| 42 | return INPUT_PORTS_NAME( a2052 ); | |
| 43 | } | |
| 44 | ||
| 45 | ||
| 46 | //************************************************************************** | |
| 47 | // LIVE DEVICE | |
| 48 | //************************************************************************** | |
| 49 | ||
| 50 | //------------------------------------------------- | |
| 51 | // a2052_device - constructor | |
| 52 | //------------------------------------------------- | |
| 53 | ||
| 54 | a2052_device::a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 55 | device_t(mconfig, A2052, "CBM A2052 Fast Memory", tag, owner, clock, "a2052", __FILE__), | |
| 56 | device_zorro2_card_interface(mconfig, *this), | |
| 57 | m_config(*this, "config") | |
| 58 | { | |
| 59 | } | |
| 60 | ||
| 61 | //------------------------------------------------- | |
| 62 | // device_start - device-specific startup | |
| 63 | //------------------------------------------------- | |
| 64 | ||
| 65 | void a2052_device::device_start() | |
| 66 | { | |
| 67 | set_zorro_device(); | |
| 68 | } | |
| 69 | ||
| 70 | ||
| 71 | //************************************************************************** | |
| 72 | // IMPLEMENTATION | |
| 73 | //************************************************************************** | |
| 74 | ||
| 75 | void a2052_device::autoconfig_base_address(offs_t address) | |
| 76 | { | |
| 77 | if (VERBOSE) | |
| 78 | logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address); | |
| 79 | ||
| 80 | if (VERBOSE) | |
| 81 | logerror("-> installing a2052\n"); | |
| 82 | ||
| 83 | // stop responding to default autoconfig | |
| 84 | m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f); | |
| 85 | ||
| 86 | // install access to the rom space | |
| 87 | m_slot->m_space->install_ram(address, address + m_ram.bytes() - 1, m_ram); | |
| 88 | ||
| 89 | // we're done | |
| 90 | m_slot->cfgout_w(0); | |
| 91 | } | |
| 92 | ||
| 93 | WRITE_LINE_MEMBER( a2052_device::cfgin_w ) | |
| 94 | { | |
| 95 | if (VERBOSE) | |
| 96 | logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state); | |
| 97 | ||
| 98 | if (state == 0) | |
| 99 | { | |
| 100 | // setup autoconfig | |
| 101 | autoconfig_board_type(BOARD_TYPE_ZORRO2); | |
| 102 | ||
| 103 | // setup ram | |
| 104 | switch (m_config->read()) | |
| 105 | { | |
| 106 | case 0: | |
| 107 | autoconfig_board_size(BOARD_SIZE_512K); | |
| 108 | m_ram.resize(0x080000/2); | |
| 109 | break; | |
| 110 | case 1: | |
| 111 | autoconfig_board_size(BOARD_SIZE_1M); | |
| 112 | m_ram.resize(0x100000/2); | |
| 113 | break; | |
| 114 | case 2: | |
| 115 | autoconfig_board_size(BOARD_SIZE_2M); | |
| 116 | m_ram.resize(0x200000/2); | |
| 117 | break; | |
| 118 | } | |
| 119 | ||
| 120 | autoconfig_product(0x0a); | |
| 121 | autoconfig_manufacturer(0x0202); | |
| 122 | autoconfig_serial(0x00000000); | |
| 123 | ||
| 124 | autoconfig_link_into_memory(true); | |
| 125 | autoconfig_rom_vector_valid(false); | |
| 126 | autoconfig_multi_device(false); | |
| 127 | autoconfig_8meg_preferred(false); | |
| 128 | autoconfig_can_shutup(true); // ? | |
| 129 | ||
| 130 | // install autoconfig handler | |
| 131 | m_slot->m_space->install_readwrite_handler(0xe80000, 0xe8007f, | |
| 132 | read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast<amiga_autoconfig *>(this)), | |
| 133 | write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast<amiga_autoconfig *>(this)), 0xffff); | |
| 134 | } | |
| 135 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Commodore A2232 | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Zorro-II Serial Card | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "a2232.h" | |
| 13 | ||
| 14 | ||
| 15 | //************************************************************************** | |
| 16 | // CONSTANTS / MACROS | |
| 17 | //************************************************************************** | |
| 18 | ||
| 19 | #define VERBOSE 0 | |
| 20 | #define VERBOSE_DATA 0 | |
| 21 | ||
| 22 | ||
| 23 | //************************************************************************** | |
| 24 | // DEVICE DEFINITIONS | |
| 25 | //************************************************************************** | |
| 26 | ||
| 27 | const device_type A2232 = &device_creator<a2232_device>; | |
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // machine_config_additions - device-specific | |
| 31 | // machine configurations | |
| 32 | //------------------------------------------------- | |
| 33 | ||
| 34 | static ADDRESS_MAP_START( iocpu_map, AS_PROGRAM, 8, a2232_device) | |
| 35 | AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE("shared") | |
| 36 | AM_RANGE(0x4000, 0x47ff) AM_READWRITE(acia_0_r, acia_0_w) | |
| 37 | AM_RANGE(0x4800, 0x4fff) AM_READWRITE(acia_1_r, acia_1_w) | |
| 38 | AM_RANGE(0x5000, 0x57ff) AM_READWRITE(acia_2_r, acia_2_w) | |
| 39 | AM_RANGE(0x5800, 0x5fff) AM_READWRITE(acia_3_r, acia_3_w) | |
| 40 | AM_RANGE(0x6000, 0x67ff) AM_READWRITE(acia_4_r, acia_4_w) | |
| 41 | AM_RANGE(0x6800, 0x6fff) AM_READWRITE(acia_5_r, acia_5_w) | |
| 42 | AM_RANGE(0x7000, 0x73ff) AM_WRITE(int2_w) | |
| 43 | AM_RANGE(0x7400, 0x77ff) AM_READWRITE(acia_6_r, acia_6_w) | |
| 44 | AM_RANGE(0x7800, 0x7fff) AM_READWRITE(cia_r, cia_w) | |
| 45 | AM_RANGE(0x8000, 0x8000) AM_WRITE(irq_ack_w) | |
| 46 | AM_RANGE(0xc000, 0xffff) AM_RAM AM_SHARE("shared") | |
| 47 | ADDRESS_MAP_END | |
| 48 | ||
| 49 | static MACHINE_CONFIG_FRAGMENT( a2232 ) | |
| 50 | // main cpu | |
| 51 | MCFG_CPU_ADD("iocpu", M65CE02, XTAL_28_37516MHz / 8) // should run at Amiga clock 7M / 2 | |
| 52 | MCFG_CPU_PROGRAM_MAP(iocpu_map) | |
| 53 | ||
| 54 | // acia | |
| 55 | MCFG_DEVICE_ADD("acia_0", MOS6551, XTAL_28_37516MHz / 8) | |
| 56 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 57 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_1", rs232_port_device, write_txd)) | |
| 58 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_0_irq_w)) | |
| 59 | ||
| 60 | MCFG_DEVICE_ADD("acia_1", MOS6551, XTAL_28_37516MHz / 8) | |
| 61 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 62 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_2", rs232_port_device, write_txd)) | |
| 63 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_1_irq_w)) | |
| 64 | ||
| 65 | MCFG_DEVICE_ADD("acia_2", MOS6551, XTAL_28_37516MHz / 8) | |
| 66 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 67 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_3", rs232_port_device, write_txd)) | |
| 68 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_2_irq_w)) | |
| 69 | ||
| 70 | MCFG_DEVICE_ADD("acia_3", MOS6551, XTAL_28_37516MHz / 8) | |
| 71 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 72 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_4", rs232_port_device, write_txd)) | |
| 73 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_3_irq_w)) | |
| 74 | ||
| 75 | MCFG_DEVICE_ADD("acia_4", MOS6551, XTAL_28_37516MHz / 8) | |
| 76 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 77 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_5", rs232_port_device, write_txd)) | |
| 78 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_4_irq_w)) | |
| 79 | ||
| 80 | MCFG_DEVICE_ADD("acia_5", MOS6551, XTAL_28_37516MHz / 8) | |
| 81 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 82 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_6", rs232_port_device, write_txd)) | |
| 83 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_5_irq_w)) | |
| 84 | ||
| 85 | MCFG_DEVICE_ADD("acia_6", MOS6551, XTAL_28_37516MHz / 8) | |
| 86 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 87 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("rs232_7", rs232_port_device, write_txd)) | |
| 88 | MCFG_MOS6551_IRQ_HANDLER(WRITELINE(a2232_device, acia_6_irq_w)) | |
| 89 | ||
| 90 | // cia | |
| 91 | MCFG_DEVICE_ADD("cia", MOS8520, XTAL_1_8432MHz) | |
| 92 | MCFG_MOS6526_IRQ_CALLBACK(WRITELINE(a2232_device, cia_irq_w)) | |
| 93 | MCFG_MOS6526_PA_INPUT_CALLBACK(READ8(a2232_device, cia_port_a_r)) | |
| 94 | MCFG_MOS6526_PB_INPUT_CALLBACK(READ8(a2232_device, cia_port_b_r)) | |
| 95 | MCFG_MOS6526_PB_OUTPUT_CALLBACK(WRITE8(a2232_device, cia_port_b_w)) | |
| 96 | ||
| 97 | // rs232 ports | |
| 98 | MCFG_RS232_PORT_ADD("rs232_1", default_rs232_devices, NULL) | |
| 99 | MCFG_RS232_RXD_HANDLER(WRITELINE(a2232_device, rs232_1_rxd_w)) | |
| 100 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_1_dcd_w)) | |
| 101 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_0", mos6551_device, write_dsr)) | |
| 102 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_1_cts_w)) | |
| 103 | ||
| 104 | MCFG_RS232_PORT_ADD("rs232_2", default_rs232_devices, NULL) | |
| 105 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia_1", mos6551_device, write_rxd)) | |
| 106 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_2_dcd_w)) | |
| 107 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_1", mos6551_device, write_dsr)) | |
| 108 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_2_cts_w)) | |
| 109 | ||
| 110 | MCFG_RS232_PORT_ADD("rs232_3", default_rs232_devices, NULL) | |
| 111 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia_2", mos6551_device, write_rxd)) | |
| 112 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_3_dcd_w)) | |
| 113 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_2", mos6551_device, write_dsr)) | |
| 114 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_3_cts_w)) | |
| 115 | ||
| 116 | MCFG_RS232_PORT_ADD("rs232_4", default_rs232_devices, NULL) | |
| 117 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia_3", mos6551_device, write_rxd)) | |
| 118 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_4_dcd_w)) | |
| 119 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_3", mos6551_device, write_dsr)) | |
| 120 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_4_cts_w)) | |
| 121 | ||
| 122 | MCFG_RS232_PORT_ADD("rs232_5", default_rs232_devices, NULL) | |
| 123 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia_4", mos6551_device, write_rxd)) | |
| 124 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_5_dcd_w)) | |
| 125 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_4", mos6551_device, write_dsr)) | |
| 126 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_5_cts_w)) | |
| 127 | ||
| 128 | MCFG_RS232_PORT_ADD("rs232_6", default_rs232_devices, NULL) | |
| 129 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia_5", mos6551_device, write_rxd)) | |
| 130 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_6_dcd_w)) | |
| 131 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_5", mos6551_device, write_dsr)) | |
| 132 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_6_cts_w)) | |
| 133 | ||
| 134 | MCFG_RS232_PORT_ADD("rs232_7", default_rs232_devices, NULL) | |
| 135 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia_6", mos6551_device, write_rxd)) | |
| 136 | MCFG_RS232_DCD_HANDLER(WRITELINE(a2232_device, rs232_7_dcd_w)) | |
| 137 | MCFG_RS232_DSR_HANDLER(DEVWRITELINE("acia_6", mos6551_device, write_dsr)) | |
| 138 | MCFG_RS232_CTS_HANDLER(WRITELINE(a2232_device, rs232_7_cts_w)) | |
| 139 | MACHINE_CONFIG_END | |
| 140 | ||
| 141 | machine_config_constructor a2232_device::device_mconfig_additions() const | |
| 142 | { | |
| 143 | return MACHINE_CONFIG_NAME( a2232 ); | |
| 144 | } | |
| 145 | ||
| 146 | ||
| 147 | //************************************************************************** | |
| 148 | // LIVE DEVICE | |
| 149 | //************************************************************************** | |
| 150 | ||
| 151 | //------------------------------------------------- | |
| 152 | // a2232_device - constructor | |
| 153 | //------------------------------------------------- | |
| 154 | ||
| 155 | a2232_device::a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 156 | device_t(mconfig, A2232, "CBM A2232 Serial Card", tag, owner, clock, "a2232", __FILE__), | |
| 157 | device_zorro2_card_interface(mconfig, *this), | |
| 158 | m_iocpu(*this, "iocpu"), | |
| 159 | m_acia_0(*this, "acia_0"), | |
| 160 | m_acia_1(*this, "acia_1"), | |
| 161 | m_acia_2(*this, "acia_2"), | |
| 162 | m_acia_3(*this, "acia_3"), | |
| 163 | m_acia_4(*this, "acia_4"), | |
| 164 | m_acia_5(*this, "acia_5"), | |
| 165 | m_acia_6(*this, "acia_6"), | |
| 166 | m_cia(*this, "cia"), | |
| 167 | m_shared_ram(*this, "shared"), | |
| 168 | m_cia_port_a(0xff), | |
| 169 | m_cia_port_b(0xff) | |
| 170 | { | |
| 171 | } | |
| 172 | ||
| 173 | //------------------------------------------------- | |
| 174 | // device_start - device-specific startup | |
| 175 | //------------------------------------------------- | |
| 176 | ||
| 177 | void a2232_device::device_start() | |
| 178 | { | |
| 179 | set_zorro_device(); | |
| 180 | memset(m_irqs, 0, sizeof(m_irqs)); | |
| 181 | } | |
| 182 | ||
| 183 | //------------------------------------------------- | |
| 184 | // device_reset_after_children - reset after child devices | |
| 185 | //------------------------------------------------- | |
| 186 | ||
| 187 | void a2232_device::device_reset_after_children() | |
| 188 | { | |
| 189 | // reset is kept high at reset, to allow the amiga time to upload its code | |
| 190 | m_iocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 191 | ||
| 192 | // cts connected to gnd | |
| 193 | m_acia_0->write_cts(0); | |
| 194 | m_acia_1->write_cts(0); | |
| 195 | m_acia_2->write_cts(0); | |
| 196 | m_acia_3->write_cts(0); | |
| 197 | m_acia_4->write_cts(0); | |
| 198 | m_acia_5->write_cts(0); | |
| 199 | m_acia_6->write_cts(0); | |
| 200 | } | |
| 201 | ||
| 202 | ||
| 203 | //************************************************************************** | |
| 204 | // IMPLEMENTATION | |
| 205 | //************************************************************************** | |
| 206 | ||
| 207 | void a2232_device::update_irqs() | |
| 208 | { | |
| 209 | // look for any active irq | |
| 210 | for (int i = 0; i < IRQ_SOURCE_COUNT; i++) | |
| 211 | { | |
| 212 | if (m_irqs[i]) | |
| 213 | { | |
| 214 | m_iocpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); | |
| 215 | return; | |
| 216 | } | |
| 217 | } | |
| 218 | ||
| 219 | // if we get here no irqs are pending | |
| 220 | m_iocpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE); | |
| 221 | } | |
| 222 | ||
| 223 | WRITE8_MEMBER( a2232_device::int2_w ) | |
| 224 | { | |
| 225 | if (VERBOSE) | |
| 226 | logerror("%s('%s'): int2_w %04x\n", shortname(), basetag(), data); | |
| 227 | ||
| 228 | m_slot->int2_w(1); | |
| 229 | } | |
| 230 | ||
| 231 | WRITE8_MEMBER( a2232_device::irq_ack_w ) | |
| 232 | { | |
| 233 | if (VERBOSE) | |
| 234 | logerror("%s('%s'): irq_ack_w %04x\n", shortname(), basetag(), data); | |
| 235 | ||
| 236 | m_irqs[IRQ_AMIGA] = CLEAR_LINE; | |
| 237 | update_irqs(); | |
| 238 | } | |
| 239 | ||
| 240 | ||
| 241 | //************************************************************************** | |
| 242 | // AUTOCONFIG | |
| 243 | //************************************************************************** | |
| 244 | ||
| 245 | void a2232_device::autoconfig_base_address(offs_t address) | |
| 246 | { | |
| 247 | if (VERBOSE) | |
| 248 | logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address); | |
| 249 | ||
| 250 | if (VERBOSE) | |
| 251 | logerror("-> installing a2232\n"); | |
| 252 | ||
| 253 | // stop responding to default autoconfig | |
| 254 | m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f); | |
| 255 | ||
| 256 | m_slot->m_space->install_readwrite_handler(address, address + 0x3fff, | |
| 257 | read16_delegate(FUNC(a2232_device::shared_ram_r), this), | |
| 258 | write16_delegate(FUNC(a2232_device::shared_ram_w), this), 0xffff); | |
| 259 | ||
| 260 | m_slot->m_space->install_readwrite_handler(address + 0x4000, address + 0x4001, | |
| 261 | read16_delegate(FUNC(a2232_device::irq_ack_r), this), | |
| 262 | write16_delegate(FUNC(a2232_device::irq_ack_w), this), 0xffff); | |
| 263 | ||
| 264 | m_slot->m_space->install_readwrite_handler(address + 0x8000, address + 0x8001, | |
| 265 | read16_delegate(FUNC(a2232_device::reset_low_r), this), | |
| 266 | write16_delegate(FUNC(a2232_device::reset_low_w), this), 0xffff); | |
| 267 | ||
| 268 | m_slot->m_space->install_readwrite_handler(address + 0xa000, address + 0xa001, | |
| 269 | read16_delegate(FUNC(a2232_device::irq_r), this), | |
| 270 | write16_delegate(FUNC(a2232_device::irq_w), this), 0xffff); | |
| 271 | ||
| 272 | m_slot->m_space->install_readwrite_handler(address + 0xc000, address + 0xc001, | |
| 273 | read16_delegate(FUNC(a2232_device::reset_high_r), this), | |
| 274 | write16_delegate(FUNC(a2232_device::reset_high_w), this), 0xffff); | |
| 275 | ||
| 276 | // we're done | |
| 277 | m_slot->cfgout_w(0); | |
| 278 | } | |
| 279 | ||
| 280 | WRITE_LINE_MEMBER( a2232_device::cfgin_w ) | |
| 281 | { | |
| 282 | if (VERBOSE) | |
| 283 | logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state); | |
| 284 | ||
| 285 | if (state == 0) | |
| 286 | { | |
| 287 | // setup autoconfig | |
| 288 | autoconfig_board_type(BOARD_TYPE_ZORRO2); | |
| 289 | autoconfig_board_size(BOARD_SIZE_64K); | |
| 290 | ||
| 291 | autoconfig_product(0x46); | |
| 292 | autoconfig_manufacturer(0x0202); | |
| 293 | autoconfig_serial(0x00000000); | |
| 294 | ||
| 295 | autoconfig_link_into_memory(false); | |
| 296 | autoconfig_rom_vector_valid(false); | |
| 297 | autoconfig_multi_device(false); | |
| 298 | autoconfig_8meg_preferred(false); | |
| 299 | autoconfig_can_shutup(true); // ? | |
| 300 | ||
| 301 | // install autoconfig handler | |
| 302 | m_slot->m_space->install_readwrite_handler(0xe80000, 0xe8007f, | |
| 303 | read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast<amiga_autoconfig *>(this)), | |
| 304 | write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast<amiga_autoconfig *>(this)), 0xffff); | |
| 305 | } | |
| 306 | } | |
| 307 | ||
| 308 | ||
| 309 | //************************************************************************** | |
| 310 | // ZORRO | |
| 311 | //************************************************************************** | |
| 312 | ||
| 313 | READ16_MEMBER( a2232_device::shared_ram_r ) | |
| 314 | { | |
| 315 | UINT16 data = 0; | |
| 316 | ||
| 317 | if (ACCESSING_BITS_0_7) | |
| 318 | data |= m_shared_ram[(offset << 1) + 1]; | |
| 319 | else | |
| 320 | data |= 0x00ff; | |
| 321 | ||
| 322 | if (ACCESSING_BITS_8_15) | |
| 323 | data |= m_shared_ram[offset << 1] << 8; | |
| 324 | else | |
| 325 | data |= 0xff00; | |
| 326 | ||
| 327 | if (VERBOSE_DATA) | |
| 328 | logerror("%s('%s'): shared_ram_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset << 1, data, mem_mask); | |
| 329 | ||
| 330 | return data; | |
| 331 | } | |
| 332 | ||
| 333 | WRITE16_MEMBER( a2232_device::shared_ram_w ) | |
| 334 | { | |
| 335 | if (VERBOSE_DATA) | |
| 336 | logerror("%s('%s'): shared_ram_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset << 1, data, mem_mask); | |
| 337 | ||
| 338 | if (ACCESSING_BITS_0_7) | |
| 339 | m_shared_ram[(offset << 1) + 1] = data & 0xff; | |
| 340 | ||
| 341 | if (ACCESSING_BITS_8_15) | |
| 342 | m_shared_ram[offset << 1] = (data & 0xff00) >> 8; | |
| 343 | } | |
| 344 | ||
| 345 | READ16_MEMBER( a2232_device::irq_ack_r ) | |
| 346 | { | |
| 347 | m_slot->int2_w(0); | |
| 348 | ||
| 349 | return 0xffff; | |
| 350 | } | |
| 351 | ||
| 352 | WRITE16_MEMBER( a2232_device::irq_ack_w ) | |
| 353 | { | |
| 354 | m_slot->int2_w(0); | |
| 355 | } | |
| 356 | ||
| 357 | READ16_MEMBER( a2232_device::reset_low_r ) | |
| 358 | { | |
| 359 | m_iocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 360 | ||
| 361 | return 0xffff; | |
| 362 | } | |
| 363 | ||
| 364 | WRITE16_MEMBER( a2232_device::reset_low_w ) | |
| 365 | { | |
| 366 | m_iocpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); | |
| 367 | } | |
| 368 | ||
| 369 | READ16_MEMBER( a2232_device::irq_r ) | |
| 370 | { | |
| 371 | m_irqs[IRQ_AMIGA] = ASSERT_LINE; | |
| 372 | update_irqs(); | |
| 373 | ||
| 374 | return 0xffff; | |
| 375 | } | |
| 376 | ||
| 377 | WRITE16_MEMBER( a2232_device::irq_w ) | |
| 378 | { | |
| 379 | m_irqs[IRQ_AMIGA] = ASSERT_LINE; | |
| 380 | update_irqs(); | |
| 381 | } | |
| 382 | ||
| 383 | READ16_MEMBER( a2232_device::reset_high_r ) | |
| 384 | { | |
| 385 | UINT16 data = 0xffff; | |
| 386 | ||
| 387 | if (VERBOSE) | |
| 388 | logerror("%s('%s'): reset_high_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 389 | ||
| 390 | m_iocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 391 | ||
| 392 | return data; | |
| 393 | } | |
| 394 | ||
| 395 | WRITE16_MEMBER( a2232_device::reset_high_w ) | |
| 396 | { | |
| 397 | if (VERBOSE) | |
| 398 | logerror("%s('%s'): reset_high_w %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 399 | ||
| 400 | m_iocpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); | |
| 401 | } | |
| 402 | ||
| 403 | ||
| 404 | //************************************************************************** | |
| 405 | // ACIA | |
| 406 | //************************************************************************** | |
| 407 | ||
| 408 | READ8_MEMBER( a2232_device::acia_0_r ) | |
| 409 | { | |
| 410 | return m_acia_0->read(space, offset >> 1); | |
| 411 | } | |
| 412 | ||
| 413 | WRITE8_MEMBER( a2232_device::acia_0_w ) | |
| 414 | { | |
| 415 | m_acia_0->write(space, offset >> 1, data); | |
| 416 | } | |
| 417 | ||
| 418 | WRITE_LINE_MEMBER( a2232_device::acia_0_irq_w ) | |
| 419 | { | |
| 420 | m_irqs[IRQ_ACIA_0] = state; | |
| 421 | update_irqs(); | |
| 422 | } | |
| 423 | ||
| 424 | READ8_MEMBER( a2232_device::acia_1_r ) | |
| 425 | { | |
| 426 | return m_acia_1->read(space, offset >> 1); | |
| 427 | } | |
| 428 | ||
| 429 | WRITE8_MEMBER( a2232_device::acia_1_w ) | |
| 430 | { | |
| 431 | m_acia_1->write(space, offset >> 1, data); | |
| 432 | } | |
| 433 | ||
| 434 | WRITE_LINE_MEMBER( a2232_device::acia_1_irq_w ) | |
| 435 | { | |
| 436 | m_irqs[IRQ_ACIA_1] = state; | |
| 437 | update_irqs(); | |
| 438 | } | |
| 439 | ||
| 440 | READ8_MEMBER( a2232_device::acia_2_r ) | |
| 441 | { | |
| 442 | return m_acia_2->read(space, offset >> 1); | |
| 443 | } | |
| 444 | ||
| 445 | WRITE8_MEMBER( a2232_device::acia_2_w ) | |
| 446 | { | |
| 447 | m_acia_2->write(space, offset >> 1, data); | |
| 448 | } | |
| 449 | ||
| 450 | WRITE_LINE_MEMBER( a2232_device::acia_2_irq_w ) | |
| 451 | { | |
| 452 | m_irqs[IRQ_ACIA_2] = state; | |
| 453 | update_irqs(); | |
| 454 | } | |
| 455 | ||
| 456 | READ8_MEMBER( a2232_device::acia_3_r ) | |
| 457 | { | |
| 458 | return m_acia_3->read(space, offset >> 1); | |
| 459 | } | |
| 460 | ||
| 461 | WRITE8_MEMBER( a2232_device::acia_3_w ) | |
| 462 | { | |
| 463 | m_acia_3->write(space, offset >> 1, data); | |
| 464 | } | |
| 465 | ||
| 466 | WRITE_LINE_MEMBER( a2232_device::acia_3_irq_w ) | |
| 467 | { | |
| 468 | m_irqs[IRQ_ACIA_3] = state; | |
| 469 | update_irqs(); | |
| 470 | } | |
| 471 | ||
| 472 | READ8_MEMBER( a2232_device::acia_4_r ) | |
| 473 | { | |
| 474 | return m_acia_4->read(space, offset >> 1); | |
| 475 | } | |
| 476 | ||
| 477 | WRITE8_MEMBER( a2232_device::acia_4_w ) | |
| 478 | { | |
| 479 | m_acia_4->write(space, offset >> 1, data); | |
| 480 | } | |
| 481 | ||
| 482 | WRITE_LINE_MEMBER( a2232_device::acia_4_irq_w ) | |
| 483 | { | |
| 484 | m_irqs[IRQ_ACIA_4] = state; | |
| 485 | update_irqs(); | |
| 486 | } | |
| 487 | ||
| 488 | READ8_MEMBER( a2232_device::acia_5_r ) | |
| 489 | { | |
| 490 | return m_acia_5->read(space, offset >> 1); | |
| 491 | } | |
| 492 | ||
| 493 | WRITE8_MEMBER( a2232_device::acia_5_w ) | |
| 494 | { | |
| 495 | m_acia_5->write(space, offset >> 1, data); | |
| 496 | } | |
| 497 | ||
| 498 | WRITE_LINE_MEMBER( a2232_device::acia_5_irq_w ) | |
| 499 | { | |
| 500 | m_irqs[IRQ_ACIA_5] = state; | |
| 501 | update_irqs(); | |
| 502 | } | |
| 503 | ||
| 504 | READ8_MEMBER( a2232_device::acia_6_r ) | |
| 505 | { | |
| 506 | return m_acia_6->read(space, offset >> 1); | |
| 507 | } | |
| 508 | ||
| 509 | WRITE8_MEMBER( a2232_device::acia_6_w ) | |
| 510 | { | |
| 511 | m_acia_6->write(space, offset >> 1, data); | |
| 512 | } | |
| 513 | ||
| 514 | WRITE_LINE_MEMBER( a2232_device::acia_6_irq_w ) | |
| 515 | { | |
| 516 | m_irqs[IRQ_ACIA_6] = state; | |
| 517 | update_irqs(); | |
| 518 | } | |
| 519 | ||
| 520 | ||
| 521 | //************************************************************************** | |
| 522 | // CIA | |
| 523 | //************************************************************************** | |
| 524 | ||
| 525 | READ8_MEMBER( a2232_device::cia_r ) | |
| 526 | { | |
| 527 | return m_cia->read(space, offset >> 1); | |
| 528 | } | |
| 529 | ||
| 530 | WRITE8_MEMBER( a2232_device::cia_w ) | |
| 531 | { | |
| 532 | m_cia->write(space, offset >> 1, data); | |
| 533 | } | |
| 534 | ||
| 535 | WRITE_LINE_MEMBER( a2232_device::cia_irq_w ) | |
| 536 | { | |
| 537 | m_irqs[IRQ_CIA] = state; | |
| 538 | update_irqs(); | |
| 539 | } | |
| 540 | ||
| 541 | READ8_MEMBER( a2232_device::cia_port_a_r ) | |
| 542 | { | |
| 543 | return m_cia_port_a; | |
| 544 | } | |
| 545 | ||
| 546 | READ8_MEMBER( a2232_device::cia_port_b_r ) | |
| 547 | { | |
| 548 | return m_cia_port_b; | |
| 549 | } | |
| 550 | ||
| 551 | WRITE8_MEMBER( a2232_device::cia_port_b_w ) | |
| 552 | { | |
| 553 | // tod clock connected to pb7 | |
| 554 | m_cia->tod_w(BIT(data, 7)); | |
| 555 | } | |
| 556 | ||
| 557 | ||
| 558 | //************************************************************************** | |
| 559 | // RS232 | |
| 560 | //************************************************************************** | |
| 561 | ||
| 562 | WRITE_LINE_MEMBER( a2232_device::rs232_1_rxd_w ) | |
| 563 | { | |
| 564 | m_acia_0->write_rxd(state); | |
| 565 | m_cia->sp_w(state); | |
| 566 | } | |
| 567 | ||
| 568 | WRITE_LINE_MEMBER( a2232_device::rs232_1_dcd_w ) | |
| 569 | { | |
| 570 | m_cia_port_a &= ~0x01; | |
| 571 | m_cia_port_a |= state << 0; | |
| 572 | } | |
| 573 | ||
| 574 | WRITE_LINE_MEMBER( a2232_device::rs232_1_cts_w ) | |
| 575 | { | |
| 576 | m_cia_port_b &= ~0x01; | |
| 577 | m_cia_port_b |= state << 0; | |
| 578 | ||
| 579 | m_cia->cnt_w(state); | |
| 580 | } | |
| 581 | ||
| 582 | WRITE_LINE_MEMBER( a2232_device::rs232_2_dcd_w ) | |
| 583 | { | |
| 584 | m_cia_port_a &= ~0x02; | |
| 585 | m_cia_port_a |= state << 1; | |
| 586 | } | |
| 587 | ||
| 588 | WRITE_LINE_MEMBER( a2232_device::rs232_2_cts_w ) | |
| 589 | { | |
| 590 | m_cia_port_b &= ~0x02; | |
| 591 | m_cia_port_b |= state << 1; | |
| 592 | } | |
| 593 | ||
| 594 | WRITE_LINE_MEMBER( a2232_device::rs232_3_dcd_w ) | |
| 595 | { | |
| 596 | m_cia_port_a &= ~0x04; | |
| 597 | m_cia_port_a |= state << 2; | |
| 598 | } | |
| 599 | ||
| 600 | WRITE_LINE_MEMBER( a2232_device::rs232_3_cts_w ) | |
| 601 | { | |
| 602 | m_cia_port_b &= ~0x04; | |
| 603 | m_cia_port_b |= state << 2; | |
| 604 | } | |
| 605 | ||
| 606 | WRITE_LINE_MEMBER( a2232_device::rs232_4_dcd_w ) | |
| 607 | { | |
| 608 | m_cia_port_a &= ~0x08; | |
| 609 | m_cia_port_a |= state << 3; | |
| 610 | } | |
| 611 | ||
| 612 | WRITE_LINE_MEMBER( a2232_device::rs232_4_cts_w ) | |
| 613 | { | |
| 614 | m_cia_port_b &= ~0x08; | |
| 615 | m_cia_port_b |= state << 3; | |
| 616 | } | |
| 617 | ||
| 618 | WRITE_LINE_MEMBER( a2232_device::rs232_5_dcd_w ) | |
| 619 | { | |
| 620 | m_cia_port_a &= ~0x10; | |
| 621 | m_cia_port_a |= state << 4; | |
| 622 | } | |
| 623 | ||
| 624 | WRITE_LINE_MEMBER( a2232_device::rs232_5_cts_w ) | |
| 625 | { | |
| 626 | m_cia_port_b &= ~0x10; | |
| 627 | m_cia_port_b |= state << 4; | |
| 628 | } | |
| 629 | ||
| 630 | WRITE_LINE_MEMBER( a2232_device::rs232_6_dcd_w ) | |
| 631 | { | |
| 632 | m_cia_port_a &= ~0x20; | |
| 633 | m_cia_port_a |= state << 5; | |
| 634 | } | |
| 635 | ||
| 636 | WRITE_LINE_MEMBER( a2232_device::rs232_6_cts_w ) | |
| 637 | { | |
| 638 | m_cia_port_b &= ~0x20; | |
| 639 | m_cia_port_b |= state << 5; | |
| 640 | } | |
| 641 | ||
| 642 | WRITE_LINE_MEMBER( a2232_device::rs232_7_dcd_w ) | |
| 643 | { | |
| 644 | m_cia_port_a &= ~0x40; | |
| 645 | m_cia_port_a |= state << 6; | |
| 646 | } | |
| 647 | ||
| 648 | WRITE_LINE_MEMBER( a2232_device::rs232_7_cts_w ) | |
| 649 | { | |
| 650 | m_cia_port_b &= ~0x40; | |
| 651 | m_cia_port_b |= state << 6; | |
| 652 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Datel Action Replay | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Freezer cartridge for Amiga 500 and Amiga 2000 | |
| 9 | ||
| 10 | Skeleton device, just loads the ROMs and generates the NMI | |
| 11 | for now. | |
| 12 | ||
| 13 | Hardware notes: | |
| 14 | - http://www.mways.co.uk/amiga/howtocode/text/actionreplay.php | |
| 15 | ||
| 16 | ***************************************************************************/ | |
| 17 | ||
| 18 | #include "action_replay.h" | |
| 19 | ||
| 20 | ||
| 21 | //************************************************************************** | |
| 22 | // DEVICE DEFINITIONS | |
| 23 | //************************************************************************** | |
| 24 | ||
| 25 | const device_type ACTION_REPLAY_MK1 = &device_creator<action_replay_mk1_device>; | |
| 26 | const device_type ACTION_REPLAY_MK2 = &device_creator<action_replay_mk2_device>; | |
| 27 | const device_type ACTION_REPLAY_MK3 = &device_creator<action_replay_mk3_device>; | |
| 28 | ||
| 29 | //------------------------------------------------- | |
| 30 | // input_ports - device-specific input ports | |
| 31 | //------------------------------------------------- | |
| 32 | ||
| 33 | static INPUT_PORTS_START( ar_button ) | |
| 34 | PORT_START("freeze") | |
| 35 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Freeze") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, action_replay_device, freeze, 0) | |
| 36 | INPUT_PORTS_END | |
| 37 | ||
| 38 | ioport_constructor action_replay_device::device_input_ports() const | |
| 39 | { | |
| 40 | return INPUT_PORTS_NAME( ar_button ); | |
| 41 | } | |
| 42 | ||
| 43 | //------------------------------------------------- | |
| 44 | // rom_region - device-specific ROM region | |
| 45 | //------------------------------------------------- | |
| 46 | ||
| 47 | ROM_START( ar_mk1 ) | |
| 48 | ROM_REGION(0x10000, "firmware", 0) | |
| 49 | ROM_DEFAULT_BIOS("v150") | |
| 50 | ROM_SYSTEM_BIOS(0, "v100", "Version 1.00") | |
| 51 | ROMX_LOAD("ar1_v100.bin", 0x0000, 0x10000, BAD_DUMP CRC(2d921771) SHA1(1ead9dda2dad29146441f5ef7218375022e01248), ROM_BIOS(1)) | |
| 52 | ROM_SYSTEM_BIOS(1, "v150", "Version 1.50") | |
| 53 | ROMX_LOAD("ar1_v150.bin", 0x0000, 0x10000, BAD_DUMP CRC(f82c4258) SHA1(843b433b2c56640e045d5fdc854dc6b1a4964e7c), ROM_BIOS(2)) | |
| 54 | ROM_END | |
| 55 | ||
| 56 | const rom_entry *action_replay_mk1_device::device_rom_region() const | |
| 57 | { | |
| 58 | return ROM_NAME( ar_mk1 ); | |
| 59 | } | |
| 60 | ||
| 61 | ROM_START( ar_mk2 ) | |
| 62 | ROM_REGION(0x20000, "firmware", 0) | |
| 63 | ROM_DEFAULT_BIOS("v214") | |
| 64 | ROM_SYSTEM_BIOS(0, "v205", "Version 2.05") | |
| 65 | ROMX_LOAD("ar2_v205.bin", 0x0000, 0x20000, BAD_DUMP CRC(4051eef8) SHA1(9df22b1d3285b522c223697c83d144d04e961a4a), ROM_BIOS(1)) | |
| 66 | ROM_SYSTEM_BIOS(1, "v212", "Version 2.12") | |
| 67 | ROMX_LOAD("ar2_v212.bin", 0x0000, 0x20000, BAD_DUMP CRC(d29bdd86) SHA1(76c2900457badf22b742f0af48b78937e8b67694), ROM_BIOS(2)) | |
| 68 | ROM_SYSTEM_BIOS(2, "v214", "Version 2.14") | |
| 69 | ROMX_LOAD("ar2_v214.bin", 0x0000, 0x20000, BAD_DUMP CRC(1bb3d0a8) SHA1(14b1f5a69efb6f4e2331970e6ca0f33c0f04ac91), ROM_BIOS(3)) | |
| 70 | ROM_END | |
| 71 | ||
| 72 | const rom_entry *action_replay_mk2_device::device_rom_region() const | |
| 73 | { | |
| 74 | return ROM_NAME( ar_mk2 ); | |
| 75 | } | |
| 76 | ||
| 77 | ROM_START( ar_mk3 ) | |
| 78 | ROM_REGION(0x40000, "firmware", 0) | |
| 79 | ROM_DEFAULT_BIOS("v309") | |
| 80 | ROM_SYSTEM_BIOS(0, "v309", "Version 3.09") | |
| 81 | ROMX_LOAD("ar3_v309.evn", 0x00000, 0x20000, CRC(2b84519f) SHA1(7841873bf009d8341dfa2794b3751bacf86adcc8), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 82 | ROMX_LOAD("ar3_v309.odd", 0x00001, 0x20000, CRC(1d35bd56) SHA1(6464be1626b519499e76e4e3409e8016515d48b6), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 83 | ROM_SYSTEM_BIOS(1, "v317", "Version 3.17") | |
| 84 | ROMX_LOAD("ar3_v314.bin", 0x0000, 0x40000, BAD_DUMP CRC(009f7768) SHA1(0439d6ccc2a0e5c2e83fcf2389dc4d4a440a4c62), ROM_BIOS(2)) | |
| 85 | ROM_END | |
| 86 | ||
| 87 | const rom_entry *action_replay_mk3_device::device_rom_region() const | |
| 88 | { | |
| 89 | return ROM_NAME( ar_mk3 ); | |
| 90 | } | |
| 91 | ||
| 92 | ||
| 93 | //************************************************************************** | |
| 94 | // LIVE DEVICE | |
| 95 | //************************************************************************** | |
| 96 | ||
| 97 | //------------------------------------------------- | |
| 98 | // action_replay_device - constructor | |
| 99 | //------------------------------------------------- | |
| 100 | ||
| 101 | action_replay_device::action_replay_device(const machine_config &mconfig, device_type type, const char *tag, | |
| 102 | device_t *owner, UINT32 clock, const char *name, const char *shortname) : | |
| 103 | device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), | |
| 104 | device_exp_card_interface(mconfig, *this), | |
| 105 | m_button(*this, "freeze") | |
| 106 | { | |
| 107 | } | |
| 108 | ||
| 109 | action_replay_mk1_device::action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 110 | action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock, "Datel Action Replay MK-I", "amiga_ar1") | |
| 111 | { | |
| 112 | } | |
| 113 | ||
| 114 | action_replay_mk2_device::action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 115 | action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock, "Datel Action Replay MK-II", "amiga_ar2") | |
| 116 | { | |
| 117 | } | |
| 118 | ||
| 119 | action_replay_mk3_device::action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 120 | action_replay_device(mconfig, ACTION_REPLAY_MK1, tag, owner, clock, "Datel Action Replay MK-III", "amiga_ar3") | |
| 121 | { | |
| 122 | } | |
| 123 | ||
| 124 | //------------------------------------------------- | |
| 125 | // device_start - device-specific startup | |
| 126 | //------------------------------------------------- | |
| 127 | ||
| 128 | void action_replay_device::device_start() | |
| 129 | { | |
| 130 | set_zorro_device(); | |
| 131 | } | |
| 132 | ||
| 133 | //------------------------------------------------- | |
| 134 | // device_reset - device-specific reset | |
| 135 | //------------------------------------------------- | |
| 136 | ||
| 137 | void action_replay_device::device_reset() | |
| 138 | { | |
| 139 | } | |
| 140 | ||
| 141 | ||
| 142 | //************************************************************************** | |
| 143 | // IMPLEMENTATION | |
| 144 | //************************************************************************** | |
| 145 | ||
| 146 | INPUT_CHANGED_MEMBER( action_replay_device::freeze ) | |
| 147 | { | |
| 148 | // pushing the freeze button generates an nmi | |
| 149 | m_slot->ipl_w(newval == 1 ? 7 : 0); | |
| 150 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Amiga Zorro Slots | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | 86-pin Expansion Slot (Zorro-I), Zorro-II, Zorro-III | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "zorro.h" | |
| 13 | ||
| 14 | ||
| 15 | //************************************************************************** | |
| 16 | // ZORRO SLOT DEVICE | |
| 17 | //************************************************************************** | |
| 18 | ||
| 19 | const device_type ZORRO_SLOT = &device_creator<zorro_slot_device>; | |
| 20 | ||
| 21 | //------------------------------------------------- | |
| 22 | // zorro_slot_device - constructor | |
| 23 | //------------------------------------------------- | |
| 24 | ||
| 25 | zorro_slot_device::zorro_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 26 | device_t(mconfig, ZORRO_SLOT, "Zorro slot", tag, owner, clock, "zorro_slot", __FILE__), | |
| 27 | device_slot_interface(mconfig, *this), | |
| 28 | m_zorro_tag(NULL) | |
| 29 | { | |
| 30 | } | |
| 31 | ||
| 32 | zorro_slot_device::zorro_slot_device(const machine_config &mconfig, device_type type, const char *name, | |
| 33 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 34 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 35 | device_slot_interface(mconfig, *this), | |
| 36 | m_zorro_tag(NULL) | |
| 37 | { | |
| 38 | } | |
| 39 | ||
| 40 | void zorro_slot_device::set_zorro_slot(device_t &device, device_t *owner, const char *zorro_tag) | |
| 41 | { | |
| 42 | zorro_slot_device &zorro_card = dynamic_cast<zorro_slot_device &>(device); | |
| 43 | zorro_card.m_owner = owner; | |
| 44 | zorro_card.m_zorro_tag = zorro_tag; | |
| 45 | } | |
| 46 | ||
| 47 | //------------------------------------------------- | |
| 48 | // device_start - device-specific startup | |
| 49 | //------------------------------------------------- | |
| 50 | ||
| 51 | void zorro_slot_device::device_start() | |
| 52 | { | |
| 53 | device_zorro_card_interface *dev = dynamic_cast<device_zorro_card_interface *>(get_card_device()); | |
| 54 | ||
| 55 | if (dev) | |
| 56 | { | |
| 57 | zorro_device *m_zorro_bus = downcast<zorro_device *>(m_owner->subdevice(m_zorro_tag)); | |
| 58 | m_zorro_bus->add_card(dev); | |
| 59 | } | |
| 60 | } | |
| 61 | ||
| 62 | ||
| 63 | //************************************************************************** | |
| 64 | // BASE ZORRO BUS DEVICE | |
| 65 | //************************************************************************** | |
| 66 | ||
| 67 | //------------------------------------------------- | |
| 68 | // exp_slot_device - constructor | |
| 69 | //------------------------------------------------- | |
| 70 | ||
| 71 | zorro_device::zorro_device(const machine_config &mconfig, device_type type, const char *name, | |
| 72 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 73 | device_t(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 74 | m_space(NULL), | |
| 75 | m_cputag(NULL), | |
| 76 | m_ovr_handler(*this), | |
| 77 | m_int2_handler(*this), | |
| 78 | m_int6_handler(*this) | |
| 79 | { | |
| 80 | } | |
| 81 | ||
| 82 | //------------------------------------------------- | |
| 83 | // set_cputag - set cpu we are attached to | |
| 84 | //------------------------------------------------- | |
| 85 | ||
| 86 | void zorro_device::set_cputag(device_t &device, const char *tag) | |
| 87 | { | |
| 88 | zorro_device &zorro = downcast<zorro_device &>(device); | |
| 89 | zorro.m_cputag = tag; | |
| 90 | } | |
| 91 | ||
| 92 | //------------------------------------------------- | |
| 93 | // device_start - device-specific startup | |
| 94 | //------------------------------------------------- | |
| 95 | ||
| 96 | void zorro_device::device_start() | |
| 97 | { | |
| 98 | // get address space | |
| 99 | device_t *cpu = machine().device(m_cputag); | |
| 100 | m_space = &cpu->memory().space(AS_PROGRAM); | |
| 101 | ||
| 102 | // resolve callbacks | |
| 103 | m_ovr_handler.resolve_safe(); | |
| 104 | m_int2_handler.resolve_safe(); | |
| 105 | m_int6_handler.resolve_safe(); | |
| 106 | } | |
| 107 | ||
| 108 | // from slot device | |
| 109 | WRITE_LINE_MEMBER( zorro_device::ovr_w ) { m_ovr_handler(state); } | |
| 110 | WRITE_LINE_MEMBER( zorro_device::int2_w ) { m_int2_handler(state); } | |
| 111 | WRITE_LINE_MEMBER( zorro_device::int6_w ) { m_int6_handler(state); } | |
| 112 | ||
| 113 | ||
| 114 | //************************************************************************** | |
| 115 | // EXPANSION SLOT DEVICE | |
| 116 | //************************************************************************** | |
| 117 | ||
| 118 | const device_type EXP_SLOT = &device_creator<exp_slot_device>; | |
| 119 | ||
| 120 | //------------------------------------------------- | |
| 121 | // exp_slot_device - constructor | |
| 122 | //------------------------------------------------- | |
| 123 | ||
| 124 | exp_slot_device::exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 125 | zorro_device(mconfig, EXP_SLOT, "86-pin expansion slot", tag, owner, clock, "exp_slot", __FILE__), | |
| 126 | m_ipl_handler(*this), | |
| 127 | m_dev(NULL) | |
| 128 | { | |
| 129 | } | |
| 130 | ||
| 131 | exp_slot_device::exp_slot_device(const machine_config &mconfig, device_type type, const char *name, | |
| 132 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 133 | zorro_device(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 134 | m_ipl_handler(*this), | |
| 135 | m_dev(NULL) | |
| 136 | { | |
| 137 | } | |
| 138 | ||
| 139 | //------------------------------------------------- | |
| 140 | // device_start - device-specific startup | |
| 141 | //------------------------------------------------- | |
| 142 | ||
| 143 | void exp_slot_device::device_start() | |
| 144 | { | |
| 145 | // resolve callbacks | |
| 146 | m_ipl_handler.resolve_safe(); | |
| 147 | ||
| 148 | // call base device start | |
| 149 | zorro_device::device_start(); | |
| 150 | } | |
| 151 | ||
| 152 | //------------------------------------------------- | |
| 153 | // add_card - add new card to our bus | |
| 154 | //------------------------------------------------- | |
| 155 | ||
| 156 | void exp_slot_device::add_card(device_zorro_card_interface *card) | |
| 157 | { | |
| 158 | m_dev = downcast<device_exp_card_interface *>(card); | |
| 159 | } | |
| 160 | ||
| 161 | // from slot device | |
| 162 | void exp_slot_device::ipl_w(int interrupt) { m_ipl_handler(0, interrupt, 0xff); } | |
| 163 | ||
| 164 | // from host | |
| 165 | void exp_slot_device::fc_w(int code) { if (m_dev) m_dev->fc_w(code); } | |
| 166 | ||
| 167 | ||
| 168 | //************************************************************************** | |
| 169 | // ZORRO2 DEVICE | |
| 170 | //************************************************************************** | |
| 171 | ||
| 172 | const device_type ZORRO2 = &device_creator<zorro2_device>; | |
| 173 | ||
| 174 | //------------------------------------------------- | |
| 175 | // zorro2_device - constructor | |
| 176 | //------------------------------------------------- | |
| 177 | ||
| 178 | zorro2_device::zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 179 | zorro_device(mconfig, ZORRO2, "Zorro-II bus", tag, owner, clock, "zorro2", __FILE__), | |
| 180 | m_eint1_handler(*this), | |
| 181 | m_eint4_handler(*this), | |
| 182 | m_eint5_handler(*this), | |
| 183 | m_eint7_handler(*this), | |
| 184 | m_autoconfig_device(NULL) | |
| 185 | { | |
| 186 | } | |
| 187 | ||
| 188 | zorro2_device::zorro2_device(const machine_config &mconfig, device_type type, const char *name, | |
| 189 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 190 | zorro_device(mconfig, type, name, tag, owner, clock, shortname, source), | |
| 191 | m_eint1_handler(*this), | |
| 192 | m_eint4_handler(*this), | |
| 193 | m_eint5_handler(*this), | |
| 194 | m_eint7_handler(*this), | |
| 195 | m_autoconfig_device(NULL) | |
| 196 | { | |
| 197 | } | |
| 198 | ||
| 199 | //------------------------------------------------- | |
| 200 | // zorro2_device - destructor | |
| 201 | //------------------------------------------------- | |
| 202 | ||
| 203 | zorro2_device::~zorro2_device() | |
| 204 | { | |
| 205 | m_dev.detach_all(); | |
| 206 | } | |
| 207 | ||
| 208 | //------------------------------------------------- | |
| 209 | // device_start - device-specific startup | |
| 210 | //------------------------------------------------- | |
| 211 | ||
| 212 | void zorro2_device::device_start() | |
| 213 | { | |
| 214 | // resolve callbacks | |
| 215 | m_eint1_handler.resolve_safe(); | |
| 216 | m_eint4_handler.resolve_safe(); | |
| 217 | m_eint5_handler.resolve_safe(); | |
| 218 | m_eint7_handler.resolve_safe(); | |
| 219 | ||
| 220 | // call base device start | |
| 221 | zorro_device::device_start(); | |
| 222 | } | |
| 223 | ||
| 224 | //------------------------------------------------- | |
| 225 | // device_reset - device-specific reset | |
| 226 | //------------------------------------------------- | |
| 227 | ||
| 228 | void zorro2_device::device_reset() | |
| 229 | { | |
| 230 | // initiate autoconfig | |
| 231 | m_autoconfig_device = m_dev.first(); | |
| 232 | ||
| 233 | // if we have a device, start the autoconfig chain | |
| 234 | if (m_autoconfig_device) | |
| 235 | m_autoconfig_device->cfgin_w(0); | |
| 236 | } | |
| 237 | ||
| 238 | //------------------------------------------------- | |
| 239 | // add_card - add new card to our bus | |
| 240 | //------------------------------------------------- | |
| 241 | ||
| 242 | void zorro2_device::add_card(device_zorro_card_interface *card) | |
| 243 | { | |
| 244 | device_zorro2_card_interface *zorro2_card = downcast<device_zorro2_card_interface *>(card); | |
| 245 | card->set_zorro_bus(this); | |
| 246 | m_dev.append(*zorro2_card); | |
| 247 | } | |
| 248 | ||
| 249 | // from slot device | |
| 250 | WRITE_LINE_MEMBER( zorro2_device::eint1_w ) { m_eint1_handler(state); } | |
| 251 | WRITE_LINE_MEMBER( zorro2_device::eint4_w ) { m_eint4_handler(state); } | |
| 252 | WRITE_LINE_MEMBER( zorro2_device::eint5_w ) { m_eint5_handler(state); } | |
| 253 | WRITE_LINE_MEMBER( zorro2_device::eint7_w ) { m_eint7_handler(state); } | |
| 254 | ||
| 255 | WRITE_LINE_MEMBER( zorro2_device::cfgout_w ) | |
| 256 | { | |
| 257 | m_autoconfig_device = m_autoconfig_device->next(); | |
| 258 | ||
| 259 | // if there is still a device in the chain, tell it to configure itself | |
| 260 | if (m_autoconfig_device) | |
| 261 | m_autoconfig_device->cfgin_w(0); | |
| 262 | } | |
| 263 | ||
| 264 | // from host | |
| 265 | void zorro2_device::fc_w(int code) | |
| 266 | { | |
| 267 | device_zorro2_card_interface *entry = m_dev.first(); | |
| 268 | ||
| 269 | while (entry) | |
| 270 | { | |
| 271 | entry->fc_w(code); | |
| 272 | entry = entry->next(); | |
| 273 | } | |
| 274 | } | |
| 275 | ||
| 276 | ||
| 277 | //************************************************************************** | |
| 278 | // ZORRO INTERFACE | |
| 279 | //************************************************************************** | |
| 280 | ||
| 281 | //------------------------------------------------- | |
| 282 | // device_zorro_card_interface - constructor | |
| 283 | //------------------------------------------------- | |
| 284 | ||
| 285 | device_zorro_card_interface::device_zorro_card_interface(const machine_config &mconfig, device_t &device) : | |
| 286 | device_slot_card_interface(mconfig, device), | |
| 287 | m_zorro(NULL) | |
| 288 | { | |
| 289 | } | |
| 290 | ||
| 291 | //------------------------------------------------- | |
| 292 | // ~device_zorro_card_interface - destructor | |
| 293 | //------------------------------------------------- | |
| 294 | ||
| 295 | device_zorro_card_interface::~device_zorro_card_interface() | |
| 296 | { | |
| 297 | } | |
| 298 | ||
| 299 | void device_zorro_card_interface::set_zorro_bus(zorro_device *device) | |
| 300 | { | |
| 301 | m_zorro = device; | |
| 302 | } | |
| 303 | ||
| 304 | void device_zorro_card_interface::fc_w(int code) | |
| 305 | { | |
| 306 | } | |
| 307 | ||
| 308 | WRITE_LINE_MEMBER( device_zorro_card_interface::cfgin_w ) | |
| 309 | { | |
| 310 | } | |
| 311 | ||
| 312 | ||
| 313 | //************************************************************************** | |
| 314 | // EXPANSION CARD INTERFACE | |
| 315 | //************************************************************************** | |
| 316 | ||
| 317 | //------------------------------------------------- | |
| 318 | // device_exp_card_interface - constructor | |
| 319 | //------------------------------------------------- | |
| 320 | ||
| 321 | device_exp_card_interface::device_exp_card_interface(const machine_config &mconfig, device_t &device) : | |
| 322 | device_zorro_card_interface(mconfig, device), | |
| 323 | m_slot(NULL) | |
| 324 | { | |
| 325 | } | |
| 326 | ||
| 327 | //------------------------------------------------- | |
| 328 | // ~device_exp_card_interface - destructor | |
| 329 | //------------------------------------------------- | |
| 330 | ||
| 331 | device_exp_card_interface::~device_exp_card_interface() | |
| 332 | { | |
| 333 | } | |
| 334 | ||
| 335 | void device_exp_card_interface::set_zorro_device() | |
| 336 | { | |
| 337 | m_slot = dynamic_cast<exp_slot_device *>(m_zorro); | |
| 338 | } | |
| 339 | ||
| 340 | ||
| 341 | //************************************************************************** | |
| 342 | // ZORRO-II CARD INTERFACE | |
| 343 | //************************************************************************** | |
| 344 | ||
| 345 | //------------------------------------------------- | |
| 346 | // device_zorro2_interface - constructor | |
| 347 | //------------------------------------------------- | |
| 348 | ||
| 349 | device_zorro2_card_interface::device_zorro2_card_interface(const machine_config &mconfig, device_t &device) : | |
| 350 | device_zorro_card_interface(mconfig, device), | |
| 351 | m_next(NULL), | |
| 352 | m_slot(NULL) | |
| 353 | { | |
| 354 | } | |
| 355 | ||
| 356 | //------------------------------------------------- | |
| 357 | // ~device_zorro2_interface - destructor | |
| 358 | //------------------------------------------------- | |
| 359 | ||
| 360 | device_zorro2_card_interface::~device_zorro2_card_interface() | |
| 361 | { | |
| 362 | } | |
| 363 | ||
| 364 | void device_zorro2_card_interface::set_zorro_device() | |
| 365 | { | |
| 366 | m_slot = dynamic_cast<zorro2_device *>(m_zorro); | |
| 367 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Buddha | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Zorro-II IDE controller | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __BUDDHA_H__ | |
| 15 | #define __BUDDHA_H__ | |
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "zorro.h" | |
| 19 | #include "machine/autoconfig.h" | |
| 20 | #include "machine/ataintf.h" | |
| 21 | ||
| 22 | ||
| 23 | //************************************************************************** | |
| 24 | // TYPE DEFINITIONS | |
| 25 | //************************************************************************** | |
| 26 | ||
| 27 | // ======================> buddha_device | |
| 28 | ||
| 29 | class buddha_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig | |
| 30 | { | |
| 31 | public: | |
| 32 | // construction/destruction | |
| 33 | buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 34 | ||
| 35 | // speed register | |
| 36 | DECLARE_READ16_MEMBER( speed_r ); | |
| 37 | DECLARE_WRITE16_MEMBER( speed_w ); | |
| 38 | ||
| 39 | // ide register | |
| 40 | DECLARE_READ16_MEMBER( ide_0_cs0_r ); | |
| 41 | DECLARE_WRITE16_MEMBER( ide_0_cs0_w ); | |
| 42 | DECLARE_READ16_MEMBER( ide_0_cs1_r ); | |
| 43 | DECLARE_WRITE16_MEMBER( ide_0_cs1_w ); | |
| 44 | DECLARE_READ16_MEMBER( ide_1_cs0_r ); | |
| 45 | DECLARE_WRITE16_MEMBER( ide_1_cs0_w ); | |
| 46 | DECLARE_READ16_MEMBER( ide_1_cs1_r ); | |
| 47 | DECLARE_WRITE16_MEMBER( ide_1_cs1_w ); | |
| 48 | ||
| 49 | // interrupt register | |
| 50 | DECLARE_READ16_MEMBER( ide_0_interrupt_r ); | |
| 51 | DECLARE_READ16_MEMBER( ide_1_interrupt_r ); | |
| 52 | DECLARE_WRITE16_MEMBER( ide_interrupt_enable_w ); | |
| 53 | ||
| 54 | DECLARE_WRITE_LINE_MEMBER( ide_0_interrupt_w ); | |
| 55 | DECLARE_WRITE_LINE_MEMBER( ide_1_interrupt_w ); | |
| 56 | ||
| 57 | protected: | |
| 58 | // device-level overrides | |
| 59 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 60 | virtual const rom_entry *device_rom_region() const; | |
| 61 | ||
| 62 | virtual void device_start(); | |
| 63 | virtual void device_reset(); | |
| 64 | ||
| 65 | // device_zorro2_card_interface overrides | |
| 66 | virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); | |
| 67 | ||
| 68 | // amiga_autoconfig overrides | |
| 69 | virtual void autoconfig_base_address(offs_t address); | |
| 70 | ||
| 71 | private: | |
| 72 | required_device<ata_interface_device> m_ata_0; | |
| 73 | required_device<ata_interface_device> m_ata_1; | |
| 74 | ||
| 75 | bool m_ide_interrupts_enabled; | |
| 76 | int m_ide_0_interrupt; | |
| 77 | int m_ide_1_interrupt; | |
| 78 | }; | |
| 79 | ||
| 80 | // device type definition | |
| 81 | extern const device_type BUDDHA; | |
| 82 | ||
| 83 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Amiga Zorro Cards | |
| 4 | ||
| 5 | ***************************************************************************/ | |
| 6 | ||
| 7 | #include "cards.h" | |
| 8 | ||
| 9 | SLOT_INTERFACE_START( a1000_expansion_cards ) | |
| 10 | SLOT_INTERFACE_END | |
| 11 | ||
| 12 | SLOT_INTERFACE_START( a500_expansion_cards ) | |
| 13 | SLOT_INTERFACE("ar1", ACTION_REPLAY_MK1) | |
| 14 | SLOT_INTERFACE("ar2", ACTION_REPLAY_MK2) | |
| 15 | SLOT_INTERFACE("ar3", ACTION_REPLAY_MK3) | |
| 16 | SLOT_INTERFACE("a590", A590) | |
| 17 | SLOT_INTERFACE_END | |
| 18 | ||
| 19 | SLOT_INTERFACE_START( a2000_expansion_cards ) | |
| 20 | SLOT_INTERFACE("ar1", ACTION_REPLAY_MK1) | |
| 21 | SLOT_INTERFACE("ar2", ACTION_REPLAY_MK2) | |
| 22 | SLOT_INTERFACE("ar3", ACTION_REPLAY_MK3) | |
| 23 | SLOT_INTERFACE_END | |
| 24 | ||
| 25 | SLOT_INTERFACE_START( zorro2_cards ) | |
| 26 | SLOT_INTERFACE("a2052", A2052) | |
| 27 | SLOT_INTERFACE("a2091", A2091) | |
| 28 | SLOT_INTERFACE("a2232", A2232) | |
| 29 | SLOT_INTERFACE("buddha", BUDDHA) | |
| 30 | SLOT_INTERFACE_END | |
| 31 | ||
| 32 | SLOT_INTERFACE_START( zorro3_cards ) | |
| 33 | SLOT_INTERFACE("a2052", A2052) | |
| 34 | SLOT_INTERFACE("a2091", A2091) | |
| 35 | SLOT_INTERFACE("a2232", A2232) | |
| 36 | SLOT_INTERFACE("buddha", BUDDHA) | |
| 37 | SLOT_INTERFACE_END |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Commodore A2052 | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Zorro-II RAM Expansion (0.5, 1 or 2 MB) | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __A2052_H__ | |
| 15 | #define __A2052_H__ | |
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "zorro.h" | |
| 19 | #include "machine/autoconfig.h" | |
| 20 | ||
| 21 | ||
| 22 | //************************************************************************** | |
| 23 | // TYPE DEFINITIONS | |
| 24 | //************************************************************************** | |
| 25 | ||
| 26 | // ======================> a2052_device | |
| 27 | ||
| 28 | class a2052_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig | |
| 29 | { | |
| 30 | public: | |
| 31 | // construction/destruction | |
| 32 | a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ||
| 34 | protected: | |
| 35 | virtual ioport_constructor device_input_ports() const; | |
| 36 | virtual void device_start(); | |
| 37 | ||
| 38 | // device_zorro2_card_interface overrides | |
| 39 | virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); | |
| 40 | ||
| 41 | // amiga_autoconfig overrides | |
| 42 | virtual void autoconfig_base_address(offs_t address); | |
| 43 | ||
| 44 | private: | |
| 45 | required_ioport m_config; | |
| 46 | dynamic_array<UINT16> m_ram; | |
| 47 | }; | |
| 48 | ||
| 49 | // device type definition | |
| 50 | extern const device_type A2052; | |
| 51 | ||
| 52 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Commodore A2232 | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Zorro-II Serial Card | |
| 9 | ||
| 10 | Provides the Amiga with 7 additional RS232 ports. | |
| 11 | ||
| 12 | ***************************************************************************/ | |
| 13 | ||
| 14 | #pragma once | |
| 15 | ||
| 16 | #ifndef __A2232_H__ | |
| 17 | #define __A2232_H__ | |
| 18 | ||
| 19 | #include "emu.h" | |
| 20 | #include "zorro.h" | |
| 21 | #include "machine/autoconfig.h" | |
| 22 | #include "cpu/m6502/m65ce02.h" | |
| 23 | #include "machine/mos6551.h" | |
| 24 | #include "machine/mos6526.h" | |
| 25 | #include "bus/rs232/rs232.h" | |
| 26 | ||
| 27 | ||
| 28 | //************************************************************************** | |
| 29 | // TYPE DEFINITIONS | |
| 30 | //************************************************************************** | |
| 31 | ||
| 32 | // ======================> a2232_device | |
| 33 | ||
| 34 | class a2232_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig | |
| 35 | { | |
| 36 | public: | |
| 37 | // construction/destruction | |
| 38 | a2232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 39 | ||
| 40 | // cpu | |
| 41 | WRITE8_MEMBER( int2_w ); | |
| 42 | WRITE8_MEMBER( irq_ack_w ); | |
| 43 | ||
| 44 | // zorro slot | |
| 45 | DECLARE_READ16_MEMBER( shared_ram_r ); | |
| 46 | DECLARE_WRITE16_MEMBER( shared_ram_w ); | |
| 47 | DECLARE_READ16_MEMBER( irq_ack_r ); | |
| 48 | DECLARE_WRITE16_MEMBER( irq_ack_w ); | |
| 49 | DECLARE_READ16_MEMBER( reset_low_r ); | |
| 50 | DECLARE_WRITE16_MEMBER( reset_low_w ); | |
| 51 | DECLARE_READ16_MEMBER( irq_r ); | |
| 52 | DECLARE_WRITE16_MEMBER( irq_w ); | |
| 53 | DECLARE_READ16_MEMBER( reset_high_r ); | |
| 54 | DECLARE_WRITE16_MEMBER( reset_high_w ); | |
| 55 | ||
| 56 | // acia | |
| 57 | DECLARE_READ8_MEMBER( acia_0_r ); | |
| 58 | DECLARE_WRITE8_MEMBER( acia_0_w ); | |
| 59 | DECLARE_WRITE_LINE_MEMBER( acia_0_irq_w ); | |
| 60 | DECLARE_READ8_MEMBER( acia_1_r ); | |
| 61 | DECLARE_WRITE8_MEMBER( acia_1_w ); | |
| 62 | DECLARE_WRITE_LINE_MEMBER( acia_1_irq_w ); | |
| 63 | DECLARE_READ8_MEMBER( acia_2_r ); | |
| 64 | DECLARE_WRITE8_MEMBER( acia_2_w ); | |
| 65 | DECLARE_WRITE_LINE_MEMBER( acia_2_irq_w ); | |
| 66 | DECLARE_READ8_MEMBER( acia_3_r ); | |
| 67 | DECLARE_WRITE8_MEMBER( acia_3_w ); | |
| 68 | DECLARE_WRITE_LINE_MEMBER( acia_3_irq_w ); | |
| 69 | DECLARE_READ8_MEMBER( acia_4_r ); | |
| 70 | DECLARE_WRITE8_MEMBER( acia_4_w ); | |
| 71 | DECLARE_WRITE_LINE_MEMBER( acia_4_irq_w ); | |
| 72 | DECLARE_READ8_MEMBER( acia_5_r ); | |
| 73 | DECLARE_WRITE8_MEMBER( acia_5_w ); | |
| 74 | DECLARE_WRITE_LINE_MEMBER( acia_5_irq_w ); | |
| 75 | DECLARE_READ8_MEMBER( acia_6_r ); | |
| 76 | DECLARE_WRITE8_MEMBER( acia_6_w ); | |
| 77 | DECLARE_WRITE_LINE_MEMBER( acia_6_irq_w ); | |
| 78 | ||
| 79 | // cia | |
| 80 | DECLARE_READ8_MEMBER( cia_r ); | |
| 81 | DECLARE_WRITE8_MEMBER( cia_w ); | |
| 82 | DECLARE_WRITE_LINE_MEMBER( cia_irq_w ); | |
| 83 | DECLARE_READ8_MEMBER( cia_port_a_r ); | |
| 84 | DECLARE_READ8_MEMBER( cia_port_b_r ); | |
| 85 | DECLARE_WRITE8_MEMBER( cia_port_b_w ); | |
| 86 | ||
| 87 | // rs232 | |
| 88 | DECLARE_WRITE_LINE_MEMBER( rs232_1_rxd_w ); | |
| 89 | DECLARE_WRITE_LINE_MEMBER( rs232_1_dcd_w ); | |
| 90 | DECLARE_WRITE_LINE_MEMBER( rs232_1_cts_w ); | |
| 91 | DECLARE_WRITE_LINE_MEMBER( rs232_2_dcd_w ); | |
| 92 | DECLARE_WRITE_LINE_MEMBER( rs232_2_cts_w ); | |
| 93 | DECLARE_WRITE_LINE_MEMBER( rs232_3_dcd_w ); | |
| 94 | DECLARE_WRITE_LINE_MEMBER( rs232_3_cts_w ); | |
| 95 | DECLARE_WRITE_LINE_MEMBER( rs232_4_dcd_w ); | |
| 96 | DECLARE_WRITE_LINE_MEMBER( rs232_4_cts_w ); | |
| 97 | DECLARE_WRITE_LINE_MEMBER( rs232_5_dcd_w ); | |
| 98 | DECLARE_WRITE_LINE_MEMBER( rs232_5_cts_w ); | |
| 99 | DECLARE_WRITE_LINE_MEMBER( rs232_6_dcd_w ); | |
| 100 | DECLARE_WRITE_LINE_MEMBER( rs232_6_cts_w ); | |
| 101 | DECLARE_WRITE_LINE_MEMBER( rs232_7_dcd_w ); | |
| 102 | DECLARE_WRITE_LINE_MEMBER( rs232_7_cts_w ); | |
| 103 | ||
| 104 | protected: | |
| 105 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 106 | virtual void device_start(); | |
| 107 | virtual void device_reset_after_children(); | |
| 108 | ||
| 109 | // device_zorro2_card_interface overrides | |
| 110 | virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); | |
| 111 | ||
| 112 | // amiga_autoconfig overrides | |
| 113 | virtual void autoconfig_base_address(offs_t address); | |
| 114 | ||
| 115 | private: | |
| 116 | enum | |
| 117 | { | |
| 118 | IRQ_ACIA_0, | |
| 119 | IRQ_ACIA_1, | |
| 120 | IRQ_ACIA_2, | |
| 121 | IRQ_ACIA_3, | |
| 122 | IRQ_ACIA_4, | |
| 123 | IRQ_ACIA_5, | |
| 124 | IRQ_ACIA_6, | |
| 125 | IRQ_CIA, | |
| 126 | IRQ_AMIGA, | |
| 127 | IRQ_SOURCE_COUNT | |
| 128 | }; | |
| 129 | ||
| 130 | void update_irqs(); | |
| 131 | ||
| 132 | required_device<m65ce02_device> m_iocpu; | |
| 133 | required_device<mos6551_device> m_acia_0; | |
| 134 | required_device<mos6551_device> m_acia_1; | |
| 135 | required_device<mos6551_device> m_acia_2; | |
| 136 | required_device<mos6551_device> m_acia_3; | |
| 137 | required_device<mos6551_device> m_acia_4; | |
| 138 | required_device<mos6551_device> m_acia_5; | |
| 139 | required_device<mos6551_device> m_acia_6; | |
| 140 | required_device<mos8520_device> m_cia; | |
| 141 | required_shared_ptr<UINT8> m_shared_ram; | |
| 142 | ||
| 143 | int m_irqs[IRQ_SOURCE_COUNT]; | |
| 144 | ||
| 145 | UINT8 m_cia_port_a; | |
| 146 | UINT8 m_cia_port_b; | |
| 147 | }; | |
| 148 | ||
| 149 | // device type definition | |
| 150 | extern const device_type A2232; | |
| 151 | ||
| 152 | #endif // __A2232_H__ |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Commodore A590 / A2091 | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | DMAC based HD controller for the Amiga 500 and Zorro-II | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "a590.h" | |
| 13 | #include "bus/scsi/scsi.h" | |
| 14 | #include "bus/scsi/scsihd.h" | |
| 15 | ||
| 16 | ||
| 17 | //************************************************************************** | |
| 18 | // DEVICE DEFINITIONS | |
| 19 | //************************************************************************** | |
| 20 | ||
| 21 | const device_type A590 = &device_creator<a590_device>; | |
| 22 | const device_type A2091 = &device_creator<a2091_device>; | |
| 23 | ||
| 24 | //------------------------------------------------- | |
| 25 | // input_ports - device-specific input ports | |
| 26 | //------------------------------------------------- | |
| 27 | ||
| 28 | static INPUT_PORTS_START( a590_pcb ) | |
| 29 | PORT_START("dips") | |
| 30 | PORT_DIPNAME(0x01, 0x01, "A590 Auto-Boot") | |
| 31 | PORT_DIPLOCATION("DIP:1") | |
| 32 | PORT_DIPSETTING(0x00, "Enabled") | |
| 33 | PORT_DIPSETTING(0x01, "Disabled") | |
| 34 | PORT_DIPNAME(0x02, 0x00, "A590 LUN") | |
| 35 | PORT_DIPLOCATION("DIP:2") | |
| 36 | PORT_DIPSETTING(0x00, "Disabled") | |
| 37 | PORT_DIPSETTING(0x02, "Enabled") | |
| 38 | PORT_DIPNAME(0x04, 0x04, "A590 Wait period") | |
| 39 | PORT_DIPLOCATION("DIP:3") | |
| 40 | PORT_DIPSETTING(0x00, "Short") | |
| 41 | PORT_DIPSETTING(0x04, "Long") | |
| 42 | PORT_DIPNAME(0x08, 0x00, "A590 Reserved") | |
| 43 | PORT_DIPLOCATION("DIP:4") | |
| 44 | PORT_DIPSETTING(0x00, "Enabled") | |
| 45 | PORT_DIPSETTING(0x08, "Disabled") | |
| 46 | PORT_START("jp1") | |
| 47 | PORT_DIPNAME(0x0f, 0x01, "A590 Memory size") | |
| 48 | PORT_DIPLOCATION("JP1:1,2,3,4") | |
| 49 | PORT_DIPSETTING(0x01, "Amnesia") | |
| 50 | PORT_DIPSETTING(0x02, "512K") | |
| 51 | PORT_DIPSETTING(0x04, "1MB") | |
| 52 | PORT_DIPSETTING(0x08, "2MB") | |
| 53 | PORT_START("jp2") | |
| 54 | PORT_DIPNAME(0x01, 0x00, "A590 Drive LED") | |
| 55 | PORT_DIPLOCATION("JP2:1") | |
| 56 | PORT_DIPSETTING(0x00, "XT Drive") | |
| 57 | PORT_DIPSETTING(0x01, "SCSI Drive") | |
| 58 | PORT_START("jp4") | |
| 59 | PORT_DIPNAME(0x01, 0x00, "A590 Interrupt") | |
| 60 | PORT_DIPLOCATION("JP4:1") | |
| 61 | PORT_DIPSETTING(0x00, "INT 2") | |
| 62 | PORT_DIPSETTING(0x01, "INT 6") | |
| 63 | INPUT_PORTS_END | |
| 64 | ||
| 65 | ioport_constructor a590_device::device_input_ports() const | |
| 66 | { | |
| 67 | return INPUT_PORTS_NAME( a590_pcb ); | |
| 68 | } | |
| 69 | ||
| 70 | static INPUT_PORTS_START( a2091_pcb ) | |
| 71 | PORT_START("jp1") | |
| 72 | PORT_DIPNAME(0x0f, 0x01, "A2091 Memory size") | |
| 73 | PORT_DIPLOCATION("JP1:1,2,3,4") | |
| 74 | PORT_DIPSETTING(0x01, "0K") | |
| 75 | PORT_DIPSETTING(0x02, "512K") | |
| 76 | PORT_DIPSETTING(0x04, "1MB") | |
| 77 | PORT_DIPSETTING(0x08, "2MB") | |
| 78 | PORT_START("jp2") | |
| 79 | PORT_DIPNAME(0x01, 0x00, "A2091 Auto-Boot") | |
| 80 | PORT_DIPLOCATION("JP2:1") | |
| 81 | PORT_DIPSETTING(0x00, "Enabled") | |
| 82 | PORT_DIPSETTING(0x01, "Disabled") | |
| 83 | PORT_START("jp3") | |
| 84 | PORT_DIPNAME(0x01, 0x00, "A2091 Interrupt") | |
| 85 | PORT_DIPLOCATION("JP3:1") | |
| 86 | PORT_DIPSETTING(0x00, "INT 2") | |
| 87 | PORT_DIPSETTING(0x01, "INT 6") | |
| 88 | PORT_START("jp5") | |
| 89 | PORT_DIPNAME(0x01, 0x00, "A2091 LUN") | |
| 90 | PORT_DIPLOCATION("JP5:1") | |
| 91 | PORT_DIPSETTING(0x00, "Disabled") | |
| 92 | PORT_DIPSETTING(0x01, "Enabled") | |
| 93 | PORT_DIPNAME(0x02, 0x00, "A2091 Time-Out") | |
| 94 | PORT_DIPLOCATION("JP5:2") | |
| 95 | PORT_DIPSETTING(0x00, "Short") | |
| 96 | PORT_DIPSETTING(0x02, "Long") | |
| 97 | PORT_DIPNAME(0x04, 0x00, "A2091 Reserved") | |
| 98 | PORT_DIPLOCATION("JP5:3") | |
| 99 | PORT_DIPSETTING(0x00, "Disabled") | |
| 100 | PORT_DIPSETTING(0x02, "Enabled") | |
| 101 | PORT_START("jp201") | |
| 102 | PORT_DIPNAME(0x01, 0x00, "A2091 WD33C93 Clock") | |
| 103 | PORT_DIPLOCATION("JP201:1") | |
| 104 | PORT_DIPSETTING(0x00, "7 MHz") | |
| 105 | PORT_DIPSETTING(0x01, "14 MHz") | |
| 106 | INPUT_PORTS_END | |
| 107 | ||
| 108 | ioport_constructor a2091_device::device_input_ports() const | |
| 109 | { | |
| 110 | return INPUT_PORTS_NAME( a2091_pcb ); | |
| 111 | } | |
| 112 | ||
| 113 | //------------------------------------------------- | |
| 114 | // machine_config_additions - device-specific | |
| 115 | // machine configurations | |
| 116 | //------------------------------------------------- | |
| 117 | ||
| 118 | static MACHINE_CONFIG_FRAGMENT( dmac_hdc ) | |
| 119 | MCFG_DMAC_ADD("dmac", 0) | |
| 120 | MCFG_DMAC_SCSI_READ_HANDLER(READ8(dmac_hdc_device, dmac_scsi_r)) | |
| 121 | MCFG_DMAC_SCSI_WRITE_HANDLER(WRITE8(dmac_hdc_device, dmac_scsi_w)) | |
| 122 | MCFG_DMAC_INT_HANDLER(WRITELINE(dmac_hdc_device, dmac_int_w)) | |
| 123 | MCFG_DMAC_CFGOUT_HANDLER(WRITELINE(dmac_hdc_device, dmac_cfgout_w)) | |
| 124 | MCFG_DEVICE_ADD("scsi", SCSI_PORT, 0) | |
| 125 | MCFG_SCSIDEV_ADD("scsi:" SCSI_PORT_DEVICE1, "harddisk", SCSIHD, SCSI_ID_1) | |
| 126 | MCFG_DEVICE_ADD("wd33c93", WD33C93, 0) | |
| 127 | MCFG_LEGACY_SCSI_PORT("scsi") | |
| 128 | MCFG_WD33C93_IRQ_CB(WRITELINE(dmac_hdc_device, scsi_irq_w)) | |
| 129 | MACHINE_CONFIG_END | |
| 130 | ||
| 131 | machine_config_constructor dmac_hdc_device::device_mconfig_additions() const | |
| 132 | { | |
| 133 | return MACHINE_CONFIG_NAME( dmac_hdc ); | |
| 134 | } | |
| 135 | ||
| 136 | ||
| 137 | //------------------------------------------------- | |
| 138 | // rom_region - device-specific ROM region | |
| 139 | //------------------------------------------------- | |
| 140 | ||
| 141 | ROM_START( dmac_hdc ) | |
| 142 | ROM_REGION16_BE(0x8000, "bootrom", 0) | |
| 143 | ROM_DEFAULT_BIOS("v70") | |
| 144 | ||
| 145 | ROM_SYSTEM_BIOS(0, "v60", "Version 6.0") | |
| 146 | ROMX_LOAD("390388-03.u13", 0x0000, 0x2000, CRC(2e77bbff) SHA1(8a098845068f32cfa4d34a278cd290f61d35a52c), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 147 | ROMX_LOAD("390389-03.u12", 0x0001, 0x2000, CRC(b0b8cf24) SHA1(fcf4017505f4d441814b45d559c19eab43816b30), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 148 | ROMX_LOAD("390388-03.u13", 0x4000, 0x2000, CRC(2e77bbff) SHA1(8a098845068f32cfa4d34a278cd290f61d35a52c), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 149 | ROMX_LOAD("390389-03.u12", 0x4001, 0x2000, CRC(b0b8cf24) SHA1(fcf4017505f4d441814b45d559c19eab43816b30), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 150 | ||
| 151 | // changelog v6.1: prevent accesses to location 0 by application programs | |
| 152 | ROM_SYSTEM_BIOS(1, "v61", "Version 6.1") | |
| 153 | ROMX_LOAD("390721-01.u13", 0x0000, 0x2000, CRC(00dbf615) SHA1(503940d04fb3b49eaa61100fd3a487018b35e25a), ROM_SKIP(1) | ROM_BIOS(2)) | |
| 154 | ROMX_LOAD("390722-01.u12", 0x0001, 0x2000, CRC(c460cfdb) SHA1(0de457daec3b84f75e8fb344defe24ce56cda3e0), ROM_SKIP(1) | ROM_BIOS(2)) | |
| 155 | ROMX_LOAD("390721-01.u13", 0x4000, 0x2000, CRC(00dbf615) SHA1(503940d04fb3b49eaa61100fd3a487018b35e25a), ROM_SKIP(1) | ROM_BIOS(2)) | |
| 156 | ROMX_LOAD("390722-01.u12", 0x4001, 0x2000, CRC(c460cfdb) SHA1(0de457daec3b84f75e8fb344defe24ce56cda3e0), ROM_SKIP(1) | ROM_BIOS(2)) | |
| 157 | ||
| 158 | // changelog v6.6: fixes dual scsi problems with the wd33c93a controller | |
| 159 | ROM_SYSTEM_BIOS(2, "v66", "Version 6.6") | |
| 160 | ROMX_LOAD("390721-02.u13", 0x0000, 0x2000, CRC(c0871d25) SHA1(e155f18abb90cf820589c15e70559d3b6b391af8), ROM_SKIP(1) | ROM_BIOS(3)) | |
| 161 | ROMX_LOAD("390722-02.u12", 0x0001, 0x2000, CRC(e536bbb2) SHA1(fd7f8a6da18c1b02d07eb990c2467a24183ede12), ROM_SKIP(1) | ROM_BIOS(3)) | |
| 162 | ROMX_LOAD("390721-02.u13", 0x4000, 0x2000, CRC(c0871d25) SHA1(e155f18abb90cf820589c15e70559d3b6b391af8), ROM_SKIP(1) | ROM_BIOS(3)) | |
| 163 | ROMX_LOAD("390722-02.u12", 0x4001, 0x2000, CRC(e536bbb2) SHA1(fd7f8a6da18c1b02d07eb990c2467a24183ede12), ROM_SKIP(1) | ROM_BIOS(3)) | |
| 164 | ||
| 165 | // final commodore released version | |
| 166 | ROM_SYSTEM_BIOS(3, "v70", "Version 7.0") | |
| 167 | ROMX_LOAD("390721-03.u13", 0x0000, 0x2000, CRC(2942747a) SHA1(dbd7648e79c753337ff3e4f491de224bf05e6bb6), ROM_SKIP(1) | ROM_BIOS(4)) | |
| 168 | ROMX_LOAD("390722-03.u12", 0x0001, 0x2000, CRC(a9ccffed) SHA1(149f5bd52e2d29904e3de483b9ad772448e9278e), ROM_SKIP(1) | ROM_BIOS(4)) | |
| 169 | ROMX_LOAD("390721-03.u13", 0x4000, 0x2000, CRC(2942747a) SHA1(dbd7648e79c753337ff3e4f491de224bf05e6bb6), ROM_SKIP(1) | ROM_BIOS(4)) | |
| 170 | ROMX_LOAD("390722-03.u12", 0x4001, 0x2000, CRC(a9ccffed) SHA1(149f5bd52e2d29904e3de483b9ad772448e9278e), ROM_SKIP(1) | ROM_BIOS(4)) | |
| 171 | ||
| 172 | // third-party upgrade rom, requires a small rom adapter pcb | |
| 173 | ROM_SYSTEM_BIOS(4, "g614", "Guru-ROM 6.14") | |
| 174 | ROMX_LOAD("gururom_v614.bin", 0x0000, 0x8000, CRC(04e52f93) SHA1(6da21b6f5e8f8837d64507cd8a4d5cdcac4f426b), ROM_GROUPWORD | ROM_BIOS(5)) | |
| 175 | ||
| 176 | // pal16l8a | |
| 177 | ROM_REGION(0x104, "ram_controller", 0) | |
| 178 | ROM_LOAD("390333-03.u5", 0x000, 0x104, CRC(dc4a8d9b) SHA1(761a1318106e49057f95258699076ec1079967ad)) | |
| 179 | ROM_END | |
| 180 | ||
| 181 | const rom_entry *dmac_hdc_device::device_rom_region() const | |
| 182 | { | |
| 183 | return ROM_NAME( dmac_hdc ); | |
| 184 | } | |
| 185 | ||
| 186 | ||
| 187 | //************************************************************************** | |
| 188 | // LIVE DEVICE | |
| 189 | //************************************************************************** | |
| 190 | ||
| 191 | //------------------------------------------------- | |
| 192 | // dmac_hdc_device - constructor | |
| 193 | //------------------------------------------------- | |
| 194 | ||
| 195 | dmac_hdc_device::dmac_hdc_device(const machine_config &mconfig, device_type type, const char *tag, | |
| 196 | device_t *owner, UINT32 clock, const char *name, const char *shortname) : | |
| 197 | device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__), | |
| 198 | m_int6(false), | |
| 199 | m_dmac(*this, "dmac"), | |
| 200 | m_wdc(*this, "wd33c93") | |
| 201 | { | |
| 202 | } | |
| 203 | ||
| 204 | a590_device::a590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 205 | dmac_hdc_device(mconfig, A590, tag, owner, clock, "CBM A590 HD Controller", "a590"), | |
| 206 | device_exp_card_interface(mconfig, *this), | |
| 207 | m_dips(*this, "dips"), | |
| 208 | m_jp1(*this, "jp1"), | |
| 209 | m_jp2(*this, "jp2"), | |
| 210 | m_jp4(*this, "jp4") | |
| 211 | { | |
| 212 | } | |
| 213 | ||
| 214 | a2091_device::a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 215 | dmac_hdc_device(mconfig, A2091, tag, owner, clock, "CBM A2091 HD Controller", "a2091"), | |
| 216 | device_zorro2_card_interface(mconfig, *this), | |
| 217 | m_jp1(*this, "jp1"), | |
| 218 | m_jp2(*this, "jp2"), | |
| 219 | m_jp3(*this, "jp3"), | |
| 220 | m_jp5(*this, "jp5"), | |
| 221 | m_jp201(*this, "jp201") | |
| 222 | { | |
| 223 | } | |
| 224 | ||
| 225 | //------------------------------------------------- | |
| 226 | // device_start - device-specific startup | |
| 227 | //------------------------------------------------- | |
| 228 | ||
| 229 | void dmac_hdc_device::device_start() | |
| 230 | { | |
| 231 | } | |
| 232 | ||
| 233 | void a590_device::device_start() | |
| 234 | { | |
| 235 | set_zorro_device(); | |
| 236 | ||
| 237 | // setup dmac | |
| 238 | m_dmac->set_address_space(m_slot->m_space); | |
| 239 | m_dmac->set_rom(memregion("bootrom")->base()); | |
| 240 | } | |
| 241 | ||
| 242 | void a2091_device::device_start() | |
| 243 | { | |
| 244 | set_zorro_device(); | |
| 245 | ||
| 246 | // setup dmac | |
| 247 | m_dmac->set_address_space(m_slot->m_space); | |
| 248 | m_dmac->set_rom(memregion("bootrom")->base()); | |
| 249 | } | |
| 250 | ||
| 251 | //------------------------------------------------- | |
| 252 | // device_reset - device-specific reset | |
| 253 | //------------------------------------------------- | |
| 254 | ||
| 255 | void dmac_hdc_device::device_reset() | |
| 256 | { | |
| 257 | } | |
| 258 | ||
| 259 | void dmac_hdc_device::resize_ram(int config) | |
| 260 | { | |
| 261 | // allocate space for ram | |
| 262 | switch (config & 0x0f) | |
| 263 | { | |
| 264 | case 0x01: | |
| 265 | m_ram.resize(0); | |
| 266 | m_dmac->ramsz_w(0); | |
| 267 | break; | |
| 268 | case 0x02: | |
| 269 | m_ram.resize(0x080000); | |
| 270 | m_dmac->ramsz_w(1); | |
| 271 | break; | |
| 272 | case 0x04: | |
| 273 | m_ram.resize(0x100000); | |
| 274 | m_dmac->ramsz_w(2); | |
| 275 | break; | |
| 276 | case 0x08: | |
| 277 | m_ram.resize(0x200000); | |
| 278 | m_dmac->ramsz_w(3); | |
| 279 | break; | |
| 280 | } | |
| 281 | ||
| 282 | m_dmac->set_ram(m_ram); | |
| 283 | } | |
| 284 | ||
| 285 | void a590_device::device_reset() | |
| 286 | { | |
| 287 | } | |
| 288 | ||
| 289 | void a2091_device::device_reset() | |
| 290 | { | |
| 291 | } | |
| 292 | ||
| 293 | ||
| 294 | //************************************************************************** | |
| 295 | // IMPLEMENTATION | |
| 296 | //************************************************************************** | |
| 297 | ||
| 298 | WRITE_LINE_MEMBER( a590_device::cfgin_w ) | |
| 299 | { | |
| 300 | // make sure we configure ourselves first | |
| 301 | m_int6 = m_jp4->read() & 0x01; | |
| 302 | resize_ram(m_dips->read() & 0x0f); | |
| 303 | ||
| 304 | // then tell the dmac to start configuring | |
| 305 | m_dmac->configin_w(state); | |
| 306 | } | |
| 307 | ||
| 308 | WRITE_LINE_MEMBER( a2091_device::cfgin_w ) | |
| 309 | { | |
| 310 | // make sure we configure ourselves first | |
| 311 | m_int6 = m_jp3->read() & 0x01; | |
| 312 | resize_ram(m_jp1->read() & 0x0f); | |
| 313 | ||
| 314 | // then tell the dmac to start configuring | |
| 315 | m_dmac->configin_w(state); | |
| 316 | } | |
| 317 | ||
| 318 | READ8_MEMBER( dmac_hdc_device::dmac_scsi_r ) | |
| 319 | { | |
| 320 | switch (offset) | |
| 321 | { | |
| 322 | case 0x48: return m_wdc->read(space, 0); | |
| 323 | case 0x49: return m_wdc->read(space, 1); | |
| 324 | } | |
| 325 | ||
| 326 | return 0xff; | |
| 327 | } | |
| 328 | ||
| 329 | WRITE8_MEMBER( dmac_hdc_device::dmac_scsi_w ) | |
| 330 | { | |
| 331 | switch (offset) | |
| 332 | { | |
| 333 | case 0x48: m_wdc->write(space, 0, data); break; | |
| 334 | case 0x49: m_wdc->write(space, 1, data); break; | |
| 335 | } | |
| 336 | } | |
| 337 | ||
| 338 | WRITE_LINE_MEMBER( dmac_hdc_device::dmac_int_w ) | |
| 339 | { | |
| 340 | if (m_int6) | |
| 341 | int6_w(state); | |
| 342 | else | |
| 343 | int2_w(state); | |
| 344 | } | |
| 345 | ||
| 346 | WRITE_LINE_MEMBER( dmac_hdc_device::scsi_irq_w ) | |
| 347 | { | |
| 348 | // should be or'ed with xt-ide irq | |
| 349 | m_dmac->intx_w(state); | |
| 350 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Datel Action Replay | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Freezer cartridge for Amiga 500 and Amiga 2000 | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __ACTION_REPLAY_H__ | |
| 15 | #define __ACTION_REPLAY_H__ | |
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "zorro.h" | |
| 19 | ||
| 20 | ||
| 21 | //************************************************************************** | |
| 22 | // TYPE DEFINITIONS | |
| 23 | //************************************************************************** | |
| 24 | ||
| 25 | // ======================> action_replay_device | |
| 26 | ||
| 27 | class action_replay_device : public device_t, public device_exp_card_interface | |
| 28 | { | |
| 29 | public: | |
| 30 | // construction/destruction | |
| 31 | action_replay_device(const machine_config &mconfig, device_type type, const char *tag, | |
| 32 | device_t *owner, UINT32 clock, const char *name, const char *shortname); | |
| 33 | ||
| 34 | // optional information overrides | |
| 35 | virtual ioport_constructor device_input_ports() const; | |
| 36 | ||
| 37 | DECLARE_INPUT_CHANGED_MEMBER( freeze ); | |
| 38 | ||
| 39 | protected: | |
| 40 | // device-level overrides | |
| 41 | virtual void device_start(); | |
| 42 | virtual void device_reset(); | |
| 43 | ||
| 44 | private: | |
| 45 | required_ioport m_button; | |
| 46 | }; | |
| 47 | ||
| 48 | class action_replay_mk1_device : public action_replay_device | |
| 49 | { | |
| 50 | public: | |
| 51 | // construction/destruction | |
| 52 | action_replay_mk1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | ||
| 54 | // optional information overrides | |
| 55 | virtual const rom_entry *device_rom_region() const; | |
| 56 | }; | |
| 57 | ||
| 58 | class action_replay_mk2_device : public action_replay_device | |
| 59 | { | |
| 60 | public: | |
| 61 | // construction/destruction | |
| 62 | action_replay_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 63 | ||
| 64 | // optional information overrides | |
| 65 | virtual const rom_entry *device_rom_region() const; | |
| 66 | }; | |
| 67 | ||
| 68 | class action_replay_mk3_device : public action_replay_device | |
| 69 | { | |
| 70 | public: | |
| 71 | // construction/destruction | |
| 72 | action_replay_mk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 73 | ||
| 74 | // optional information overrides | |
| 75 | virtual const rom_entry *device_rom_region() const; | |
| 76 | }; | |
| 77 | ||
| 78 | // device type definition | |
| 79 | extern const device_type ACTION_REPLAY_MK1; | |
| 80 | extern const device_type ACTION_REPLAY_MK2; | |
| 81 | extern const device_type ACTION_REPLAY_MK3; | |
| 82 | ||
| 83 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Amiga Zorro Slots | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | 86-pin Expansion Slot (Zorro-I), Zorro-II, Zorro-III | |
| 9 | ||
| 10 | 86-pin Expansion Slot | |
| 11 | ||
| 12 | 2 Ground 1 Ground | |
| 13 | 4 Ground 3 Ground | |
| 14 | 6 +5VDC 5 +5VDC | |
| 15 | 8 -5VDC 7 N/C | |
| 16 | 10 +12VDC 9 N/C *1 | |
| 17 | 12 CFGIN 11 N/C *2 | |
| 18 | 14 /C3 Clock 13 Ground | |
| 19 | 16 /C1 Clock 15 CDAC | |
| 20 | 18 XRDY 17 /OVR | |
| 21 | 20 N/C *3 19 /INT2 | |
| 22 | 22 /INT6 21 A5 | |
| 23 | 24 A4 23 A6 | |
| 24 | 26 A3 25 Ground | |
| 25 | 28 A7 27 A2 | |
| 26 | 30 A8 29 A1 | |
| 27 | 32 A9 31 FC0 | |
| 28 | 34 A10 33 FC1 | |
| 29 | 36 A11 35 FC2 | |
| 30 | 38 A12 37 Ground | |
| 31 | 40 /IPL0 39 A13 | |
| 32 | 42 /IPL1 41 A14 | |
| 33 | 44 /IPL2 43 A15 | |
| 34 | 46 /BEER 45 A16 | |
| 35 | 48 /VPA 47 A17 | |
| 36 | 50 E Clock 49 Ground | |
| 37 | 52 A18 51 /VMA | |
| 38 | 54 A19 53 /RST | |
| 39 | 56 A20 55 /HLT | |
| 40 | 58 A21 57 A22 | |
| 41 | 60 /BR *4 59 A23 | |
| 42 | 62 /BGACK 61 Ground | |
| 43 | 64 /BG *5 63 D15 | |
| 44 | 66 /DTACK 65 D14 | |
| 45 | 68 R/W 67 D13 | |
| 46 | 70 /LDS 69 D12 | |
| 47 | 72 /UDS 71 D11 | |
| 48 | 74 /AS 73 Ground | |
| 49 | 76 D10 75 D0 | |
| 50 | 78 D9 77 D1 | |
| 51 | 80 D8 79 D2 | |
| 52 | 82 D7 81 D3 | |
| 53 | 84 D6 83 D4 | |
| 54 | 86 D5 85 Ground | |
| 55 | ||
| 56 | *1 28 MHz Clock on A2000 and B2000 | |
| 57 | *2 /COPCFG on B2000 | |
| 58 | *3 /PALOPE on A1000, /BOSS on B2000 | |
| 59 | *4 /CBR on B2000 | |
| 60 | *5 /CBG on B2000 | |
| 61 | ||
| 62 | Zorro-II (differences only) | |
| 63 | ||
| 64 | 7 /OWN | |
| 65 | 9 /SLAVEn | |
| 66 | 11 /CFGOUTn | |
| 67 | 12 /CFGINn | |
| 68 | 20 -12VDC | |
| 69 | 40 /EINT7 | |
| 70 | 42 /EINT5 | |
| 71 | 44 /EINT4 | |
| 72 | 60 /BRn | |
| 73 | 64 /BGn | |
| 74 | ||
| 75 | 88 Ground 87 Ground | |
| 76 | 90 Ground 89 Ground | |
| 77 | 92 7 MHz 91 Ground | |
| 78 | 94 /BURST 93 DOE | |
| 79 | 96 /EINT1 95 /BG *5 | |
| 80 | 98 N/C 97 N/C | |
| 81 | 100 Ground 99 Ground | |
| 82 | ||
| 83 | *6 /GBG on B2000 | |
| 84 | ||
| 85 | Zorro-III | |
| 86 | ||
| 87 | The Zorro-III is a multiplexed Zorro-II bus with address- and | |
| 88 | data phases. Signals changes as follows: | |
| 89 | ||
| 90 | 17 /CINH | |
| 91 | 18 /MTCR | |
| 92 | 29 /LOCK | |
| 93 | 30 AD8 (D0) | |
| 94 | 32 AD9 (D1) | |
| 95 | 34 AD10 (D2) | |
| 96 | 36 AD11 (D3) | |
| 97 | 38 AD12 (D4) | |
| 98 | 39 AD13 (D5) | |
| 99 | 40 Reserved | |
| 100 | 41 AD14 (D6) | |
| 101 | 42 Reserved | |
| 102 | 43 AD15 (D7) | |
| 103 | 44 Reserved | |
| 104 | 45 AD16 (D8) | |
| 105 | 47 AD17 (D9) | |
| 106 | 48 /MTACK | |
| 107 | 51 /DS0 | |
| 108 | 52 AD18 (D10) | |
| 109 | 54 AD19 (D11) | |
| 110 | 56 AD20 (D12) | |
| 111 | 57 AD22 (D14) | |
| 112 | 58 AD21 (D13) | |
| 113 | 59 AD23 (D15) | |
| 114 | 63 AD31 | |
| 115 | 65 AD30 | |
| 116 | 67 AD29 | |
| 117 | 69 AD28 | |
| 118 | 70 /DS2 | |
| 119 | 71 AD27 | |
| 120 | 72 /DS3 | |
| 121 | 74 /CCS | |
| 122 | 75 SD0 (D16) | |
| 123 | 76 AD26 | |
| 124 | 77 SD1 (D17) | |
| 125 | 78 AD25 | |
| 126 | 79 SD2 (D18) | |
| 127 | 80 AD24 | |
| 128 | 81 SD3 (D19) | |
| 129 | 82 SD7 (D23) | |
| 130 | 83 SD4 (D20) | |
| 131 | 84 SD6 (D22) | |
| 132 | 86 SD5 (D21) | |
| 133 | 91 Sense Z3 | |
| 134 | 94 /IORST | |
| 135 | 95 /BCLR | |
| 136 | 97 /FCS | |
| 137 | 98 /DS1 | |
| 138 | ||
| 139 | ||
| 140 | ***************************************************************************/ | |
| 141 | ||
| 142 | #pragma once | |
| 143 | ||
| 144 | #ifndef __ZORRO_H__ | |
| 145 | #define __ZORRO_H__ | |
| 146 | ||
| 147 | #include "emu.h" | |
| 148 | ||
| 149 | ||
| 150 | //************************************************************************** | |
| 151 | // INTERFACE CONFIGURATION MACROS | |
| 152 | //************************************************************************** | |
| 153 | ||
| 154 | #define MCFG_ZORRO_SLOT_ADD(_zorrotag, _tag, _slot_intf, _def_slot) \ | |
| 155 | MCFG_DEVICE_ADD(_tag, ZORRO_SLOT, 0) \ | |
| 156 | MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) \ | |
| 157 | zorro_slot_device::set_zorro_slot(*device, owner, _zorrotag); | |
| 158 | ||
| 159 | // ======================> expansion slot | |
| 160 | ||
| 161 | #define MCFG_EXPANSION_SLOT_ADD(_cputag, _slot_intf, _def_slot) \ | |
| 162 | MCFG_DEVICE_ADD("exp", EXP_SLOT, 0) \ | |
| 163 | zorro_device::set_cputag(*device, _cputag); \ | |
| 164 | MCFG_ZORRO_SLOT_ADD("exp", "slot", _slot_intf, _def_slot) | |
| 165 | ||
| 166 | // callbacks | |
| 167 | #define MCFG_EXPANSION_SLOT_OVR_HANDLER(_devcb) \ | |
| 168 | devcb = &zorro_device::set_ovr_handler(*device, DEVCB_##_devcb); | |
| 169 | ||
| 170 | #define MCFG_EXPANSION_SLOT_INT2_HANDLER(_devcb) \ | |
| 171 | devcb = &zorro_device::set_int2_handler(*device, DEVCB_##_devcb); | |
| 172 | ||
| 173 | #define MCFG_EXPANSION_SLOT_INT6_HANDLER(_devcb) \ | |
| 174 | devcb = &zorro_device::set_int6_handler(*device, DEVCB_##_devcb); | |
| 175 | ||
| 176 | #define MCFG_EXPANSION_SLOT_IPL_HANDLER(_devcb) \ | |
| 177 | devcb = &exp_slot_device::set_ipl_handler(*device, DEVCB_##_devcb); | |
| 178 | ||
| 179 | // ======================> zorro 2 bus | |
| 180 | ||
| 181 | #define MCFG_ZORRO2_ADD(_cputag) \ | |
| 182 | MCFG_DEVICE_ADD("zorrobus", ZORRO2, 0) \ | |
| 183 | zorro_device::set_cputag(*device, _cputag); | |
| 184 | ||
| 185 | #define MCFG_ZORRO2_SLOT_ADD(_tag, _slot_intf, _def_slot) \ | |
| 186 | MCFG_ZORRO_SLOT_ADD("zorrobus", _tag, _slot_intf, _def_slot) | |
| 187 | ||
| 188 | #define MCFG_ZORRO2_OVR_HANDLER(_devcb) \ | |
| 189 | devcb = &zorro_device::set_ovr_handler(*device, DEVCB_##_devcb); | |
| 190 | ||
| 191 | #define MCFG_ZORRO2_INT2_HANDLER(_devcb) \ | |
| 192 | devcb = &zorro_device::set_int2_handler(*device, DEVCB_##_devcb); | |
| 193 | ||
| 194 | #define MCFG_ZORRO2_INT6_HANDLER(_devcb) \ | |
| 195 | devcb = &zorro_device::set_int6_handler(*device, DEVCB_##_devcb); | |
| 196 | ||
| 197 | #define MCFG_ZORRO2_EINT1_HANDLER(_devcb) \ | |
| 198 | devcb = &zorro2_device::set_eint1_handler(*device, DEVCB_##_devcb); | |
| 199 | ||
| 200 | #define MCFG_ZORRO2_EINT4_HANDLER(_devcb) \ | |
| 201 | devcb = &zorro2_device::set_eint4_handler(*device, DEVCB_##_devcb); | |
| 202 | ||
| 203 | #define MCFG_ZORRO2_EINT5_HANDLER(_devcb) \ | |
| 204 | devcb = &zorro2_device::set_eint5_handler(*device, DEVCB_##_devcb); | |
| 205 | ||
| 206 | #define MCFG_ZORRO2_EINT7_HANDLER(_devcb) \ | |
| 207 | devcb = &zorro2_device::set_eint7_handler(*device, DEVCB_##_devcb); | |
| 208 | ||
| 209 | ||
| 210 | //************************************************************************** | |
| 211 | // TYPE DEFINITIONS | |
| 212 | //************************************************************************** | |
| 213 | ||
| 214 | // forward declaration of card interfaces | |
| 215 | class device_zorro_card_interface; | |
| 216 | class device_exp_card_interface; | |
| 217 | class device_zorro2_card_interface; | |
| 218 | ||
| 219 | // ======================> zorro slot device | |
| 220 | ||
| 221 | class zorro_slot_device : public device_t, public device_slot_interface | |
| 222 | { | |
| 223 | public: | |
| 224 | // construction/destruction | |
| 225 | zorro_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 226 | zorro_slot_device(const machine_config &mconfig, device_type type, const char *name, | |
| 227 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 228 | ||
| 229 | // device-level overrides | |
| 230 | virtual void device_start(); | |
| 231 | ||
| 232 | // inline configuration | |
| 233 | static void set_zorro_slot(device_t &device, device_t *owner, const char *zorro_tag); | |
| 234 | ||
| 235 | protected: | |
| 236 | // configuration | |
| 237 | const char *m_zorro_tag; | |
| 238 | }; | |
| 239 | ||
| 240 | // device type definition | |
| 241 | extern const device_type ZORRO_SLOT; | |
| 242 | ||
| 243 | // ======================> base zorro bus device | |
| 244 | ||
| 245 | class zorro_device : public device_t | |
| 246 | { | |
| 247 | public: | |
| 248 | // construction/destruction | |
| 249 | zorro_device(const machine_config &mconfig, device_type type, const char *name, | |
| 250 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 251 | ||
| 252 | // static configuration helpers | |
| 253 | static void set_cputag(device_t &device, const char *tag); | |
| 254 | ||
| 255 | template<class _Object> static devcb_base &set_int2_handler(device_t &device, _Object object) | |
| 256 | { return downcast<zorro_device &>(device).m_int2_handler.set_callback(object); } | |
| 257 | template<class _Object> static devcb_base &set_int6_handler(device_t &device, _Object object) | |
| 258 | { return downcast<zorro_device &>(device).m_int6_handler.set_callback(object); } | |
| 259 | template<class _Object> static devcb_base &set_ovr_handler(device_t &device, _Object object) | |
| 260 | { return downcast<zorro_device &>(device).m_ovr_handler.set_callback(object); } | |
| 261 | ||
| 262 | virtual void add_card(device_zorro_card_interface *card) = 0; | |
| 263 | ||
| 264 | // interface (from slot device) | |
| 265 | virtual DECLARE_WRITE_LINE_MEMBER( cfgout_w ) {}; | |
| 266 | ||
| 267 | DECLARE_WRITE_LINE_MEMBER( int2_w ); | |
| 268 | DECLARE_WRITE_LINE_MEMBER( int6_w ); | |
| 269 | DECLARE_WRITE_LINE_MEMBER( ovr_w ); | |
| 270 | ||
| 271 | // interface (from host) | |
| 272 | virtual void fc_w(int code) = 0; | |
| 273 | ||
| 274 | // access to the host space | |
| 275 | address_space *m_space; | |
| 276 | ||
| 277 | protected: | |
| 278 | // device-level overrides | |
| 279 | virtual void device_start(); | |
| 280 | ||
| 281 | private: | |
| 282 | const char *m_cputag; | |
| 283 | ||
| 284 | devcb_write_line m_ovr_handler; | |
| 285 | devcb_write_line m_int2_handler; | |
| 286 | devcb_write_line m_int6_handler; | |
| 287 | }; | |
| 288 | ||
| 289 | // ======================> expansion slot device | |
| 290 | ||
| 291 | class exp_slot_device : public zorro_device | |
| 292 | { | |
| 293 | public: | |
| 294 | // construction/destruction | |
| 295 | exp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 296 | exp_slot_device(const machine_config &mconfig, device_type type, const char *name, | |
| 297 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 298 | ||
| 299 | template<class _Object> static devcb_base &set_ipl_handler(device_t &device, _Object object) | |
| 300 | { return downcast<exp_slot_device &>(device).m_ipl_handler.set_callback(object); } | |
| 301 | ||
| 302 | // the expansion slot can only have a single card | |
| 303 | virtual void add_card(device_zorro_card_interface *card); | |
| 304 | ||
| 305 | // interface (from slot device) | |
| 306 | void ipl_w(int interrupt); | |
| 307 | ||
| 308 | // interface (from host) | |
| 309 | virtual void fc_w(int code); | |
| 310 | ||
| 311 | protected: | |
| 312 | // device-level overrides | |
| 313 | virtual void device_start(); | |
| 314 | ||
| 315 | private: | |
| 316 | devcb_write8 m_ipl_handler; | |
| 317 | ||
| 318 | device_exp_card_interface *m_dev; | |
| 319 | }; | |
| 320 | ||
| 321 | // device type definition | |
| 322 | extern const device_type EXP_SLOT; | |
| 323 | ||
| 324 | // ======================> zorro2 slot device | |
| 325 | ||
| 326 | class zorro2_device : public zorro_device | |
| 327 | { | |
| 328 | public: | |
| 329 | // construction/destruction | |
| 330 | zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 331 | zorro2_device(const machine_config &mconfig, device_type type, const char *name, | |
| 332 | const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); | |
| 333 | ~zorro2_device(); | |
| 334 | ||
| 335 | template<class _Object> static devcb_base &set_eint1_handler(device_t &device, _Object object) | |
| 336 | { return downcast<zorro2_device &>(device).m_eint1_handler.set_callback(object); } | |
| 337 | template<class _Object> static devcb_base &set_eint4_handler(device_t &device, _Object object) | |
| 338 | { return downcast<zorro2_device &>(device).m_eint4_handler.set_callback(object); } | |
| 339 | template<class _Object> static devcb_base &set_eint5_handler(device_t &device, _Object object) | |
| 340 | { return downcast<zorro2_device &>(device).m_eint5_handler.set_callback(object); } | |
| 341 | template<class _Object> static devcb_base &set_eint7_handler(device_t &device, _Object object) | |
| 342 | { return downcast<zorro2_device &>(device).m_eint7_handler.set_callback(object); } | |
| 343 | ||
| 344 | // device-level overrides | |
| 345 | virtual void device_reset(); | |
| 346 | ||
| 347 | // the zorro2 bus supports multiple cards | |
| 348 | virtual void add_card(device_zorro_card_interface *card); | |
| 349 | ||
| 350 | // interface (from slot device) | |
| 351 | virtual DECLARE_WRITE_LINE_MEMBER( cfgout_w ); | |
| 352 | ||
| 353 | DECLARE_WRITE_LINE_MEMBER( eint1_w ); | |
| 354 | DECLARE_WRITE_LINE_MEMBER( eint4_w ); | |
| 355 | DECLARE_WRITE_LINE_MEMBER( eint5_w ); | |
| 356 | DECLARE_WRITE_LINE_MEMBER( eint7_w ); | |
| 357 | ||
| 358 | // interface (from host) | |
| 359 | virtual void fc_w(int code); | |
| 360 | ||
| 361 | protected: | |
| 362 | // device-level overrides | |
| 363 | virtual void device_start(); | |
| 364 | ||
| 365 | private: | |
| 366 | devcb_write_line m_eint1_handler; | |
| 367 | devcb_write_line m_eint4_handler; | |
| 368 | devcb_write_line m_eint5_handler; | |
| 369 | devcb_write_line m_eint7_handler; | |
| 370 | ||
| 371 | simple_list<device_zorro2_card_interface> m_dev; | |
| 372 | ||
| 373 | // the device which is currently configuring | |
| 374 | device_zorro2_card_interface *m_autoconfig_device; | |
| 375 | }; | |
| 376 | ||
| 377 | // device type definition | |
| 378 | extern const device_type ZORRO2; | |
| 379 | ||
| 380 | ||
| 381 | // ======================> base zorro card interface | |
| 382 | ||
| 383 | class device_zorro_card_interface : public device_slot_card_interface | |
| 384 | { | |
| 385 | public: | |
| 386 | // construction/destruction | |
| 387 | device_zorro_card_interface(const machine_config &mconfig, device_t &device); | |
| 388 | virtual ~device_zorro_card_interface(); | |
| 389 | ||
| 390 | virtual void set_zorro_device() = 0; | |
| 391 | ||
| 392 | void set_zorro_bus(zorro_device *device); | |
| 393 | ||
| 394 | // interface (from device) | |
| 395 | void cfgout_w(int state) { m_zorro->cfgout_w(state); } | |
| 396 | ||
| 397 | // interface (from host) | |
| 398 | virtual void fc_w(int code); | |
| 399 | virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); | |
| 400 | ||
| 401 | protected: | |
| 402 | zorro_device *m_zorro; | |
| 403 | }; | |
| 404 | ||
| 405 | // ======================> expansion slot card interface | |
| 406 | ||
| 407 | class device_exp_card_interface : public device_zorro_card_interface | |
| 408 | { | |
| 409 | public: | |
| 410 | // construction/destruction | |
| 411 | device_exp_card_interface(const machine_config &mconfig, device_t &device); | |
| 412 | virtual ~device_exp_card_interface(); | |
| 413 | ||
| 414 | virtual void set_zorro_device(); | |
| 415 | ||
| 416 | protected: | |
| 417 | exp_slot_device *m_slot; | |
| 418 | }; | |
| 419 | ||
| 420 | // ======================> zorro2 card interface | |
| 421 | ||
| 422 | class device_zorro2_card_interface : public device_zorro_card_interface | |
| 423 | { | |
| 424 | public: | |
| 425 | // construction/destruction | |
| 426 | device_zorro2_card_interface(const machine_config &mconfig, device_t &device); | |
| 427 | virtual ~device_zorro2_card_interface(); | |
| 428 | ||
| 429 | virtual void set_zorro_device(); | |
| 430 | ||
| 431 | device_zorro2_card_interface *next() const { return m_next; } | |
| 432 | device_zorro2_card_interface *m_next; | |
| 433 | ||
| 434 | protected: | |
| 435 | zorro2_device *m_slot; | |
| 436 | }; | |
| 437 | ||
| 438 | ||
| 439 | // include this here so that you don't need to include it into every | |
| 440 | // driver that uses zorro slots | |
| 441 | #include "cards.h" | |
| 442 | ||
| 443 | ||
| 444 | #endif // __ZORRO_H__ |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Amiga Zorro Cards | |
| 4 | ||
| 5 | There are different card types and layouts: | |
| 6 | ||
| 7 | * 86-pin expansion slot | |
| 8 | - A1000 | |
| 9 | - A500 (rotated slot) | |
| 10 | - A2000/B2000 (internal slot) | |
| 11 | * Zorro-II | |
| 12 | - A2000 | |
| 13 | - B2000 | |
| 14 | * Zorro-III | |
| 15 | - A3000, A4000 | |
| 16 | ||
| 17 | For details see zorro.h. Zorro-II cards can be inserted into | |
| 18 | Zorro-III slots. | |
| 19 | ||
| 20 | ***************************************************************************/ | |
| 21 | ||
| 22 | #pragma once | |
| 23 | ||
| 24 | #ifndef __CARDS_H__ | |
| 25 | #define __CARDS_H__ | |
| 26 | ||
| 27 | #include "emu.h" | |
| 28 | ||
| 29 | #include "a2052.h" | |
| 30 | #include "a2232.h" | |
| 31 | #include "a590.h" | |
| 32 | #include "action_replay.h" | |
| 33 | #include "buddha.h" | |
| 34 | ||
| 35 | SLOT_INTERFACE_EXTERN( a1000_expansion_cards ); | |
| 36 | SLOT_INTERFACE_EXTERN( a500_expansion_cards ); | |
| 37 | SLOT_INTERFACE_EXTERN( a2000_expansion_cards ); | |
| 38 | ||
| 39 | SLOT_INTERFACE_EXTERN( zorro2_cards ); | |
| 40 | SLOT_INTERFACE_EXTERN( zorro3_cards ); | |
| 41 | ||
| 42 | #endif // __CARDS_H__ |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Commodore A590 / A2091 | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | DMAC based SCSI controller for the Amiga 500 and Zorro-II | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #pragma once | |
| 13 | ||
| 14 | #ifndef __A590_H__ | |
| 15 | #define __A590_H__ | |
| 16 | ||
| 17 | #include "emu.h" | |
| 18 | #include "zorro.h" | |
| 19 | #include "machine/dmac.h" | |
| 20 | #include "machine/wd33c93.h" | |
| 21 | ||
| 22 | ||
| 23 | //************************************************************************** | |
| 24 | // TYPE DEFINITIONS | |
| 25 | //************************************************************************** | |
| 26 | ||
| 27 | // ======================> dmac_hdc_device | |
| 28 | ||
| 29 | class dmac_hdc_device : public device_t | |
| 30 | { | |
| 31 | public: | |
| 32 | // construction/destruction | |
| 33 | dmac_hdc_device(const machine_config &mconfig, device_type type, const char *tag, | |
| 34 | device_t *owner, UINT32 clock, const char *name, const char *shortname); | |
| 35 | ||
| 36 | // optional information overrides | |
| 37 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 38 | virtual const rom_entry *device_rom_region() const; | |
| 39 | ||
| 40 | DECLARE_READ8_MEMBER( dmac_scsi_r ); | |
| 41 | DECLARE_WRITE8_MEMBER( dmac_scsi_w ); | |
| 42 | DECLARE_WRITE_LINE_MEMBER( dmac_int_w ); | |
| 43 | DECLARE_WRITE_LINE_MEMBER( dmac_cfgout_w ) { cfgout_w(state); } | |
| 44 | DECLARE_WRITE_LINE_MEMBER( scsi_irq_w ); | |
| 45 | ||
| 46 | protected: | |
| 47 | // device-level overrides | |
| 48 | virtual void device_start(); | |
| 49 | virtual void device_reset(); | |
| 50 | ||
| 51 | // to slot | |
| 52 | virtual void cfgout_w(int state) = 0; | |
| 53 | virtual void int2_w(int state) = 0; | |
| 54 | virtual void int6_w(int state) = 0; | |
| 55 | ||
| 56 | // should be called when the ram size changes | |
| 57 | void resize_ram(int config); | |
| 58 | ||
| 59 | // amiga interrupt target, int 2 or 6 | |
| 60 | bool m_int6; | |
| 61 | ||
| 62 | // sub-devices | |
| 63 | required_device<dmac_device> m_dmac; | |
| 64 | required_device<wd33c93_device> m_wdc; | |
| 65 | ||
| 66 | dynamic_buffer m_ram; | |
| 67 | }; | |
| 68 | ||
| 69 | // ======================> a590_device | |
| 70 | ||
| 71 | class a590_device : public dmac_hdc_device, public device_exp_card_interface | |
| 72 | { | |
| 73 | public: | |
| 74 | // construction/destruction | |
| 75 | a590_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 76 | ||
| 77 | protected: | |
| 78 | // device-level overrides | |
| 79 | virtual void device_start(); | |
| 80 | virtual void device_reset(); | |
| 81 | ||
| 82 | // optional information overrides | |
| 83 | virtual ioport_constructor device_input_ports() const; | |
| 84 | ||
| 85 | // output to slot | |
| 86 | virtual void cfgout_w(int state) { m_slot->cfgout_w(state); } | |
| 87 | virtual void int2_w(int state) { m_slot->int2_w(state); } | |
| 88 | virtual void int6_w(int state) { m_slot->int6_w(state); } | |
| 89 | ||
| 90 | // input from slot | |
| 91 | virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); | |
| 92 | ||
| 93 | private: | |
| 94 | required_ioport m_dips; | |
| 95 | required_ioport m_jp1; | |
| 96 | required_ioport m_jp2; | |
| 97 | required_ioport m_jp4; | |
| 98 | }; | |
| 99 | ||
| 100 | // ======================> a2091_device | |
| 101 | ||
| 102 | class a2091_device : public dmac_hdc_device, public device_zorro2_card_interface | |
| 103 | { | |
| 104 | public: | |
| 105 | // construction/destruction | |
| 106 | a2091_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 107 | ||
| 108 | // device-level overrides | |
| 109 | virtual void device_start(); | |
| 110 | virtual void device_reset(); | |
| 111 | ||
| 112 | // optional information overrides | |
| 113 | virtual ioport_constructor device_input_ports() const; | |
| 114 | ||
| 115 | // output to slot | |
| 116 | virtual void cfgout_w(int state) { m_slot->cfgout_w(state); } | |
| 117 | virtual void int2_w(int state) { m_slot->int2_w(state); } | |
| 118 | virtual void int6_w(int state) { m_slot->int6_w(state); } | |
| 119 | ||
| 120 | // input from slot | |
| 121 | virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); | |
| 122 | ||
| 123 | private: | |
| 124 | required_ioport m_jp1; | |
| 125 | required_ioport m_jp2; | |
| 126 | required_ioport m_jp3; | |
| 127 | required_ioport m_jp5; | |
| 128 | required_ioport m_jp201; | |
| 129 | }; | |
| 130 | ||
| 131 | // device type definition | |
| 132 | extern const device_type A590; | |
| 133 | extern const device_type A2091; | |
| 134 | ||
| 135 | #endif |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r0 | r30651 | |
|---|---|---|
| 1 | /*************************************************************************** | |
| 2 | ||
| 3 | Buddha | |
| 4 | ||
| 5 | license: MAME, GPL-2.0+ | |
| 6 | copyright-holders: Dirk Best | |
| 7 | ||
| 8 | Zorro-II IDE controller | |
| 9 | ||
| 10 | ***************************************************************************/ | |
| 11 | ||
| 12 | #include "buddha.h" | |
| 13 | ||
| 14 | //************************************************************************** | |
| 15 | // CONSTANTS / MACROS | |
| 16 | //************************************************************************** | |
| 17 | ||
| 18 | #define VERBOSE 1 | |
| 19 | ||
| 20 | ||
| 21 | //************************************************************************** | |
| 22 | // DEVICE DEFINITIONS | |
| 23 | //************************************************************************** | |
| 24 | ||
| 25 | const device_type BUDDHA = &device_creator<buddha_device>; | |
| 26 | ||
| 27 | //------------------------------------------------- | |
| 28 | // machine_config_additions - device-specific | |
| 29 | // machine configurations | |
| 30 | //------------------------------------------------- | |
| 31 | ||
| 32 | static MACHINE_CONFIG_FRAGMENT( buddha ) | |
| 33 | MCFG_ATA_INTERFACE_ADD("ata_0", ata_devices, NULL, NULL, false) | |
| 34 | MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(buddha_device, ide_0_interrupt_w)) | |
| 35 | MCFG_ATA_INTERFACE_ADD("ata_1", ata_devices, NULL, NULL, false) | |
| 36 | MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(buddha_device, ide_1_interrupt_w)) | |
| 37 | MACHINE_CONFIG_END | |
| 38 | ||
| 39 | machine_config_constructor buddha_device::device_mconfig_additions() const | |
| 40 | { | |
| 41 | return MACHINE_CONFIG_NAME( buddha ); | |
| 42 | } | |
| 43 | ||
| 44 | //------------------------------------------------- | |
| 45 | // rom_region - device-specific ROM region | |
| 46 | //------------------------------------------------- | |
| 47 | ||
| 48 | ROM_START( buddha ) | |
| 49 | ROM_REGION16_BE(0x10000, "bootrom", 0) | |
| 50 | ROM_DEFAULT_BIOS("v103-17") | |
| 51 | ROM_SYSTEM_BIOS(0, "v103-8", "Version 103.8") | |
| 52 | ROMX_LOAD("buddha_103-8.rom", 0x0000, 0x8000, CRC(44f81426) SHA1(95555c6690b5c697e1cdca2726e47c1c6c194d7c), ROM_SKIP(1) | ROM_BIOS(1)) | |
| 53 | ROM_SYSTEM_BIOS(1, "v103-17", "Version 103.17") | |
| 54 | ROMX_LOAD("buddha_103-17.rom", 0x0000, 0x8000, CRC(2b7b24e0) SHA1(ec17a58962c373a2892090ec9b1722d2c326d631), ROM_SKIP(1) | ROM_BIOS(2)) | |
| 55 | ROM_END | |
| 56 | ||
| 57 | const rom_entry *buddha_device::device_rom_region() const | |
| 58 | { | |
| 59 | return ROM_NAME( buddha ); | |
| 60 | } | |
| 61 | ||
| 62 | ||
| 63 | //************************************************************************** | |
| 64 | // LIVE DEVICE | |
| 65 | //************************************************************************** | |
| 66 | ||
| 67 | //------------------------------------------------- | |
| 68 | // buddha_device - constructor | |
| 69 | //------------------------------------------------- | |
| 70 | ||
| 71 | buddha_device::buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : | |
| 72 | device_t(mconfig, BUDDHA, "Buddha IDE controller", tag, owner, clock, "buddha", __FILE__), | |
| 73 | device_zorro2_card_interface(mconfig, *this), | |
| 74 | m_ata_0(*this, "ata_0"), | |
| 75 | m_ata_1(*this, "ata_1"), | |
| 76 | m_ide_interrupts_enabled(false), | |
| 77 | m_ide_0_interrupt(0), | |
| 78 | m_ide_1_interrupt(0) | |
| 79 | { | |
| 80 | } | |
| 81 | ||
| 82 | //------------------------------------------------- | |
| 83 | // device_start - device-specific startup | |
| 84 | //------------------------------------------------- | |
| 85 | ||
| 86 | void buddha_device::device_start() | |
| 87 | { | |
| 88 | set_zorro_device(); | |
| 89 | } | |
| 90 | ||
| 91 | //------------------------------------------------- | |
| 92 | // device_reset - device-specific reset | |
| 93 | //------------------------------------------------- | |
| 94 | ||
| 95 | void buddha_device::device_reset() | |
| 96 | { | |
| 97 | } | |
| 98 | ||
| 99 | ||
| 100 | //************************************************************************** | |
| 101 | // IMPLEMENTATION | |
| 102 | //************************************************************************** | |
| 103 | ||
| 104 | void buddha_device::autoconfig_base_address(offs_t address) | |
| 105 | { | |
| 106 | if (VERBOSE) | |
| 107 | logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address); | |
| 108 | ||
| 109 | if (VERBOSE) | |
| 110 | logerror("-> installing buddha\n"); | |
| 111 | ||
| 112 | // stop responding to default autoconfig | |
| 113 | m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f); | |
| 114 | ||
| 115 | // install autoconfig handler to new location | |
| 116 | m_slot->m_space->install_readwrite_handler(address, address + 0x7f, | |
| 117 | read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast<amiga_autoconfig *>(this)), | |
| 118 | write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast<amiga_autoconfig *>(this)), 0xffff); | |
| 119 | ||
| 120 | // buddha registers | |
| 121 | m_slot->m_space->install_readwrite_handler(address + 0x7fe, address + 0x7ff, | |
| 122 | read16_delegate(FUNC(buddha_device::speed_r), this), | |
| 123 | write16_delegate(FUNC(buddha_device::speed_w), this), 0xffff); | |
| 124 | ||
| 125 | m_slot->m_space->install_readwrite_handler(address + 0x800, address + 0x8ff, | |
| 126 | read16_delegate(FUNC(buddha_device::ide_0_cs0_r), this), | |
| 127 | write16_delegate(FUNC(buddha_device::ide_0_cs0_w), this), 0xffff); | |
| 128 | ||
| 129 | m_slot->m_space->install_readwrite_handler(address + 0x900, address + 0x9ff, | |
| 130 | read16_delegate(FUNC(buddha_device::ide_0_cs1_r), this), | |
| 131 | write16_delegate(FUNC(buddha_device::ide_0_cs1_w), this), 0xffff); | |
| 132 | ||
| 133 | m_slot->m_space->install_readwrite_handler(address + 0xa00, address + 0xaff, | |
| 134 | read16_delegate(FUNC(buddha_device::ide_0_cs0_r), this), | |
| 135 | write16_delegate(FUNC(buddha_device::ide_0_cs0_w), this), 0xffff); | |
| 136 | ||
| 137 | m_slot->m_space->install_readwrite_handler(address + 0xb00, address + 0xbff, | |
| 138 | read16_delegate(FUNC(buddha_device::ide_0_cs1_r), this), | |
| 139 | write16_delegate(FUNC(buddha_device::ide_0_cs1_w), this), 0xffff); | |
| 140 | ||
| 141 | m_slot->m_space->install_read_handler(address + 0xf00, address + 0xf3f, | |
| 142 | read16_delegate(FUNC(buddha_device::ide_0_interrupt_r), this), 0xffff); | |
| 143 | ||
| 144 | m_slot->m_space->install_read_handler(address + 0xf40, address + 0xf7f, | |
| 145 | read16_delegate(FUNC(buddha_device::ide_1_interrupt_r), this), 0xffff); | |
| 146 | ||
| 147 | m_slot->m_space->install_write_handler(address + 0xfc0, address + 0xfff, | |
| 148 | write16_delegate(FUNC(buddha_device::ide_interrupt_enable_w), this), 0xffff); | |
| 149 | ||
| 150 | // install access to the rom space | |
| 151 | m_slot->m_space->install_rom(address + 0x1000, address + 0xffff, memregion("bootrom")->base() + 0x1000); | |
| 152 | ||
| 153 | // we're done | |
| 154 | m_slot->cfgout_w(0); | |
| 155 | } | |
| 156 | ||
| 157 | WRITE_LINE_MEMBER( buddha_device::cfgin_w ) | |
| 158 | { | |
| 159 | if (VERBOSE) | |
| 160 | logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state); | |
| 161 | ||
| 162 | if (state == 0) | |
| 163 | { | |
| 164 | // setup autoconfig | |
| 165 | autoconfig_board_type(BOARD_TYPE_ZORRO2); | |
| 166 | autoconfig_board_size(BOARD_SIZE_64K); | |
| 167 | autoconfig_link_into_memory(false); | |
| 168 | autoconfig_rom_vector_valid(true); | |
| 169 | autoconfig_multi_device(false); | |
| 170 | autoconfig_8meg_preferred(false); | |
| 171 | autoconfig_can_shutup(true); | |
| 172 | autoconfig_product(0x00); | |
| 173 | autoconfig_manufacturer(0x1212); | |
| 174 | autoconfig_serial(0x00000000); | |
| 175 | autoconfig_rom_vector(0x1000); | |
| 176 | ||
| 177 | // install autoconfig handler | |
| 178 | m_slot->m_space->install_readwrite_handler(0xe80000, 0xe8007f, | |
| 179 | read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast<amiga_autoconfig *>(this)), | |
| 180 | write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast<amiga_autoconfig *>(this)), 0xffff); | |
| 181 | } | |
| 182 | } | |
| 183 | ||
| 184 | READ16_MEMBER( buddha_device::speed_r ) | |
| 185 | { | |
| 186 | UINT16 data = 0xffff; | |
| 187 | ||
| 188 | if (VERBOSE) | |
| 189 | logerror("%s('%s'): ide_0_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 190 | ||
| 191 | return data; | |
| 192 | } | |
| 193 | ||
| 194 | WRITE16_MEMBER( buddha_device::speed_w ) | |
| 195 | { | |
| 196 | if (VERBOSE) | |
| 197 | logerror("%s('%s'): speed_w %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 198 | } | |
| 199 | ||
| 200 | WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w) | |
| 201 | { | |
| 202 | if (VERBOSE) | |
| 203 | logerror("%s('%s'): ide_0_interrupt_w (%d)\n", shortname(), basetag(), state); | |
| 204 | ||
| 205 | m_ide_0_interrupt = state; | |
| 206 | ||
| 207 | if (m_ide_interrupts_enabled) | |
| 208 | m_slot->int2_w(state); | |
| 209 | } | |
| 210 | ||
| 211 | WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w) | |
| 212 | { | |
| 213 | if (VERBOSE) | |
| 214 | logerror("%s('%s'): ide_1_interrupt_w (%d)\n", shortname(), basetag(), state); | |
| 215 | ||
| 216 | m_ide_1_interrupt = state; | |
| 217 | ||
| 218 | if (m_ide_interrupts_enabled) | |
| 219 | m_slot->int2_w(state); | |
| 220 | } | |
| 221 | ||
| 222 | READ16_MEMBER( buddha_device::ide_0_interrupt_r ) | |
| 223 | { | |
| 224 | UINT16 data = 0xffff; | |
| 225 | ||
| 226 | data = m_ide_0_interrupt << 15; | |
| 227 | ||
| 228 | if (VERBOSE) | |
| 229 | logerror("%s('%s'): ide_0_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 230 | ||
| 231 | logerror("%s\n", device().machine().describe_context()); | |
| 232 | ||
| 233 | return data; | |
| 234 | } | |
| 235 | ||
| 236 | READ16_MEMBER( buddha_device::ide_1_interrupt_r ) | |
| 237 | { | |
| 238 | UINT16 data = 0xffff; | |
| 239 | ||
| 240 | data = m_ide_1_interrupt << 15; | |
| 241 | ||
| 242 | if (VERBOSE) | |
| 243 | logerror("%s('%s'): ide_1_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 244 | ||
| 245 | return data; | |
| 246 | } | |
| 247 | ||
| 248 | WRITE16_MEMBER( buddha_device::ide_interrupt_enable_w ) | |
| 249 | { | |
| 250 | if (VERBOSE) | |
| 251 | logerror("%s('%s'): ide_interrupt_enable_w %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); | |
| 252 | ||
| 253 | // writing any value here enables ide interrupts to the zorro slot | |
| 254 | m_ide_interrupts_enabled = true; | |
| 255 | } | |
| 256 | ||
| 257 | READ16_MEMBER( buddha_device::ide_0_cs0_r ) | |
| 258 | { | |
| 259 | UINT16 data = 0xffff; | |
| 260 | ||
| 261 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 262 | data = m_ata_0->read_cs0(space, (offset >> 1) & 0x07, mem_mask); | |
| 263 | ||
| 264 | if (VERBOSE) | |
| 265 | logerror("%s('%s'): ide_0_cs0_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 266 | ||
| 267 | return (data << 8) | (data >> 8); | |
| 268 | } | |
| 269 | ||
| 270 | WRITE16_MEMBER( buddha_device::ide_0_cs0_w ) | |
| 271 | { | |
| 272 | if (VERBOSE) | |
| 273 | logerror("%s('%s'): ide_0_cs0_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 274 | ||
| 275 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 276 | data = (data << 8) | (data >> 8); | |
| 277 | ||
| 278 | m_ata_0->write_cs0(space, (offset >> 1) & 0x07, data, mem_mask); | |
| 279 | } | |
| 280 | ||
| 281 | READ16_MEMBER( buddha_device::ide_0_cs1_r ) | |
| 282 | { | |
| 283 | UINT16 data = 0xffff; | |
| 284 | ||
| 285 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 286 | data = m_ata_0->read_cs1(space, (offset >> 1) & 0x07, mem_mask); | |
| 287 | ||
| 288 | if (VERBOSE) | |
| 289 | logerror("%s('%s'): ide_0_cs1_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 290 | ||
| 291 | return (data << 8) | (data >> 8); | |
| 292 | } | |
| 293 | ||
| 294 | WRITE16_MEMBER( buddha_device::ide_0_cs1_w ) | |
| 295 | { | |
| 296 | if (VERBOSE) | |
| 297 | logerror("%s('%s'): ide_0_cs1_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 298 | ||
| 299 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 300 | data = (data << 8) | (data >> 8); | |
| 301 | ||
| 302 | m_ata_0->write_cs1(space, (offset >> 1) & 0x07, data, mem_mask); | |
| 303 | } | |
| 304 | ||
| 305 | READ16_MEMBER( buddha_device::ide_1_cs0_r ) | |
| 306 | { | |
| 307 | UINT16 data = 0xffff; | |
| 308 | ||
| 309 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 310 | data = m_ata_1->read_cs0(space, (offset >> 1) & 0x07, mem_mask); | |
| 311 | ||
| 312 | if (VERBOSE) | |
| 313 | logerror("%s('%s'): ide_1_cs0_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 314 | ||
| 315 | return (data << 8) | (data >> 8); | |
| 316 | } | |
| 317 | ||
| 318 | WRITE16_MEMBER( buddha_device::ide_1_cs0_w ) | |
| 319 | { | |
| 320 | if (VERBOSE) | |
| 321 | logerror("%s('%s'): ide_1_cs0_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 322 | ||
| 323 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 324 | data = (data << 8) | (data >> 8); | |
| 325 | ||
| 326 | m_ata_1->write_cs0(space, (offset >> 1) & 0x07, data, mem_mask); | |
| 327 | } | |
| 328 | ||
| 329 | READ16_MEMBER( buddha_device::ide_1_cs1_r ) | |
| 330 | { | |
| 331 | UINT16 data = 0xffff; | |
| 332 | ||
| 333 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 334 | data = m_ata_1->read_cs1(space, (offset >> 1) & 0x07, mem_mask); | |
| 335 | ||
| 336 | if (VERBOSE) | |
| 337 | logerror("%s('%s'): ide_1_cs1_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 338 | ||
| 339 | return (data << 8) | (data >> 8); | |
| 340 | } | |
| 341 | ||
| 342 | WRITE16_MEMBER( buddha_device::ide_1_cs1_w ) | |
| 343 | { | |
| 344 | if (VERBOSE) | |
| 345 | logerror("%s('%s'): ide_1_cs1_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); | |
| 346 | ||
| 347 | mem_mask = (mem_mask << 8) | (mem_mask >> 8); | |
| 348 | data = (data << 8) | (data >> 8); | |
| 349 | ||
| 350 | m_ata_1->write_cs1(space, (offset >> 1) & 0x07, data, mem_mask); | |
| 351 | } |
| Added: svn:mime-type + text/plain Added: svn:eol-style + native |
| r30650 | r30651 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| 11 | 11 | #include "includes/amiga.h" |
| 12 | #include "bus/zorro/zorro.h" | |
| 12 | #include "bus/amiga/zorro/zorro.h" | |
| 13 | 13 | #include "cpu/m68000/m68000.h" |
| 14 | 14 | #include "cpu/m6502/m6502.h" |
| 15 | 15 | #include "machine/bankdev.h" |
| Previous | 199869 Revisions | Next |