diff options
Diffstat (limited to 'src/devices/bus/hp_dio/hp98544.cpp')
-rw-r--r-- | src/devices/bus/hp_dio/hp98544.cpp | 61 |
1 files changed, 31 insertions, 30 deletions
diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp index 11cf120f08d..012793c726d 100644 --- a/src/devices/bus/hp_dio/hp98544.cpp +++ b/src/devices/bus/hp_dio/hp98544.cpp @@ -34,14 +34,15 @@ DEFINE_DEVICE_TYPE(HPDIO_98544, dio16_98544_device, "dio98544", "HP98544 high-re MACHINE_CONFIG_START(dio16_98544_device::device_add_mconfig) MCFG_SCREEN_ADD(HP98544_SCREEN_NAME, RASTER) MCFG_SCREEN_UPDATE_DEVICE(DEVICE_SELF, dio16_98544_device, screen_update) - MCFG_SCREEN_SIZE(1024,768) + MCFG_SCREEN_SIZE(1024,1024) MCFG_SCREEN_VISIBLE_AREA(0, 1024-1, 0, 768-1) MCFG_SCREEN_REFRESH_RATE(70) MCFG_DEVICE_ADD("topcat", TOPCAT, XTAL(35904000)) MCFG_TOPCAT_FB_WIDTH(1024) MCFG_TOPCAT_FB_HEIGHT(768) - MCFG_TOPCAT_PLANES(1) + MCFG_TOPCAT_PLANEMASK(1) + MACHINE_CONFIG_END //------------------------------------------------- @@ -69,8 +70,24 @@ dio16_98544_device::dio16_98544_device(const machine_config &mconfig, const char dio16_98544_device::dio16_98544_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), device_dio16_card_interface(mconfig, *this), - m_topcat(*this, "topcat") + device_memory_interface(mconfig, *this), + m_topcat(*this, "topcat"), + m_space_config("vram", ENDIANNESS_BIG, 8, 20, 0, address_map_constructor(FUNC(dio16_98544_device::map), this)), + m_rom(*this, HP98544_ROM_REGION), + m_vram(*this, "vram") +{ +} + +void dio16_98544_device::map(address_map& map) { + map(0, 0xfffff).ram().share("vram"); +} + +device_memory_interface::space_config_vector dio16_98544_device::memory_space_config() const +{ + return space_config_vector { + std::make_pair(0, &m_space_config) + }; } //------------------------------------------------- @@ -82,20 +99,18 @@ void dio16_98544_device::device_start() // set_nubus_device makes m_slot valid set_dio_device(); - m_rom = device().machine().root_device().memregion(this->subtag(HP98544_ROM_REGION).c_str())->base(); - m_dio->install_memory( 0x200000, 0x2fffff, - read16_delegate(FUNC(dio16_98544_device::vram_r), this), - write16_delegate(FUNC(dio16_98544_device::vram_w), this)); + read16_delegate(FUNC(topcat_device::vram_r), static_cast<topcat_device*>(m_topcat)), + write16_delegate(FUNC(topcat_device::vram_w), static_cast<topcat_device*>(m_topcat))); m_dio->install_memory( 0x560000, 0x563fff, read16_delegate(FUNC(dio16_98544_device::rom_r), this), write16_delegate(FUNC(dio16_98544_device::rom_w), this)); m_dio->install_memory( 0x564000, 0x567fff, - read16_delegate(FUNC(dio16_98544_device::ctrl_r), this), - write16_delegate(FUNC(dio16_98544_device::ctrl_w), this)); + read16_delegate(FUNC(topcat_device::ctrl_r), static_cast<topcat_device*>(m_topcat)), + write16_delegate(FUNC(topcat_device::ctrl_w), static_cast<topcat_device*>(m_topcat))); } //------------------------------------------------- @@ -106,16 +121,6 @@ void dio16_98544_device::device_reset() { } -READ16_MEMBER(dio16_98544_device::vram_r) -{ - return m_topcat->vram_r(space, offset, mem_mask); -} - -WRITE16_MEMBER(dio16_98544_device::vram_w) -{ - m_topcat->vram_w(space, offset, data, mem_mask); -} - READ16_MEMBER(dio16_98544_device::rom_r) { return 0xff00 | m_rom[offset]; @@ -126,17 +131,13 @@ WRITE16_MEMBER(dio16_98544_device::rom_w) { } -WRITE16_MEMBER(dio16_98544_device::ctrl_w) -{ - return m_topcat->ctrl_w(space, offset, data); -} - -READ16_MEMBER(dio16_98544_device::ctrl_r) -{ - return m_topcat->ctrl_r(space, offset); -} - uint32_t dio16_98544_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - return m_topcat->screen_update(screen, bitmap, cliprect); + for (int y = 0; y < 768; y++) { + uint32_t *scanline = &bitmap.pix32(y); + for (int x = 0; x < 1024; x++) + *scanline++ = m_vram[y * 1024 + x] ? rgb_t(255,255,255) : rgb_t(0, 0, 0); + } + return 0; } + |