diff options
Diffstat (limited to 'src/mame/video/mmdisplay2.cpp')
-rw-r--r-- | src/mame/video/mmdisplay2.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/mame/video/mmdisplay2.cpp b/src/mame/video/mmdisplay2.cpp index fee2739463e..750e7506173 100644 --- a/src/mame/video/mmdisplay2.cpp +++ b/src/mame/video/mmdisplay2.cpp @@ -8,6 +8,7 @@ but that part is emulated in the driver. TODO: - add mmdisplay1.cpp, the one with shift registers and 4-digit lcd +- correct lcd screen aspect ratio in layouts *********************************************************************/ @@ -25,7 +26,7 @@ DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display_module2_device, "m mephisto_display_module2_device::mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MEPHISTO_DISPLAY_MODULE2, tag, owner, clock) - , m_lcdc(*this, "hd44780") + , m_lcd(*this, "hd44780") , m_dac(*this, "dac") { } @@ -39,15 +40,18 @@ void mephisto_display_module2_device::device_add_mconfig(machine_config &config) { /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); - screen.set_refresh_hz(50); - screen.set_size(16*6, 9*2); - screen.set_visarea(0, 16*6-1, 0, 9*2-3); + screen.set_refresh_hz(60); // arbitrary + screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); + screen.set_size(6*16+1, 9*2+1); + screen.set_visarea_full(); screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); screen.set_palette("palette"); - PALETTE(config, "palette", FUNC(mephisto_display_module2_device::lcd_palette), 2); - HD44780(config, m_lcdc, 0); - m_lcdc->set_lcd_size(2, 16); + PALETTE(config, "palette", FUNC(mephisto_display_module2_device::lcd_palette), 3); + + HD44780(config, m_lcd, 0); + m_lcd->set_lcd_size(2, 16); + m_lcd->set_pixel_update_cb(FUNC(mephisto_display_module2_device::lcd_pixel_update)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); @@ -61,6 +65,13 @@ void mephisto_display_module2_device::lcd_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(138, 146, 148)); // background palette.set_pen_color(1, rgb_t(51, 42, 43)); // lcd pixel on + palette.set_pen_color(2, rgb_t(130, 136, 137)); // lcd pixel off +} + +HD44780_PIXEL_UPDATE(mephisto_display_module2_device::lcd_pixel_update) +{ + if (x < 5 && y < 8 && line < 2 && pos < 16) + bitmap.pix16(line*9 + 1 + y, 1 + pos*6 + x) = state ? 1 : 2; } @@ -98,7 +109,7 @@ void mephisto_display_module2_device::latch_w(uint8_t data) void mephisto_display_module2_device::io_w(uint8_t data) { if (BIT(data, 1) && !BIT(m_ctrl, 1)) - m_lcdc->write(BIT(data, 0), m_latch); + m_lcd->write(BIT(data, 0), m_latch); m_dac->write(data >> 2 & 3); |