Skip to content

Commit e462f6a

Browse files
committed
bus/rs232/teletex800: Add front panel layout. [Curt Coder]
1 parent 470a06a commit e462f6a

File tree

3 files changed

+252
-19
lines changed

3 files changed

+252
-19
lines changed

scripts/src/bus.lua

+8
Original file line numberDiff line numberDiff line change
@@ -3372,6 +3372,14 @@ if (BUSES["RS232"]~=null) then
33723372
MAME_DIR .. "src/devices/bus/rs232/xvd701.cpp",
33733373
MAME_DIR .. "src/devices/bus/rs232/xvd701.h",
33743374
}
3375+
3376+
dependency {
3377+
{ MAME_DIR .. "src/devices/bus/rs232/teletex800.cpp", GEN_DIR .. "emu/layout/teletex800.lh" },
3378+
}
3379+
3380+
custombuildtask {
3381+
layoutbuildtask("emu/layout", "teletex800"),
3382+
}
33753383
end
33763384

33773385
---------------------------------------------------

src/devices/bus/rs232/teletex800.cpp

+77-19
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,10 @@
1010
#include "machine/z80ctc.h"
1111
#include "machine/z80daisy.h"
1212
#include "machine/z80sio.h"
13+
#include "teletex800.lh"
1314

1415
namespace {
1516

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-
3417
class teletex_800_device : public device_t, public device_rs232_port_interface
3518
{
3619
public:
@@ -42,7 +25,21 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
4225
m_sio(*this, "sio"),
4326
m_acia(*this, "acia"),
4427
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)
4643
{
4744
}
4845

@@ -54,6 +51,8 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
5451

5552
virtual void device_add_mconfig(machine_config &config) override
5653
{
54+
config.set_default_layout(layout_teletex800);
55+
5756
// main board
5857
Z80(config, m_maincpu, XTAL(4'915'200));
5958
m_maincpu->set_daisy_config(z80_daisy_chain);
@@ -77,6 +76,24 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
7776
}
7877

7978
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
8097
{
8198
}
8299

@@ -88,6 +105,21 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
88105
required_device<pia6821_device> m_pia;
89106
required_device<pia6821_device> m_pia_cp;
90107

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+
91123
void program_map(address_map &map)
92124
{
93125
map(0x0000, 0x0fff).rom().region("z80", 0);
@@ -96,6 +128,32 @@ class teletex_800_device : public device_t, public device_rs232_port_interface
96128
void io_map(address_map &map)
97129
{
98130
}
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
99157
};
100158

101159
} // anonymous namespace

src/emu/layout/teletex800.lay

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
license:CC0-1.0
4+
-->
5+
<mamelayout version="2">
6+
<element name="panel">
7+
<!--<image file="teletex800.png" />-->
8+
</element>
9+
10+
<element name="button">
11+
<rect>
12+
<color red="0.25" green="0.25" blue="0.25" />
13+
</rect>
14+
</element>
15+
16+
<element name="red_led" defstate="0">
17+
<disk state="0">
18+
<color red="0.20" green="0.0" blue="0.0" />
19+
</disk>
20+
<disk state="1">
21+
<color red="0.75" green="0.0" blue="0.0" />
22+
</disk>
23+
</element>
24+
25+
<element name="green_led" defstate="0">
26+
<disk state="0">
27+
<color red="0.0" green="0.20" blue="0.0" />
28+
</disk>
29+
<disk state="1">
30+
<color red="0.0" green="0.75" blue="0.0" />
31+
</disk>
32+
</element>
33+
34+
<element name="digit" defstate="0">
35+
<led7seg>
36+
<color red="0.0" green="1.0" blue="0.0" />
37+
</led7seg>
38+
</element>
39+
40+
<element name="time_led" defstate="0">
41+
<text state="0" string="TID">
42+
<color red="0.0" green="0.20" blue="0.0" />
43+
</text>
44+
<text state="1" string="TID">
45+
<color red="0.0" green="0.75" blue="0.0" />
46+
</text>
47+
</element>
48+
49+
<element name="date_led" defstate="0">
50+
<text state="0" string="DAT">
51+
<color red="0.0" green="0.20" blue="0.0" />
52+
</text>
53+
<text state="1" string="DAT">
54+
<color red="0.0" green="0.75" blue="0.0" />
55+
</text>
56+
</element>
57+
58+
<element name="year_led" defstate="0">
59+
<text state="0" string="ÅR">
60+
<color red="0.0" green="0.20" blue="0.0" />
61+
</text>
62+
<text state="1" string="ÅR">
63+
<color red="0.0" green="0.75" blue="0.0" />
64+
</text>
65+
</element>
66+
67+
<view name="Front panel">
68+
<bounds x="0" y="0" width="810" height="473" />
69+
70+
<element ref="panel">
71+
<bounds x="0" y="0" width="810" height="473" />
72+
</element>
73+
74+
<!-- BATTERI DRIFT -->
75+
<element name="bat_led" ref="red_led">
76+
<bounds x="114" y="118" width="16" height="16" />
77+
</element>
78+
79+
<!-- SKRIVAR FEL -->
80+
<element name="pr_led" ref="red_led">
81+
<bounds x="205" y="118" width="16" height="16" />
82+
</element>
83+
84+
<!-- OKVITT TELEX -->
85+
<element name="telex_led" ref="green_led">
86+
<bounds x="298" y="118" width="16" height="16" />
87+
</element>
88+
89+
<!-- MOTTAGNA -->
90+
<element name="rx_digit0" ref="digit">
91+
<bounds x="384" y="107" width="38" height="49" />
92+
</element>
93+
94+
<element name="rx_digit1" ref="digit">
95+
<bounds x="440" y="107" width="38" height="49" />
96+
</element>
97+
98+
<!-- SEND KÖ -->
99+
<element name="tx_digit0" ref="digit">
100+
<bounds x="522" y="107" width="38" height="49" />
101+
</element>
102+
103+
<element name="tx_digit1" ref="digit">
104+
<bounds x="578" y="107" width="38" height="49" />
105+
</element>
106+
107+
<!-- TID -->
108+
<element name="time_led" ref="time_led">
109+
<bounds x="658" y="99" width="29" height="14" />
110+
</element>
111+
112+
<!-- DAT -->
113+
<element name="date_led" ref="date_led">
114+
<bounds x="659" y="123" width="29" height="14" />
115+
</element>
116+
117+
<!-- ÅR -->
118+
<element name="year_led" ref="year_led">
119+
<bounds x="659" y="147" width="22" height="14" />
120+
</element>
121+
122+
<!-- MINNES VARNING -->
123+
<element name="mem_led" ref="red_led">
124+
<bounds x="114" y="204" width="16" height="16" />
125+
</element>
126+
127+
<!-- OBS -->
128+
<element name="obs_led" ref="red_led">
129+
<bounds x="205" y="204" width="16" height="16" />
130+
</element>
131+
132+
<!-- SKRIV -->
133+
<element name="write_led" ref="green_led">
134+
<bounds x="298" y="204" width="16" height="16" />
135+
</element>
136+
137+
<!-- LOG -->
138+
<element name="log_led" ref="green_led">
139+
<bounds x="388" y="204" width="16" height="16" />
140+
</element>
141+
142+
<!---->
143+
<element name="queue_led" ref="green_led">
144+
<bounds x="479" y="204" width="16" height="16" />
145+
</element>
146+
147+
<!-- ALLA -->
148+
<element name="all_led" ref="green_led">
149+
<bounds x="571" y="204" width="16" height="16" />
150+
</element>
151+
152+
<!-- SKRIV -->
153+
<element ref="button" inputtag="BTN" inputmask="0x01">
154+
<bounds x="275" y="262" width="54" height="54" />
155+
</element>
156+
157+
<!-- ALLA -->
158+
<element ref="button" inputtag="BTN" inputmask="0x02">
159+
<bounds x="556" y="261" width="54" height="54" />
160+
</element>
161+
162+
<!-- KLOCK -->
163+
<element ref="button" inputtag="BTN" inputmask="0x04">
164+
<bounds x="648" y="263" width="54" height="54" />
165+
</element>
166+
</view>
167+
</mamelayout>

0 commit comments

Comments
 (0)