From bca7fead9f2319bca355a365bd546eed136b455c Mon Sep 17 00:00:00 2001 From: arbee Date: Thu, 25 Feb 2021 20:15:50 -0500 Subject: [PATCH] pmac6100: fix boot video [R. Belmont] --- src/mame/drivers/mac.cpp | 4 ++-- src/mame/includes/mac.h | 3 +++ src/mame/video/mac.cpp | 29 +++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/mame/drivers/mac.cpp b/src/mame/drivers/mac.cpp index 90474a077eb..53e4a28c33e 100644 --- a/src/mame/drivers/mac.cpp +++ b/src/mame/drivers/mac.cpp @@ -646,7 +646,7 @@ void mac_state::maciifx_map(address_map &map) void mac_state::pwrmac_map(address_map &map) { - map(0x00000000, 0x007fffff).ram(); // 8 MB standard + map(0x00000000, 0x007fffff).ram().share("vram64"); // 8 MB standard map(0x40000000, 0x403fffff).rom().region("bootrom", 0).mirror(0x0fc00000); @@ -1244,7 +1244,7 @@ void mac_state::pwrmac(machine_config &config) m_screen->set_video_attributes(VIDEO_UPDATE_BEFORE_VBLANK); m_screen->set_size(1024, 768); m_screen->set_visarea(0, 640-1, 0, 480-1); - m_screen->set_screen_update(FUNC(mac_state::screen_update_macrbv)); + m_screen->set_screen_update(FUNC(mac_state::screen_update_pwrmac)); PALETTE(config, m_palette).set_entries(256); diff --git a/src/mame/includes/mac.h b/src/mame/includes/mac.h index b0bb23eb6cd..cddb4f2aef9 100644 --- a/src/mame/includes/mac.h +++ b/src/mame/includes/mac.h @@ -81,6 +81,7 @@ public: m_main_buffer(true), m_vram(*this,"vram"), m_vram16(*this,"vram16"), + m_vram64(*this,"vram64"), m_via2_ca1_hack(0), m_screen(*this, "screen"), m_palette(*this, "palette") @@ -291,6 +292,7 @@ private: // this is shared among all video setups with vram optional_shared_ptr m_vram; optional_shared_ptr m_vram16; + optional_shared_ptr m_vram64; // interrupts int m_scc_interrupt, m_via_interrupt, m_via2_interrupt, m_scsi_interrupt, m_asc_interrupt, m_last_taken_interrupt; @@ -415,6 +417,7 @@ private: uint32_t screen_update_mac(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_macse30(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); uint32_t screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); + uint32_t screen_update_pwrmac(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macv8(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t screen_update_macsonora(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); diff --git a/src/mame/video/mac.cpp b/src/mame/video/mac.cpp index 26bcf75942a..2b49dbfd3b2 100644 --- a/src/mame/video/mac.cpp +++ b/src/mame/video/mac.cpp @@ -367,6 +367,35 @@ uint32_t mac_state::screen_update_macrbv(screen_device &screen, bitmap_rgb32 &bi return 0; } +uint32_t mac_state::screen_update_pwrmac(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +{ + uint8_t const *const vram8 = (uint8_t *)m_vram64.target(); + int hres, vres; + + hres = 640; + vres = 480; + + for (int y = 0; y < vres; y++) + { + uint32_t *scanline = &bitmap.pix(y); + for (int x = 0; x < hres; x += 8) + { + uint8_t const pixels = vram8[(y * (hres / 8)) + ((x / 8) ^ 3)]; + + *scanline++ = m_rbv_palette[0x7f | (pixels & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 1) & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 2) & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 3) & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 4) & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 5) & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 6) & 0x80)]; + *scanline++ = m_rbv_palette[0x7f | ((pixels << 7) & 0x80)]; + } + } + + return 0; +} + uint32_t mac_state::screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { int hres, vres;