octopus: add blink and underline attributes

This commit is contained in:
mahlemiut 2016-11-10 13:25:05 +13:00
parent 20d8b6aec4
commit 6a4e6097ad

View File

@ -782,13 +782,12 @@ SCN2674_DRAW_CHARACTER_MEMBER(octopus_state::display_pixels)
// b4 : GP2 (general purpose) // b4 : GP2 (general purpose)
// b2 : High intensity // b2 : High intensity
// b1 : Grey background // b1 : Grey background
// b0 : Blank // b0 : Blank (TODO)
// - Colour // - Colour
// b6,5,4 : background colour (RGB) // b6,5,4 : background colour (RGB)
// b2,1,0 : foreground colour (RGB) // b2,1,0 : foreground colour (RGB)
if(!lg) if(!lg)
{ {
// TODO: handle attributes
uint8_t tile = m_vram[address & 0x0fff]; uint8_t tile = m_vram[address & 0x0fff];
uint8_t attr = m_vram[(address & 0x0fff) + 0x1000]; uint8_t attr = m_vram[(address & 0x0fff) + 0x1000];
uint8_t data = m_fontram[(tile * 16) + linecount]; uint8_t data = m_fontram[(tile * 16) + linecount];
@ -815,14 +814,13 @@ SCN2674_DRAW_CHARACTER_MEMBER(octopus_state::display_pixels)
else else
bg = 0x000000; bg = 0x000000;
if(attr & 0x20) // reverse video, for now, swap foreground and background if(attr & 0x20) // reverse video
{ data = ~data;
rgb_t temp;
temp = bg;
bg = fg;
fg = temp;
}
} }
if(ul && (attr & 0x08))
data = 0xff;
if(blink && (attr & 0x80))
data = 0x00;
if(cursor && !blink) if(cursor && !blink)
{ {
bool inverse = true; bool inverse = true;
@ -831,20 +829,14 @@ SCN2674_DRAW_CHARACTER_MEMBER(octopus_state::display_pixels)
inverse = false; inverse = false;
if(m_vidctrl & 0x40) // not enabled if(m_vidctrl & 0x40) // not enabled
inverse = false; inverse = false;
for (int z=0;z<8;z++)
{
if(inverse) if(inverse)
bitmap.pix32(y,x + z) = BIT(data,z) ? bg : fg; data = ~data;
else else
bitmap.pix32(y,x + z) = fg; data = 0xff;
} }
}
else
{
for (int z=0;z<8;z++) for (int z=0;z<8;z++)
bitmap.pix32(y,x + z) = BIT(data,z) ? fg : bg; bitmap.pix32(y,x + z) = BIT(data,z) ? fg : bg;
} }
}
} }
READ8_MEMBER( octopus_state::get_slave_ack ) READ8_MEMBER( octopus_state::get_slave_ack )