1 // license:BSD-3-Clause
2 // copyright-holders:Curt Coder,Jonathan Gevaryahu
3 #ifndef MAME_INCLUDES_TDV2324_H
4 #define MAME_INCLUDES_TDV2324_H
5 
6 #pragma once
7 
8 
9 #include "cpu/i8085/i8085.h"
10 #include "cpu/m6800/m6800.h"
11 #include "imagedev/floppy.h"
12 #include "imagedev/harddriv.h"
13 #include "machine/pit8253.h"
14 #include "machine/pic8259.h"
15 #include "machine/ram.h"
16 #include "machine/wd_fdc.h"
17 #include "machine/z80sio.h"
18 #include "video/tms9927.h"
19 
20 
21 
22 //**************************************************************************
23 //  MACROS / CONSTANTS
24 //**************************************************************************
25 
26 #define P8085AH_0_TAG       "17f"
27 #define P8259A_TAG          "17d"
28 #define P8253_5_0_TAG       "17c"
29 #define P8253_5_1_TAG       "18c"
30 #define ER3400_TAG          "12a"
31 
32 #define P8085AH_1_TAG       "6c"
33 #define TMS9937NL_TAG       "7e"
34 #define MK3887N4_TAG        "15d"
35 
36 #define MC68B02P_TAG        "12b"
37 #define FD1797PL02_TAG      "fd1797"
38 
39 #define SCREEN_TAG          "screen"
40 
41 
42 
43 //**************************************************************************
44 //  TYPE DEFINITIONS
45 //**************************************************************************
46 
47 class tdv2324_state : public driver_device
48 {
49 public:
tdv2324_state(const machine_config & mconfig,device_type type,const char * tag)50 	tdv2324_state(const machine_config &mconfig, device_type type, const char *tag)
51 		: driver_device(mconfig, type, tag)
52 		, m_maincpu(*this, P8085AH_0_TAG)
53 		, m_subcpu(*this, P8085AH_1_TAG)
54 		, m_fdccpu(*this, MC68B02P_TAG)
55 		, m_sio(*this, MK3887N4_TAG)
56 		, m_pic(*this, P8259A_TAG)
57 		, m_pit0(*this, P8253_5_0_TAG)
58 		, m_pit1(*this, P8253_5_1_TAG)
59 		, m_tms(*this, TMS9937NL_TAG)
60 		, m_video_ram(*this, "video_ram")
61 	{ }
62 
63 	void tdv2324(machine_config &config);
64 
65 private:
66 	required_device<cpu_device> m_maincpu;
67 	required_device<cpu_device> m_subcpu;
68 	required_device<m6802_cpu_device> m_fdccpu;
69 	required_device<z80sio_device> m_sio;
70 	required_device<pic8259_device> m_pic;
71 	required_device<pit8253_device> m_pit0;
72 	required_device<pit8253_device> m_pit1;
73 	required_device<tms9927_device> m_tms;
74 
75 	virtual void video_start() override;
76 	uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
77 
78 	uint8_t tdv2324_main_io_30();
79 	uint8_t tdv2324_main_io_e6();
80 	void tdv2324_main_io_e2(uint8_t data);
81 
82 	// video state
83 	required_shared_ptr<uint8_t> m_video_ram;
84 	void tdv2324_fdc_mem(address_map &map);
85 	void tdv2324_io(address_map &map);
86 	void tdv2324_mem(address_map &map);
87 	void tdv2324_sub_io(address_map &map);
88 	void tdv2324_sub_mem(address_map &map);
89 };
90 
91 
92 #endif
93