From f058e5649d6fd0e5c34ba88c8995f573fa04699f Mon Sep 17 00:00:00 2001 From: holub Date: Thu, 24 Aug 2023 13:57:24 -0400 Subject: sinclair/sprinter.cpp: Added internal layout with Turbo, NeoGS and floppy drive indicators. (#11492) --- src/devices/bus/spectrum/neogs.cpp | 7 +++- src/mame/layout/sprinter.lay | 75 ++++++++++++++++++++++++++++++++++++++ src/mame/sinclair/beta_m.cpp | 11 ++++++ src/mame/sinclair/beta_m.h | 1 + src/mame/sinclair/sprinter.cpp | 10 ++++- 5 files changed, 100 insertions(+), 4 deletions(-) create mode 100644 src/mame/layout/sprinter.lay 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 m_dac; required_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 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 m_wd179x; required_device_array 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 +#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"); -- cgit v1.2.3