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
|
// license:BSD-3-Clause
// copyright-holders:Miodrag Milanovic
/*****************************************************************************
*
* includes/mz80.h
*
****************************************************************************/
#ifndef MZ80_H_
#define MZ80_H_
#include "cpu/z80/z80.h"
#include "machine/i8255.h"
#include "machine/pit8253.h"
#include "imagedev/cassette.h"
#include "sound/speaker.h"
#include "sound/wave.h"
class mz80_state : public driver_device
{
public:
mz80_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_pit(*this, "pit8253")
, m_ppi(*this, "ppi8255")
, m_cassette(*this, "cassette")
, m_speaker(*this, "speaker")
, m_p_ram(*this, "p_ram")
, m_p_videoram(*this, "videoram")
{ }
DECLARE_READ8_MEMBER(mz80k_strobe_r);
DECLARE_WRITE8_MEMBER(mz80k_strobe_w);
DECLARE_READ8_MEMBER(mz80k_8255_portb_r);
DECLARE_READ8_MEMBER(mz80k_8255_portc_r);
DECLARE_WRITE8_MEMBER(mz80k_8255_porta_w);
DECLARE_WRITE8_MEMBER(mz80k_8255_portc_w);
DECLARE_WRITE_LINE_MEMBER(pit_out0_changed);
DECLARE_WRITE_LINE_MEMBER(pit_out2_changed);
DECLARE_DRIVER_INIT(mz80k);
uint32_t screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ne555_tempo_callback);
private:
required_device<cpu_device> m_maincpu;
required_device<pit8253_device> m_pit;
required_device<i8255_device> m_ppi;
required_device<cassette_image_device> m_cassette;
required_device<speaker_sound_device> m_speaker;
bool m_mz80k_vertical;
bool m_mz80k_tempo_strobe;
uint8_t m_speaker_level;
bool m_prev_state;
uint8_t m_mz80k_cursor_cnt;
uint8_t m_mz80k_keyboard_line;
required_shared_ptr<uint8_t> m_p_ram;
const uint8_t *m_p_chargen;
required_shared_ptr<uint8_t> m_p_videoram;
virtual void machine_reset() override;
virtual void video_start() override;
};
/*----------- defined in video/mz80.c -----------*/
extern const gfx_layout mz80k_charlayout;
extern const gfx_layout mz80kj_charlayout;
#endif /* MZ80_H_ */
|