Skip to content

Commit

Permalink
bus/amiga/zorro/merlin: Implement RAMDAC with hardware cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
startaq committed Jan 8, 2025
1 parent 2c98fd3 commit ed95a2d
Show file tree
Hide file tree
Showing 5 changed files with 657 additions and 4 deletions.
12 changes: 12 additions & 0 deletions scripts/src/video.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1684,3 +1684,15 @@ if (VIDEOS["ZR36110"]~=null) then
MAME_DIR .. "src/devices/video/zr36110.h",
}
end

--------------------------------------------------
--
--@src/devices/video/bt48x.h,VIDEOS["BT48X"] = true
--------------------------------------------------

if (VIDEOS["BT48X"]~=null) then
files {
MAME_DIR .. "src/devices/video/bt48x.cpp",
MAME_DIR .. "src/devices/video/bt48x.h",
}
end
18 changes: 14 additions & 4 deletions src/devices/bus/amiga/zorro/merlin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
- Tseng Labs ET4000W32
- 1, 2 (maximum in Zorro-II mode) or 4 MB RAM
- 33 MHz and 14.31818 MHz XTAL
- BT482 RAMDAC
- BT482KPJ85 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
***************************************************************************/

Expand All @@ -42,6 +41,7 @@ merlin_device::merlin_device(const machine_config &mconfig, const char *tag, dev
device_t(mconfig, ZORRO_MERLIN, tag, owner, clock),
device_zorro2_card_interface(mconfig, *this),
m_vga(*this, "vga"),
m_ramdac(*this, "ramdac"),
m_autoconfig_memory_done(false)
{
}
Expand All @@ -54,7 +54,7 @@ merlin_device::merlin_device(const machine_config &mconfig, const char *tag, dev
void merlin_device::mmio_map(address_map &map)
{
map(0x0000, 0xffff).unmaprw();
//map(0x0000, 0x001f) RAMDAC
map(0x0000, 0x001f).m(m_ramdac, FUNC(bt482_device::map)).umask32(0x00ff0000); // TODO: 16-bit
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));
Expand All @@ -70,12 +70,14 @@ 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));
screen.set_screen_update(FUNC(merlin_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); });

BT482(config, m_ramdac, 0);
}


Expand All @@ -93,6 +95,14 @@ void merlin_device::busrst_w(int state)
m_autoconfig_memory_done = false;
}

uint32_t merlin_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
m_vga->screen_update(screen, bitmap, cliprect);
m_ramdac->screen_update(screen, bitmap, cliprect);

return 0;
}


//**************************************************************************
// AUTOCONFIG
Expand Down
3 changes: 3 additions & 0 deletions src/devices/bus/amiga/zorro/merlin.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "zorro.h"
#include "machine/autoconfig.h"
#include "video/bt48x.h"
#include "video/pc_vga_tseng.h"


Expand All @@ -39,8 +40,10 @@ class merlin_device : public device_t, public device_zorro2_card_interface, publ

private:
void mmio_map(address_map &map) ATTR_COLD;
uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);

required_device<et4kw32i_vga_device> m_vga;
required_device<bt482_device> m_ramdac;

bool m_autoconfig_memory_done;
};
Expand Down
Loading

0 comments on commit ed95a2d

Please sign in to comment.