mirror of
https://github.com/mamedev/mame.git
synced 2024-11-18 10:06:19 +01:00
mmdisplay2: hd44780_device is not optional_device
This commit is contained in:
parent
4e6cea2f8f
commit
0c3cd2504b
3 changed files with 13 additions and 17 deletions
|
@ -9,7 +9,6 @@ with 4 4015 dual shift registers.
|
|||
*********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "mmdisplay1.h"
|
||||
|
||||
|
||||
|
|
|
@ -9,9 +9,11 @@ but that part is emulated in the driver.
|
|||
*********************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "mmdisplay2.h"
|
||||
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display2_device, "mdisplay2", "Mephisto Display Module 2")
|
||||
|
||||
|
@ -19,7 +21,7 @@ DEFINE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display2_device, "mdisplay
|
|||
// constructor
|
||||
//-------------------------------------------------
|
||||
|
||||
mephisto_display2_device::mephisto_display2_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, u32 clock)
|
||||
: device_t(mconfig, MEPHISTO_DISPLAY_MODULE2, tag, owner, clock)
|
||||
, m_lcd(*this, "hd44780")
|
||||
, m_dac(*this, "dac")
|
||||
|
@ -93,12 +95,12 @@ void mephisto_display2_device::device_reset()
|
|||
// I/O handlers
|
||||
//-------------------------------------------------
|
||||
|
||||
void mephisto_display2_device::latch_w(uint8_t data)
|
||||
void mephisto_display2_device::latch_w(u8 data)
|
||||
{
|
||||
m_latch = data;
|
||||
}
|
||||
|
||||
void mephisto_display2_device::io_w(uint8_t data)
|
||||
void mephisto_display2_device::io_w(u8 data)
|
||||
{
|
||||
if (BIT(data, 1) && !BIT(m_ctrl, 1))
|
||||
m_lcd->write(BIT(data, 0), m_latch);
|
||||
|
|
|
@ -11,26 +11,22 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include "video/hd44780.h"
|
||||
#include "sound/dac.h"
|
||||
#include "video/hd44780.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
// ======================> mephisto_display2_device
|
||||
|
||||
class mephisto_display2_device : public device_t
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
mephisto_display2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
|
||||
mephisto_display2_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
|
||||
|
||||
hd44780_device *get() { return m_lcd; }
|
||||
|
||||
void latch_w(uint8_t data);
|
||||
void io_w(uint8_t data);
|
||||
void latch_w(u8 data);
|
||||
void io_w(u8 data);
|
||||
u8 io_r() { return m_ctrl; }
|
||||
|
||||
protected:
|
||||
|
@ -40,18 +36,17 @@ protected:
|
|||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
optional_device<hd44780_device> m_lcd;
|
||||
required_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 = 0;
|
||||
uint8_t m_ctrl = 0;
|
||||
u8 m_latch = 0;
|
||||
u8 m_ctrl = 0;
|
||||
};
|
||||
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(MEPHISTO_DISPLAY_MODULE2, mephisto_display2_device)
|
||||
|
||||
#endif // MAME_VIDEO_MMDISPLAY2_H
|
||||
|
|
Loading…
Reference in a new issue