summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author holub <andrei.holub@gmail.com>2023-08-24 13:57:24 -0400
committer GitHub <noreply@github.com>2023-08-25 03:57:24 +1000
commitf058e5649d6fd0e5c34ba88c8995f573fa04699f (patch)
tree4f2af9929aa13cf5ddc275770309001b476a2b8a
parent7c3d247e5a267da0281283c54363c701fd2e10af (diff)
sinclair/sprinter.cpp: Added internal layout with Turbo, NeoGS and floppy drive indicators. (#11492)
-rw-r--r--src/devices/bus/spectrum/neogs.cpp7
-rw-r--r--src/mame/layout/sprinter.lay75
-rw-r--r--src/mame/sinclair/beta_m.cpp11
-rw-r--r--src/mame/sinclair/beta_m.h1
-rw-r--r--src/mame/sinclair/sprinter.cpp10
5 files changed, 100 insertions, 4 deletions
diff --git a/src/devices/bus/spectrum/neogs.cpp b/src/devices/bus/spectrum/neogs.cpp
index 2a8b826c4dd..c2da1d03fd7 100644
--- a/src/devices/bus/spectrum/neogs.cpp
+++ b/src/devices/bus/spectrum/neogs.cpp
@@ -81,6 +81,7 @@ public:
, m_view(*this, "view")
, m_dac(*this, "dac%u", 0U)
, m_sdcard(*this, "sdcard")
+ , m_neogs_led(*this, "neogs_led")
{ }
protected:
@@ -106,6 +107,7 @@ protected:
memory_view m_view;
required_device_array<dac_word_interface, 2> m_dac;
required_device<spi_sdcard_sdhc_device> m_sdcard;
+ output_finder<> m_neogs_led;
private:
TIMER_CALLBACK_MEMBER(spi_clock);
@@ -212,8 +214,7 @@ void neogs_device::neogs_ctrl_w(u8 data)
LOG("NMI Request\n");
m_maincpu->pulse_input_line(INPUT_LINE_NMI, attotime::zero);
}
- if (data & 0x20)
- ; // LED data:0 - 1-on, 0-off
+ m_neogs_led = BIT(data, 5);
}
template <u8 Bank> u8 neogs_device::ram_bank_r(offs_t offset)
@@ -451,6 +452,8 @@ void neogs_device::device_start()
});
m_zxbus->install_device(0x0000, 0xffff, *this, &neogs_device::neogsmap);
+
+ m_neogs_led.resolve();
}
void neogs_device::device_reset()
diff --git a/src/mame/layout/sprinter.lay b/src/mame/layout/sprinter.lay
new file mode 100644
index 00000000000..4a37e73fb2e
--- /dev/null
+++ b/src/mame/layout/sprinter.lay
@@ -0,0 +1,75 @@
+<?xml version="1.0"?>
+<!--
+license:CC0-1.0
+-->
+
+<mamelayout version="2">
+ <element name="green_led">
+ <rect state="0">
+ <color red="0.2" green="0.2" blue="0.2" />
+ </rect>
+ <rect state="1">
+ <color red="0.0" green="1.0" blue="0.0" />
+ </rect>
+ </element>
+ <element name="orange_led">
+ <rect state="0">
+ <color red="0.2" green="0.2" blue="0.2" />
+ </rect>
+ <rect state="1">
+ <color red="1.0" green="0.6" blue="0.0" />
+ </rect>
+ </element>
+ <element name="turbo_name">
+ <text string="Turbo" align="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+ <element name="fdd0_name">
+ <text string="Drive A" align="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+ <element name="fdd1_name">
+ <text string="Drive B" align="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+ <element name="neogs_name">
+ <text string="NeoGS" align="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+
+ <view name="System LEDs">
+ <screen index="0">
+ <bounds x="75" y="0" width="1024" height="768" />
+ </screen>
+ <element name="turbo_led_name" ref="turbo_name">
+ <bounds left="0" right="74" top="0" bottom="30" />
+ </element>
+ <element name="turbo_led" ref="green_led">
+ <bounds left="0" right="20" top="31" bottom="39" />
+ </element>
+
+ <element name="fdd0_led_name" ref="fdd0_name">
+ <bounds left="0" right="74" top="80" bottom="110" />
+ </element>
+ <element name="fdd0_led" ref="orange_led">
+ <bounds left="0" right="20" top="111" bottom="119" />
+ </element>
+ <element name="fdd1_led_name" ref="fdd1_name">
+ <bounds left="0" right="74" top="120" bottom="150" />
+ </element>
+ <element name="fdd1_led" ref="orange_led">
+ <bounds left="0" right="20" top="151" bottom="159" />
+ </element>
+
+ <element name="neogs_led_name" ref="neogs_name">
+ <bounds left="0" right="74" top="200" bottom="230" />
+ </element>
+ <element name="neogs_led" ref="green_led">
+ <bounds left="0" right="20" top="231" bottom="239" />
+ </element>
+ </view>
+</mamelayout>
diff --git a/src/mame/sinclair/beta_m.cpp b/src/mame/sinclair/beta_m.cpp
index d9ab4f5eaf8..09fec6be5c5 100644
--- a/src/mame/sinclair/beta_m.cpp
+++ b/src/mame/sinclair/beta_m.cpp
@@ -32,6 +32,7 @@ beta_disk_device::beta_disk_device(const machine_config &mconfig, const char *ta
, m_betadisk_active(0)
, m_wd179x(*this, "wd179x")
, m_floppy(*this, "wd179x:%u", 0U)
+ , m_floppy_led(*this, "fdd%u_led", 0U)
, m_control(0)
, m_motor_active(false)
{
@@ -46,6 +47,8 @@ void beta_disk_device::device_start()
save_item(NAME(m_betadisk_active));
save_item(NAME(m_control));
save_item(NAME(m_motor_active));
+
+ m_floppy_led.resolve();
}
//-------------------------------------------------
@@ -55,6 +58,8 @@ void beta_disk_device::device_start()
void beta_disk_device::device_reset()
{
m_control = 0;
+ for (int i = 0; i < m_floppy_led.size(); i++)
+ m_floppy_led[i] = 0;
}
int beta_disk_device::is_active()
@@ -180,9 +185,15 @@ void beta_disk_device::motors_control()
for (int i = 0; i < 4; i++)
{
if (m_motor_active && (m_control & 3) == i)
+ {
m_floppy[i]->get_device()->mon_w(CLEAR_LINE);
+ m_floppy_led[i] = 1;
+ }
else
+ {
m_floppy[i]->get_device()->mon_w(ASSERT_LINE);
+ m_floppy_led[i] = 0;
+ }
}
}
diff --git a/src/mame/sinclair/beta_m.h b/src/mame/sinclair/beta_m.h
index cb25d6d0aa9..f809f12a057 100644
--- a/src/mame/sinclair/beta_m.h
+++ b/src/mame/sinclair/beta_m.h
@@ -53,6 +53,7 @@ private:
required_device<kr1818vg93_device> m_wd179x;
required_device_array<floppy_connector, 4> m_floppy;
+ output_finder<4> m_floppy_led;
void fdc_hld_w(int state);
void motors_control();
u8 m_control;
diff --git a/src/mame/sinclair/sprinter.cpp b/src/mame/sinclair/sprinter.cpp
index 4ab46c5a42d..b34d9a27845 100644
--- a/src/mame/sinclair/sprinter.cpp
+++ b/src/mame/sinclair/sprinter.cpp
@@ -58,6 +58,8 @@ TODO:
#include <algorithm>
+#include "sprinter.lh"
+
#define LOG_IO (1U << 1)
#define LOG_MEM (1U << 2)
@@ -98,6 +100,7 @@ public:
, m_bank0_fastram(*this, "bank0_fastram")
, m_bank_view0(*this, "bank_view0")
, m_bank_view3(*this, "bank_view3")
+ , m_turbo_led(*this, "turbo_led")
{ }
void sprinter(machine_config &config);
@@ -222,6 +225,7 @@ private:
memory_view m_bank_view0;
memory_view m_bank_view3;
memory_access<16, 0, 0, ENDIANNESS_LITTLE>::specific m_program;
+ output_finder<> m_turbo_led;
TILE_GET_INFO_MEMBER(get_tile_info);
@@ -346,6 +350,7 @@ void sprinter_state::update_memory()
void sprinter_state::update_cpu()
{
+ m_turbo_led = m_turbo && m_turbo_hard;
m_maincpu->set_clock_scale((m_turbo && m_turbo_hard) ? 6 : 1); // 1 - 21MHz, 0 - 3.5MHz
}
@@ -1268,6 +1273,8 @@ void sprinter_state::machine_start()
spectrum_128_state::machine_start();
+ m_turbo_led.resolve();
+
save_item(NAME(m_ram_pages));
save_item(NAME(m_pages));
save_item(NAME(m_z80_m1));
@@ -1521,8 +1528,6 @@ INPUT_CHANGED_MEMBER(sprinter_state::turbo_changed)
{
m_turbo_hard = !m_turbo_hard;
update_cpu();
-
- popmessage("Turbo %s\n", (m_turbo && m_turbo_hard) ? "ON" : "OFF");
}
INPUT_PORTS_START( sprinter )
@@ -1670,6 +1675,7 @@ void sprinter_state::sprinter(machine_config &config)
{
spectrum_128(config);
config.device_remove("palette");
+ config.set_default_layout(layout_sprinter);
m_ram->set_default_size("64M");