1 // license:BSD-3-Clause
2 // copyright-holders:Curt Coder, Robbbert
3 #pragma once
4 
5 #ifndef MAME_INCLUDES_PHC25_H
6 #define MAME_INCLUDES_PHC25_H
7 
8 
9 #include "cpu/z80/z80.h"
10 #include "imagedev/cassette.h"
11 #include "machine/ram.h"
12 #include "bus/centronics/ctronics.h"
13 #include "video/mc6847.h"
14 #include "sound/ay8910.h"
15 #include "formats/phc25_cas.h"
16 
17 #define SCREEN_TAG      "screen"
18 #define Z80_TAG         "z80"
19 #define AY8910_TAG      "ay8910"
20 #define MC6847_TAG      "mc6847"
21 #define CENTRONICS_TAG  "centronics"
22 
23 #define PHC25_VIDEORAM_SIZE     0x1800
24 
25 class phc25_state : public driver_device
26 {
27 public:
phc25_state(const machine_config & mconfig,device_type type,const char * tag)28 	phc25_state(const machine_config &mconfig, device_type type, const char *tag)
29 		: driver_device(mconfig, type, tag)
30 		, m_vram(*this, "videoram")
31 		, m_maincpu(*this, Z80_TAG)
32 		, m_vdg(*this, MC6847_TAG)
33 		, m_centronics(*this, CENTRONICS_TAG)
34 		, m_cassette(*this, "cassette")
35 	{ }
36 
37 	void phc25(machine_config &config);
38 	void pal(machine_config &config);
39 	void ntsc(machine_config &config);
40 
41 private:
42 	void io_map(address_map &map);
43 	void mem_map(address_map &map);
44 	DECLARE_WRITE_LINE_MEMBER( write_centronics_busy );
45 	uint8_t port40_r();
46 	void port40_w(uint8_t data);
47 	DECLARE_WRITE_LINE_MEMBER(irq_w);
48 	uint8_t video_ram_r(offs_t offset);
49 	MC6847_GET_CHARROM_MEMBER(ntsc_char_rom_r);
50 	MC6847_GET_CHARROM_MEMBER(pal_char_rom_r);
51 	void machine_start() override;
52 	void machine_reset() override;
53 	uint8_t *m_char_rom;
54 	uint8_t m_port40;
55 	int m_centronics_busy;
56 	required_shared_ptr<uint8_t> m_vram;
57 	required_device<cpu_device> m_maincpu;
58 	required_device<mc6847_base_device> m_vdg;
59 	required_device<centronics_device> m_centronics;
60 	required_device<cassette_image_device> m_cassette;
61 };
62 
63 #endif
64