10
10
#include " machine/z80ctc.h"
11
11
#include " machine/z80daisy.h"
12
12
#include " machine/z80sio.h"
13
+ #include " teletex800.lh"
13
14
14
15
namespace {
15
16
16
- ROM_START ( teletex800 )
17
- ROM_REGION ( 0x1000 , " z80" , 0 )
18
- ROM_LOAD ( " ix44_ver1.1.u57" , 0x0000 , 0x1000 , CRC(5c11b89c) SHA1(4911332709a8dcda12e72bcdf7a0acd58d65cbfd) )
19
- ROM_END
20
-
21
- static const z80_daisy_config z80_daisy_chain[] =
22
- {
23
- { nullptr }
24
- };
25
-
26
- static void printer_devices (device_slot_interface &device)
27
- {
28
- device.option_add (" printer" , SERIAL_PRINTER);
29
- }
30
-
31
- static INPUT_PORTS_START ( teletex800 )
32
- INPUT_PORTS_END
33
-
34
17
class teletex_800_device : public device_t , public device_rs232_port_interface
35
18
{
36
19
public:
@@ -42,7 +25,21 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
42
25
m_sio (*this , " sio" ),
43
26
m_acia (*this , " acia" ),
44
27
m_pia (*this , " pia" ),
45
- m_pia_cp (*this , " pia_cp" )
28
+ m_pia_cp (*this , " pia_cp" ),
29
+ m_bat_led (*this , " bat_led" ),
30
+ m_pr_led (*this , " pr_led" ),
31
+ m_telex_led (*this , " telex_led" ),
32
+ m_mem_led (*this , " mem_led" ),
33
+ m_obs_led (*this , " obs_led" ),
34
+ m_write_led (*this , " write_led" ),
35
+ m_log_led (*this , " log_led" ),
36
+ m_queue_led (*this , " queue_led" ),
37
+ m_all_led (*this , " all_led" ),
38
+ m_time_led (*this , " time_led" ),
39
+ m_date_led (*this , " date_led" ),
40
+ m_year_led (*this , " year_led" ),
41
+ m_rx_digits (*this , " rx_digit%u" , 0U ),
42
+ m_tx_digits (*this , " tx_digit%u" , 0U )
46
43
{
47
44
}
48
45
@@ -54,6 +51,8 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
54
51
55
52
virtual void device_add_mconfig (machine_config &config) override
56
53
{
54
+ config.set_default_layout (layout_teletex800);
55
+
57
56
// main board
58
57
Z80 (config, m_maincpu, XTAL (4'915'200 ));
59
58
m_maincpu->set_daisy_config (z80_daisy_chain);
@@ -77,6 +76,24 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
77
76
}
78
77
79
78
virtual void device_start () override
79
+ {
80
+ m_bat_led.resolve ();
81
+ m_pr_led.resolve ();
82
+ m_telex_led.resolve ();
83
+ m_mem_led.resolve ();
84
+ m_obs_led.resolve ();
85
+ m_write_led.resolve ();
86
+ m_log_led.resolve ();
87
+ m_queue_led.resolve ();
88
+ m_all_led.resolve ();
89
+ m_time_led.resolve ();
90
+ m_date_led.resolve ();
91
+ m_year_led.resolve ();
92
+ m_rx_digits.resolve ();
93
+ m_tx_digits.resolve ();
94
+ }
95
+
96
+ virtual void device_reset () override
80
97
{
81
98
}
82
99
@@ -88,6 +105,21 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
88
105
required_device<pia6821_device> m_pia;
89
106
required_device<pia6821_device> m_pia_cp;
90
107
108
+ output_finder<> m_bat_led;
109
+ output_finder<> m_pr_led;
110
+ output_finder<> m_telex_led;
111
+ output_finder<> m_mem_led;
112
+ output_finder<> m_obs_led;
113
+ output_finder<> m_write_led;
114
+ output_finder<> m_log_led;
115
+ output_finder<> m_queue_led;
116
+ output_finder<> m_all_led;
117
+ output_finder<> m_time_led;
118
+ output_finder<> m_date_led;
119
+ output_finder<> m_year_led;
120
+ output_finder<2 > m_rx_digits;
121
+ output_finder<2 > m_tx_digits;
122
+
91
123
void program_map (address_map &map)
92
124
{
93
125
map (0x0000 , 0x0fff ).rom ().region (" z80" , 0 );
@@ -96,6 +128,32 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
96
128
void io_map (address_map &map)
97
129
{
98
130
}
131
+
132
+ constexpr static const z80_daisy_config z80_daisy_chain[] =
133
+ {
134
+ { nullptr }
135
+ };
136
+
137
+ static void printer_devices (device_slot_interface &device)
138
+ {
139
+ device.option_add (" printer" , SERIAL_PRINTER);
140
+ }
141
+
142
+ INPUT_CHANGED_MEMBER ( write ) { };
143
+ INPUT_CHANGED_MEMBER ( all ) { };
144
+ INPUT_CHANGED_MEMBER ( clock ) { };
145
+
146
+ static INPUT_PORTS_START ( teletex800 )
147
+ PORT_START(" BTN" )
148
+ PORT_BIT( 0x01 , IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(" SKRIV" ) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(teletex_800_device::write), 0)
149
+ PORT_BIT( 0x02 , IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(" ALLA" ) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(teletex_800_device::all), 0)
150
+ PORT_BIT( 0x04 , IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME(" KLOCK" ) PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(teletex_800_device::clock), 0)
151
+ INPUT_PORTS_END
152
+
153
+ constexpr ROM_START( teletex800 )
154
+ ROM_REGION( 0x1000 , " z80" , 0 )
155
+ ROM_LOAD( " ix44_ver1.1.u57" , 0x0000 , 0x1000 , CRC(5c11b89c) SHA1(4911332709a8dcda12e72bcdf7a0acd58d65cbfd) )
156
+ ROM_END
99
157
};
100
158
101
159
} // anonymous namespace
0 commit comments