nereid: add support for reading colormap entries

This commit is contained in:
Sven Schnelle 2018-06-27 11:16:23 +02:00
parent d353e05016
commit 0a144d17f3
2 changed files with 11 additions and 5 deletions

View File

@ -48,12 +48,12 @@ READ16_MEMBER(nereid_device::ctrl_r)
case NEREID_RED_DATA:
return 0xff00 | m_red;
case NEREID_GREEN_DATA:
return 0xff00 | m_red;
return 0xff00 | m_green;
case NEREID_BLUE_DATA:
return 0xff00 | m_red;
return 0xff00 | m_blue;
case NEREID_INDEX:
return 0xff00 | m_index;
case NEREID_STROBE:
case NEREID_WRITE_STROBE:
return 0xff00;
case NEREID_PLANE_MASK:
return 0xff00 | m_plane_mask;
@ -80,11 +80,16 @@ WRITE16_MEMBER(nereid_device::ctrl_w)
case NEREID_INDEX:
m_index = ~data;
break;
case NEREID_STROBE:
case NEREID_WRITE_STROBE:
LOG("NEREID: set color index %u: rgb_t(%u,%u,%u)\n",
m_index, m_red, m_green, m_blue);
m_palette[m_index] = rgb_t(m_red, m_green, m_blue);
break;
case NEREID_READ_STROBE:
m_red = (m_palette[m_index]).r();
m_green = (m_palette[m_index]).g();
m_blue = (m_palette[m_index]).b();
break;
case NEREID_PLANE_MASK:
m_plane_mask = data;
break;

View File

@ -27,7 +27,8 @@ private:
static constexpr int NEREID_BLUE_DATA=0x5b;
static constexpr int NEREID_INDEX=0x5c;
static constexpr int NEREID_PLANE_MASK=0x5d;
static constexpr int NEREID_STROBE=0x78;
static constexpr int NEREID_WRITE_STROBE=0x78;
static constexpr int NEREID_READ_STROBE=0x7c;
rgb_t m_palette[256];