diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2019-04-20 17:22:47 -0400 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2019-04-20 17:22:47 -0400 |
commit | ec1a4cf4a03bb01c7704fce7ecc08149cffcca29 (patch) | |
tree | 7a590112889036010b9f836e3279e211f0f97941 | |
parent | f58ae6ade13b2fc15f1733656b8cb7e5729731cd (diff) |
newport: Implement device_palette_interface (nw)
-rw-r--r-- | src/mame/video/newport.cpp | 9 | ||||
-rw-r--r-- | src/mame/video/newport.h | 7 |
2 files changed, 5 insertions, 11 deletions
diff --git a/src/mame/video/newport.cpp b/src/mame/video/newport.cpp index fa1abb9770c..369678fc3fa 100644 --- a/src/mame/video/newport.cpp +++ b/src/mame/video/newport.cpp @@ -48,9 +48,9 @@ DEFINE_DEVICE_TYPE(NEWPORT_VIDEO, newport_video_device, "newport_video", "SGI Ne newport_video_device::newport_video_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, NEWPORT_VIDEO, tag, owner, clock) + , device_palette_interface(mconfig, *this) , m_maincpu(*this, finder_base::DUMMY_TAG) , m_hpc3(*this, finder_base::DUMMY_TAG) - , m_palette(*this, "palette") { } @@ -400,7 +400,7 @@ void newport_video_device::cmap0_write(uint32_t data) case 0x02: m_cmap0.m_palette[m_cmap0.m_palette_idx] = data >> 8; if (m_cmap0.m_palette_idx < 0x2000) - m_palette->set_pen_color(m_cmap0.m_palette_idx, rgb_t((uint8_t)(data >> 24), (uint8_t)(data >> 16), (uint8_t)(data >> 8))); + set_pen_color(m_cmap0.m_palette_idx, rgb_t((uint8_t)(data >> 24), (uint8_t)(data >> 16), (uint8_t)(data >> 8))); LOGMASKED(LOG_CMAP0, "CMAP0 Palette Entry %04x Write: %08x\n", m_cmap0.m_palette_idx, data >> 8); break; default: @@ -2737,8 +2737,3 @@ WRITE64_MEMBER(newport_video_device::rex3_w) do_rex3_command(); } } - -void newport_video_device::device_add_mconfig(machine_config &config) -{ - PALETTE(config, "palette").set_entries(0x2000); -} diff --git a/src/mame/video/newport.h b/src/mame/video/newport.h index 0f8f03c5838..f49a75529c6 100644 --- a/src/mame/video/newport.h +++ b/src/mame/video/newport.h @@ -10,11 +10,10 @@ #pragma once #include "machine/hpc3.h" -#include "emupal.h" #define ENABLE_NEWVIEW_LOG (0) -class newport_video_device : public device_t +class newport_video_device : public device_t, public device_palette_interface { public: template <typename T, typename U> @@ -35,7 +34,7 @@ public: DECLARE_WRITE_LINE_MEMBER(vblank_w); protected: - virtual void device_add_mconfig(machine_config &config) override; + virtual uint32_t palette_entries() const override { return 0x2000; } virtual void device_start() override; virtual void device_reset() override; @@ -201,7 +200,7 @@ private: required_device<cpu_device> m_maincpu; required_device<hpc3_device> m_hpc3; - required_device<palette_device> m_palette; + vc2_t m_vc2; xmap_t m_xmap0; xmap_t m_xmap1; |