-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bus/amiga/zorro: Add preliminary support for the merlin gfx card
- Loading branch information
Showing
4 changed files
with
239 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |