fs3216: Draw messages on screen (nw)

This commit is contained in:
AJR 2018-12-30 23:08:23 -05:00
parent 0a7430ed12
commit 399db630fc

View File

@ -33,6 +33,8 @@ public:
, m_ctc(*this, "ctc")
, m_fdc(*this, "fdc")
, m_earom(*this, "earom")
, m_videoram(*this, "videoram")
, m_chargen(*this, "chargen")
{
}
@ -43,7 +45,7 @@ protected:
virtual void machine_reset() override;
private:
MC6845_UPDATE_ROW(update_row);
MC6845_UPDATE_ROW(crt_update_row);
DECLARE_READ16_MEMBER(mmu_read);
DECLARE_WRITE16_MEMBER(mmu_write);
@ -71,6 +73,9 @@ private:
required_device<upd765a_device> m_fdc;
required_device<x2212_device> m_earom;
required_shared_ptr<u16> m_videoram;
required_region_ptr<u8> m_chargen;
std::unique_ptr<u8[]> m_fdc_ram;
bool m_in_reset;
@ -97,8 +102,20 @@ void fs3216_state::machine_reset()
}
MC6845_UPDATE_ROW(fs3216_state::update_row)
MC6845_UPDATE_ROW(fs3216_state::crt_update_row)
{
u32 *px = &bitmap.pix32(y);
for (int i = 0; i < x_count; i++)
{
u16 chr = m_videoram[(ma + i) & 0x7ff];
rgb_t fg = rgb_t::white();
rgb_t bg = rgb_t::black();
u16 dots = m_chargen[(chr & 0xff) << 4 | ra] << 1;
for (int n = 9; n > 0; n--, dots <<= 1)
*px++ = BIT(dots, 8) ? fg : bg;
}
}
@ -267,7 +284,7 @@ void fs3216_state::fs3216(machine_config &config)
mc6845_device &crtc(MC6845(config, "crtc", 14.58_MHz_XTAL / 9)); // HD46505RP
crtc.set_char_width(9);
crtc.set_show_border_area(false);
crtc.set_update_row_callback(FUNC(fs3216_state::update_row), this);
crtc.set_update_row_callback(FUNC(fs3216_state::crt_update_row), this);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_raw(14.58_MHz_XTAL, 900, 0, 720, 270, 0, 250);