summaryrefslogtreecommitdiffstats
path: root/src/mame/includes/pk8000.h
blob: cb92dca6aa7973a7c637116349a48cdf4c2060c1 (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
// license:BSD-3-Clause
// copyright-holders:Miodrag Milanovic
#ifndef MAME_INCLUDES_PK8000_H
#define MAME_INCLUDES_PK8000_H

#pragma once

#include "emupal.h"

class pk8000_base_state : public driver_device
{
public:
	pk8000_base_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag)
		, m_maincpu(*this, "maincpu")
	{ }

protected:
	uint8_t _84_porta_r();
	void _84_porta_w(uint8_t data);
	void _84_portc_w(uint8_t data);

	uint8_t video_color_r();
	void video_color_w(uint8_t data);
	uint8_t text_start_r();
	void text_start_w(uint8_t data);
	uint8_t chargen_start_r();
	void chargen_start_w(uint8_t data);
	uint8_t video_start_r();
	void video_start_w(uint8_t data);
	uint8_t color_start_r();
	void color_start_w(uint8_t data);
	uint8_t color_r(offs_t offset);
	void color_w(offs_t offset, uint8_t data);

	void pk8000_palette(palette_device &palette) const;
	uint32_t video_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, uint8_t *videomem);

	uint8_t m_text_start = 0;
	uint8_t m_chargen_start = 0;
	uint8_t m_video_start = 0;
	uint8_t m_color_start = 0;

	uint8_t m_video_mode = 0;
	uint8_t m_video_color = 0;
	uint8_t m_color[32];
	uint8_t m_video_enable = 0;
	required_device<cpu_device> m_maincpu;
};

#endif // MAME_INCLUDES_PK8000_H