summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/ti99/evpc.h
blob: 6cb64e54a0bf2f1cb821dc35472088654102eca5 (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
54
55
56
57
58
59
60
61
62
/****************************************************************************

    SNUG Enhanced Video Processor Card (evpc)
    See evpc.c for documentation.

    Michael Zapf

    October 2010: Rewritten as device
    February 2012: Rewritten as class

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

#ifndef __EVPC__
#define __EVPC__

#include "emu.h"
#include "ti99defs.h"
#include "peribox.h"
#include "dinvram.h"

extern const device_type TI99_EVPC;

struct evpc_palette
{
	UINT8		read_index, write_index, mask;
	int 		read;
	int 		state;
	struct { UINT8 red, green, blue; } color[0x100];
	//int dirty;
};

class snug_enhanced_video_device : public ti_expansion_card_device, public device_nvram_interface
{
public:
	snug_enhanced_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	DECLARE_READ8Z_MEMBER(readz);
	DECLARE_WRITE8_MEMBER(write);

	void	crureadz(offs_t offset, UINT8 *value);
	void	cruwrite(offs_t offset, UINT8 data);

protected:
	void device_start(void);
	void device_reset(void);
	void device_stop(void);

	const rom_entry *device_rom_region() const;
	ioport_constructor device_input_ports() const;

	void nvram_default();
	void nvram_read(emu_file &file);
	void nvram_write(emu_file &file);

private:
	UINT8*			m_dsrrom;
	bool			m_RAMEN;
	int 			m_dsr_page;
	UINT8*			m_novram;	/* NOVRAM area */
	evpc_palette	m_palette;
};

#endif