summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/includes/cybiko.h
blob: 769d1208a41af24c05518c714b2bb2023addb4a8 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*****************************************************************************
 *
 * includes/cybiko.h
 *
 * Cybiko Wireless Inter-tainment System
 *
 * (c) 2001-2007 Tim Schuerewegen
 *
 * Cybiko Classic (V1)
 * Cybiko Classic (V2)
 * Cybiko Xtreme
 *
 ****************************************************************************/

#ifndef CYBIKO_H_
#define CYBIKO_H_

/* Core includes */
#include "emu.h"
#include "emuopts.h"
#include "sound/speaker.h"

/* Components */
#include "cpu/h83002/h8.h"
#include "video/hd66421.h"
#include "machine/pcf8593.h"
#include "machine/at45dbxx.h"
#include "machine/sst39vfx.h"
#include "machine/ram.h"

struct CYBIKO_RS232_PINS 
{
	int sck; // serial clock
	int txd; // transmit data
	int rxd; // receive data
};

struct CYBIKO_RS232 
{
	CYBIKO_RS232_PINS pin;
	UINT8 rx_bits, rx_byte, tx_byte, tx_bits;
};

class cybiko_state : public driver_device
{
public:
	cybiko_state(const machine_config &mconfig, device_type type, const char *tag)
		: driver_device(mconfig, type, tag),
	m_crtc(*this, "hd66421"),
	m_speaker(*this, SPEAKER_TAG),
	m_rtc(*this, "rtc"),
	m_flash1(*this, "flash1")
	{ }

	CYBIKO_RS232 m_rs232;
	DECLARE_READ16_MEMBER(cybiko_lcd_r);
	DECLARE_WRITE16_MEMBER(cybiko_lcd_w);
	DECLARE_READ16_MEMBER(cybikov1_key_r);
	DECLARE_READ16_MEMBER(cybikov2_key_r);
	DECLARE_READ16_MEMBER(cybikoxt_key_r);
	DECLARE_WRITE16_MEMBER(cybiko_usb_w);
	DECLARE_READ8_MEMBER(cybikov1_io_reg_r);
	DECLARE_READ8_MEMBER(cybikov2_io_reg_r);
	DECLARE_READ8_MEMBER(cybikoxt_io_reg_r);
	DECLARE_WRITE8_MEMBER(cybikov1_io_reg_w);
	DECLARE_WRITE8_MEMBER(cybikov2_io_reg_w);
	DECLARE_WRITE8_MEMBER(cybikoxt_io_reg_w);
	int cybiko_key_r( offs_t offset, int mem_mask);
	void cybiko_rs232_write_byte(int data);
	void cybiko_rs232_pin_sck(int data);
	void cybiko_rs232_pin_txd(int data);
	int cybiko_rs232_pin_rxd();
	int cybiko_rs232_rx_queue();

	required_device<hd66421_device> m_crtc;
	required_device<device_t> m_speaker;
	required_device<device_t> m_rtc;
	optional_device<device_t> m_flash1;
	DECLARE_DRIVER_INIT(cybikoxt);
	DECLARE_DRIVER_INIT(cybikov1);
	DECLARE_DRIVER_INIT(cybikov2);
	virtual void machine_start();
	virtual void machine_reset();
	virtual void palette_init();
	DECLARE_MACHINE_START(cybikov2);
	DECLARE_MACHINE_RESET(cybikov2);
	DECLARE_MACHINE_START(cybikoxt);
	DECLARE_MACHINE_RESET(cybikoxt);
};


/*----------- defined in machine/cybiko.c -----------*/

// driver init

// machine start




// machine reset





#endif /* CYBIKO_H_ */