From 82f9511ca48f2dd36acc50afb7ccc8feb6ea5406 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 28 Nov 2023 07:48:12 +1100 Subject: Use C++ swappable idiom correctly, clean up #include guards for headers that were moved. --- src/mame/ampex/ampex210_kbd.h | 8 +++++--- src/mame/microcraft/dim68k_kbd.h | 9 ++++----- src/mame/ncr/dmv_keyb.cpp | 3 +++ src/mame/ncr/dmv_keyb.h | 24 ++++++++++-------------- src/mame/wicat/t7000.cpp | 12 +++++++++--- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/mame/ampex/ampex210_kbd.h b/src/mame/ampex/ampex210_kbd.h index ae38687b34b..88ec18bc671 100644 --- a/src/mame/ampex/ampex210_kbd.h +++ b/src/mame/ampex/ampex210_kbd.h @@ -1,11 +1,13 @@ // license:BSD-3-Clause // copyright-holders:AJR +#ifndef MAME_AMPEX_AMPEX210_KBD_H +#define MAME_AMPEX_AMPEX210_KBD_H -#ifndef MAME_SKELETON_AMPEX210_KBD_H -#define MAME_SKELETON_AMPEX210_KBD_H +#pragma once #include "cpu/mcs48/mcs48.h" + class ampex230_keyboard_device : public device_t { public: @@ -46,4 +48,4 @@ private: // device type declaration DECLARE_DEVICE_TYPE(AMPEX230_KEYBOARD, ampex230_keyboard_device) -#endif // MAME_SKELETON_AMPEX210_KBD_H +#endif // MAME_AMPEX_AMPEX210_KBD_H diff --git a/src/mame/microcraft/dim68k_kbd.h b/src/mame/microcraft/dim68k_kbd.h index e6b993edc92..b9ef3237870 100644 --- a/src/mame/microcraft/dim68k_kbd.h +++ b/src/mame/microcraft/dim68k_kbd.h @@ -5,9 +5,8 @@ Micro Craft Dimension 68000 84-key keyboard **********************************************************************/ - -#ifndef MAME_SKELETON_DIM68K_KBD_H -#define MAME_SKELETON_DIM68K_KBD_H +#ifndef MAME_MICROCRAFT_DIM68K_KBD_H +#define MAME_MICROCRAFT_DIM68K_KBD_H #pragma once @@ -30,7 +29,7 @@ public: auto txd_callback() { return m_txd_callback.bind(); } protected: - // device-level overrides + // device_t implementation virtual void device_resolve_objects() override; virtual void device_start() override; virtual ioport_constructor device_input_ports() const override; @@ -64,4 +63,4 @@ private: // device type declarations DECLARE_DEVICE_TYPE(DIM68K_KEYBOARD, dim68k_keyboard_device) -#endif // MAME_SKELETON_DIM68K_KBD_H +#endif // MAME_MICROCRAFT_DIM68K_KBD_H diff --git a/src/mame/ncr/dmv_keyb.cpp b/src/mame/ncr/dmv_keyb.cpp index 60e3adf2c5b..7a6215cb623 100644 --- a/src/mame/ncr/dmv_keyb.cpp +++ b/src/mame/ncr/dmv_keyb.cpp @@ -200,6 +200,9 @@ dmv_keyboard_device::dmv_keyboard_device(const machine_config &mconfig, const ch : device_t(mconfig, DMV_KEYBOARD, tag, owner, clock) , m_maincpu(*this, "mcu") , m_keyboard(*this, "COL.%u", 0) + , m_col(0) + , m_sd_data_state(0) + , m_sd_poll_state(0) { } diff --git a/src/mame/ncr/dmv_keyb.h b/src/mame/ncr/dmv_keyb.h index c3ef650889a..b21a6e229d2 100644 --- a/src/mame/ncr/dmv_keyb.h +++ b/src/mame/ncr/dmv_keyb.h @@ -5,13 +5,11 @@ Decision Mate V keyboard emulation *********************************************************************/ - -#ifndef MAME_SKELETON_DMV_KEYB_H -#define MAME_SKELETON_DMV_KEYB_H +#ifndef MAME_NCR_DMV_KEYB_H +#define MAME_NCR_DMV_KEYB_H #pragma once - #include "cpu/mcs48/mcs48.h" @@ -31,22 +29,20 @@ public: int sd_poll_r(); protected: - // device-level overrides - virtual void device_start() override; - virtual void device_reset() override; - - // optional information overrides + // device_t implementation virtual const tiny_rom_entry *device_rom_region() const override; virtual void device_add_mconfig(machine_config &config) override; virtual ioport_constructor device_input_ports() const override; + virtual void device_start() override; + virtual void device_reset() override; private: required_device m_maincpu; required_ioport_array<16> m_keyboard; - uint8_t m_col = 0; - int m_sd_data_state = 0; - int m_sd_poll_state = 0; + uint8_t m_col; + int m_sd_data_state; + int m_sd_poll_state; uint8_t port1_r(); uint8_t port2_r(); @@ -54,8 +50,8 @@ private: }; -// device type definition +// device type declaration DECLARE_DEVICE_TYPE(DMV_KEYBOARD, dmv_keyboard_device) -#endif // MAME_SKELETON_DMV_KEYB_H +#endif // MAME_NCR_DMV_KEYB_H diff --git a/src/mame/wicat/t7000.cpp b/src/mame/wicat/t7000.cpp index 510f85383ee..a223a7edf0d 100644 --- a/src/mame/wicat/t7000.cpp +++ b/src/mame/wicat/t7000.cpp @@ -17,6 +17,7 @@ ****************************************************************************/ #include "emu.h" + #include "bus/rs232/rs232.h" #include "cpu/z80/z80.h" #include "machine/74259.h" @@ -25,8 +26,10 @@ #include "machine/scn_pci.h" #include "machine/x2212.h" #include "video/i8275.h" + #include "screen.h" + namespace { class t7000_state : public driver_device @@ -95,11 +98,14 @@ I8275_DRAW_CHARACTER_MEMBER(t7000_state::display_character) rgb_t fg = rgb_t::white(); rgb_t bg = rgb_t::black(); if (m_outlatch->q2_r()) - std::swap(fg, bg); + { + using std::swap; + swap(fg, bg); + } for (int i = 0; i < 10; i++) { - bitmap.pix(y, x + i) = (dots & 0x300) != 0 ? fg : bg; + bitmap.pix(y, x + i) = ((dots & 0x300) != 0) ? fg : bg; dots <<= 1; } } @@ -258,4 +264,4 @@ ROM_END } // anonymous namespace -SYST(1982, t7000, 0, 0, t7000, t7000, t7000_state, empty_init, "Wicat Systems", "T7000 Video Terminal", MACHINE_IMPERFECT_GRAPHICS | MACHINE_NOT_WORKING | MACHINE_SUPPORTS_SAVE) +SYST(1982, t7000, 0, 0, t7000, t7000, t7000_state, empty_init, "Wicat Systems", "T7000 Video Terminal", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) -- cgit v1.2.3