diff options
-rw-r--r-- | scripts/src/bus.lua | 2 | ||||
-rw-r--r-- | src/devices/bus/amiga/zorro/cards.cpp | 3 | ||||
-rw-r--r-- | src/devices/bus/amiga/zorro/merlin.cpp | 181 | ||||
-rw-r--r-- | src/devices/bus/amiga/zorro/merlin.h | 53 |
4 files changed, 239 insertions, 0 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua index 84c205ad974..7341724f85c 100644 --- a/scripts/src/bus.lua +++ b/scripts/src/bus.lua @@ -4698,6 +4698,8 @@ if (BUSES["ZORRO"]~=null) then MAME_DIR .. "src/devices/bus/amiga/zorro/action_replay.h", MAME_DIR .. "src/devices/bus/amiga/zorro/buddha.cpp", MAME_DIR .. "src/devices/bus/amiga/zorro/buddha.h", + MAME_DIR .. "src/devices/bus/amiga/zorro/merlin.cpp", + MAME_DIR .. "src/devices/bus/amiga/zorro/merlin.h", MAME_DIR .. "src/devices/bus/amiga/zorro/picasso2.cpp", MAME_DIR .. "src/devices/bus/amiga/zorro/picasso2.h", MAME_DIR .. "src/devices/bus/amiga/zorro/rainbow2.cpp", diff --git a/src/devices/bus/amiga/zorro/cards.cpp b/src/devices/bus/amiga/zorro/cards.cpp index 2d32dac9631..31f07fe1218 100644 --- a/src/devices/bus/amiga/zorro/cards.cpp +++ b/src/devices/bus/amiga/zorro/cards.cpp @@ -16,6 +16,7 @@ #include "a590.h" #include "action_replay.h" #include "buddha.h" +#include "merlin.h" #include "picasso2.h" #include "rainbow2.h" #include "ripple.h" @@ -49,6 +50,7 @@ void zorro2_cards(device_slot_interface &device) device.option_add("a2091", ZORRO_A2091); device.option_add("a2232", ZORRO_A2232); device.option_add("buddha", ZORRO_BUDDHA); + device.option_add("merlin", ZORRO_MERLIN); device.option_add("picasso2p", ZORRO_PICASSO2P); device.option_add("rainbow2", ZORRO_RAINBOW2); device.option_add("framemaster", ZORRO_FRAMEMASTER); @@ -64,6 +66,7 @@ void zorro3_cards(device_slot_interface &device) device.option_add("a2091", ZORRO_A2091); device.option_add("a2232", ZORRO_A2232); device.option_add("buddha", ZORRO_BUDDHA); + device.option_add("merlin", ZORRO_MERLIN); device.option_add("picasso2p", ZORRO_PICASSO2P); device.option_add("rainbow2", ZORRO_RAINBOW2); device.option_add("framemaster", ZORRO_FRAMEMASTER); diff --git a/src/devices/bus/amiga/zorro/merlin.cpp b/src/devices/bus/amiga/zorro/merlin.cpp new file mode 100644 index 00000000000..75add37ff98 --- /dev/null +++ b/src/devices/bus/amiga/zorro/merlin.cpp @@ -0,0 +1,181 @@ +// license: GPL-2.0+ +// copyright-holders: Dirk Best +/*************************************************************************** + + XPert/ProDev Merlin + + RTG graphics card for Amiga 2000/3000/4000 + + Hardware: + - Tseng Labs ET4000W32 + - 1, 2 (maximum in Zorro-II mode) or 4 MB RAM + - 33 MHz and 14.31818 MHz XTAL + - BT482 RAMDAC + - Serial EEPROM with stored serial number (unknown type) + - DG894 (video switcher) + - Optional video module: X-Calibur (S-VHS/Composite input/output) + + TODO: + - Skeleton + - RAMDAC + +***************************************************************************/ + +#include "emu.h" +#include "merlin.h" +#include "screen.h" + +#define VERBOSE (LOG_GENERAL) + +#include "logmacro.h" + + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +DEFINE_DEVICE_TYPE(ZORRO_MERLIN, bus::amiga::zorro::merlin_device, "zorro_merlin", "Merlin RTG") + +namespace bus::amiga::zorro { + +merlin_device::merlin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, ZORRO_MERLIN, tag, owner, clock), + device_zorro2_card_interface(mconfig, *this), + m_vga(*this, "vga"), + m_autoconfig_memory_done(false) +{ +} + + +//************************************************************************** +// ADDRESS MAPS +//************************************************************************** + +void merlin_device::mmio_map(address_map &map) +{ + map(0x0000, 0xffff).unmaprw(); + //map(0x0000, 0x001f) RAMDAC + map(0x03b0, 0x03df).m(m_vga, FUNC(et4kw32i_vga_device::io_map)); + //map(0x0401, 0x0401) monitor switch + map(0x210a, 0x210a).mirror(0x70).rw(m_vga, FUNC(et4kw32i_vga_device::acl_index_r), FUNC(et4kw32i_vga_device::acl_index_w)); + map(0x210b, 0x210b).mirror(0x70).rw(m_vga, FUNC(et4kw32i_vga_device::acl_data_r), FUNC(et4kw32i_vga_device::acl_data_w)); +} + + +//************************************************************************** +// MACHINE DEFINITIONS +//************************************************************************** + +void merlin_device::device_add_mconfig(machine_config &config) +{ + screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_raw(33_MHz_XTAL, 900, 0, 640, 526, 0, 480); // TODO + screen.set_screen_update(m_vga, FUNC(et4kw32i_vga_device::screen_update)); + + ET4KW32I_VGA(config, m_vga, 0); // should be ET4000W32 + m_vga->set_screen("screen"); + m_vga->set_vram_size(0x200000); + m_vga->vsync_cb().set([this](int state) { m_slot->int6_w(state); }); +} + + +//************************************************************************** +// MACHINE EMULATION +//************************************************************************** + +void merlin_device::device_start() +{ +} + +void merlin_device::busrst_w(int state) +{ + if (state == 0) + m_autoconfig_memory_done = false; +} + + +//************************************************************************** +// AUTOCONFIG +//************************************************************************** + +void merlin_device::autoconfig_base_address(offs_t address) +{ + LOG("autoconfig_base_address received: 0x%06x\n", address); + + if (!m_autoconfig_memory_done) + { + LOG("-> installing merlin memory\n"); + + m_slot->space().install_readwrite_handler(address, address + 0x1fffff, + emu::rw_delegate(m_vga, FUNC(et4kw32i_vga_device::mem_r)), + emu::rw_delegate(m_vga, FUNC(et4kw32i_vga_device::mem_w)), 0xffffffff); + + m_autoconfig_memory_done = true; + + // configure next + cfgin_w(0); + } + else + { + LOG("-> installing merlin registers\n"); + + // install merlin registers + m_slot->space().install_device(address, address + 0x0ffff, *this, &merlin_device::mmio_map); + + // stop responding to default autoconfig + m_slot->space().unmap_readwrite(0xe80000, 0xe8007f); + + // we're done + m_slot->cfgout_w(0); + } +} + +void merlin_device::cfgin_w(int state) +{ + LOG("configin_w (%d)\n", state); + + if (state != 0) + return; + + if (!m_autoconfig_memory_done) + { + LOG("autoconfig for memory\n"); + + // setup autoconfig for memory + autoconfig_board_type(BOARD_TYPE_ZORRO2); + autoconfig_board_size(BOARD_SIZE_2M); + autoconfig_link_into_memory(false); + autoconfig_rom_vector_valid(false); + autoconfig_multi_device(false); // ? + autoconfig_8meg_preferred(false); + autoconfig_can_shutup(true); // ? + autoconfig_product(3); + autoconfig_manufacturer(2117); + autoconfig_serial(0x00000000); + autoconfig_rom_vector(0x0000); + + // install autoconfig handler + m_slot->space().install_readwrite_handler(0xe80000, 0xe8007f, + read16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_read)), + write16_delegate(*this, FUNC(amiga_autoconfig::autoconfig_write)), 0xffffffff); + } + else + { + LOG("autoconfig for registers\n"); + + // setup autoconfig for registers + autoconfig_board_type(BOARD_TYPE_ZORRO2); + autoconfig_board_size(BOARD_SIZE_64K); + autoconfig_link_into_memory(false); + autoconfig_rom_vector_valid(false); + autoconfig_multi_device(false); // ? + autoconfig_8meg_preferred(false); + autoconfig_can_shutup(true); // ? + autoconfig_product(4); + autoconfig_manufacturer(2117); + autoconfig_serial(0x00000000); + autoconfig_rom_vector(0x0000); + } +} + +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/merlin.h b/src/devices/bus/amiga/zorro/merlin.h new file mode 100644 index 00000000000..a21aa218256 --- /dev/null +++ b/src/devices/bus/amiga/zorro/merlin.h @@ -0,0 +1,53 @@ +// license: GPL-2.0+ +// copyright-holders: Dirk Best +/*************************************************************************** + + XPert/ProDev Merlin + + RTG graphics card for Amiga 2000/3000/4000 + +***************************************************************************/ + +#ifndef MAME_BUS_AMIGA_ZORRO_MERLIN_H +#define MAME_BUS_AMIGA_ZORRO_MERLIN_H + +#pragma once + +#include "zorro.h" +#include "machine/autoconfig.h" +#include "video/pc_vga_tseng.h" + + +namespace bus::amiga::zorro { + +class merlin_device : public device_t, public device_zorro2_card_interface, public amiga_autoconfig +{ +public: + merlin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + virtual void device_add_mconfig(machine_config &config) override ATTR_COLD; + + virtual void device_start() override ATTR_COLD; + + // device_zorro2_card_interface overrides + virtual void cfgin_w(int state) override; + virtual void busrst_w(int state) override; + + // amiga_autoconfig overrides + virtual void autoconfig_base_address(offs_t address) override; + +private: + void mmio_map(address_map &map) ATTR_COLD; + + required_device<et4kw32i_vga_device> m_vga; + + bool m_autoconfig_memory_done; +}; + +} // namespace bus::amiga::zorro + +// device type declaration +DECLARE_DEVICE_TYPE_NS(ZORRO_MERLIN, bus::amiga::zorro, merlin_device) + +#endif // MAME_BUS_AMIGA_ZORRO_MERLIN_H |