From 38fd821b64309eb810540e7a3ee4226306fd23a8 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Thu, 24 Aug 2023 16:39:46 +1000 Subject: Tidied up some recent changes, and more use of BIT helper. --- src/mame/heathkit/intr_cntrl.h | 8 ++++---- src/mame/heathkit/tlb.h | 5 +++-- src/mame/jaleco/cischeat.cpp | 2 +- src/mame/namco/namcos11.cpp | 8 ++++---- src/mame/olympia/portrait.cpp | 2 +- src/mame/ramtek/m79amb_a.h | 2 +- src/mame/taito/grchamp.cpp | 2 +- src/mame/taito/othunder.cpp | 10 +++++----- 8 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/mame/heathkit/intr_cntrl.h b/src/mame/heathkit/intr_cntrl.h index a7ea6247baf..942398478b4 100644 --- a/src/mame/heathkit/intr_cntrl.h +++ b/src/mame/heathkit/intr_cntrl.h @@ -31,7 +31,7 @@ protected: virtual uint8_t get_instruction() = 0; - heath_intr_socket * const m_socket; + heath_intr_socket *const m_socket; friend heath_intr_socket; }; @@ -116,9 +116,9 @@ public: void raise_irq(int state) { m_irq_line(state); } - void set_irq(int state) { if (m_cntrl) { m_cntrl->set_irq(state); }} - void set_drq(int state) { if (m_cntrl) { m_cntrl->set_drq(state); }} - void block_interrupts(uint8_t data) { if (m_cntrl) { m_cntrl->block_interrupts(data); }} + void set_irq(int state) { if (m_cntrl) { m_cntrl->set_irq(state); } } + void set_drq(int state) { if (m_cntrl) { m_cntrl->set_drq(state); } } + void block_interrupts(uint8_t data) { if (m_cntrl) { m_cntrl->block_interrupts(data); } } protected: diff --git a/src/mame/heathkit/tlb.h b/src/mame/heathkit/tlb.h index 2954530a666..a5f2010e8fd 100644 --- a/src/mame/heathkit/tlb.h +++ b/src/mame/heathkit/tlb.h @@ -17,6 +17,7 @@ #include "machine/mm5740.h" #include "sound/beep.h" #include "video/mc6845.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -34,13 +35,13 @@ public: // optional operations virtual void rlsd_in_w(int state) {} virtual void dsr_in_w(int state) {} - virtual void cts_in_w(int state) {} + virtual void cts_in_w(int state) {} protected: // construction/destruction device_heath_tlb_card_interface(const machine_config &mconfig, device_t &device); - heath_tlb_connector * const m_slot; + heath_tlb_connector *const m_slot; }; diff --git a/src/mame/jaleco/cischeat.cpp b/src/mame/jaleco/cischeat.cpp index 5e8778fe6e8..c84cdd27e98 100644 --- a/src/mame/jaleco/cischeat.cpp +++ b/src/mame/jaleco/cischeat.cpp @@ -832,7 +832,7 @@ void captflag_state::motor_move(int side, uint16_t data) dev.reset(); } - (side == RIGHT) ? (m_motor_right_output = pos) : (m_motor_left_output = pos) ; + ((side == RIGHT) ? m_motor_right_output : m_motor_left_output) = pos; } template diff --git a/src/mame/namco/namcos11.cpp b/src/mame/namco/namcos11.cpp index ad0d378d0d0..0e1846ffc08 100644 --- a/src/mame/namco/namcos11.cpp +++ b/src/mame/namco/namcos11.cpp @@ -565,10 +565,10 @@ void namcos11_state::lightgun_w(offs_t offset, uint16_t data, uint16_t mem_mask) switch( offset ) { case 0: - m_led[0] = !( data & 0x08 ); - m_led[1] = !( data & 0x04 ); - m_recoil[0] = !( data & 0x02 ); - m_recoil[1] = !( data & 0x01 ); + m_led[0] = BIT(~data, 3); + m_led[1] = BIT(~data, 2); + m_recoil[0] = BIT(~data, 1); + m_recoil[1] = BIT(~data, 0); verboselog(1, "lightgun_w: outputs (%08x %08x)\n", data, mem_mask ); break; diff --git a/src/mame/olympia/portrait.cpp b/src/mame/olympia/portrait.cpp index 18d30d2d794..0a54886f089 100644 --- a/src/mame/olympia/portrait.cpp +++ b/src/mame/olympia/portrait.cpp @@ -120,7 +120,7 @@ void portrait_state::ctrl_w(uint8_t data) m_lamps[1] = BIT(data, 6); /* shows the black and white photo from the camera */ - m_photo = (data >> 7) & 1; + m_photo = BIT(data, 7); } // $9235-$9236 raw scroll values up to 511 diff --git a/src/mame/ramtek/m79amb_a.h b/src/mame/ramtek/m79amb_a.h index 4340ad8638b..2209f283efb 100644 --- a/src/mame/ramtek/m79amb_a.h +++ b/src/mame/ramtek/m79amb_a.h @@ -27,4 +27,4 @@ DISCRETE_SOUND_EXTERN( m79amb_discrete ); -#endif // MAME_RAMTEK_M79AMB_A_H \ No newline at end of file +#endif // MAME_RAMTEK_M79AMB_A_H diff --git a/src/mame/taito/grchamp.cpp b/src/mame/taito/grchamp.cpp index f9f66140c14..bd33a013e35 100644 --- a/src/mame/taito/grchamp.cpp +++ b/src/mame/taito/grchamp.cpp @@ -199,7 +199,7 @@ void grchamp_state::cpu0_outputs_w(offs_t offset, uint8_t data) /* bit 5: Game Over lamp */ /* bit 6-7: n/c */ machine().bookkeeping().coin_lockout_global_w((data >> 4) & 1); - m_led0 = (~data >> 5) & 1; + m_led0 = BIT(~data, 5); break; case 0x0a: /* OUT10 */ diff --git a/src/mame/taito/othunder.cpp b/src/mame/taito/othunder.cpp index 53ba13226f0..01b79b1541e 100644 --- a/src/mame/taito/othunder.cpp +++ b/src/mame/taito/othunder.cpp @@ -342,15 +342,15 @@ void othunder_state::eeprom_w(u8 data) x0000000 eeprom out data */ /* Recoil Piston Motor Status */ - m_recoil_piston[0] = data & 0x1; - m_recoil_piston[1] = (data & 0x2) >> 1; + m_recoil_piston[0] = BIT(data, 0); + m_recoil_piston[1] = BIT(data, 1); if (data & 4) popmessage("OBPRI SET!"); - m_eeprom->di_write((data & 0x40) >> 6); - m_eeprom->clk_write((data & 0x20) ? ASSERT_LINE : CLEAR_LINE); - m_eeprom->cs_write((data & 0x10) ? ASSERT_LINE : CLEAR_LINE); + m_eeprom->di_write(BIT(data, 6)); + m_eeprom->clk_write(BIT(data, 5)); + m_eeprom->cs_write(BIT(data, 4)); } void othunder_state::coins_w(u8 data) -- cgit v1.2.3