summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/rainbow.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2020-10-18 15:36:37 -0400
committer AJR <ajrhacker@users.noreply.github.com>2020-10-18 15:36:37 -0400
commit5add31766977fbcdc45f8144861a685cefeede53 (patch)
treef29b57d1616adb0a35da6fb5d89da0d100e5d2c9 /src/mame/drivers/rainbow.cpp
parent911515af31bf39462ac5bc1e9f8f248fa6e0a2ec (diff)
Numerous drivers: Modernization and runtime tag lookup elimination
* Substitute output finders for output().set_value * Use more array finders, particularly for keyboard ports
Diffstat (limited to 'src/mame/drivers/rainbow.cpp')
-rw-r--r--src/mame/drivers/rainbow.cpp87
1 files changed, 43 insertions, 44 deletions
diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp
index 15889f0a18d..8db3fc465ac 100644
--- a/src/mame/drivers/rainbow.cpp
+++ b/src/mame/drivers/rainbow.cpp
@@ -497,7 +497,9 @@ public:
m_palette2(*this, "palette2"), // GDC
m_video_ram(*this, "vram"),
- m_digits(*this, "digit%u", 0U)
+ m_digits(*this, "digit%u", 0U),
+ m_leds(*this, "led%u", 1U),
+ m_driveleds(*this, "driveled%u", 0U)
{
}
@@ -652,6 +654,8 @@ protected:
required_shared_ptr<uint16_t> m_video_ram;
output_finder<2> m_digits;
+ output_finder<7> m_leds;
+ output_finder<4> m_driveleds;
void raise_8088_irq(int ref);
void lower_8088_irq(int ref);
@@ -893,6 +897,8 @@ void rainbow_base_state::machine_start()
switch_off_timer->adjust(attotime::from_msec(10));
m_digits.resolve();
+ m_leds.resolve();
+ m_driveleds.resolve();
m_screen_blank = false;
@@ -1188,7 +1194,7 @@ void rainbow_base_state::machine_reset()
hard_disk_file *local_hard_disk;
local_hard_disk = rainbow_hdc_file(0); // one hard disk for now.
- output().set_value("led1", 0);
+ m_leds[0] = 0;
switch_off_timer->adjust(attotime::from_msec(500));
if (local_hard_disk)
@@ -1196,7 +1202,7 @@ void rainbow_base_state::machine_reset()
hard_disk_info *info;
if ((info = hard_disk_get_info(local_hard_disk)))
{
- output().set_value("led1", 1);
+ m_leds[0] = 1;
uint32_t max_sector = (info->cylinders) * (info->heads) * (info->sectors);
popmessage("DEC %u (%3.2f) MB HARD DISK MOUNTED.\nGEOMETRY: %d HEADS (1..%d ARE OK).\n%d CYLINDERS (151 to %d ARE OK).\n%d SECTORS / TRACK (up to %d ARE OK). \n%d BYTES / SECTOR (128 to 1024 ARE OK).\n",
@@ -1251,19 +1257,15 @@ void rainbow_base_state::machine_reset()
m_irq_mask = 0;
// RESET RED LEDs
- output().set_value("led1", 1);
- output().set_value("led2", 1);
- output().set_value("led3", 1);
- output().set_value("led4", 1);
- output().set_value("led5", 1);
- output().set_value("led6", 1);
- output().set_value("led7", 1);
+ m_leds[0] = 1;
+ m_leds[1] = 1;
+ m_leds[2] = 1;
+ m_leds[3] = 1;
+ m_leds[4] = 1;
+ m_leds[5] = 1;
+ m_leds[6] = 1;
- // GREEN KEYBOARD LEDs (1 = on, 0 = off):
- output().set_value("led_wait", 0); // led8
- output().set_value("led_compose", 0); // led9
- output().set_value("led_lock", 0); // led10
- output().set_value("led_hold", 0); // led11
+ // GREEN KEYBOARD LEDs (see machine/dec_lk201.cpp)
}
void rainbow_modela_state::machine_reset()
@@ -1302,13 +1304,13 @@ void rainbow_base_state::device_timer(emu_timer &timer, device_timer_id tid, int
switch_off_timer->adjust(attotime::never);
- output().set_value("driveled0", 0); // DRIVE 0 (A)
- output().set_value("driveled1", 0); // DRIVE 1 (B)
- output().set_value("driveled2", 0); // DRIVE 2 (C)
- output().set_value("driveled3", 0); // DRIVE 3 (D)
+ m_driveleds[0] = 0; // DRIVE 0 (A)
+ m_driveleds[1] = 0; // DRIVE 1 (B)
+ m_driveleds[2] = 0; // DRIVE 2 (C)
+ m_driveleds[3] = 0; // DRIVE 3 (D)
- output().set_value("led1", 1); // 1 = OFF (One of the CPU LEDs as drive LED for DEC hard disk)
- output().set_value("led2", 1); // 1 = OFF (One of the CPU LEDs as drive LED for Corvus HD)
+ m_leds[0] = 1; // 1 = OFF (One of the CPU LEDs as drive LED for DEC hard disk)
+ m_leds[1] = 1; // 1 = OFF (One of the CPU LEDs as drive LED for Corvus HD)
break; // case 1
@@ -1637,7 +1639,7 @@ uint8_t rainbow_base_state::corvus_status_r()
}
else
{
- output().set_value("led2", 0);
+ m_leds[1] = 0;
switch_off_timer->adjust(attotime::from_msec(500));
uint8_t status = m_corvus_hdc->status_r();
@@ -1747,7 +1749,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_read_sector)
if ((state == 0) && (last_state == 1) && (drv == 0))
{
read_status = 2; // logerror("\nTRYING TO READ");
- output().set_value("led1", 0);
+ m_leds[0] = 0;
switch_off_timer->adjust(attotime::from_msec(500));
int hi = (m_hdc->read(0x05)) & 0x07;
@@ -1765,7 +1767,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_read_sector)
if ((info = hard_disk_get_info(local_hard_disk)))
{
read_status = 4;
- output().set_value("led1", 1);
+ m_leds[0] = 1;
// Pointer to info + C + H + S
uint32_t lbasector = get_and_print_lbasector(this, info, cylinder, sdh & 0x07, sector_number);
@@ -1816,7 +1818,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_write_sector)
if (state == 0 && wg_last == 1 && drv == 0) // Check correct state transition and DRIVE 0 ....
{
- output().set_value("led1", 0); // (1 = OFF ) =HARD DISK ACTIVITY =
+ m_leds[0] = 0; // (1 = OFF ) =HARD DISK ACTIVITY =
switch_off_timer->adjust(attotime::from_msec(500));
if (rainbow_hdc_file(0) != nullptr)
@@ -1853,7 +1855,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_write_sector)
int rainbow_base_state::do_write_sector()
{
int feedback = 0; // no error
- output().set_value("led1", 0); // ON
+ m_leds[0] = 0; // ON
switch_off_timer->adjust(attotime::from_msec(500));
hard_disk_file *local_hard_disk = rainbow_hdc_file(0); // one hard disk for now.
@@ -1864,7 +1866,7 @@ int rainbow_base_state::do_write_sector()
if (info)
{
feedback = 10;
- output().set_value("led1", 1); // OFF
+ m_leds[0] = 1; // OFF
uint8_t sdh = (m_hdc->read(0x06));
@@ -2007,7 +2009,7 @@ void rainbow_base_state::hd_status_68_w(uint8_t data)
// 1 : see @ 088D after 'READ_SECTOR_OK'
if (data & 0x01)
{
- output().set_value("led1", 0); // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY =
+ m_leds[0] = 0; // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY =
switch_off_timer->adjust(attotime::from_msec(500));
m_hdc->buffer_ready(true);
@@ -2075,7 +2077,7 @@ WRITE_LINE_MEMBER(rainbow_base_state::hdc_step)
{
m_hdc_step_latch = true;
- output().set_value("led1", 0); // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY =
+ m_leds[0] = 0; // 1 = OFF (One of the CPU LEDs as DRIVE LED) = HARD DISK ACTIVITY =
switch_off_timer->adjust(attotime::from_msec(500));
}
@@ -2240,10 +2242,10 @@ void rainbow_base_state::comm_control_w(uint8_t data)
D6 -D5-D4-D3 <- INTERNAL LED NUMBER (DEC PDF)
-4--5--6--7- <- NUMBERS EMBOSSED ON BACK OF PLASTIC HOUSING (see error chart)
*/
- output().set_value("led4", BIT(data, 5)); // LED "D6"
- output().set_value("led5", BIT(data, 7)); // LED "D5"
- output().set_value("led6", BIT(data, 6)); // LED "D4"
- output().set_value("led7", BIT(data, 4)); // LED "D3"
+ m_leds[3] = BIT(data, 5); // LED "D6"
+ m_leds[4] = BIT(data, 7); // LED "D5"
+ m_leds[5] = BIT(data, 6); // LED "D4"
+ m_leds[6] = BIT(data, 4); // LED "D3"
}
// 8088 writes to port 0x00 (interrupts Z80)
@@ -2307,9 +2309,9 @@ void rainbow_base_state::z80_diskdiag_write_w(uint8_t data)
D11 D10 -D9 <- INTERNAL LED NUMBER (see PDF)
-1 --2-- 3 <- NUMBERS EMBOSSED ON BACK OF PLASTIC HOUSING (see error chart)
*/
- output().set_value("led1", BIT(data, 4)); // LED "D11"
- output().set_value("led2", BIT(data, 5)); // LED "D10"
- output().set_value("led3", BIT(data, 6)); // LED "D9"
+ m_leds[0] = BIT(data, 4); // LED "D11"
+ m_leds[1] = BIT(data, 5); // LED "D10"
+ m_leds[2] = BIT(data, 6); // LED "D9"
m_zflip = false; // "a write to 21H will reset ZFLIP"
}
@@ -2457,11 +2459,8 @@ void rainbow_base_state::z80_diskcontrol_w(uint8_t data)
m_floppy = nullptr;
}
- output().set_value("driveled0", (selected_drive == 0) ? 1 : 0);
- output().set_value("driveled1", (selected_drive == 1) ? 1 : 0);
-
- output().set_value("driveled2", (selected_drive == 2) ? 1 : 0);
- output().set_value("driveled3", (selected_drive == 3) ? 1 : 0);
+ for (int i = 0; i < 4; i++)
+ m_driveleds[i] = (selected_drive == i) ? 1 : 0;
switch_off_timer->adjust(attotime::from_msec(500));
if (m_floppy != nullptr)
@@ -2483,14 +2482,14 @@ void rainbow_base_state::z80_diskcontrol_w(uint8_t data)
m_fdc->set_force_ready(force_ready); // 1 : assert DRIVE READY on FDC (diagnostic override)
if (selected_drive < 2)
- { data |= 8;
+ {
+ data |= 8;
enable_start = 0;
disable_start = 2;
}
- else
+ else
{
data |= 16;
-
enable_start = 2;
disable_start = 4;
}