mirror of
https://github.com/holub/mame
synced 2025-05-07 06:44:51 +03:00
(MESS) esqvfd: fake underline until we redo the character matrix (nw)
This commit is contained in:
parent
b7f5764e32
commit
c3a8f80371
@ -162,7 +162,7 @@ static void esq1_doc_irq(device_t *device, int state)
|
||||
|
||||
static UINT8 esq1_adc_read(device_t *device)
|
||||
{
|
||||
return 0x80;
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
void esq1_state::machine_reset()
|
||||
@ -282,17 +282,16 @@ static void duart_tx(device_t *device, int channel, UINT8 data)
|
||||
|
||||
if (channel == 1)
|
||||
{
|
||||
#if 0
|
||||
if (data >= 0x20 && data <= 0x7f)
|
||||
{
|
||||
printf("%c", data);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("[%02x]", data);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if ((data >= 0x20) && (data < 0x80))
|
||||
{
|
||||
printf("%c", data);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("[%02x]", data);
|
||||
}
|
||||
#endif
|
||||
state->m_vfd->write_char(data);
|
||||
}
|
||||
}
|
||||
@ -391,12 +390,12 @@ static INPUT_PORTS_START( esq1 )
|
||||
PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x91)
|
||||
PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x92)
|
||||
PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x93)
|
||||
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x94)
|
||||
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x95)
|
||||
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x96)
|
||||
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x97)
|
||||
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x98)
|
||||
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x99)
|
||||
PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x99)
|
||||
PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x94)
|
||||
PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x95)
|
||||
PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x96)
|
||||
PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x97)
|
||||
PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHANGED_MEMBER(DEVICE_SELF, esq1_state, key_stroke, 0x98)
|
||||
#endif
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
@ -169,6 +169,12 @@ void esqvfd_t::update_display()
|
||||
{
|
||||
UINT32 segdata = conv_segments(font[m_chars[row][col]]);
|
||||
|
||||
// force bottom bar on all underlined chars
|
||||
if (m_attrs[row][col] & AT_UNDERLINE)
|
||||
{
|
||||
segdata |= 0x0008;
|
||||
}
|
||||
|
||||
output_set_indexed_value("vfd", (row*m_cols) + col, segdata);
|
||||
|
||||
m_dirty[row][col] = 0;
|
||||
@ -190,6 +196,22 @@ machine_config_constructor esq2x40_t::device_mconfig_additions() const
|
||||
|
||||
void esq2x40_t::write_char(int data)
|
||||
{
|
||||
// ESQ-1 sends (cursor move) 0xfa 0xYY to mark YY characters as underlined at the current cursor location
|
||||
if (m_lastchar == 0xfa)
|
||||
{
|
||||
for (int i = 0; i < data; i++)
|
||||
{
|
||||
m_attrs[m_cursy][m_cursx + i] |= AT_UNDERLINE;
|
||||
m_dirty[m_cursy][m_cursx + i] = 1;
|
||||
}
|
||||
|
||||
m_lastchar = 0;
|
||||
update_display();
|
||||
return;
|
||||
}
|
||||
|
||||
m_lastchar = data;
|
||||
|
||||
if ((data >= 0x80) && (data < 0xd0))
|
||||
{
|
||||
m_cursy = ((data & 0x7f) >= 40) ? 1 : 0;
|
||||
@ -203,10 +225,14 @@ void esq2x40_t::write_char(int data)
|
||||
m_curattr = AT_BLINK;
|
||||
break;
|
||||
|
||||
case 0xd1: // blink stop
|
||||
m_curattr &= ~AT_BLINK;
|
||||
case 0xd1: // blink stop (cancel all attribs on VFX+)
|
||||
m_curattr = 0; //&= ~AT_BLINK;
|
||||
break;
|
||||
|
||||
case 0xd3: // start underline
|
||||
m_curattr |= AT_UNDERLINE;
|
||||
break;
|
||||
|
||||
case 0xd6: // clear screen
|
||||
m_cursx = m_cursy = 0;
|
||||
memset(m_chars, 0, sizeof(m_chars));
|
||||
@ -355,4 +381,3 @@ esq2x40_sq1_t::esq2x40_sq1_t(const machine_config &mconfig, const char *tag, dev
|
||||
m_cols = 40;
|
||||
m_Wait87Shift = false;
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,7 @@ protected:
|
||||
int m_cursx, m_cursy;
|
||||
int m_rows, m_cols;
|
||||
UINT8 m_curattr;
|
||||
UINT8 m_lastchar;
|
||||
UINT8 m_chars[2][40];
|
||||
UINT8 m_attrs[2][40];
|
||||
UINT8 m_dirty[2][40];
|
||||
|
Loading…
Reference in New Issue
Block a user