summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2019-04-20 20:51:27 +0200
committer MooglyGuy <therealmogminer@gmail.com>2019-04-20 20:51:51 +0200
commit24b0adbe04581ceb1e2c5c40da3f963e615856a6 (patch)
tree1ee4d1dafcb644daacccca77f50f2306293fab06
parent077a6ba5ff98fcd46f6907e0efece008232e69b2 (diff)
-indy_indigo2: Removed unnecessary palette device, nw
-newport: Added palette device to allow for palette viewing, nw
-rw-r--r--src/mame/drivers/indy_indigo2.cpp2
-rw-r--r--src/mame/video/newport.cpp10
-rw-r--r--src/mame/video/newport.h4
3 files changed, 12 insertions, 4 deletions
diff --git a/src/mame/drivers/indy_indigo2.cpp b/src/mame/drivers/indy_indigo2.cpp
index 5d2e88a4de5..80e1163560a 100644
--- a/src/mame/drivers/indy_indigo2.cpp
+++ b/src/mame/drivers/indy_indigo2.cpp
@@ -209,8 +209,6 @@ void ip22_state::ip22_base(machine_config &config)
screen.set_screen_update("newport", FUNC(newport_video_device::screen_update));
screen.screen_vblank().set(m_newport, FUNC(newport_video_device::vblank_w));
- PALETTE(config, "palette").set_entries(65536);
-
NEWPORT_VIDEO(config, m_newport, m_maincpu, m_hpc3);
SGI_MC(config, m_mem_ctrl, m_maincpu, ":hpc3:eeprom", m_hpc3);
diff --git a/src/mame/video/newport.cpp b/src/mame/video/newport.cpp
index 72715b628db..fa1abb9770c 100644
--- a/src/mame/video/newport.cpp
+++ b/src/mame/video/newport.cpp
@@ -40,7 +40,7 @@
#define LOG_REJECTS (1 << 8)
#define LOG_ALL (LOG_UNKNOWN | LOG_VC2 | LOG_CMAP0 | LOG_CMAP1 | LOG_XMAP0 | LOG_XMAP1 | LOG_REX3)
-#define VERBOSE (0)//(LOG_UNKNOWN | LOG_REX3 | LOG_COMMANDS | LOG_REJECTS)
+#define VERBOSE (0)//(LOG_UNKNOWN | LOG_REX3 | LOG_COMMANDS | LOG_REJECTS)
#include "logmacro.h"
DEFINE_DEVICE_TYPE(NEWPORT_VIDEO, newport_video_device, "newport_video", "SGI Newport graphics board")
@@ -50,6 +50,7 @@ newport_video_device::newport_video_device(const machine_config &mconfig, const
: device_t(mconfig, NEWPORT_VIDEO, tag, owner, clock)
, m_maincpu(*this, finder_base::DUMMY_TAG)
, m_hpc3(*this, finder_base::DUMMY_TAG)
+ , m_palette(*this, "palette")
{
}
@@ -398,6 +399,8 @@ void newport_video_device::cmap0_write(uint32_t data)
break;
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)));
LOGMASKED(LOG_CMAP0, "CMAP0 Palette Entry %04x Write: %08x\n", m_cmap0.m_palette_idx, data >> 8);
break;
default:
@@ -2734,3 +2737,8 @@ 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 8e050eeff5b..0f8f03c5838 100644
--- a/src/mame/video/newport.h
+++ b/src/mame/video/newport.h
@@ -10,6 +10,7 @@
#pragma once
#include "machine/hpc3.h"
+#include "emupal.h"
#define ENABLE_NEWVIEW_LOG (0)
@@ -34,7 +35,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(vblank_w);
protected:
- // device-level overrides
+ virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
@@ -200,6 +201,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;