From 161d24ddb78478af5234dd9eb15ee03e019321eb Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 29 Aug 2023 13:12:01 +0200 Subject: fphantom,robotadv: no need to output x coord twice --- src/mame/fidelity/phantom.cpp | 10 ++++----- src/mame/layout/fidel_cphantom.lay | 44 +++++++++++++++---------------------- src/mame/layout/fidel_phantom.lay | 44 +++++++++++++++---------------------- src/mame/layout/novag_robotadv.lay | 45 +++++++++++++++----------------------- src/mame/novag/robotadv.cpp | 11 +++++----- 5 files changed, 64 insertions(+), 90 deletions(-) diff --git a/src/mame/fidelity/phantom.cpp b/src/mame/fidelity/phantom.cpp index 49c2ce1123b..6b9fddcc8b9 100644 --- a/src/mame/fidelity/phantom.cpp +++ b/src/mame/fidelity/phantom.cpp @@ -77,7 +77,7 @@ public: m_inputs(*this, "IN.%u", 0), m_piece_hand(*this, "cpu_hand"), m_out_motor(*this, "motor%u", 0U), - m_out_magnetx(*this, "magnetx%u", 0U), + m_out_magnetx(*this, "magnetx"), m_out_magnety(*this, "magnety") { } @@ -97,7 +97,7 @@ protected: optional_ioport_array<2> m_inputs; output_finder<> m_piece_hand; output_finder<5> m_out_motor; - output_finder<2> m_out_magnetx; + output_finder<> m_out_magnetx; output_finder<> m_out_magnety; // address maps @@ -235,9 +235,9 @@ void phantom_state::check_rotation() void phantom_state::output_magnet_pos() { - int on = BIT(m_motors_ctrl, 4); - m_out_magnetx[on ^ 1] = 0xd0; // hide - m_out_magnetx[on] = m_hmotor_pos; + // put active state on x bit 8 + const int active = BIT(m_motors_ctrl, 4) ? 0x100 : 0; + m_out_magnetx = m_hmotor_pos | active; m_out_magnety = m_vmotor_pos; } diff --git a/src/mame/layout/fidel_cphantom.lay b/src/mame/layout/fidel_cphantom.lay index 9047ddb3538..93e8ce73a03 100644 --- a/src/mame/layout/fidel_cphantom.lay +++ b/src/mame/layout/fidel_cphantom.lay @@ -38,26 +38,15 @@ license:CC0-1.0 - + - + - - - - - - - - - - - - - + + @@ -701,17 +690,20 @@ license:CC0-1.0 - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/mame/layout/fidel_phantom.lay b/src/mame/layout/fidel_phantom.lay index d2bbcd21d35..7fad11fb737 100644 --- a/src/mame/layout/fidel_phantom.lay +++ b/src/mame/layout/fidel_phantom.lay @@ -38,26 +38,15 @@ license:CC0-1.0 - + - + - - - - - - - - - - - - - + + @@ -698,17 +687,20 @@ license:CC0-1.0 - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/mame/layout/novag_robotadv.lay b/src/mame/layout/novag_robotadv.lay index 03c95894115..31eed08bf8e 100644 --- a/src/mame/layout/novag_robotadv.lay +++ b/src/mame/layout/novag_robotadv.lay @@ -21,7 +21,6 @@ license:CC0-1.0 - @@ -52,26 +51,15 @@ license:CC0-1.0 - - - - - - - - - - - - + - + - - + + @@ -735,17 +723,20 @@ license:CC0-1.0 - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/mame/novag/robotadv.cpp b/src/mame/novag/robotadv.cpp index ac422b32f5e..d86487a3250 100644 --- a/src/mame/novag/robotadv.cpp +++ b/src/mame/novag/robotadv.cpp @@ -64,7 +64,7 @@ public: m_inputs(*this, "IN.%u", 0), m_piece_hand(*this, "cpu_hand"), m_out_motor(*this, "motor%u", 0U), - m_out_clawx(*this, "clawx%u", 0U), + m_out_clawx(*this, "clawx"), m_out_clawy(*this, "clawy") { } @@ -82,7 +82,7 @@ private: required_ioport_array<3> m_inputs; output_finder<> m_piece_hand; output_finder<6> m_out_motor; - output_finder<2> m_out_clawx; + output_finder<> m_out_clawx; output_finder<> m_out_clawy; void main_map(address_map &map); @@ -311,9 +311,8 @@ void robotadv_state::refresh() update_piece(x, y); // output claw position - int open = m_limits & 1; - m_out_clawx[open ^ 1] = 1500; // hide - m_out_clawx[open] = int((x + 15.0) * 50.0); + const int open = (m_limits & 1) ? 0x800 : 0; // put open state on x bit 11 + m_out_clawx = int((x + 15.0) * 50.0) | open; m_out_clawy = int((y + 15.0) * 50.0); } @@ -367,7 +366,7 @@ void robotadv_state::control2_w(u8 data) void robotadv_state::latch_w(u8 data) { - // d0-d7: led data, sound data, chessboard mux + // led data, sound data, chessboard mux m_display->write_mx(data); m_latch = data; } -- cgit v1.2.3