From bb9228134b8b0a97da57d576e706c7dc23c4ffc0 Mon Sep 17 00:00:00 2001 From: AJR Date: Sun, 19 Mar 2023 17:49:32 -0400 Subject: pc8801mk2sr, pc88va: Enable outputs to joystick pins 6 & 7 --- src/mame/nec/pc8801.cpp | 8 ++++++++ src/mame/nec/pc8801.h | 1 + src/mame/nec/pc88va.cpp | 7 +++++++ src/mame/nec/pc88va.h | 1 + 4 files changed, 17 insertions(+) diff --git a/src/mame/nec/pc8801.cpp b/src/mame/nec/pc8801.cpp index 3e63c453c49..17c8e102640 100644 --- a/src/mame/nec/pc8801.cpp +++ b/src/mame/nec/pc8801.cpp @@ -1540,6 +1540,12 @@ uint8_t pc8801mk2sr_state::opn_portb_r() return BIT(m_mouse_port->read(), 4, 2) | 0xfc; } +void pc8801mk2sr_state::opn_portb_w(uint8_t data) +{ + m_mouse_port->pin_6_w(BIT(data, 0)); + m_mouse_port->pin_7_w(BIT(data, 1)); +} + // Cassette Configuration WRITE_LINE_MEMBER( pc8801_state::txdata_callback ) { @@ -1741,6 +1747,7 @@ void pc8801mk2sr_state::pc8801mk2sr(machine_config &config) m_opn->irq_handler().set(FUNC(pc8801mk2sr_state::int4_irq_w)); m_opn->port_a_read_callback().set(FUNC(pc8801mk2sr_state::opn_porta_r)); m_opn->port_b_read_callback().set(FUNC(pc8801mk2sr_state::opn_portb_r)); + m_opn->port_b_write_callback().set(FUNC(pc8801mk2sr_state::opn_portb_w)); for (auto &speaker : { m_lspeaker, m_rspeaker }) { @@ -1769,6 +1776,7 @@ void pc8801fh_state::pc8801fh(machine_config &config) m_opna->irq_handler().set(FUNC(pc8801fh_state::int4_irq_w)); m_opna->port_a_read_callback().set(FUNC(pc8801fh_state::opn_porta_r)); m_opna->port_b_read_callback().set(FUNC(pc8801fh_state::opn_portb_r)); + m_opna->port_b_write_callback().set(FUNC(pc8801fh_state::opn_portb_w)); // TODO: per-channel mixing is unconfirmed m_opna->add_route(0, m_lspeaker, 0.25); diff --git a/src/mame/nec/pc8801.h b/src/mame/nec/pc8801.h index 7b48ae0afe6..3aaca31ff68 100644 --- a/src/mame/nec/pc8801.h +++ b/src/mame/nec/pc8801.h @@ -232,6 +232,7 @@ protected: uint8_t opn_porta_r(); uint8_t opn_portb_r(); + void opn_portb_w(uint8_t data); private: optional_device m_opn; diff --git a/src/mame/nec/pc88va.cpp b/src/mame/nec/pc88va.cpp index d71c9179b1b..c8d5a417cd8 100644 --- a/src/mame/nec/pc88va.cpp +++ b/src/mame/nec/pc88va.cpp @@ -154,6 +154,12 @@ uint8_t pc88va_state::opn_portb_r() return BIT(m_mouse_port->read(), 4, 2) | 0xfc; } +void pc88va_state::opn_portb_w(u8 data) +{ + m_mouse_port->pin_6_w(BIT(data, 0)); + m_mouse_port->pin_7_w(BIT(data, 1)); +} + void pc88va_state::rtc_w(offs_t offset, u8 data) { m_rtc->c0_w((data & 1) >> 0); @@ -1182,6 +1188,7 @@ void pc88va_state::pc88va(machine_config &config) m_opna->irq_handler().set(FUNC(pc88va_state::int4_irq_w)); m_opna->port_a_read_callback().set(FUNC(pc88va_state::opn_porta_r)); m_opna->port_b_read_callback().set(FUNC(pc88va_state::opn_portb_r)); + m_opna->port_b_write_callback().set(FUNC(pc88va_state::opn_portb_w)); // TODO: per-channel mixing is unconfirmed m_opna->add_route(0, m_lspeaker, 0.25); m_opna->add_route(0, m_rspeaker, 0.25); diff --git a/src/mame/nec/pc88va.h b/src/mame/nec/pc88va.h index 4dff0279ee1..7a3a66b4e58 100644 --- a/src/mame/nec/pc88va.h +++ b/src/mame/nec/pc88va.h @@ -269,6 +269,7 @@ private: void rtc_w(offs_t offset, u8 data); u8 opn_porta_r(); u8 opn_portb_r(); + void opn_portb_w(u8 data); u8 m_device_ctrl_data = 0; u8 m_misc_ctrl = 0x80; -- cgit v1.2.3