diff options
Diffstat (limited to 'src/mame/video/mmdisplay2.cpp')
-rw-r--r-- | src/mame/video/mmdisplay2.cpp | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/mame/video/mmdisplay2.cpp b/src/mame/video/mmdisplay2.cpp index 2171c571680..0692c5d9c30 100644 --- a/src/mame/video/mmdisplay2.cpp +++ b/src/mame/video/mmdisplay2.cpp @@ -6,9 +6,6 @@ Hegener + Glaser Mephisto Display Module for modular chesscomputers, the 2nd version with 2 LCD lines. The 16/32bit module also includes 8KB NVRAM, but that part is emulated in the driver. -TODO: -- add mmdisplay1.cpp, the one with shift registers and 4-digit lcd - *********************************************************************/ #include "emu.h" @@ -16,13 +13,13 @@ TODO: #include "mmdisplay2.h" -DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display_module2_device, "mdisplay2", "Mephisto Display Module 2") +DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display2_device, "mdisplay2", "Mephisto Display Module 2") //------------------------------------------------- // constructor //------------------------------------------------- -mephisto_display_module2_device::mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) +mephisto_display2_device::mephisto_display2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, MEPHISTO_DISPLAY_MODULE2, tag, owner, clock) , m_lcd(*this, "hd44780") , m_dac(*this, "dac") @@ -34,7 +31,7 @@ mephisto_display_module2_device::mephisto_display_module2_device(const machine_c // device_add_mconfig //------------------------------------------------- -void mephisto_display_module2_device::device_add_mconfig(machine_config &config) +void mephisto_display2_device::device_add_mconfig(machine_config &config) { /* video hardware */ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_LCD)); @@ -45,25 +42,25 @@ void mephisto_display_module2_device::device_add_mconfig(machine_config &config) screen.set_screen_update("hd44780", FUNC(hd44780_device::screen_update)); screen.set_palette("palette"); - PALETTE(config, "palette", FUNC(mephisto_display_module2_device::lcd_palette), 3); + PALETTE(config, "palette", FUNC(mephisto_display2_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)); + m_lcd->set_pixel_update_cb(FUNC(mephisto_display2_device::lcd_pixel_update)); /* sound hardware */ SPEAKER(config, "speaker").front_center(); DAC_2BIT_BINARY_WEIGHTED_ONES_COMPLEMENT(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.25); } -void mephisto_display_module2_device::lcd_palette(palette_device &palette) const +void mephisto_display2_device::lcd_palette(palette_device &palette) const { palette.set_pen_color(0, rgb_t(0xff, 0xff, 0xff)); // background palette.set_pen_color(1, rgb_t(0x00, 0x00, 0x00)); // lcd pixel on palette.set_pen_color(2, rgb_t(0xe8, 0xe8, 0xe8)); // lcd pixel off } -HD44780_PIXEL_UPDATE(mephisto_display_module2_device::lcd_pixel_update) +HD44780_PIXEL_UPDATE(mephisto_display2_device::lcd_pixel_update) { if (x < 5 && y < 8 && line < 2 && pos < 16) bitmap.pix(line*9 + 1 + y, 1 + pos*6 + x) = state ? 1 : 2; @@ -74,7 +71,7 @@ HD44780_PIXEL_UPDATE(mephisto_display_module2_device::lcd_pixel_update) // device_start - device-specific startup //------------------------------------------------- -void mephisto_display_module2_device::device_start() +void mephisto_display2_device::device_start() { save_item(NAME(m_latch)); save_item(NAME(m_ctrl)); @@ -85,7 +82,7 @@ void mephisto_display_module2_device::device_start() // device_reset - device-specific reset //------------------------------------------------- -void mephisto_display_module2_device::device_reset() +void mephisto_display2_device::device_reset() { m_latch = 0; m_ctrl = 0; @@ -96,12 +93,12 @@ void mephisto_display_module2_device::device_reset() // I/O handlers //------------------------------------------------- -void mephisto_display_module2_device::latch_w(uint8_t data) +void mephisto_display2_device::latch_w(uint8_t data) { m_latch = data; } -void mephisto_display_module2_device::io_w(uint8_t data) +void mephisto_display2_device::io_w(uint8_t data) { if (BIT(data, 1) && !BIT(m_ctrl, 1)) m_lcd->write(BIT(data, 0), m_latch); |