From 3dbb81e4f8c6379a80775683323d9341eaab4ddd Mon Sep 17 00:00:00 2001 From: Dirk Best Date: Tue, 20 May 2014 15:32:17 +0000 Subject: [PATCH] Amiga: Fix some Zorro slot bugs. Add the Commodore A2052 Zorro-II card as an example for a basic memory expansion. Add the Buddha IDE controller Zorro-II card (not working yet though). --- .gitattributes | 4 + src/emu/bus/bus.mak | 2 + src/emu/bus/zorro/a2052.c | 135 ++++++++++++++ src/emu/bus/zorro/a2052.h | 52 ++++++ src/emu/bus/zorro/buddha.c | 351 +++++++++++++++++++++++++++++++++++++ src/emu/bus/zorro/buddha.h | 83 +++++++++ src/emu/bus/zorro/cards.c | 4 + src/emu/bus/zorro/cards.h | 3 + src/emu/bus/zorro/zorro.c | 9 + src/emu/bus/zorro/zorro.h | 1 + src/mame/includes/amiga.h | 12 +- src/mame/machine/amiga.c | 14 +- src/mess/drivers/amiga.c | 16 +- 13 files changed, 666 insertions(+), 20 deletions(-) create mode 100644 src/emu/bus/zorro/a2052.c create mode 100644 src/emu/bus/zorro/a2052.h create mode 100644 src/emu/bus/zorro/buddha.c create mode 100644 src/emu/bus/zorro/buddha.h diff --git a/.gitattributes b/.gitattributes index 9bc687014db..f9586d1a9f6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1473,10 +1473,14 @@ src/emu/bus/z88/rom.c svneol=native#text/plain src/emu/bus/z88/rom.h svneol=native#text/plain src/emu/bus/z88/z88.c svneol=native#text/plain src/emu/bus/z88/z88.h svneol=native#text/plain +src/emu/bus/zorro/a2052.c svneol=native#text/plain +src/emu/bus/zorro/a2052.h svneol=native#text/plain src/emu/bus/zorro/a590.c svneol=native#text/plain src/emu/bus/zorro/a590.h svneol=native#text/plain src/emu/bus/zorro/action_replay.c svneol=native#text/plain src/emu/bus/zorro/action_replay.h svneol=native#text/plain +src/emu/bus/zorro/buddha.c svneol=native#text/plain +src/emu/bus/zorro/buddha.h svneol=native#text/plain src/emu/bus/zorro/cards.c svneol=native#text/plain src/emu/bus/zorro/cards.h svneol=native#text/plain src/emu/bus/zorro/zorro.c svneol=native#text/plain diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index 2890bb2ffb1..a0403473b6d 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -1125,6 +1125,8 @@ ifneq ($(filter ZORRO,$(BUSES)),) OBJDIRS += $(BUSOBJ)/zorro BUSOBJS += $(BUSOBJ)/zorro/zorro.o BUSOBJS += $(BUSOBJ)/zorro/cards.o +BUSOBJS += $(BUSOBJ)/zorro/a2052.o BUSOBJS += $(BUSOBJ)/zorro/a590.o BUSOBJS += $(BUSOBJ)/zorro/action_replay.o +BUSOBJS += $(BUSOBJ)/zorro/buddha.o endif diff --git a/src/emu/bus/zorro/a2052.c b/src/emu/bus/zorro/a2052.c new file mode 100644 index 00000000000..fb11c214407 --- /dev/null +++ b/src/emu/bus/zorro/a2052.c @@ -0,0 +1,135 @@ +/*************************************************************************** + + Commodore A2052 + + license: MAME, GPL-2.0+ + copyright-holders: Dirk Best + + Zorro-II RAM Expansion (0.5, 1 or 2 MB) + +***************************************************************************/ + +#include "a2052.h" + + +//************************************************************************** +// CONSTANTS / MACROS +//************************************************************************** + +#define VERBOSE 1 + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type A2052 = &device_creator; + +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( a2052 ) + PORT_START("config") + PORT_CONFNAME(0x03, 0x02, "A2052 Installed RAM") + PORT_CONFSETTING(0x00, "512 KB") + PORT_CONFSETTING(0x01, "1 MB") + PORT_CONFSETTING(0x02, "2 MB") +INPUT_PORTS_END + +ioport_constructor a2052_device::device_input_ports() const +{ + return INPUT_PORTS_NAME( a2052 ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// a2052_device - constructor +//------------------------------------------------- + +a2052_device::a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, A2052, "A2052 ", tag, owner, clock, "a2052", __FILE__), + device_zorro2_card_interface(mconfig, *this), + m_config(*this, "config") +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void a2052_device::device_start() +{ + set_zorro_device(); +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +void a2052_device::autoconfig_base_address(offs_t address) +{ + if (VERBOSE) + logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address); + + if (VERBOSE) + logerror("-> installing a2052\n"); + + // stop responding to default autoconfig + m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f); + + // install access to the rom space + m_slot->m_space->install_ram(address, address + m_ram.bytes() - 1, m_ram); + + // we're done + m_slot->cfgout_w(0); +} + +WRITE_LINE_MEMBER( a2052_device::cfgin_w ) +{ + if (VERBOSE) + logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state); + + if (state == 0) + { + // setup autoconfig + autoconfig_board_type(BOARD_TYPE_ZORRO2); + + // setup ram + switch (m_config->read()) + { + case 0: + autoconfig_board_size(BOARD_SIZE_512K); + m_ram.resize(0x080000/2); + break; + case 1: + autoconfig_board_size(BOARD_SIZE_1M); + m_ram.resize(0x100000/2); + break; + case 2: + autoconfig_board_size(BOARD_SIZE_2M); + m_ram.resize(0x200000/2); + break; + } + + autoconfig_product(0x0a); + autoconfig_manufacturer(0x0202); + autoconfig_serial(0x00000000); + + autoconfig_link_into_memory(true); + autoconfig_rom_vector_valid(false); + autoconfig_multi_device(false); + autoconfig_8meg_preferred(false); + autoconfig_can_shutup(true); // ? + + // install autoconfig handler + m_slot->m_space->install_readwrite_handler(0xe80000, 0xe8007f, + read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast(this)), + write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast(this)), 0xffff); + } +} diff --git a/src/emu/bus/zorro/a2052.h b/src/emu/bus/zorro/a2052.h new file mode 100644 index 00000000000..4ba55e94342 --- /dev/null +++ b/src/emu/bus/zorro/a2052.h @@ -0,0 +1,52 @@ +/*************************************************************************** + + Commodore A2052 + + license: MAME, GPL-2.0+ + copyright-holders: Dirk Best + + Zorro-II RAM Expansion (0.5, 1 or 2 MB) + +***************************************************************************/ + +#pragma once + +#ifndef __A2052_H__ +#define __A2052_H__ + +#include "emu.h" +#include "zorro.h" +#include "machine/autoconfig.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> a2052_device + +class a2052_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig +{ +public: + // construction/destruction + a2052_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + +protected: + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + + // device_zorro2_card_interface overrides + virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); + + // amiga_autoconfig overrides + virtual void autoconfig_base_address(offs_t address); + +private: + required_ioport m_config; + dynamic_array m_ram; +}; + +// device type definition +extern const device_type A2052; + +#endif diff --git a/src/emu/bus/zorro/buddha.c b/src/emu/bus/zorro/buddha.c new file mode 100644 index 00000000000..98f49346481 --- /dev/null +++ b/src/emu/bus/zorro/buddha.c @@ -0,0 +1,351 @@ +/*************************************************************************** + + Buddha + + license: MAME, GPL-2.0+ + copyright-holders: Dirk Best + + Zorro-II IDE controller + +***************************************************************************/ + +#include "buddha.h" + +//************************************************************************** +// CONSTANTS / MACROS +//************************************************************************** + +#define VERBOSE 1 + + +//************************************************************************** +// DEVICE DEFINITIONS +//************************************************************************** + +const device_type BUDDHA = &device_creator; + +//------------------------------------------------- +// machine_config_additions - device-specific +// machine configurations +//------------------------------------------------- + +static MACHINE_CONFIG_FRAGMENT( buddha ) + MCFG_ATA_INTERFACE_ADD("ata_0", ata_devices, NULL, NULL, false) + MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(buddha_device, ide_0_interrupt_w)) + MCFG_ATA_INTERFACE_ADD("ata_1", ata_devices, NULL, NULL, false) + MCFG_ATA_INTERFACE_IRQ_HANDLER(WRITELINE(buddha_device, ide_1_interrupt_w)) +MACHINE_CONFIG_END + +machine_config_constructor buddha_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( buddha ); +} + +//------------------------------------------------- +// rom_region - device-specific ROM region +//------------------------------------------------- + +ROM_START( buddha ) + ROM_REGION16_BE(0x10000, "bootrom", 0) + ROM_DEFAULT_BIOS("v103-17") + ROM_SYSTEM_BIOS(0, "v103-8", "Version 103.8") + ROMX_LOAD("buddha_103-8.rom", 0x0000, 0x8000, CRC(44f81426) SHA1(95555c6690b5c697e1cdca2726e47c1c6c194d7c), ROM_SKIP(1) | ROM_BIOS(1)) + ROM_SYSTEM_BIOS(1, "v103-17", "Version 103.17") + ROMX_LOAD("buddha_103-17.rom", 0x0000, 0x8000, CRC(2b7b24e0) SHA1(ec17a58962c373a2892090ec9b1722d2c326d631), ROM_SKIP(1) | ROM_BIOS(2)) +ROM_END + +const rom_entry *buddha_device::device_rom_region() const +{ + return ROM_NAME( buddha ); +} + + +//************************************************************************** +// LIVE DEVICE +//************************************************************************** + +//------------------------------------------------- +// buddha_device - constructor +//------------------------------------------------- + +buddha_device::buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, BUDDHA, "Buddha IDE controller", tag, owner, clock, "buddha", __FILE__), + device_zorro2_card_interface(mconfig, *this), + m_ata_0(*this, "ata_0"), + m_ata_1(*this, "ata_1"), + m_ide_interrupts_enabled(false), + m_ide_0_interrupt(0), + m_ide_1_interrupt(0) +{ +} + +//------------------------------------------------- +// device_start - device-specific startup +//------------------------------------------------- + +void buddha_device::device_start() +{ + set_zorro_device(); +} + +//------------------------------------------------- +// device_reset - device-specific reset +//------------------------------------------------- + +void buddha_device::device_reset() +{ +} + + +//************************************************************************** +// IMPLEMENTATION +//************************************************************************** + +void buddha_device::autoconfig_base_address(offs_t address) +{ + if (VERBOSE) + logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address); + + if (VERBOSE) + logerror("-> installing buddha\n"); + + // stop responding to default autoconfig + m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f); + + // install autoconfig handler to new location + m_slot->m_space->install_readwrite_handler(address, address + 0x7f, + read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast(this)), + write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast(this)), 0xffff); + + // buddha registers + m_slot->m_space->install_readwrite_handler(address + 0x7fe, address + 0x7ff, + read16_delegate(FUNC(buddha_device::speed_r), this), + write16_delegate(FUNC(buddha_device::speed_w), this), 0xffff); + + m_slot->m_space->install_readwrite_handler(address + 0x800, address + 0x8ff, + read16_delegate(FUNC(buddha_device::ide_0_cs0_r), this), + write16_delegate(FUNC(buddha_device::ide_0_cs0_w), this), 0xffff); + + m_slot->m_space->install_readwrite_handler(address + 0x900, address + 0x9ff, + read16_delegate(FUNC(buddha_device::ide_0_cs1_r), this), + write16_delegate(FUNC(buddha_device::ide_0_cs1_w), this), 0xffff); + + m_slot->m_space->install_readwrite_handler(address + 0xa00, address + 0xaff, + read16_delegate(FUNC(buddha_device::ide_0_cs0_r), this), + write16_delegate(FUNC(buddha_device::ide_0_cs0_w), this), 0xffff); + + m_slot->m_space->install_readwrite_handler(address + 0xb00, address + 0xbff, + read16_delegate(FUNC(buddha_device::ide_0_cs1_r), this), + write16_delegate(FUNC(buddha_device::ide_0_cs1_w), this), 0xffff); + + m_slot->m_space->install_read_handler(address + 0xf00, address + 0xf3f, + read16_delegate(FUNC(buddha_device::ide_0_interrupt_r), this), 0xffff); + + m_slot->m_space->install_read_handler(address + 0xf40, address + 0xf7f, + read16_delegate(FUNC(buddha_device::ide_1_interrupt_r), this), 0xffff); + + m_slot->m_space->install_write_handler(address + 0xfc0, address + 0xfff, + write16_delegate(FUNC(buddha_device::ide_interrupt_enable_w), this), 0xffff); + + // install access to the rom space + m_slot->m_space->install_rom(address + 0x1000, address + 0xffff, memregion("bootrom")->base() + 0x1000); + + // we're done + m_slot->cfgout_w(0); +} + +WRITE_LINE_MEMBER( buddha_device::cfgin_w ) +{ + if (VERBOSE) + logerror("%s('%s'): configin_w (%d)\n", shortname(), basetag(), state); + + if (state == 0) + { + // setup autoconfig + autoconfig_board_type(BOARD_TYPE_ZORRO2); + autoconfig_board_size(BOARD_SIZE_64K); + autoconfig_link_into_memory(false); + autoconfig_rom_vector_valid(true); + autoconfig_multi_device(false); + autoconfig_8meg_preferred(false); + autoconfig_can_shutup(true); + autoconfig_product(0x00); + autoconfig_manufacturer(0x1212); + autoconfig_serial(0x00000000); + autoconfig_rom_vector(0x1000); + + // install autoconfig handler + m_slot->m_space->install_readwrite_handler(0xe80000, 0xe8007f, + read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast(this)), + write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast(this)), 0xffff); + } +} + +READ16_MEMBER( buddha_device::speed_r ) +{ + UINT16 data = 0xffff; + + if (VERBOSE) + logerror("%s('%s'): ide_0_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); + + return data; +} + +WRITE16_MEMBER( buddha_device::speed_w ) +{ + if (VERBOSE) + logerror("%s('%s'): speed_w %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); +} + +WRITE_LINE_MEMBER( buddha_device::ide_0_interrupt_w) +{ + if (VERBOSE) + logerror("%s('%s'): ide_0_interrupt_w (%d)\n", shortname(), basetag(), state); + + m_ide_0_interrupt = state; + + if (m_ide_interrupts_enabled) + m_slot->int2_w(state); +} + +WRITE_LINE_MEMBER( buddha_device::ide_1_interrupt_w) +{ + if (VERBOSE) + logerror("%s('%s'): ide_1_interrupt_w (%d)\n", shortname(), basetag(), state); + + m_ide_1_interrupt = state; + + if (m_ide_interrupts_enabled) + m_slot->int2_w(state); +} + +READ16_MEMBER( buddha_device::ide_0_interrupt_r ) +{ + UINT16 data = 0xffff; + + data = m_ide_0_interrupt << 15; + + if (VERBOSE) + logerror("%s('%s'): ide_0_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); + + logerror("%s\n", device().machine().describe_context()); + + return data; +} + +READ16_MEMBER( buddha_device::ide_1_interrupt_r ) +{ + UINT16 data = 0xffff; + + data = m_ide_1_interrupt << 15; + + if (VERBOSE) + logerror("%s('%s'): ide_1_interrupt_r %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); + + return data; +} + +WRITE16_MEMBER( buddha_device::ide_interrupt_enable_w ) +{ + if (VERBOSE) + logerror("%s('%s'): ide_interrupt_enable_w %04x [mask = %04x]\n", shortname(), basetag(), data, mem_mask); + + // writing any value here enables ide interrupts to the zorro slot + m_ide_interrupts_enabled = true; +} + +READ16_MEMBER( buddha_device::ide_0_cs0_r ) +{ + UINT16 data = 0xffff; + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = m_ata_0->read_cs0(space, (offset >> 1) & 0x07, mem_mask); + + if (VERBOSE) + logerror("%s('%s'): ide_0_cs0_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + return (data << 8) | (data >> 8); +} + +WRITE16_MEMBER( buddha_device::ide_0_cs0_w ) +{ + if (VERBOSE) + logerror("%s('%s'): ide_0_cs0_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = (data << 8) | (data >> 8); + + m_ata_0->write_cs0(space, (offset >> 1) & 0x07, data, mem_mask); +} + +READ16_MEMBER( buddha_device::ide_0_cs1_r ) +{ + UINT16 data = 0xffff; + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = m_ata_0->read_cs1(space, (offset >> 1) & 0x07, mem_mask); + + if (VERBOSE) + logerror("%s('%s'): ide_0_cs1_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + return (data << 8) | (data >> 8); +} + +WRITE16_MEMBER( buddha_device::ide_0_cs1_w ) +{ + if (VERBOSE) + logerror("%s('%s'): ide_0_cs1_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = (data << 8) | (data >> 8); + + m_ata_0->write_cs1(space, (offset >> 1) & 0x07, data, mem_mask); +} + +READ16_MEMBER( buddha_device::ide_1_cs0_r ) +{ + UINT16 data = 0xffff; + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = m_ata_1->read_cs0(space, (offset >> 1) & 0x07, mem_mask); + + if (VERBOSE) + logerror("%s('%s'): ide_1_cs0_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + return (data << 8) | (data >> 8); +} + +WRITE16_MEMBER( buddha_device::ide_1_cs0_w ) +{ + if (VERBOSE) + logerror("%s('%s'): ide_1_cs0_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = (data << 8) | (data >> 8); + + m_ata_1->write_cs0(space, (offset >> 1) & 0x07, data, mem_mask); +} + +READ16_MEMBER( buddha_device::ide_1_cs1_r ) +{ + UINT16 data = 0xffff; + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = m_ata_1->read_cs1(space, (offset >> 1) & 0x07, mem_mask); + + if (VERBOSE) + logerror("%s('%s'): ide_1_cs1_r(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + return (data << 8) | (data >> 8); +} + +WRITE16_MEMBER( buddha_device::ide_1_cs1_w ) +{ + if (VERBOSE) + logerror("%s('%s'): ide_1_cs1_w(%04x) %04x [mask = %04x]\n", shortname(), basetag(), offset, data, mem_mask); + + mem_mask = (mem_mask << 8) | (mem_mask >> 8); + data = (data << 8) | (data >> 8); + + m_ata_1->write_cs1(space, (offset >> 1) & 0x07, data, mem_mask); +} diff --git a/src/emu/bus/zorro/buddha.h b/src/emu/bus/zorro/buddha.h new file mode 100644 index 00000000000..9cc2a479e55 --- /dev/null +++ b/src/emu/bus/zorro/buddha.h @@ -0,0 +1,83 @@ +/*************************************************************************** + + Buddha + + license: MAME, GPL-2.0+ + copyright-holders: Dirk Best + + Zorro-II IDE controller + +***************************************************************************/ + +#pragma once + +#ifndef __BUDDHA_H__ +#define __BUDDHA_H__ + +#include "emu.h" +#include "zorro.h" +#include "machine/autoconfig.h" +#include "machine/ataintf.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> buddha_device + +class buddha_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig +{ +public: + // construction/destruction + buddha_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // speed register + DECLARE_READ16_MEMBER( speed_r ); + DECLARE_WRITE16_MEMBER( speed_w ); + + // ide register + DECLARE_READ16_MEMBER( ide_0_cs0_r ); + DECLARE_WRITE16_MEMBER( ide_0_cs0_w ); + DECLARE_READ16_MEMBER( ide_0_cs1_r ); + DECLARE_WRITE16_MEMBER( ide_0_cs1_w ); + DECLARE_READ16_MEMBER( ide_1_cs0_r ); + DECLARE_WRITE16_MEMBER( ide_1_cs0_w ); + DECLARE_READ16_MEMBER( ide_1_cs1_r ); + DECLARE_WRITE16_MEMBER( ide_1_cs1_w ); + + // interrupt register + DECLARE_READ16_MEMBER( ide_0_interrupt_r ); + DECLARE_READ16_MEMBER( ide_1_interrupt_r ); + DECLARE_WRITE16_MEMBER( ide_interrupt_enable_w ); + + DECLARE_WRITE_LINE_MEMBER( ide_0_interrupt_w ); + DECLARE_WRITE_LINE_MEMBER( ide_1_interrupt_w ); + +protected: + // device-level overrides + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; + + virtual void device_start(); + virtual void device_reset(); + + // device_zorro2_card_interface overrides + virtual DECLARE_WRITE_LINE_MEMBER( cfgin_w ); + + // amiga_autoconfig overrides + virtual void autoconfig_base_address(offs_t address); + +private: + required_device m_ata_0; + required_device m_ata_1; + + bool m_ide_interrupts_enabled; + int m_ide_0_interrupt; + int m_ide_1_interrupt; +}; + +// device type definition +extern const device_type BUDDHA; + +#endif diff --git a/src/emu/bus/zorro/cards.c b/src/emu/bus/zorro/cards.c index 68af08c60a5..2b0ac3501e9 100644 --- a/src/emu/bus/zorro/cards.c +++ b/src/emu/bus/zorro/cards.c @@ -23,9 +23,13 @@ SLOT_INTERFACE_START( a2000_expansion_cards ) SLOT_INTERFACE_END SLOT_INTERFACE_START( zorro2_cards ) + SLOT_INTERFACE("a2052", A2052) SLOT_INTERFACE("a2091", A2091) + SLOT_INTERFACE("buddha", BUDDHA) SLOT_INTERFACE_END SLOT_INTERFACE_START( zorro3_cards ) + SLOT_INTERFACE("a2052", A2052) SLOT_INTERFACE("a2091", A2091) + SLOT_INTERFACE("buddha", BUDDHA) SLOT_INTERFACE_END diff --git a/src/emu/bus/zorro/cards.h b/src/emu/bus/zorro/cards.h index 6c34f9394fb..84ba309cc59 100644 --- a/src/emu/bus/zorro/cards.h +++ b/src/emu/bus/zorro/cards.h @@ -25,8 +25,11 @@ #define __CARDS_H__ #include "emu.h" + +#include "a2052.h" #include "a590.h" #include "action_replay.h" +#include "buddha.h" SLOT_INTERFACE_EXTERN( a1000_expansion_cards ); SLOT_INTERFACE_EXTERN( a500_expansion_cards ); diff --git a/src/emu/bus/zorro/zorro.c b/src/emu/bus/zorro/zorro.c index 91918c2ffea..47c2db44dcd 100644 --- a/src/emu/bus/zorro/zorro.c +++ b/src/emu/bus/zorro/zorro.c @@ -196,6 +196,15 @@ zorro2_device::zorro2_device(const machine_config &mconfig, device_type type, co { } +//------------------------------------------------- +// zorro2_device - destructor +//------------------------------------------------- + +zorro2_device::~zorro2_device() +{ + m_dev.detach_all(); +} + //------------------------------------------------- // device_start - device-specific startup //------------------------------------------------- diff --git a/src/emu/bus/zorro/zorro.h b/src/emu/bus/zorro/zorro.h index 754ee63a4cd..7c6d593f6d5 100644 --- a/src/emu/bus/zorro/zorro.h +++ b/src/emu/bus/zorro/zorro.h @@ -330,6 +330,7 @@ public: zorro2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); zorro2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); + ~zorro2_device(); template static devcb_base &set_eint1_handler(device_t &device, _Object object) { return downcast(device).m_eint1_handler.set_callback(object); } diff --git a/src/mame/includes/amiga.h b/src/mame/includes/amiga.h index c3412ee405e..4103ee0dd15 100644 --- a/src/mame/includes/amiga.h +++ b/src/mame/includes/amiga.h @@ -513,16 +513,8 @@ protected: // interrupts void set_interrupt(int interrupt); - - virtual void update_irq2() - { - set_interrupt((m_cia_0_irq ? 0x8000 : 0x0000) | INTENA_PORTS); - } - - virtual void update_irq6() - { - set_interrupt((m_cia_1_irq ? 0x8000 : 0x0000) | INTENA_EXTER); - } + virtual void update_int2(); + virtual void update_int6(); virtual void vblank(); diff --git a/src/mame/machine/amiga.c b/src/mame/machine/amiga.c index c104070ab0a..b6c7cc9ba4d 100644 --- a/src/mame/machine/amiga.c +++ b/src/mame/machine/amiga.c @@ -363,6 +363,16 @@ void amiga_state::set_interrupt(int interrupt) custom_chip_w(m_maincpu->space(AS_PROGRAM), REG_INTREQ, interrupt, 0xffff); } +void amiga_state::update_int2() +{ + set_interrupt((m_cia_0_irq ? INTENA_SETCLR : 0x0000) | INTENA_PORTS); +} + +void amiga_state::update_int6() +{ + set_interrupt((m_cia_1_irq ? INTENA_SETCLR : 0x0000) | INTENA_EXTER); +} + void amiga_state::update_irqs() { amiga_state *state = this; @@ -1113,7 +1123,7 @@ WRITE_LINE_MEMBER( amiga_state::cia_0_irq ) logerror("%s: cia_0_irq: %d\n", machine().describe_context(), state); m_cia_0_irq = state; - update_irq2(); + update_int2(); } READ8_MEMBER( amiga_state::cia_1_port_a_read ) @@ -1136,7 +1146,7 @@ WRITE_LINE_MEMBER( amiga_state::cia_1_irq ) logerror("%s: cia_1_irq: %d\n", machine().describe_context(), state); m_cia_1_irq = state; - update_irq6(); + update_int6(); } diff --git a/src/mess/drivers/amiga.c b/src/mess/drivers/amiga.c index 1546aa83faa..4fb38e91539 100644 --- a/src/mess/drivers/amiga.c +++ b/src/mess/drivers/amiga.c @@ -218,7 +218,7 @@ public: static const UINT8 GAYLE_ID = 0xd0; protected: - virtual void update_irq2(); + virtual void update_int2(); private: int m_gayle_int2; @@ -240,7 +240,7 @@ public: static const UINT8 GAYLE_ID = 0xd1; protected: - virtual void update_irq2(); + virtual void update_int2(); private: int m_gayle_int2; @@ -560,13 +560,13 @@ WRITE16_MEMBER( a1000_state::write_protect_w ) WRITE_LINE_MEMBER( a2000_state::zorro2_int2_w ) { m_zorro2_int2 = state; - update_irq2(); + update_int2(); } WRITE_LINE_MEMBER( a2000_state::zorro2_int6_w ) { m_zorro2_int6 = state; - update_irq6(); + update_int6(); } void a2000_state::update_int2() @@ -627,7 +627,7 @@ WRITE32_MEMBER( a3000_state::motherboard_w ) logerror("motherboard_w(%06x): %08x & %08x\n", offset, data, mem_mask); } -void a600_state::update_irq2() +void a600_state::update_int2() { int state = (m_cia_0_irq || m_gayle_int2); set_interrupt((state ? INTENA_SETCLR : 0x0000) | INTENA_PORTS); @@ -636,10 +636,10 @@ void a600_state::update_irq2() WRITE_LINE_MEMBER( a600_state::gayle_int2_w ) { m_gayle_int2 = state; - update_irq2(); + update_int2(); } -void a1200_state::update_irq2() +void a1200_state::update_int2() { int state = (m_cia_0_irq || m_gayle_int2); set_interrupt((state ? INTENA_SETCLR : 0x0000) | INTENA_PORTS); @@ -648,7 +648,7 @@ void a1200_state::update_irq2() WRITE_LINE_MEMBER( a1200_state::gayle_int2_w ) { m_gayle_int2 = state; - update_irq2(); + update_int2(); } READ32_MEMBER( a4000_state::scsi_r )