bt45x: overlay for single channel devices (nw)

This commit is contained in:
Patrick Mackinlay 2019-07-23 17:37:52 +07:00
parent 03dbd1ad3f
commit a0b9d3729c
4 changed files with 13 additions and 8 deletions

View File

@ -755,9 +755,9 @@ u32 edge2plus_framebuffer_device_base::screen_update(screen_device &screen, bitm
const u8 index = *pixel_data++;
bitmap.pix(y, x) = rgb_t(
m_ramdac[0]->palette_lookup(index),
m_ramdac[1]->palette_lookup(index),
m_ramdac[2]->palette_lookup(index));
m_ramdac[0]->lookup(index),
m_ramdac[1]->lookup(index),
m_ramdac[2]->lookup(index));
}
return 0;

View File

@ -29,7 +29,7 @@
*
* TODO
* - refactor to separate devices with registers
* - implement blinking and overlay
* - implement blinking and rgb device overlay
* - unsure about address masking when accessing overlay colors
*/

View File

@ -97,9 +97,14 @@ protected:
class bt45x_mono_device_base : public bt45x_device_base
{
public:
// helpers instead of a device_palette_interface
u8 palette_lookup(u8 index) const { return m_color_ram[index & m_read_mask]; }
u8 overlay_lookup(u8 index) const { return m_color_ram[m_palette_colors + index]; }
// helper instead of device_palette_interface
u8 lookup(u8 pixel, u8 overlay = 0) const
{
if (overlay & 3)
return m_color_ram[m_palette_colors + (overlay & (m_command & (CR1|CR0)))];
else
return (m_command & CR6) ? m_color_ram[pixel & m_read_mask] : m_color_ram[m_palette_colors + 0];
}
protected:
bt45x_mono_device_base(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const u32 palette_colors, const u32 overlay_colors);

View File

@ -231,7 +231,7 @@ u32 ncd17c_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, rec
for (unsigned x = 0; x < 1024; x++)
{
u8 const pixels = m_vram->read((y * 1024) + BYTE4_XOR_BE(x));
*scanline++ = m_ramdac->palette_lookup(pixels);
*scanline++ = m_ramdac->lookup(pixels);
}
}