mirror of
https://github.com/holub/mame
synced 2025-06-30 07:58:56 +03:00
mmdisplay2: lcd screen was missing 1 line (nw)
This commit is contained in:
parent
ab1e7c73c4
commit
c32a21f8b0
@ -894,7 +894,7 @@ void video_manager::update_frameskip()
|
||||
// calibrate the "adjusted speed" based on the target
|
||||
double adjusted_speed_percent = m_speed_percent / (double) m_throttle_rate;
|
||||
|
||||
// if we're too fast, attempt to increase the frameskip
|
||||
// if we're too fast, attempt to decrease the frameskip
|
||||
double speed = m_speed * 0.001;
|
||||
if (adjusted_speed_percent >= 0.995 * speed)
|
||||
{
|
||||
|
@ -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);
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
// construction/destruction
|
||||
mephisto_display_module2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
|
||||
hd44780_device *get() { return m_lcdc; }
|
||||
hd44780_device *get() { return m_lcd; }
|
||||
|
||||
void latch_w(uint8_t data);
|
||||
void io_w(uint8_t data);
|
||||
@ -38,11 +38,13 @@ protected:
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
void lcd_palette(palette_device &palette) const;
|
||||
|
||||
private:
|
||||
optional_device<hd44780_device> m_lcdc;
|
||||
optional_device<hd44780_device> m_lcd;
|
||||
required_device<dac_byte_interface> m_dac;
|
||||
|
||||
void lcd_palette(palette_device &palette) const;
|
||||
HD44780_PIXEL_UPDATE(lcd_pixel_update);
|
||||
|
||||
uint8_t m_latch;
|
||||
uint8_t m_ctrl;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user