summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Nigel Barnes <ngbarnes@gmail.com>2026-02-20 23:54:29 +0000
committer Nigel Barnes <ngbarnes@gmail.com>2026-02-20 23:54:29 +0000
commit7e974b41ece31fc2bee38b6d862a841ea061a9f4 (patch)
tree51dc982e244c19594959471c8f92a97e7f3039d0
parentb7f3039533f869490f6b81793fccde30f8ad420a (diff)
acorn/bbcm.cpp/bbcmc.cpp: Added floppy drive LED's to the artwork.
-rw-r--r--src/mame/acorn/bbcm.cpp66
-rw-r--r--src/mame/acorn/bbcmc.cpp62
-rw-r--r--src/mame/layout/bbcm.lay73
3 files changed, 154 insertions, 47 deletions
diff --git a/src/mame/acorn/bbcm.cpp b/src/mame/acorn/bbcm.cpp
index 800c63654f4..b9525d27d38 100644
--- a/src/mame/acorn/bbcm.cpp
+++ b/src/mame/acorn/bbcm.cpp
@@ -45,9 +45,11 @@ public:
, m_kbd(*this, "kbd")
, m_sn(*this, "sn")
, m_rtc(*this, "rtc")
- , m_wdfdc(*this, "wdfdc")
, m_adlc(*this, "mc6854")
, m_modem(*this, "modem")
+ , m_wdfdc(*this, "wdfdc")
+ , m_floppy(*this, "wdfdc:%u", 0U)
+ , m_floppy_leds(*this, "floppy%u_led", 0U)
, m_power_led(*this, "power_led")
{ }
@@ -76,18 +78,7 @@ protected:
virtual void machine_reset() override ATTR_COLD;
private:
- memory_view m_view_lynne;
- memory_view m_view_hazel;
- memory_view m_view_andy;
- memory_view m_view_1mhz;
- memory_view m_view_tst;
- required_device<bbc_kbd_device> m_kbd;
- optional_device<sn76489a_device> m_sn;
- required_device<mc146818_device> m_rtc;
- optional_device<wd1770_device> m_wdfdc;
- required_device<mc6854_device> m_adlc;
- optional_device<bbc_modem_slot_device> m_modem;
- output_finder<> m_power_led;
+ template<int floppy> void floppy_led_cb(floppy_image_device *, int state);
void bbcm_fetch(address_map &map) ATTR_COLD;
void bbcm_base(address_map &map) ATTR_COLD;
@@ -119,6 +110,21 @@ private:
uint8_t sysvia_pb_r();
void sysvia_pb_w(uint8_t data);
+ memory_view m_view_lynne;
+ memory_view m_view_hazel;
+ memory_view m_view_andy;
+ memory_view m_view_1mhz;
+ memory_view m_view_tst;
+ required_device<bbc_kbd_device> m_kbd;
+ optional_device<sn76489a_device> m_sn;
+ required_device<mc146818_device> m_rtc;
+ required_device<mc6854_device> m_adlc;
+ optional_device<bbc_modem_slot_device> m_modem;
+ optional_device<wd1770_device> m_wdfdc;
+ optional_device_array<floppy_connector, 2> m_floppy;
+ output_finder<2> m_floppy_leds;
+ output_finder<> m_power_led;
+
int m_mc146818_as = 0;
int m_mc146818_ce = 0;
@@ -139,11 +145,23 @@ private:
};
+template<int floppy> void bbcm_state::floppy_led_cb(floppy_image_device *, int state)
+{
+ m_floppy_leds[floppy] = state;
+}
+
+
void bbcm_state::machine_start()
{
bbc_state::machine_start();
m_power_led.resolve();
+ m_floppy_leds.resolve();
+
+ if (m_floppy[0] && m_floppy[0]->get_device())
+ m_floppy[0]->get_device()->setup_led_cb(floppy_image_device::led_cb(&bbcm_state::floppy_led_cb<0>, this));
+ if (m_floppy[1] && m_floppy[1]->get_device())
+ m_floppy[1]->get_device()->setup_led_cb(floppy_image_device::led_cb(&bbcm_state::floppy_led_cb<1>, this));
save_item(NAME(m_acccon));
save_item(NAME(m_sdb));
@@ -576,11 +594,21 @@ void bbcm_state::drive_control_w(uint8_t data)
// 1 Drive select 1
// 0 Drive select 0
+ int ds = -1;
+
floppy_image_device *floppy = nullptr;
// bit 0, 1, 3: drive select
- if (BIT(data, 0)) floppy = m_wdfdc->subdevice<floppy_connector>("0")->get_device();
- if (BIT(data, 1)) floppy = m_wdfdc->subdevice<floppy_connector>("1")->get_device();
+ if (BIT(data, 0)) ds = 0;
+ if (BIT(data, 1)) ds = 1;
+
+ for (auto &conn : m_floppy)
+ {
+ floppy = conn->get_device();
+ if (floppy)
+ floppy->ds_w(ds);
+ }
+ floppy = (ds != -1) ? m_floppy[ds]->get_device() : nullptr;
m_wdfdc->set_floppy(floppy);
// bit 4: side select
@@ -798,8 +826,8 @@ void bbcm_state::bbcm(machine_config &config)
m_wdfdc->intrq_wr_callback().set(FUNC(bbcm_state::fdc_intrq_w));
m_wdfdc->drq_wr_callback().set(FUNC(bbcm_state::fdc_drq_w));
- FLOPPY_CONNECTOR(config, "wdfdc:0", bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, "wdfdc:1", bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[0], bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[1], bbc_floppies, "525qd", bbc_state::floppy_formats).enable_sound(true);
BBC_1MHZBUS_SLOT(config, m_1mhzbus, 16_MHz_XTAL / 16, bbcm_1mhzbus_devices, nullptr);
m_1mhzbus->add_route(ALL_OUTPUTS, "mono", 1.0);
@@ -888,8 +916,8 @@ void bbcm_state::cfa3000(machine_config &config)
{
bbcm(config);
- m_wdfdc->subdevice<floppy_connector>("0")->set_default_option(nullptr);
- m_wdfdc->subdevice<floppy_connector>("1")->set_default_option(nullptr);
+ m_floppy[0]->set_default_option(nullptr);
+ m_floppy[1]->set_default_option(nullptr);
// LK18 and LK19 are set to enable rom, disabling ram
m_rom[0x04]->set_default_option("rom").set_fixed(true);
diff --git a/src/mame/acorn/bbcmc.cpp b/src/mame/acorn/bbcmc.cpp
index 366b120484a..b33e55ff117 100644
--- a/src/mame/acorn/bbcmc.cpp
+++ b/src/mame/acorn/bbcmc.cpp
@@ -39,10 +39,12 @@ public:
, m_kbd(*this, "kbd")
, m_sn(*this, "sn")
, m_i2cmem(*this, "i2cmem")
- , m_wdfdc(*this, "wdfdc")
, m_adlc(*this, "mc6854")
, m_exp(*this, "exp")
, m_joyport(*this, "joyport")
+ , m_wdfdc(*this, "wdfdc")
+ , m_floppy(*this, "wdfdc:%u", 0U)
+ , m_floppy_leds(*this, "floppy%u_led", 0U)
, m_power_led(*this, "power_led")
{ }
@@ -55,18 +57,7 @@ protected:
virtual void machine_reset() override ATTR_COLD;
private:
- memory_view m_view_lynne;
- memory_view m_view_hazel;
- memory_view m_view_andy;
- memory_view m_view_tst;
- required_device<bbc_kbd_device> m_kbd;
- required_device<sn76489a_device> m_sn;
- required_device<i2cmem_device> m_i2cmem;
- required_device<wd1772_device> m_wdfdc;
- required_device<mc6854_device> m_adlc;
- required_device<bbc_exp_slot_device> m_exp;
- required_device<bbc_joyport_slot_device> m_joyport;
- output_finder<> m_power_led;
+ template<int floppy> void floppy_led_cb(floppy_image_device *, int state);
void bbcmc_fetch(address_map &map) ATTR_COLD;
void bbcmc_mem(address_map &map) ATTR_COLD;
@@ -93,6 +84,21 @@ private:
uint8_t joyport_r();
void joyport_w(uint8_t data);
+ memory_view m_view_lynne;
+ memory_view m_view_hazel;
+ memory_view m_view_andy;
+ memory_view m_view_tst;
+ required_device<bbc_kbd_device> m_kbd;
+ required_device<sn76489a_device> m_sn;
+ required_device<i2cmem_device> m_i2cmem;
+ required_device<mc6854_device> m_adlc;
+ required_device<bbc_exp_slot_device> m_exp;
+ required_device<bbc_joyport_slot_device> m_joyport;
+ required_device<wd1772_device> m_wdfdc;
+ required_device_array<floppy_connector, 2> m_floppy;
+ output_finder<2> m_floppy_leds;
+ output_finder<> m_power_led;
+
uint8_t m_sdb = 0x00;
uint8_t m_acccon = 0x00;
@@ -110,11 +116,23 @@ private:
};
+template<int floppy> void bbcmc_state::floppy_led_cb(floppy_image_device *, int state)
+{
+ m_floppy_leds[floppy] = state;
+}
+
+
void bbcmc_state::machine_start()
{
bbc_state::machine_start();
m_power_led.resolve();
+ m_floppy_leds.resolve();
+
+ if (m_floppy[0]->get_device())
+ m_floppy[0]->get_device()->setup_led_cb(floppy_image_device::led_cb(&bbcmc_state::floppy_led_cb<0>, this));
+ if (m_floppy[1]->get_device())
+ m_floppy[1]->get_device()->setup_led_cb(floppy_image_device::led_cb(&bbcmc_state::floppy_led_cb<1>, this));
save_item(NAME(m_acccon));
save_item(NAME(m_sdb));
@@ -455,11 +473,21 @@ void bbcmc_state::drive_control_w(uint8_t data)
// 1 Drive select 1
// 0 Drive select 0
+ int ds = -1;
+
floppy_image_device *floppy = nullptr;
// bit 0, 1, 3: drive select
- if (BIT(data, 0)) floppy = m_wdfdc->subdevice<floppy_connector>("0")->get_device();
- if (BIT(data, 1)) floppy = m_wdfdc->subdevice<floppy_connector>("1")->get_device();
+ if (BIT(data, 0)) ds = 0;
+ if (BIT(data, 1)) ds = 1;
+
+ for (auto &conn : m_floppy)
+ {
+ floppy = conn->get_device();
+ if (floppy)
+ floppy->ds_w(ds);
+ }
+ floppy = (ds != -1) ? m_floppy[ds]->get_device() : nullptr;
m_wdfdc->set_floppy(floppy);
// bit 4: side select
@@ -598,8 +626,8 @@ void bbcmc_state::bbcmc(machine_config &config)
m_wdfdc->intrq_wr_callback().set(FUNC(bbcmc_state::fdc_intrq_w));
m_wdfdc->drq_wr_callback().set(FUNC(bbcmc_state::fdc_drq_w));
- FLOPPY_CONNECTOR(config, "wdfdc:0", bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true);
- FLOPPY_CONNECTOR(config, "wdfdc:1", bbc_floppies, nullptr, bbc_state::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[0], bbc_floppies, "35dd", bbc_state::floppy_formats).enable_sound(true);
+ FLOPPY_CONNECTOR(config, m_floppy[1], bbc_floppies, nullptr, bbc_state::floppy_formats).enable_sound(true);
MC6854(config, m_adlc);
m_adlc->out_txd_cb().set("network", FUNC(econet_device::host_data_w));
diff --git a/src/mame/layout/bbcm.lay b/src/mame/layout/bbcm.lay
index 7cc696c3da0..c9b26d295f4 100644
--- a/src/mame/layout/bbcm.lay
+++ b/src/mame/layout/bbcm.lay
@@ -46,46 +46,97 @@ Basic display of keyboard LEDs for the BBC Master series
</text>
</element>
+ <element name="label_drive">
+ <text string="Drive">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+
+ <element name="label_d0">
+ <text string="0">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+
+ <element name="label_d1">
+ <text string="1">
+ <color red="1.0" green="1.0" blue="1.0" />
+ </text>
+ </element>
+
+ <element name="drive_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>
+
<view name="Keyboard LED's">
- <bounds left="0" right="400" top="0" bottom="330" />
+ <bounds left="0" right="800" top="0" bottom="660" />
<screen index="0">
- <bounds left="0" right="400" top="0" bottom="300" />
+ <bounds left="0" right="800" top="0" bottom="600" />
</screen>
<element name="label_power" ref="label_power">
- <bounds x="10" y="305" width="24" height="7" />
+ <bounds x="20" y="610" width="48" height="14" />
</element>
<element name="label_on" ref="label_on">
- <bounds x="10" y="312" width="24" height="7" />
+ <bounds x="20" y="624" width="48" height="14" />
</element>
<element name="power_led" ref="red_led">
- <bounds x="20" y="320" width="5" height="5" />
+ <bounds x="40" y="640" width="10" height="10" />
</element>
<element name="label_caps" ref="label_caps">
- <bounds x="40" y="305" width="24" height="7" />
+ <bounds x="80" y="610" width="48" height="14" />
</element>
<element name="label_lock" ref="label_lock">
- <bounds x="40" y="312" width="24" height="7" />
+ <bounds x="80" y="624" width="48" height="14" />
</element>
<element name="capslock_led" ref="red_led">
- <bounds x="50" y="320" width="5" height="5" />
+ <bounds x="100" y="640" width="10" height="10" />
</element>
<element name="label_shift" ref="label_shift">
- <bounds x="70" y="305" width="24" height="7" />
+ <bounds x="140" y="610" width="48" height="14" />
</element>
<element name="label_lock" ref="label_lock">
- <bounds x="70" y="312" width="24" height="7" />
+ <bounds x="140" y="624" width="48" height="14" />
</element>
<element name="shiftlock_led" ref="red_led">
- <bounds x="80" y="320" width="5" height="5" />
+ <bounds x="160" y="640" width="10" height="10" />
+ </element>
+
+ <element name="label_drive0" ref="label_drive">
+ <bounds x="700" y="610" width="48" height="14" />
+ </element>
+
+ <element name="label_d0" ref="label_d0">
+ <bounds x="700" y="624" width="48" height="14" />
+ </element>
+
+ <element name="floppy0_led" ref="drive_led">
+ <bounds x="719" y="640" width="10" height="10" />
+ </element>
+
+ <element name="label_drive1" ref="label_drive">
+ <bounds x="740" y="610" width="48" height="14" />
+ </element>
+
+ <element name="label_d1" ref="label_d1">
+ <bounds x="740" y="624" width="48" height="14" />
+ </element>
+
+ <element name="floppy1_led" ref="drive_led">
+ <bounds x="759" y="640" width="10" height="10" />
</element>
</view>