summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2024-12-20 11:09:52 +0200
committer Curt Coder <curtcoder@mail.com>2024-12-20 11:11:24 +0200
commite462f6a53992b55d05b5850d44272808e01bd426 (patch)
tree290fbc6ff1cbf9e949bed834a85e8e2701571289
parent470a06a297b032fc733799781793b45306eb20b9 (diff)
bus/rs232/teletex800: Add front panel layout. [Curt Coder]
-rw-r--r--scripts/src/bus.lua8
-rw-r--r--src/devices/bus/rs232/teletex800.cpp96
-rw-r--r--src/emu/layout/teletex800.lay167
3 files changed, 252 insertions, 19 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 6c7105a6e77..404c3093864 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -3372,6 +3372,14 @@ if (BUSES["RS232"]~=null) then
MAME_DIR .. "src/devices/bus/rs232/xvd701.cpp",
MAME_DIR .. "src/devices/bus/rs232/xvd701.h",
}
+
+ dependency {
+ { MAME_DIR .. "src/devices/bus/rs232/teletex800.cpp", GEN_DIR .. "emu/layout/teletex800.lh" },
+ }
+
+ custombuildtask {
+ layoutbuildtask("emu/layout", "teletex800"),
+ }
end
---------------------------------------------------
diff --git a/src/devices/bus/rs232/teletex800.cpp b/src/devices/bus/rs232/teletex800.cpp
index e4af30a9dd7..46bac3bb5fd 100644
--- a/src/devices/bus/rs232/teletex800.cpp
+++ b/src/devices/bus/rs232/teletex800.cpp
@@ -10,27 +10,10 @@
#include "machine/z80ctc.h"
#include "machine/z80daisy.h"
#include "machine/z80sio.h"
+#include "teletex800.lh"
namespace {
-ROM_START( teletex800 )
- ROM_REGION( 0x1000, "z80", 0 )
- ROM_LOAD( "ix44_ver1.1.u57", 0x0000, 0x1000, CRC(5c11b89c) SHA1(4911332709a8dcda12e72bcdf7a0acd58d65cbfd) )
-ROM_END
-
-static const z80_daisy_config z80_daisy_chain[] =
-{
- { nullptr }
-};
-
-static void printer_devices(device_slot_interface &device)
-{
- device.option_add("printer", SERIAL_PRINTER);
-}
-
-static INPUT_PORTS_START( teletex800 )
-INPUT_PORTS_END
-
class teletex_800_device : public device_t, public device_rs232_port_interface
{
public:
@@ -42,7 +25,21 @@ public:
m_sio(*this, "sio"),
m_acia(*this, "acia"),
m_pia(*this, "pia"),
- m_pia_cp(*this, "pia_cp")
+ m_pia_cp(*this, "pia_cp"),
+ m_bat_led(*this, "bat_led"),
+ m_pr_led(*this, "pr_led"),
+ m_telex_led(*this, "telex_led"),
+ m_mem_led(*this, "mem_led"),
+ m_obs_led(*this, "obs_led"),
+ m_write_led(*this, "write_led"),
+ m_log_led(*this, "log_led"),
+ m_queue_led(*this, "queue_led"),
+ m_all_led(*this, "all_led"),
+ m_time_led(*this, "time_led"),
+ m_date_led(*this, "date_led"),
+ m_year_led(*this, "year_led"),
+ m_rx_digits(*this, "rx_digit%u", 0U),
+ m_tx_digits(*this, "tx_digit%u", 0U)
{
}
@@ -54,6 +51,8 @@ protected:
virtual void device_add_mconfig(machine_config &config) override
{
+ config.set_default_layout(layout_teletex800);
+
// main board
Z80(config, m_maincpu, XTAL(4'915'200));
m_maincpu->set_daisy_config(z80_daisy_chain);
@@ -78,6 +77,24 @@ protected:
virtual void device_start() override
{
+ m_bat_led.resolve();
+ m_pr_led.resolve();
+ m_telex_led.resolve();
+ m_mem_led.resolve();
+ m_obs_led.resolve();
+ m_write_led.resolve();
+ m_log_led.resolve();
+ m_queue_led.resolve();
+ m_all_led.resolve();
+ m_time_led.resolve();
+ m_date_led.resolve();
+ m_year_led.resolve();
+ m_rx_digits.resolve();
+ m_tx_digits.resolve();
+ }
+
+ virtual void device_reset() override
+ {
}
private:
@@ -88,6 +105,21 @@ private:
required_device<pia6821_device> m_pia;
required_device<pia6821_device> m_pia_cp;
+ output_finder<> m_bat_led;
+ output_finder<> m_pr_led;
+ output_finder<> m_telex_led;
+ output_finder<> m_mem_led;
+ output_finder<> m_obs_led;
+ output_finder<> m_write_led;
+ output_finder<> m_log_led;
+ output_finder<> m_queue_led;
+ output_finder<> m_all_led;
+ output_finder<> m_time_led;
+ output_finder<> m_date_led;
+ output_finder<> m_year_led;
+ output_finder<2> m_rx_digits;
+ output_finder<2> m_tx_digits;
+
void program_map(address_map &map)
{
map(0x0000, 0x0fff).rom().region("z80", 0);
@@ -96,6 +128,32 @@ private:
void io_map(address_map &map)
{
}
+
+ constexpr static const z80_daisy_config z80_daisy_chain[] =
+ {
+ { nullptr }
+ };
+
+ static void printer_devices(device_slot_interface &device)
+ {
+ device.option_add("printer", SERIAL_PRINTER);
+ }
+
+ INPUT_CHANGED_MEMBER( write ) { };
+ INPUT_CHANGED_MEMBER( all ) { };
+ INPUT_CHANGED_MEMBER( clock ) { };
+
+ static INPUT_PORTS_START( teletex800 )
+ PORT_START("BTN")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("SKRIV") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(teletex_800_device::write), 0)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("ALLA") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(teletex_800_device::all), 0)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("KLOCK") PORT_CHANGED_MEMBER(DEVICE_SELF, FUNC(teletex_800_device::clock), 0)
+ INPUT_PORTS_END
+
+ constexpr ROM_START( teletex800 )
+ ROM_REGION( 0x1000, "z80", 0 )
+ ROM_LOAD( "ix44_ver1.1.u57", 0x0000, 0x1000, CRC(5c11b89c) SHA1(4911332709a8dcda12e72bcdf7a0acd58d65cbfd) )
+ ROM_END
};
} // anonymous namespace
diff --git a/src/emu/layout/teletex800.lay b/src/emu/layout/teletex800.lay
new file mode 100644
index 00000000000..b34f144cb55
--- /dev/null
+++ b/src/emu/layout/teletex800.lay
@@ -0,0 +1,167 @@
+<?xml version="1.0"?>
+<!--
+license:CC0-1.0
+-->
+<mamelayout version="2">
+ <element name="panel">
+ <!--<image file="teletex800.png" />-->
+ </element>
+
+ <element name="button">
+ <rect>
+ <color red="0.25" green="0.25" blue="0.25" />
+ </rect>
+ </element>
+
+ <element name="red_led" defstate="0">
+ <disk state="0">
+ <color red="0.20" green="0.0" blue="0.0" />
+ </disk>
+ <disk state="1">
+ <color red="0.75" green="0.0" blue="0.0" />
+ </disk>
+ </element>
+
+ <element name="green_led" defstate="0">
+ <disk state="0">
+ <color red="0.0" green="0.20" blue="0.0" />
+ </disk>
+ <disk state="1">
+ <color red="0.0" green="0.75" blue="0.0" />
+ </disk>
+ </element>
+
+ <element name="digit" defstate="0">
+ <led7seg>
+ <color red="0.0" green="1.0" blue="0.0" />
+ </led7seg>
+ </element>
+
+ <element name="time_led" defstate="0">
+ <text state="0" string="TID">
+ <color red="0.0" green="0.20" blue="0.0" />
+ </text>
+ <text state="1" string="TID">
+ <color red="0.0" green="0.75" blue="0.0" />
+ </text>
+ </element>
+
+ <element name="date_led" defstate="0">
+ <text state="0" string="DAT">
+ <color red="0.0" green="0.20" blue="0.0" />
+ </text>
+ <text state="1" string="DAT">
+ <color red="0.0" green="0.75" blue="0.0" />
+ </text>
+ </element>
+
+ <element name="year_led" defstate="0">
+ <text state="0" string="ÅR">
+ <color red="0.0" green="0.20" blue="0.0" />
+ </text>
+ <text state="1" string="ÅR">
+ <color red="0.0" green="0.75" blue="0.0" />
+ </text>
+ </element>
+
+ <view name="Front panel">
+ <bounds x="0" y="0" width="810" height="473" />
+
+ <element ref="panel">
+ <bounds x="0" y="0" width="810" height="473" />
+ </element>
+
+ <!-- BATTERI DRIFT -->
+ <element name="bat_led" ref="red_led">
+ <bounds x="114" y="118" width="16" height="16" />
+ </element>
+
+ <!-- SKRIVAR FEL -->
+ <element name="pr_led" ref="red_led">
+ <bounds x="205" y="118" width="16" height="16" />
+ </element>
+
+ <!-- OKVITT TELEX -->
+ <element name="telex_led" ref="green_led">
+ <bounds x="298" y="118" width="16" height="16" />
+ </element>
+
+ <!-- MOTTAGNA -->
+ <element name="rx_digit0" ref="digit">
+ <bounds x="384" y="107" width="38" height="49" />
+ </element>
+
+ <element name="rx_digit1" ref="digit">
+ <bounds x="440" y="107" width="38" height="49" />
+ </element>
+
+ <!-- SEND KÖ -->
+ <element name="tx_digit0" ref="digit">
+ <bounds x="522" y="107" width="38" height="49" />
+ </element>
+
+ <element name="tx_digit1" ref="digit">
+ <bounds x="578" y="107" width="38" height="49" />
+ </element>
+
+ <!-- TID -->
+ <element name="time_led" ref="time_led">
+ <bounds x="658" y="99" width="29" height="14" />
+ </element>
+
+ <!-- DAT -->
+ <element name="date_led" ref="date_led">
+ <bounds x="659" y="123" width="29" height="14" />
+ </element>
+
+ <!-- ÅR -->
+ <element name="year_led" ref="year_led">
+ <bounds x="659" y="147" width="22" height="14" />
+ </element>
+
+ <!-- MINNES VARNING -->
+ <element name="mem_led" ref="red_led">
+ <bounds x="114" y="204" width="16" height="16" />
+ </element>
+
+ <!-- OBS -->
+ <element name="obs_led" ref="red_led">
+ <bounds x="205" y="204" width="16" height="16" />
+ </element>
+
+ <!-- SKRIV -->
+ <element name="write_led" ref="green_led">
+ <bounds x="298" y="204" width="16" height="16" />
+ </element>
+
+ <!-- LOG -->
+ <element name="log_led" ref="green_led">
+ <bounds x="388" y="204" width="16" height="16" />
+ </element>
+
+ <!-- KÖ -->
+ <element name="queue_led" ref="green_led">
+ <bounds x="479" y="204" width="16" height="16" />
+ </element>
+
+ <!-- ALLA -->
+ <element name="all_led" ref="green_led">
+ <bounds x="571" y="204" width="16" height="16" />
+ </element>
+
+ <!-- SKRIV -->
+ <element ref="button" inputtag="BTN" inputmask="0x01">
+ <bounds x="275" y="262" width="54" height="54" />
+ </element>
+
+ <!-- ALLA -->
+ <element ref="button" inputtag="BTN" inputmask="0x02">
+ <bounds x="556" y="261" width="54" height="54" />
+ </element>
+
+ <!-- KLOCK -->
+ <element ref="button" inputtag="BTN" inputmask="0x04">
+ <bounds x="648" y="263" width="54" height="54" />
+ </element>
+ </view>
+</mamelayout>