From b742018c29a3b844fae0aec0ab5cf266923eead0 Mon Sep 17 00:00:00 2001 From: cracyc Date: Wed, 7 May 2014 22:41:04 +0000 Subject: [PATCH] (mess) pcw16: make switch suspend, doesn't resume though (nw) --- src/mess/drivers/pcw16.c | 10 ++++++---- src/mess/includes/pcw16.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c index ca4dda05c4b..bd65b589d94 100644 --- a/src/mess/drivers/pcw16.c +++ b/src/mess/drivers/pcw16.c @@ -537,8 +537,6 @@ WRITE_LINE_MEMBER(pcw16_state::pcw16_keyboard_callback) pcw16_keyboard_signal_byte_received(data); } } - // TODO: fix - m_uart2->ri_w((m_io_extra->read() & 0x040) ? 0 : 1); } @@ -921,6 +919,11 @@ WRITE_LINE_MEMBER(pcw16_state::pcw16_com_interrupt_2) pcw16_refresh_ints(); } +INPUT_CHANGED_MEMBER(pcw16_state::power) +{ + m_uart2->ri_w((newval & 0x040) ? 0 : 1); +} + FLOPPY_FORMATS_MEMBER( pcw16_state::floppy_formats ) FLOPPY_PC_FORMAT FLOPPY_FORMATS_END @@ -993,7 +996,7 @@ static INPUT_PORTS_START(pcw16) /* vblank */ PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_CUSTOM) PORT_VBLANK("screen") /* power switch - default is on */ - PORT_DIPNAME(0x40, 0x40, "Power Switch/Suspend") + PORT_DIPNAME(0x40, 0x40, "Power Switch/Suspend") PORT_CHANGED_MEMBER(DEVICE_SELF, pcw16_state, power, 0) PORT_DIPSETTING(0x0, DEF_STR( Off) ) PORT_DIPSETTING(0x40, DEF_STR( On) ) @@ -1033,7 +1036,6 @@ static MACHINE_CONFIG_START( pcw16, pcw16_state ) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, rx_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, dcd_w)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, dsr_w)) - MCFG_RS232_RI_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, ri_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ns16550_2", ins8250_uart_device, cts_w)) /* video hardware */ diff --git a/src/mess/includes/pcw16.h b/src/mess/includes/pcw16.h index 1f1ada8001a..0d60f73f47f 100644 --- a/src/mess/includes/pcw16.h +++ b/src/mess/includes/pcw16.h @@ -143,6 +143,7 @@ public: DECLARE_WRITE_LINE_MEMBER(pcw16_com_dtr_1); DECLARE_WRITE_LINE_MEMBER(pcw16_com_rts_1); DECLARE_WRITE_LINE_MEMBER(pcw16_keyboard_callback); + INPUT_CHANGED_MEMBER(power); void trigger_fdc_int(); DECLARE_WRITE_LINE_MEMBER( fdc_interrupt );