summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/mc68328lcd.h
blob: 0954eaa65058a1838d35081644708e84424c7e6d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
/******************************************************************************

    Generic LCD emulation for use with MC68328/MC68EZ328 devices

******************************************************************************/

#ifndef MAME_VIDEO_MC68328LCD_H
#define MAME_VIDEO_MC68328LCD_H

#pragma once

class mc68328_lcd_device : public device_t,
                           public device_palette_interface,
                           public device_video_interface
{
public:
	mc68328_lcd_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);

	DECLARE_WRITE_LINE_MEMBER(flm_w);
	DECLARE_WRITE_LINE_MEMBER(llp_w);
	DECLARE_WRITE_LINE_MEMBER(lsclk_w);
	void ld_w(u8 data);
	void lcd_info_changed(double refresh_hz, int width, int height, u8 bus_width, u8 bpp);

	void video_update(bitmap_rgb32 &bitmap, const rectangle &cliprect);

protected:
	// device-level overrides
	virtual void device_start() override;
	virtual void device_reset() override;

	// device_palette_interface overrides
	virtual uint32_t palette_entries() const noexcept override { return 16; }

	void palette_init();

	bitmap_rgb32 m_lcd_bitmap;
	bool m_lcd_first_line;
	bool m_lcd_line_pulse;
	bool m_lcd_shift_clk;
	u8 m_lcd_data;
	u16 m_lcd_scan_x;
	u16 m_lcd_scan_y;
	u8 m_bus_width;
	u8 m_bpp;
};

// device type definition
DECLARE_DEVICE_TYPE(MC68328_LCD, mc68328_lcd_device)

#endif // MAME_VIDEO_MC68328LCD_H