diff options
Diffstat (limited to 'src')
250 files changed, 1042 insertions, 1022 deletions
diff --git a/src/devices/bus/amiga/keyboard/a1200.cpp b/src/devices/bus/amiga/keyboard/a1200.cpp index 74d0f98518d..e9107fbe5be 100644 --- a/src/devices/bus/amiga/keyboard/a1200.cpp +++ b/src/devices/bus/amiga/keyboard/a1200.cpp @@ -61,7 +61,7 @@ DEFINE_DEVICE_TYPE_NS(A1200_KBD, bus::amiga::keyboard, a1200_kbd_device, "a1200k -namespace bus { namespace amiga { namespace keyboard { +namespace bus::amiga::keyboard { namespace { @@ -211,4 +211,4 @@ void a1200_kbd_device::device_reset_after_children() m_mpu->set_input_line(M68HC05_IRQ_LINE, BIT(ioport("IRQ")->read(), 0) ? CLEAR_LINE : ASSERT_LINE); } -} } } // namespace bus::amiga::keyboard +} // namespace bus::amiga::keyboard diff --git a/src/devices/bus/amiga/keyboard/a1200.h b/src/devices/bus/amiga/keyboard/a1200.h index edb946699f2..4cbba0616db 100644 --- a/src/devices/bus/amiga/keyboard/a1200.h +++ b/src/devices/bus/amiga/keyboard/a1200.h @@ -14,7 +14,7 @@ #include "keyboard.h" -namespace bus { namespace amiga { namespace keyboard { +namespace bus::amiga::keyboard { //************************************************************************** // TYPE DECLARATIONS @@ -55,7 +55,7 @@ private: bool m_host_kdat, m_mpu_kdat; }; -} } } // namespace bus::amiga::keyboard +} // namespace bus::amiga::keyboard //************************************************************************** diff --git a/src/devices/bus/amiga/keyboard/a2000.cpp b/src/devices/bus/amiga/keyboard/a2000.cpp index 656881eefe2..b9728ca7f26 100644 --- a/src/devices/bus/amiga/keyboard/a2000.cpp +++ b/src/devices/bus/amiga/keyboard/a2000.cpp @@ -82,7 +82,7 @@ DEFINE_DEVICE_TYPE_NS(A2000_KBD_G80_GB, bus::amiga::keyboard, a2000_kbd_g80_gb_d -namespace bus { namespace amiga { namespace keyboard { +namespace bus::amiga::keyboard { namespace { @@ -669,4 +669,4 @@ ioport_constructor a2000_kbd_g80_gb_device::device_input_ports() const return INPUT_PORTS_NAME(a2000_gb_keyboard); } -} } } // namespace bus::amiga::keyboard +} // namespace bus::amiga::keyboard diff --git a/src/devices/bus/amiga/keyboard/a2000.h b/src/devices/bus/amiga/keyboard/a2000.h index bcc7016ed8b..7a710f6ad37 100644 --- a/src/devices/bus/amiga/keyboard/a2000.h +++ b/src/devices/bus/amiga/keyboard/a2000.h @@ -14,7 +14,7 @@ #include "keyboard.h" -namespace bus { namespace amiga { namespace keyboard { +namespace bus::amiga::keyboard { //************************************************************************** // TYPE DECLARATIONS @@ -110,7 +110,7 @@ protected: virtual ioport_constructor device_input_ports() const override; }; -} } } // namespace bus::amiga::keyboard +} // namespace bus::amiga::keyboard //************************************************************************** diff --git a/src/devices/bus/amiga/keyboard/matrix.cpp b/src/devices/bus/amiga/keyboard/matrix.cpp index fa588052cd7..530d243f4b0 100644 --- a/src/devices/bus/amiga/keyboard/matrix.cpp +++ b/src/devices/bus/amiga/keyboard/matrix.cpp @@ -9,7 +9,7 @@ #include "emu.h" #include "matrix.h" -namespace bus { namespace amiga { namespace keyboard { +namespace bus::amiga::keyboard { namespace { @@ -852,4 +852,4 @@ INPUT_PORTS_START(remove_keypad) PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) INPUT_PORTS_END -} } } // namespace bus::amiga::keyboard +} // namespace bus::amiga::keyboard diff --git a/src/devices/bus/amiga/keyboard/matrix.h b/src/devices/bus/amiga/keyboard/matrix.h index 01ab81b1dec..50060d01f22 100644 --- a/src/devices/bus/amiga/keyboard/matrix.h +++ b/src/devices/bus/amiga/keyboard/matrix.h @@ -11,7 +11,7 @@ #pragma once -namespace bus { namespace amiga { namespace keyboard { +namespace bus::amiga::keyboard { INPUT_PORTS_EXTERN(matrix_us); INPUT_PORTS_EXTERN(matrix_de); @@ -27,6 +27,6 @@ INPUT_PORTS_EXTERN(matrix_gb); INPUT_PORTS_EXTERN(a1000_keypad); INPUT_PORTS_EXTERN(remove_keypad); -} } } // namespace bus::amiga::keyboard +} // namespace bus::amiga::keyboard #endif // MAME_BUS_AMIGA_KEYBOARD_MATRIX_H diff --git a/src/devices/bus/amiga/zorro/a2052.cpp b/src/devices/bus/amiga/zorro/a2052.cpp index 877d0f9c1d3..69b5f324d18 100644 --- a/src/devices/bus/amiga/zorro/a2052.cpp +++ b/src/devices/bus/amiga/zorro/a2052.cpp @@ -22,7 +22,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_A2052, bus::amiga::zorro, a2052_device, "zorro_a2052", "CBM A2052 Fast Memory") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // input_ports - device-specific input ports @@ -128,4 +128,4 @@ WRITE_LINE_MEMBER( a2052_device::cfgin_w ) } } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/a2052.h b/src/devices/bus/amiga/zorro/a2052.h index fbbac14f4cb..f64bf06196d 100644 --- a/src/devices/bus/amiga/zorro/a2052.h +++ b/src/devices/bus/amiga/zorro/a2052.h @@ -17,7 +17,7 @@ #include "machine/autoconfig.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -46,7 +46,7 @@ private: std::vector<uint16_t> m_ram; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_A2052, bus::amiga::zorro, a2052_device) diff --git a/src/devices/bus/amiga/zorro/a2058.cpp b/src/devices/bus/amiga/zorro/a2058.cpp index cb30212620f..34a587454d8 100644 --- a/src/devices/bus/amiga/zorro/a2058.cpp +++ b/src/devices/bus/amiga/zorro/a2058.cpp @@ -22,7 +22,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_A2058, bus::amiga::zorro, a2058_device, "zorro_a2058", "CBM A2058 Fast Memory") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // input_ports - device-specific input ports @@ -139,4 +139,4 @@ WRITE_LINE_MEMBER( a2058_device::cfgin_w ) } } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/a2058.h b/src/devices/bus/amiga/zorro/a2058.h index e46a6774a3e..9b361b403e4 100644 --- a/src/devices/bus/amiga/zorro/a2058.h +++ b/src/devices/bus/amiga/zorro/a2058.h @@ -17,7 +17,7 @@ #include "machine/autoconfig.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -47,7 +47,7 @@ private: int m_ram_size; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_A2058, bus::amiga::zorro, a2058_device) diff --git a/src/devices/bus/amiga/zorro/a2065.cpp b/src/devices/bus/amiga/zorro/a2065.cpp index 50c92753eae..b99eb51ebfb 100644 --- a/src/devices/bus/amiga/zorro/a2065.cpp +++ b/src/devices/bus/amiga/zorro/a2065.cpp @@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_A2065, bus::amiga::zorro, a2065_device, "zorro_a2065", "CBM A2065 Ethernet Card") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // device_add_mconfig - add device configuration @@ -164,4 +164,4 @@ WRITE_LINE_MEMBER( a2065_device::lance_irq_w ) m_slot->int2_w(!state); } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/a2065.h b/src/devices/bus/amiga/zorro/a2065.h index f305309fe48..43e66c29678 100644 --- a/src/devices/bus/amiga/zorro/a2065.h +++ b/src/devices/bus/amiga/zorro/a2065.h @@ -18,7 +18,7 @@ #include "machine/autoconfig.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -56,7 +56,7 @@ private: std::unique_ptr<uint16_t[]> m_ram; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_A2065, bus::amiga::zorro, a2065_device) diff --git a/src/devices/bus/amiga/zorro/a2232.cpp b/src/devices/bus/amiga/zorro/a2232.cpp index af2e6db7461..938b60ffb63 100644 --- a/src/devices/bus/amiga/zorro/a2232.cpp +++ b/src/devices/bus/amiga/zorro/a2232.cpp @@ -24,7 +24,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_A2232, bus::amiga::zorro, a2232_device, "zorro_a2232", "CBM A2232 Serial Card") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // device_add_mconfig - add device configuration @@ -488,4 +488,4 @@ void a2232_device::iocpu_map(address_map &map) map(0xc000, 0xffff).ram().share("shared"); } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/a2232.h b/src/devices/bus/amiga/zorro/a2232.h index c6c836aec80..e8a5da3258c 100644 --- a/src/devices/bus/amiga/zorro/a2232.h +++ b/src/devices/bus/amiga/zorro/a2232.h @@ -24,7 +24,7 @@ #include "bus/rs232/rs232.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -106,7 +106,7 @@ private: uint8_t m_cia_port_b; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_A2232, bus::amiga::zorro, a2232_device) diff --git a/src/devices/bus/amiga/zorro/a590.cpp b/src/devices/bus/amiga/zorro/a590.cpp index c183ed93c3b..a956e845b90 100644 --- a/src/devices/bus/amiga/zorro/a590.cpp +++ b/src/devices/bus/amiga/zorro/a590.cpp @@ -22,7 +22,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_A590, bus::amiga::zorro, a590_device, "zorro_a590" DEFINE_DEVICE_TYPE_NS(ZORRO_A2091, bus::amiga::zorro, a2091_device, "zorro_a2091", "CBM A2091 HD Controller") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // input_ports - device-specific input ports @@ -377,4 +377,4 @@ WRITE_LINE_MEMBER( dmac_hdc_device_base::scsi_drq_w ) m_dmac->xdreq_w(state); } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/a590.h b/src/devices/bus/amiga/zorro/a590.h index bdf9ad1ec0c..ab2a71bb0ce 100644 --- a/src/devices/bus/amiga/zorro/a590.h +++ b/src/devices/bus/amiga/zorro/a590.h @@ -18,7 +18,7 @@ #include "machine/wd33c9x.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -132,7 +132,7 @@ private: required_ioport m_jp201; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_A590, bus::amiga::zorro, a590_device) diff --git a/src/devices/bus/amiga/zorro/action_replay.cpp b/src/devices/bus/amiga/zorro/action_replay.cpp index d8aea30153a..6fe65413709 100644 --- a/src/devices/bus/amiga/zorro/action_replay.cpp +++ b/src/devices/bus/amiga/zorro/action_replay.cpp @@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK2, bus::amiga::zorro, action_replay_ DEFINE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK3, bus::amiga::zorro, action_replay_mk3_device, "zorro_ar3", "Datel Action Replay MK-III") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // input_ports - device-specific input ports @@ -150,4 +150,4 @@ INPUT_CHANGED_MEMBER( action_replay_device_base::freeze ) m_slot->ipl_w(newval == 1 ? 7 : 0); } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/action_replay.h b/src/devices/bus/amiga/zorro/action_replay.h index 4c0d6f3c93d..18a3c6c6456 100644 --- a/src/devices/bus/amiga/zorro/action_replay.h +++ b/src/devices/bus/amiga/zorro/action_replay.h @@ -16,7 +16,7 @@ #include "zorro.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -77,7 +77,7 @@ protected: virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_ACTION_REPLAY_MK1, bus::amiga::zorro, action_replay_mk1_device) diff --git a/src/devices/bus/amiga/zorro/buddha.cpp b/src/devices/bus/amiga/zorro/buddha.cpp index 842a32f7f2d..08e7df229ec 100644 --- a/src/devices/bus/amiga/zorro/buddha.cpp +++ b/src/devices/bus/amiga/zorro/buddha.cpp @@ -36,7 +36,7 @@ DEFINE_DEVICE_TYPE_NS(ZORRO_BUDDHA, bus::amiga::zorro, buddha_device, "zorro_buddha", "Buddha IDE controller") -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //------------------------------------------------- // mmio_map - device-specific memory mapped I/O @@ -326,4 +326,4 @@ void buddha_device::ide_1_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask) m_ata_1->cs1_w((offset >> 1) & 0x07, data, mem_mask); } -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro diff --git a/src/devices/bus/amiga/zorro/buddha.h b/src/devices/bus/amiga/zorro/buddha.h index f79382f6013..80fce2682c5 100644 --- a/src/devices/bus/amiga/zorro/buddha.h +++ b/src/devices/bus/amiga/zorro/buddha.h @@ -18,7 +18,7 @@ #include "bus/ata/ataintf.h" -namespace bus { namespace amiga { namespace zorro { +namespace bus::amiga::zorro { //************************************************************************** // TYPE DEFINITIONS @@ -78,7 +78,7 @@ private: int m_ide_1_interrupt; }; -} } } // namespace bus::amiga::zorro +} // namespace bus::amiga::zorro // device type definition DECLARE_DEVICE_TYPE_NS(ZORRO_BUDDHA, bus::amiga::zorro, buddha_device) diff --git a/src/devices/bus/hexbus/hexbus.cpp b/src/devices/bus/hexbus/hexbus.cpp index 53e8a40e7c0..b9dcfd29ef8 100644 --- a/src/devices/bus/hexbus/hexbus.cpp +++ b/src/devices/bus/hexbus/hexbus.cpp @@ -160,7 +160,7 @@ // Hexbus instance DEFINE_DEVICE_TYPE_NS(HEXBUS, bus::hexbus, hexbus_device, "hexbus", "Hexbus connector") -namespace bus { namespace hexbus { +namespace bus::hexbus { device_hexbus_interface::device_hexbus_interface(const machine_config &mconfig, device_t &device) : device_interface(device, "hexbus") @@ -428,7 +428,7 @@ int hexbus_chained_device::data_bit(int n) // ------------------------------------------------------------------------ -} } // end namespace bus::hexbus +} // end namespace bus::hexbus void hexbus_options(device_slot_interface &device) { diff --git a/src/devices/bus/hexbus/hexbus.h b/src/devices/bus/hexbus/hexbus.h index 7f39400974b..1d225c55749 100644 --- a/src/devices/bus/hexbus/hexbus.h +++ b/src/devices/bus/hexbus/hexbus.h @@ -15,7 +15,7 @@ #pragma once -namespace bus { namespace hexbus { +namespace bus::hexbus { enum { @@ -171,7 +171,7 @@ private: hexbus_chained_device* m_chain_element; }; -} } // end namespace bus::hexbus +} // end namespace bus::hexbus DECLARE_DEVICE_TYPE_NS(HEXBUS, bus::hexbus, hexbus_device) diff --git a/src/devices/bus/hexbus/hx5102.cpp b/src/devices/bus/hexbus/hx5102.cpp index 65f59e0a18a..64fb31d57b0 100644 --- a/src/devices/bus/hexbus/hx5102.cpp +++ b/src/devices/bus/hexbus/hx5102.cpp @@ -109,7 +109,7 @@ DEFINE_DEVICE_TYPE_NS(HX5102, bus::hexbus, hx5102_device, "ti_hx5102", "TI Hexbus Floppy Drive") -namespace bus { namespace hexbus { +namespace bus::hexbus { void hx5102_device::memmap(address_map &map) { @@ -744,5 +744,5 @@ ioport_constructor hx5102_device::device_input_ports() const return INPUT_PORTS_NAME( hx5102 ); } -} } // end namespace bus::hexbus +} // end namespace bus::hexbus diff --git a/src/devices/bus/hexbus/hx5102.h b/src/devices/bus/hexbus/hx5102.h index 573c999ce3b..ac7b9e6a88b 100644 --- a/src/devices/bus/hexbus/hx5102.h +++ b/src/devices/bus/hexbus/hx5102.h @@ -28,7 +28,7 @@ #include "imagedev/floppy.h" #include "tp0370.h" -namespace bus { namespace hexbus { +namespace bus::hexbus { class hx5102_device : public hexbus_chained_device { @@ -121,7 +121,7 @@ private: uint8_t* m_rom2; }; -} } // end namespace bus::hexbus +} // end namespace bus::hexbus DECLARE_DEVICE_TYPE_NS(HX5102, bus::hexbus, hx5102_device) diff --git a/src/devices/bus/hexbus/tp0370.cpp b/src/devices/bus/hexbus/tp0370.cpp index 6b8b416383b..739d7c4a685 100644 --- a/src/devices/bus/hexbus/tp0370.cpp +++ b/src/devices/bus/hexbus/tp0370.cpp @@ -130,7 +130,7 @@ enum // Hexbus instance DEFINE_DEVICE_TYPE_NS(IBC, bus::hexbus, ibc_device, "ibc", "Intelligent Peripheral Bus Controller") -namespace bus { namespace hexbus { +namespace bus::hexbus { ibc_device::ibc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, IBC, tag, owner, clock), @@ -358,5 +358,5 @@ void ibc_device::device_reset() m_disable = true; } -} } +} // namespace bus::hexbus diff --git a/src/devices/bus/hexbus/tp0370.h b/src/devices/bus/hexbus/tp0370.h index eb8b37dfd60..9aafc27804a 100644 --- a/src/devices/bus/hexbus/tp0370.h +++ b/src/devices/bus/hexbus/tp0370.h @@ -16,7 +16,7 @@ #pragma once -namespace bus { namespace hexbus { +namespace bus::hexbus { class ibc_device : public device_t { @@ -69,7 +69,7 @@ private: void set_lines(bool bav, bool hsk); }; -} } +} // namespace bus::hexbus DECLARE_DEVICE_TYPE_NS(IBC, bus::hexbus, ibc_device) #endif diff --git a/src/devices/bus/hp_dio/hp98265a.cpp b/src/devices/bus/hp_dio/hp98265a.cpp index f02a4b9fcb2..97f6b9bc945 100644 --- a/src/devices/bus/hp_dio/hp98265a.cpp +++ b/src/devices/bus/hp_dio/hp98265a.cpp @@ -19,7 +19,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98265A, bus::hp_dio, dio16_98265a_device, "hp98265a", "HP98265A SCSI S16 Interface") -namespace bus { namespace hp_dio { +namespace bus::hp_dio { void dio16_98265a_device::mb87030_scsi_adapter(device_t *device) { @@ -295,4 +295,4 @@ WRITE_LINE_MEMBER(dio16_98265a_device::dmar0_w) } -} } // namespace bus::hp_dio +} // namespace bus::hp_dio diff --git a/src/devices/bus/hp_dio/hp98265a.h b/src/devices/bus/hp_dio/hp98265a.h index c2bd58726b5..8246f9bb743 100644 --- a/src/devices/bus/hp_dio/hp98265a.h +++ b/src/devices/bus/hp_dio/hp98265a.h @@ -11,8 +11,7 @@ #include "bus/scsi/scsi.h" #include "bus/scsi/scsicd.h" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { class dio16_98265a_device : public device_t, @@ -65,7 +64,7 @@ private: bool m_dmar0; }; -} } // namespace bus::hp_dio +} // namespace bus::hp_dio DECLARE_DEVICE_TYPE_NS(HPDIO_98265A, bus::hp_dio, dio16_98265a_device) diff --git a/src/devices/bus/hp_dio/hp98543.cpp b/src/devices/bus/hp_dio/hp98543.cpp index d219dbd77c8..6df0757f04f 100644 --- a/src/devices/bus/hp_dio/hp98543.cpp +++ b/src/devices/bus/hp_dio/hp98543.cpp @@ -23,8 +23,7 @@ ROM_END DEFINE_DEVICE_TYPE_NS(HPDIO_98543, bus::hp_dio, dio16_98543_device, "dio98543", "HP98543 medium-res color DIO video card") -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { void dio16_98543_device::device_add_mconfig(machine_config &config) { @@ -253,4 +252,3 @@ uint32_t dio16_98543_device::screen_update(screen_device &screen, bitmap_rgb32 & } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98543.h b/src/devices/bus/hp_dio/hp98543.h index 567f2215c1b..c1e86126880 100644 --- a/src/devices/bus/hp_dio/hp98543.h +++ b/src/devices/bus/hp_dio/hp98543.h @@ -11,8 +11,8 @@ #include "video/nereid.h" #include "machine/ram.h" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { + class dio16_98543_device : public device_t, public device_dio16_card_interface, @@ -67,7 +67,6 @@ private: }; } // namespace bus::hp_dio -} // namespace bus // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98543, bus::hp_dio, dio16_98543_device) diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp index 4c211e8778d..040e36637aa 100644 --- a/src/devices/bus/hp_dio/hp98544.cpp +++ b/src/devices/bus/hp_dio/hp98544.cpp @@ -21,8 +21,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98544, bus::hp_dio, dio16_98544_device, "dio98544", "HP98544 high-res monochrome DIO video card") -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { ROM_START( hp98544 ) ROM_REGION( 0x2000, HP98544_ROM_REGION, 0 ) @@ -186,4 +185,3 @@ uint32_t dio16_98544_device::screen_update(screen_device &screen, bitmap_rgb32 & } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98544.h b/src/devices/bus/hp_dio/hp98544.h index 7e718180ea6..a490f765c84 100644 --- a/src/devices/bus/hp_dio/hp98544.h +++ b/src/devices/bus/hp_dio/hp98544.h @@ -14,8 +14,7 @@ // ======================> dio16_98544_device -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { class dio16_98544_device : public device_t, @@ -59,7 +58,6 @@ private: }; } // namespace bus::hp_dio -} // namespace bus // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98544, bus::hp_dio, dio16_98544_device) diff --git a/src/devices/bus/hp_dio/hp98550.cpp b/src/devices/bus/hp_dio/hp98550.cpp index 878c5193a37..b4a9af05a73 100644 --- a/src/devices/bus/hp_dio/hp98550.cpp +++ b/src/devices/bus/hp_dio/hp98550.cpp @@ -25,7 +25,7 @@ ROM_END DEFINE_DEVICE_TYPE_NS(HPDIO_98550, bus::hp_dio, dio32_98550_device, "dio98550", "HP98550A high-res color DIO video card") -namespace bus { namespace hp_dio { +namespace bus::hp_dio { void dio32_98550_device::device_add_mconfig(machine_config &config) { @@ -233,4 +233,3 @@ uint32_t dio32_98550_device::screen_update(screen_device &screen, bitmap_rgb32 & } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98550.h b/src/devices/bus/hp_dio/hp98550.h index 155a7213c09..eca4da5bed6 100644 --- a/src/devices/bus/hp_dio/hp98550.h +++ b/src/devices/bus/hp_dio/hp98550.h @@ -11,8 +11,8 @@ #include "video/nereid.h" #include "machine/ram.h" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { + class dio32_98550_device : public device_t, public device_dio16_card_interface, @@ -68,7 +68,6 @@ protected: }; } // namespace bus::hp_dio -} // namespace bus // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98550, bus::hp_dio, dio32_98550_device) diff --git a/src/devices/bus/hp_dio/hp98603a.cpp b/src/devices/bus/hp_dio/hp98603a.cpp index caf83b3373f..791366d7639 100644 --- a/src/devices/bus/hp_dio/hp98603a.cpp +++ b/src/devices/bus/hp_dio/hp98603a.cpp @@ -13,8 +13,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98603A, bus::hp_dio, dio16_98603a_device, "dio98603a #define HP98603A_ROM_REGION "98603a_rom" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { ROM_START(hp98603a) ROM_REGION(0x80000, HP98603A_ROM_REGION, 0) @@ -81,4 +80,3 @@ void dio16_98603a_device::rom_w(offs_t offset, uint16_t data) } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98603a.h b/src/devices/bus/hp_dio/hp98603a.h index ff369071bab..15cccb7ab3d 100644 --- a/src/devices/bus/hp_dio/hp98603a.h +++ b/src/devices/bus/hp_dio/hp98603a.h @@ -8,8 +8,7 @@ #include "hp_dio.h" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { class dio16_98603a_device : public device_t, @@ -37,7 +36,6 @@ private: }; } // namespace bus::hp_dio -} // namespace bus DECLARE_DEVICE_TYPE_NS(HPDIO_98603A, bus::hp_dio, dio16_98603a_device) diff --git a/src/devices/bus/hp_dio/hp98603b.cpp b/src/devices/bus/hp_dio/hp98603b.cpp index 16bb4831bd0..e9ab716f30f 100644 --- a/src/devices/bus/hp_dio/hp98603b.cpp +++ b/src/devices/bus/hp_dio/hp98603b.cpp @@ -13,8 +13,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98603B, bus::hp_dio, dio16_98603b_device, "dio98603b #define HP98603B_ROM_REGION "98603b_rom" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { ROM_START(hp98603b) ROM_REGION(0x100000, HP98603B_ROM_REGION, 0) @@ -76,4 +75,3 @@ void dio16_98603b_device::rom_w(offs_t offset, uint16_t data) } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98603b.h b/src/devices/bus/hp_dio/hp98603b.h index 615815edc51..4f910781dba 100644 --- a/src/devices/bus/hp_dio/hp98603b.h +++ b/src/devices/bus/hp_dio/hp98603b.h @@ -8,8 +8,7 @@ #include "hp_dio.h" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { class dio16_98603b_device : public device_t, @@ -37,7 +36,6 @@ private: }; } // namespace bus::hp_dio -} // namespace bus DECLARE_DEVICE_TYPE_NS(HPDIO_98603B, bus::hp_dio, dio16_98603b_device) diff --git a/src/devices/bus/hp_dio/hp98620.cpp b/src/devices/bus/hp_dio/hp98620.cpp index 2a872dae77f..6a58ef2af78 100644 --- a/src/devices/bus/hp_dio/hp98620.cpp +++ b/src/devices/bus/hp_dio/hp98620.cpp @@ -15,8 +15,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98620, bus::hp_dio, dio16_98620_device, "hp98620", "HP98620 DMA Controller") -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { dio16_98620_device::dio16_98620_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dio16_98620_device(mconfig, HPDIO_98620, tag, owner, clock) @@ -377,5 +376,3 @@ WRITE_LINE_MEMBER(dio16_98620_device::dmar1_in) } } // namespace bus::hp_dio -} // namespace bus - diff --git a/src/devices/bus/hp_dio/hp98620.h b/src/devices/bus/hp_dio/hp98620.h index ca6d2ae9da2..d8779f0e852 100644 --- a/src/devices/bus/hp_dio/hp98620.h +++ b/src/devices/bus/hp_dio/hp98620.h @@ -9,8 +9,7 @@ #include "hp_dio.h" -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { class dio16_98620_device : public device_t, @@ -125,7 +124,7 @@ private: bool m_dmar[2]; }; -} } // namespace bus::hp_dio +} // namespace bus::hp_dio DECLARE_DEVICE_TYPE_NS(HPDIO_98620, bus::hp_dio, dio16_98620_device) diff --git a/src/devices/bus/hp_dio/hp98643.cpp b/src/devices/bus/hp_dio/hp98643.cpp index 7d5cc557e71..bba7cefebb5 100644 --- a/src/devices/bus/hp_dio/hp98643.cpp +++ b/src/devices/bus/hp_dio/hp98643.cpp @@ -15,7 +15,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98643, bus::hp_dio, dio16_98643_device, "dio98643", "HP98643A LANIC Ethernet card") -namespace bus { namespace hp_dio { +namespace bus::hp_dio { void dio16_98643_device::device_add_mconfig(machine_config &config) { @@ -213,4 +213,3 @@ void dio16_98643_device::addrmap(address_map &map) } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98643.h b/src/devices/bus/hp_dio/hp98643.h index 665528ad3f6..c1944bb1b8f 100644 --- a/src/devices/bus/hp_dio/hp98643.h +++ b/src/devices/bus/hp_dio/hp98643.h @@ -9,7 +9,7 @@ #include "hp_dio.h" #include "machine/am79c90.h" -namespace bus { namespace hp_dio { +namespace bus::hp_dio { static constexpr int REG_SWITCHES_REMOTE = 0x80; @@ -84,7 +84,6 @@ private: }; } // namespace bus::hp_dio -} // namespace bus // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98643, bus::hp_dio, dio16_98643_device) diff --git a/src/devices/bus/hp_dio/hp98644.cpp b/src/devices/bus/hp_dio/hp98644.cpp index 7badd2d2f15..2896076d01f 100644 --- a/src/devices/bus/hp_dio/hp98644.cpp +++ b/src/devices/bus/hp_dio/hp98644.cpp @@ -17,8 +17,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_98644, bus::hp_dio, dio16_98644_device, "dio98644", "HP98644A Asynchronous Serial Interface") -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { //------------------------------------------------- // device_add_mconfig - add device configuration @@ -242,4 +241,3 @@ void dio16_98644_device::io_w(offs_t offset, uint16_t data) } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/hp98644.h b/src/devices/bus/hp_dio/hp98644.h index f34ff193588..6cd99123b92 100644 --- a/src/devices/bus/hp_dio/hp98644.h +++ b/src/devices/bus/hp_dio/hp98644.h @@ -15,8 +15,7 @@ // ======================> dio16_98644_device -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { class dio16_98644_device : public device_t, @@ -53,7 +52,6 @@ private: }; } // namespace bus::hp_dio -} // namespace bus // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_98644, bus::hp_dio, dio16_98644_device) diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp index 50cad490dc0..75102828b01 100644 --- a/src/devices/bus/hp_dio/hp_dio.cpp +++ b/src/devices/bus/hp_dio/hp_dio.cpp @@ -28,8 +28,7 @@ DEFINE_DEVICE_TYPE_NS(DIO32_SLOT, bus::hp_dio, dio32_slot_device, "dio32_slot", DEFINE_DEVICE_TYPE_NS(DIO16, bus::hp_dio, dio16_device, "dio16", "16-bit DIO bus") DEFINE_DEVICE_TYPE_NS(DIO32, bus::hp_dio, dio32_device, "dio32", "32-bit DIO-II bus") -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { //************************************************************************** // LIVE DEVICE @@ -354,7 +353,6 @@ void device_dio32_card_interface::interface_pre_start() } } // namespace bus::hp_dio -} // namespace bus void dio16_cards(device_slot_interface & device) { diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h index 71d71e67106..744c4940dc5 100644 --- a/src/devices/bus/hp_dio/hp_dio.h +++ b/src/devices/bus/hp_dio/hp_dio.h @@ -17,7 +17,7 @@ #pragma once -namespace bus { namespace hp_dio { +namespace bus::hp_dio { //************************************************************************** // TYPE DEFINITIONS @@ -280,7 +280,7 @@ protected: dio32_device &dio() { assert(m_dio_dev); return downcast<dio32_device &>(*m_dio_dev); } }; -} } // namespace bus::hp_dio +} // namespace bus::hp_dio // device type definition DECLARE_DEVICE_TYPE_NS(DIO16_SLOT, bus::hp_dio, dio16_slot_device) diff --git a/src/devices/bus/hp_dio/human_interface.cpp b/src/devices/bus/hp_dio/human_interface.cpp index 9f160380a51..b084ac47e24 100644 --- a/src/devices/bus/hp_dio/human_interface.cpp +++ b/src/devices/bus/hp_dio/human_interface.cpp @@ -21,8 +21,7 @@ DEFINE_DEVICE_TYPE_NS(HPDIO_HUMAN_INTERFACE, bus::hp_dio, human_interface_device, "human_interface", "HP human interface card") -namespace bus { - namespace hp_dio { +namespace bus::hp_dio { void human_interface_device::device_add_mconfig(machine_config &config) { @@ -389,4 +388,3 @@ uint8_t human_interface_device::dmack_r_in(int channel) } } // namespace bus::hp_dio -} // namespace bus diff --git a/src/devices/bus/hp_dio/human_interface.h b/src/devices/bus/hp_dio/human_interface.h index 26f3548b731..2e1d1376211 100644 --- a/src/devices/bus/hp_dio/human_interface.h +++ b/src/devices/bus/hp_dio/human_interface.h @@ -14,8 +14,9 @@ #include "bus/hp_hil/hp_hil.h" #include "bus/hp_hil/hil_devices.h" #include "bus/ieee488/ieee488.h" -namespace bus { - namespace hp_dio { + +namespace bus::hp_dio { + class human_interface_device : public device_t, public device_dio16_card_interface @@ -96,7 +97,7 @@ private: uint8_t m_ppoll_mask; }; -} } // namespace bus::hp_dio +} // namespace bus::hp_dio // device type definition DECLARE_DEVICE_TYPE_NS(HPDIO_HUMAN_INTERFACE, bus::hp_dio, human_interface_device) diff --git a/src/devices/bus/hp_hil/hlebase.cpp b/src/devices/bus/hp_hil/hlebase.cpp index f122919dc1c..b43271f705a 100644 --- a/src/devices/bus/hp_hil/hlebase.cpp +++ b/src/devices/bus/hp_hil/hlebase.cpp @@ -6,8 +6,7 @@ //#define VERBOSE 1 #include "logmacro.h" -namespace bus { - namespace hp_hil { +namespace bus::hp_hil { /*************************************************************************** BASE HLE KEYBOARD DEVICE @@ -160,4 +159,3 @@ out: } } // namespace bus::hp_hil -} // namespace bus diff --git a/src/devices/bus/hp_hil/hlebase.h b/src/devices/bus/hp_hil/hlebase.h index ebffc3455b2..2ea81239560 100644 --- a/src/devices/bus/hp_hil/hlebase.h +++ b/src/devices/bus/hp_hil/hlebase.h @@ -9,8 +9,7 @@ #include "machine/keyboard.h" -namespace bus { - namespace hp_hil { +namespace bus::hp_hil { class hle_device_base : public device_t @@ -41,6 +40,5 @@ private: }; } // namespace bus::hp_hil -} // namespace bus #endif // MAME_DEVICES_HP_HIL_HLEBASE_H diff --git a/src/devices/bus/hp_hil/hlekbd.cpp b/src/devices/bus/hp_hil/hlekbd.cpp index b3709676d30..2a07bc083df 100644 --- a/src/devices/bus/hp_hil/hlekbd.cpp +++ b/src/devices/bus/hp_hil/hlekbd.cpp @@ -14,7 +14,7 @@ DEFINE_DEVICE_TYPE_NS(HP_IPC_HLE_KEYBOARD, bus::hp_hil, hle_hp_ipc_device, "hp_ipc_hle_kbd", "HP Integral Keyboard (HLE)") DEFINE_DEVICE_TYPE_NS(HP_ITF_HLE_KEYBOARD, bus::hp_hil, hle_hp_itf_device, "hp_itf_hle_kbd", "HP ITF Keyboard") -namespace bus { namespace hp_hil { +namespace bus::hp_hil { namespace { @@ -610,4 +610,4 @@ void hle_hp_itf_device::hil_idd() m_hp_hil_mlc->hil_write(m_device_id16 | 0x04); } -} } // namespace bus::hp_hil +} // namespace bus::hp_hil diff --git a/src/devices/bus/hp_hil/hlekbd.h b/src/devices/bus/hp_hil/hlekbd.h index c9bb59faaad..e1b5c08fd5a 100644 --- a/src/devices/bus/hp_hil/hlekbd.h +++ b/src/devices/bus/hp_hil/hlekbd.h @@ -10,7 +10,7 @@ #include "machine/keyboard.h" -namespace bus { namespace hp_hil { +namespace bus::hp_hil { class hle_hp_ipc_device : public hle_device_base @@ -64,7 +64,7 @@ private: void transmit_byte(uint8_t byte); }; -} } // namespace bus::hp_hil +} // namespace bus::hp_hil DECLARE_DEVICE_TYPE_NS(HP_IPC_HLE_KEYBOARD, bus::hp_hil, hle_hp_ipc_device); diff --git a/src/devices/bus/hp_hil/hlemouse.cpp b/src/devices/bus/hp_hil/hlemouse.cpp index fe4fd311733..c9378446dc6 100644 --- a/src/devices/bus/hp_hil/hlemouse.cpp +++ b/src/devices/bus/hp_hil/hlemouse.cpp @@ -12,8 +12,7 @@ DEFINE_DEVICE_TYPE_NS(HP_46060B_MOUSE, bus::hp_hil, hle_hp_46060b_device, "hp_46060b", "HP 46060B Mouse") -namespace bus { - namespace hp_hil { +namespace bus::hp_hil { namespace { @@ -128,4 +127,3 @@ INPUT_CHANGED_MEMBER(hle_hp_46060b_device::mouse_button) } } // namesapce bus::hp_hil -} // namespace bus diff --git a/src/devices/bus/hp_hil/hlemouse.h b/src/devices/bus/hp_hil/hlemouse.h index 7abfc1d5192..830ffd20bfe 100644 --- a/src/devices/bus/hp_hil/hlemouse.h +++ b/src/devices/bus/hp_hil/hlemouse.h @@ -10,8 +10,7 @@ #include "machine/keyboard.h" -namespace bus { - namespace hp_hil { +namespace bus::hp_hil { class hle_hp_46060b_device : public hle_device_base @@ -45,7 +44,6 @@ public: }; } // namespace bus::hp_hil -} // namespace bus DECLARE_DEVICE_TYPE_NS(HP_46060B_MOUSE, bus::hp_hil, hle_hp_46060b_device); diff --git a/src/devices/bus/intellec4/insdatastor.cpp b/src/devices/bus/intellec4/insdatastor.cpp index 77a9cc378e5..30a7554d1ab 100644 --- a/src/devices/bus/intellec4/insdatastor.cpp +++ b/src/devices/bus/intellec4/insdatastor.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(INTELLEC4_INST_DATA_STORAGE, bus::intellec4, imm4_22_device, "intlc4_imm4_22", "Intel imm4-22 Instruction/Data Storage Module") -namespace bus { namespace intellec4 { +namespace bus::intellec4 { namespace { @@ -188,4 +188,4 @@ void imm4_22_device::unmap_prom() rom_space().unmap_read(offs_t(m_rom_page) << 10, (offs_t(m_rom_page) << 10) | 0x03ffU, m_rom_mirror ? 0x1000U : 0x0000U); } -} } // namespace bus::intellec4 +} // namespace bus::intellec4 diff --git a/src/devices/bus/intellec4/insdatastor.h b/src/devices/bus/intellec4/insdatastor.h index 9c6acad729f..d7c83c30307 100644 --- a/src/devices/bus/intellec4/insdatastor.h +++ b/src/devices/bus/intellec4/insdatastor.h @@ -144,7 +144,7 @@ P2 outputs (40-pin IDC) #include "intellec4.h" -namespace bus { namespace intellec4 { +namespace bus::intellec4 { class imm4_22_device : public device_t, public device_univ_card_interface, public device_image_interface { @@ -192,7 +192,7 @@ private: std::unique_ptr<u8 []> m_prom; }; -} } // namespace bus::intellec4 +} // namespace bus::intellec4 DECLARE_DEVICE_TYPE_NS(INTELLEC4_INST_DATA_STORAGE, bus::intellec4, imm4_22_device) diff --git a/src/devices/bus/intellec4/intellec4.cpp b/src/devices/bus/intellec4/intellec4.cpp index 07b42f3ae52..5c0de621b50 100644 --- a/src/devices/bus/intellec4/intellec4.cpp +++ b/src/devices/bus/intellec4/intellec4.cpp @@ -11,7 +11,7 @@ DEFINE_DEVICE_TYPE_NS(INTELLEC4_UNIV_SLOT, bus::intellec4, univ_slot_device, "in DEFINE_DEVICE_TYPE_NS(INTELLEC4_UNIV_BUS, bus::intellec4, univ_bus_device, "intlc4univbus", "INTELLEC 4 Universal Bus") -namespace bus { namespace intellec4 { +namespace bus::intellec4 { /*********************************************************************** SLOT DEVICE @@ -256,7 +256,7 @@ void device_univ_card_interface::set_bus(univ_bus_device &bus) m_index = (m_bus = &bus)->add_card(*this); } -} } // namespace bus::intellec4 +} // namespace bus::intellec4 diff --git a/src/devices/bus/intellec4/intellec4.h b/src/devices/bus/intellec4/intellec4.h index 8ae65f94487..230e1c80fd4 100644 --- a/src/devices/bus/intellec4/intellec4.h +++ b/src/devices/bus/intellec4/intellec4.h @@ -114,7 +114,7 @@ to implement the card in both systems. #pragma once -namespace bus { namespace intellec4 { +namespace bus::intellec4 { class univ_slot_device; class univ_bus_device; @@ -247,7 +247,7 @@ private: unsigned m_index; }; -} } // namespace bus::intellec4 +} // namespace bus::intellec4 DECLARE_DEVICE_TYPE_NS(INTELLEC4_UNIV_SLOT, bus::intellec4, univ_slot_device) diff --git a/src/devices/bus/intellec4/prommemory.cpp b/src/devices/bus/intellec4/prommemory.cpp index 0eab857a72f..7ce7dd962fd 100644 --- a/src/devices/bus/intellec4/prommemory.cpp +++ b/src/devices/bus/intellec4/prommemory.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(INTELLEC4_PROM_MEMORY, bus::intellec4, imm6_26_device, "intlc4_imm6_26", "Intel imm6-26 PROM Memory Module") -namespace bus { namespace intellec4 { +namespace bus::intellec4 { imm6_26_device::imm6_26_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, INTELLEC4_PROM_MEMORY, tag, owner, clock) @@ -64,4 +64,4 @@ void imm6_26_device::unmap() rom_space().unmap_read(0x1000U, 0x1fffU); } -} } // namespace bus::intellec4 +} // namespace bus::intellec4 diff --git a/src/devices/bus/intellec4/prommemory.h b/src/devices/bus/intellec4/prommemory.h index 14724a0e437..9003129c54c 100644 --- a/src/devices/bus/intellec4/prommemory.h +++ b/src/devices/bus/intellec4/prommemory.h @@ -89,7 +89,7 @@ RAM MOD ENBL not jumpered in on INTELLEC 4, allows PROM to overlay RAM on #include "intellec4.h" -namespace bus { namespace intellec4 { +namespace bus::intellec4 { class imm6_26_device : public device_t, public device_univ_card_interface, public device_image_interface { @@ -119,7 +119,7 @@ private: std::unique_ptr<u8 []> m_data; }; -} } // namespace bus::intellec4 +} // namespace bus::intellec4 DECLARE_DEVICE_TYPE_NS(INTELLEC4_PROM_MEMORY, bus::intellec4, imm6_26_device) diff --git a/src/devices/bus/intellec4/tapereader.cpp b/src/devices/bus/intellec4/tapereader.cpp index ba9566fad2d..1f32815fbd5 100644 --- a/src/devices/bus/intellec4/tapereader.cpp +++ b/src/devices/bus/intellec4/tapereader.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(INTELLEC4_TAPE_READER, bus::intellec4, imm4_90_device, "intlc4_imm4_90", "Intel imm4-90 High-Speed Paper Tape Reader") -namespace bus { namespace intellec4 { +namespace bus::intellec4 { imm4_90_device::imm4_90_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) : device_t(mconfig, INTELLEC4_TAPE_READER, tag, owner, clock) @@ -83,4 +83,4 @@ TIMER_CALLBACK_MEMBER(imm4_90_device::step) } } -} } // namespace bus::intellec4 +} // namespace bus::intellec4 diff --git a/src/devices/bus/intellec4/tapereader.h b/src/devices/bus/intellec4/tapereader.h index 64e1727e5d5..963bf2ae404 100644 --- a/src/devices/bus/intellec4/tapereader.h +++ b/src/devices/bus/intellec4/tapereader.h @@ -19,7 +19,7 @@ interface and paper tape reader as a single device. #include "intellec4.h" -namespace bus { namespace intellec4 { +namespace bus::intellec4 { class imm4_90_device : public device_t, public device_univ_card_interface, public device_image_interface { @@ -56,7 +56,7 @@ private: bool m_stepping; }; -} } // namespace bus::intellec4 +} // namespace bus::intellec4 DECLARE_DEVICE_TYPE_NS(INTELLEC4_TAPE_READER, bus::intellec4, imm4_90_device) diff --git a/src/devices/bus/interpro/keyboard/hle.cpp b/src/devices/bus/interpro/keyboard/hle.cpp index 15dd262eddf..66fa8e44a30 100644 --- a/src/devices/bus/interpro/keyboard/hle.cpp +++ b/src/devices/bus/interpro/keyboard/hle.cpp @@ -122,7 +122,7 @@ DEFINE_DEVICE_TYPE_NS(INTERPRO_HLE_EN_US_KEYBOARD, bus::interpro::keyboard, hle_en_us_device, "kbd_hle_en_us", "InterPro Keyboard (HLE, US English)") -namespace bus { namespace interpro { namespace keyboard { +namespace bus::interpro::keyboard { namespace { @@ -461,4 +461,4 @@ u8 hle_en_us_device::translate(u8 row, u8 column) return TRANSLATION_TABLE[map][row][column]; } -} } } // namespace bus::interpro::keyboard +} // namespace bus::interpro::keyboard diff --git a/src/devices/bus/interpro/keyboard/hle.h b/src/devices/bus/interpro/keyboard/hle.h index 944569b9658..1f4e2066829 100644 --- a/src/devices/bus/interpro/keyboard/hle.h +++ b/src/devices/bus/interpro/keyboard/hle.h @@ -10,7 +10,7 @@ #include "sound/beep.h" #include "diserial.h" -namespace bus { namespace interpro { namespace keyboard { +namespace bus::interpro::keyboard { class hle_device_base : public device_t @@ -113,7 +113,7 @@ public: required_ioport m_modifiers; }; -} } } // namespace bus::interpro::keyboard +} // namespace bus::interpro::keyboard DECLARE_DEVICE_TYPE_NS(INTERPRO_HLE_EN_US_KEYBOARD, bus::interpro::keyboard, hle_en_us_device) diff --git a/src/devices/bus/interpro/keyboard/lle.cpp b/src/devices/bus/interpro/keyboard/lle.cpp index 6beb3581d13..7151f1e0fc0 100644 --- a/src/devices/bus/interpro/keyboard/lle.cpp +++ b/src/devices/bus/interpro/keyboard/lle.cpp @@ -157,7 +157,7 @@ DEFINE_DEVICE_TYPE_NS(INTERPRO_LLE_EN_US_KEYBOARD, bus::interpro::keyboard, lle_en_us_device, "kbd_lle_en_us", "InterPro Keyboard (LLE, US English)") -namespace bus { namespace interpro { namespace keyboard { +namespace bus::interpro::keyboard { namespace { @@ -610,4 +610,4 @@ ioport_constructor lle_en_us_device::device_input_ports() const return INPUT_PORTS_NAME(lle_en_us_device); } -} } } // namespace bus::interpro::keyboard +} // namespace bus::interpro::keyboard diff --git a/src/devices/bus/interpro/keyboard/lle.h b/src/devices/bus/interpro/keyboard/lle.h index 98c565e6cfa..385f2484fab 100644 --- a/src/devices/bus/interpro/keyboard/lle.h +++ b/src/devices/bus/interpro/keyboard/lle.h @@ -12,7 +12,7 @@ #include "machine/bankdev.h" #include "sound/spkrdev.h" -namespace bus { namespace interpro { namespace keyboard { +namespace bus::interpro::keyboard { class lle_device_base : public device_t @@ -66,7 +66,7 @@ public: virtual tiny_rom_entry const *device_rom_region() const override; }; -} } } // namespace bus::interpro::keyboard +} // namespace bus::interpro::keyboard DECLARE_DEVICE_TYPE_NS(INTERPRO_LLE_EN_US_KEYBOARD, bus::interpro::keyboard, lle_en_us_device) diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp index 554eabf6763..35811671add 100644 --- a/src/devices/bus/isa/sblaster.cpp +++ b/src/devices/bus/isa/sblaster.cpp @@ -344,6 +344,7 @@ void sb_device::process_fifo(uint8_t cmd) case 0x17: // 2-bit ADPCM w/new reference m_dsp.adpcm_new_ref = true; m_dsp.adpcm_step = 0; + [[fallthrough]]; case 0x16: // 2-bit ADPCM m_dsp.adpcm_count = 0; m_dsp.dma_length = (m_dsp.fifo[1] + (m_dsp.fifo[2]<<8)) + 1; @@ -406,6 +407,7 @@ void sb_device::process_fifo(uint8_t cmd) case 0x75: // 4-bit ADPCM w/new reference m_dsp.adpcm_new_ref = true; m_dsp.adpcm_step = 0; + [[fallthrough]]; case 0x74: // 4-bit ADPCM m_dsp.adpcm_count = 0; m_dsp.dma_length = (m_dsp.fifo[1] + (m_dsp.fifo[2]<<8)) + 1; @@ -420,6 +422,7 @@ void sb_device::process_fifo(uint8_t cmd) case 0x77: // 2.6-bit ADPCM w/new reference m_dsp.adpcm_new_ref = true; m_dsp.adpcm_step = 0; + [[fallthrough]]; case 0x76: // 2.6-bit ADPCM m_dsp.adpcm_count = 0; m_dsp.dma_length = (m_dsp.fifo[1] + (m_dsp.fifo[2]<<8)) + 1; diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp index 9be591c7d9f..e58ca754186 100644 --- a/src/devices/bus/nes/mmc3_clones.cpp +++ b/src/devices/bus/nes/mmc3_clones.cpp @@ -2488,6 +2488,7 @@ void nes_pjoy84_device::write_m(offs_t offset, uint8_t data) case 0x03: if (m_reg[3] & 0x80) return; // else we act as if offset & 3 = 1,2 + [[fallthrough]]; case 0x01: case 0x02: m_reg[offset & 0x03] = data; diff --git a/src/devices/bus/nes/waixing.cpp b/src/devices/bus/nes/waixing.cpp index 3706d64b26e..2aba7b3f412 100644 --- a/src/devices/bus/nes/waixing.cpp +++ b/src/devices/bus/nes/waixing.cpp @@ -746,6 +746,7 @@ void nes_waixing_h_device::write_h(offs_t offset, uint8_t data) m_prg_base = (data << 5) & 0x40; m_prg_mask = 0x3f; set_prg(m_prg_base, m_prg_mask); + [[fallthrough]]; case 1: case 2: case 3: case 4: case 5: m_mmc_vrom_bank[cmd] = data; @@ -787,6 +788,7 @@ void nes_waixing_h1_device::write_h(offs_t offset, uint8_t data) m_prg_base = (data << 5) & 0x40; m_prg_mask = 0x3f; set_prg(m_prg_base, m_prg_mask); + [[fallthrough]]; case 1: case 2: case 3: case 4: case 5: m_mmc_vrom_bank[cmd] = data; diff --git a/src/devices/bus/nubus/nubus_image.cpp b/src/devices/bus/nubus/nubus_image.cpp index aa54fe51c7a..9d75788c469 100644 --- a/src/devices/bus/nubus/nubus_image.cpp +++ b/src/devices/bus/nubus/nubus_image.cpp @@ -263,6 +263,7 @@ void nubus_image_device::file_cmd_w(uint32_t data) break; case kFileCmdGetFirstListing: filectx.dirp = osd::directory::open((const char *)filectx.curdir); + [[fallthrough]]; case kFileCmdGetNextListing: if (filectx.dirp) { osd::directory::entry const *const dp = filectx.dirp->read(); diff --git a/src/devices/bus/psx/analogue.cpp b/src/devices/bus/psx/analogue.cpp index daf7a7f689f..61feefeb311 100644 --- a/src/devices/bus/psx/analogue.cpp +++ b/src/devices/bus/psx/analogue.cpp @@ -97,7 +97,7 @@ bool psx_analog_controller_device::get_pad(int count, uint8_t *odata, uint8_t id case CONFIG_MODE: // 43 if(count == 3) m_temp = idata; - /* no break */ + [[fallthrough]]; case QUERY_PAD_STATE: // 42 *odata = pad_data(count, true); break; @@ -142,7 +142,7 @@ bool psx_analog_controller_device::get_pad(int count, uint8_t *odata, uint8_t id { case 3: m_temp = idata; - /* no break */ + [[fallthrough]]; default: *odata = 0x00; break; @@ -181,7 +181,7 @@ bool psx_analog_controller_device::get_pad(int count, uint8_t *odata, uint8_t id case 3: if(m_cmd == CONFIG_MODE) m_temp = idata; - /* no break */ + [[fallthrough]]; default: *odata = pad_data(count, true); break; @@ -207,7 +207,7 @@ bool psx_analog_controller_device::get_pad(int count, uint8_t *odata, uint8_t id case 3: if(m_cmd == CONFIG_MODE) m_temp = idata; - /* no break */ + [[fallthrough]]; default: *odata = pad_data(count, false); break; diff --git a/src/devices/bus/rs232/hlemouse.cpp b/src/devices/bus/rs232/hlemouse.cpp index 38e9bfd5c20..599e0d77d14 100644 --- a/src/devices/bus/rs232/hlemouse.cpp +++ b/src/devices/bus/rs232/hlemouse.cpp @@ -81,7 +81,7 @@ DEFINE_DEVICE_TYPE_NS(MSYSTEMS_HLE_SERIAL_MOUSE, bus::rs232, hle_msystems_mouse DEFINE_DEVICE_TYPE_NS(ROTATABLE_HLE_SERIAL_MOUSE, bus::rs232, hle_rotatable_mouse_device, "rs232_mouse_hle_rotatable", "Mouse Systems Rotatable Mouse (HLE)") DEFINE_DEVICE_TYPE_NS(SGI_HLE_SERIAL_MOUSE, bus::rs232, hle_sgi_mouse_device, "rs232_mouse_hle_sgi", "SGI IRIS Indigo Mouse (HLE)") -namespace bus { namespace rs232 { +namespace bus::rs232 { namespace { @@ -720,4 +720,4 @@ void hle_sgi_mouse_device::device_start() transmit_register_reset(); } -} } // namespace bus::rs232 +} // namespace bus::rs232 diff --git a/src/devices/bus/rs232/hlemouse.h b/src/devices/bus/rs232/hlemouse.h index f6fb537e51c..d2fae5bd4d1 100644 --- a/src/devices/bus/rs232/hlemouse.h +++ b/src/devices/bus/rs232/hlemouse.h @@ -16,7 +16,7 @@ #include <type_traits> -namespace bus { namespace rs232 { +namespace bus::rs232 { //************************************************** // Microsoft mouse base @@ -220,7 +220,7 @@ protected: virtual void device_start() override; }; -} } // namespace bus::rs232 +} // namespace bus::rs232 //************************************************** diff --git a/src/devices/bus/sgikbd/hlekbd.cpp b/src/devices/bus/sgikbd/hlekbd.cpp index 517e8496fa0..c5f0b8c4c83 100644 --- a/src/devices/bus/sgikbd/hlekbd.cpp +++ b/src/devices/bus/sgikbd/hlekbd.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(SGI_HLE_KEYBOARD, bus::sgikbd, hle_device, "hlekbd", "SGI Indigo Keyboard (HLE)") -namespace bus { namespace sgikbd { +namespace bus::sgikbd { namespace { @@ -410,4 +410,4 @@ void hle_device::received_byte(uint8_t byte) } } -} } // namespace bus::sgikbd +} // namespace bus::sgikbd diff --git a/src/devices/bus/sgikbd/hlekbd.h b/src/devices/bus/sgikbd/hlekbd.h index a83268693bc..b2c21889d58 100644 --- a/src/devices/bus/sgikbd/hlekbd.h +++ b/src/devices/bus/sgikbd/hlekbd.h @@ -11,7 +11,7 @@ #include "diserial.h" -namespace bus { namespace sgikbd { +namespace bus::sgikbd { class hle_device : public device_t , public device_buffered_serial_interface<16U> @@ -109,7 +109,7 @@ private: uint8_t m_led_state; }; -} } // namespace bus::sgikbd +} // namespace bus::sgikbd DECLARE_DEVICE_TYPE_NS(SGI_HLE_KEYBOARD, bus::sgikbd, hle_device) diff --git a/src/devices/bus/sunkbd/hlekbd.cpp b/src/devices/bus/sunkbd/hlekbd.cpp index 21f4de349ed..96e91a8136f 100644 --- a/src/devices/bus/sunkbd/hlekbd.cpp +++ b/src/devices/bus/sunkbd/hlekbd.cpp @@ -145,7 +145,7 @@ DEFINE_DEVICE_TYPE_NS(SUN_TYPE5_JP_HLE_KEYBOARD, bus::sunkbd, hle_type5_jp_devic -namespace bus { namespace sunkbd { +namespace bus::sunkbd { namespace { @@ -1279,4 +1279,4 @@ ioport_constructor hle_type5_jp_device::device_input_ports() const return INPUT_PORTS_NAME(hle_type5_jp_device); } -} } // namespace bus::sunkbd +} // namespace bus::sunkbd diff --git a/src/devices/bus/sunkbd/hlekbd.h b/src/devices/bus/sunkbd/hlekbd.h index 4f442daad4a..6a3814973a2 100644 --- a/src/devices/bus/sunkbd/hlekbd.h +++ b/src/devices/bus/sunkbd/hlekbd.h @@ -11,7 +11,7 @@ #include "diserial.h" -namespace bus { namespace sunkbd { +namespace bus::sunkbd { class hle_device_base : public device_t @@ -199,7 +199,7 @@ protected: virtual ioport_constructor device_input_ports() const override; }; -} } // namespace bus::sunkbd +} // namespace bus::sunkbd DECLARE_DEVICE_TYPE_NS(SUN_TYPE3_HLE_KEYBOARD, bus::sunkbd, hle_type3_device) diff --git a/src/devices/bus/sunmouse/hlemouse.cpp b/src/devices/bus/sunmouse/hlemouse.cpp index 2969b9b2d9e..014176538db 100644 --- a/src/devices/bus/sunmouse/hlemouse.cpp +++ b/src/devices/bus/sunmouse/hlemouse.cpp @@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE_NS(SUN_1200BAUD_HLE_MOUSE, bus::sunmouse, hle_1200baud_device, "sunmouse_hle1200", "Sun Mouse (1200 Baud, HLE)") DEFINE_DEVICE_TYPE_NS(SUN_4800BAUD_HLE_MOUSE, bus::sunmouse, hle_4800baud_device, "sunmouse_hle4800", "Sun Mouse (4800 Baud, HLE)") -namespace bus { namespace sunmouse { +namespace bus::sunmouse { namespace { @@ -311,4 +311,4 @@ hle_4800baud_device::hle_4800baud_device( { } -} } // namespace bus::sunmouse +} // namespace bus::sunmouse diff --git a/src/devices/bus/sunmouse/hlemouse.h b/src/devices/bus/sunmouse/hlemouse.h index 6eb5cf44b63..342eb04241e 100644 --- a/src/devices/bus/sunmouse/hlemouse.h +++ b/src/devices/bus/sunmouse/hlemouse.h @@ -9,7 +9,7 @@ #include "diserial.h" -namespace bus { namespace sunmouse { +namespace bus::sunmouse { class hle_device_base : public device_t @@ -73,7 +73,7 @@ public: uint32_t clock); }; -} } // namespace bus::sunmouse +} // namespace bus::sunmouse DECLARE_DEVICE_TYPE_NS(SUN_1200BAUD_HLE_MOUSE, bus::sunmouse, hle_1200baud_device) diff --git a/src/devices/bus/ti8x/bitsocket.cpp b/src/devices/bus/ti8x/bitsocket.cpp index bfe7849aa40..00f0e1b4b8d 100644 --- a/src/devices/bus/ti8x/bitsocket.cpp +++ b/src/devices/bus/ti8x/bitsocket.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(TI8X_BIT_SOCKET, bus::ti8x, bit_socket_device, "ti8x_bitsock", "TI-8x Bit Socket") -namespace bus { namespace ti8x { +namespace bus::ti8x { bit_socket_device::bit_socket_device( machine_config const &mconfig, @@ -78,4 +78,4 @@ WRITE_LINE_MEMBER(bit_socket_device::input_ring) m_stream->output((m_ring_in ? 0x01 : 0x00) | 0x04); } -} } // namespace bus::ti8x +} // namespace bus::ti8x diff --git a/src/devices/bus/ti8x/bitsocket.h b/src/devices/bus/ti8x/bitsocket.h index b8729a6c00d..d144d332fb8 100644 --- a/src/devices/bus/ti8x/bitsocket.h +++ b/src/devices/bus/ti8x/bitsocket.h @@ -19,7 +19,7 @@ #include "imagedev/bitbngr.h" -namespace bus { namespace ti8x { +namespace bus::ti8x { class bit_socket_device : public device_t @@ -47,7 +47,7 @@ private: bool m_tip_in, m_ring_in; }; -} } // namespace bus::ti8x +} // namespace bus::ti8x DECLARE_DEVICE_TYPE_NS(TI8X_BIT_SOCKET, bus::ti8x, bit_socket_device) diff --git a/src/devices/bus/ti8x/graphlinkhle.cpp b/src/devices/bus/ti8x/graphlinkhle.cpp index ecdec035b06..9368b2ec0bc 100644 --- a/src/devices/bus/ti8x/graphlinkhle.cpp +++ b/src/devices/bus/ti8x/graphlinkhle.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(TI8X_GRAPH_LINK_HLE, bus::ti8x, graph_link_hle_device, "ti8x_glinkhle", "TI-Graph Link (grey, HLE)") -namespace bus { namespace ti8x { +namespace bus::ti8x { graph_link_hle_device::graph_link_hle_device( machine_config const &mconfig, @@ -142,4 +142,4 @@ void graph_link_hle_device::tra_complete() accept_byte(); } -} } // namespace bus::ti8x +} // namespace bus::ti8x diff --git a/src/devices/bus/ti8x/graphlinkhle.h b/src/devices/bus/ti8x/graphlinkhle.h index 310a4daf133..3d6bdddca10 100644 --- a/src/devices/bus/ti8x/graphlinkhle.h +++ b/src/devices/bus/ti8x/graphlinkhle.h @@ -25,7 +25,7 @@ #include <memory> -namespace bus { namespace ti8x { +namespace bus::ti8x { class graph_link_hle_device : public device_t @@ -59,7 +59,7 @@ private: bool m_empty, m_ready; }; -} } // namespace bus::ti8x +} // namespace bus::ti8x DECLARE_DEVICE_TYPE_NS(TI8X_GRAPH_LINK_HLE, bus::ti8x, graph_link_hle_device) diff --git a/src/devices/bus/ti8x/teeconn.cpp b/src/devices/bus/ti8x/teeconn.cpp index 7277d4af93e..92b2048a486 100644 --- a/src/devices/bus/ti8x/teeconn.cpp +++ b/src/devices/bus/ti8x/teeconn.cpp @@ -8,7 +8,7 @@ DEFINE_DEVICE_TYPE_NS(TI8X_TEE_CONNECTOR, bus::ti8x, tee_connector_device, "ti8x_tconn", "TI-8x T-connector") -namespace bus { namespace ti8x { +namespace bus::ti8x { tee_connector_device::tee_connector_device( machine_config const &mconfig, @@ -102,4 +102,4 @@ WRITE_LINE_MEMBER(tee_connector_device::input_ring) m_port_b->ring_w((m_ring_host && m_ring_a) ? 1 : 0); } -} } // namespace bus::ti8x +} // namespace bus::ti8x diff --git a/src/devices/bus/ti8x/teeconn.h b/src/devices/bus/ti8x/teeconn.h index 65ffa1c6d81..c47e1613a82 100644 --- a/src/devices/bus/ti8x/teeconn.h +++ b/src/devices/bus/ti8x/teeconn.h @@ -11,7 +11,7 @@ #include "ti8x.h" -namespace bus { namespace ti8x { +namespace bus::ti8x { class tee_connector_device : public device_t, public device_ti8x_link_port_interface { @@ -37,7 +37,7 @@ protected: bool m_ring_host, m_ring_a, m_ring_b; }; -} } // namespace bus::ti8x +} // namespace bus::ti8x DECLARE_DEVICE_TYPE_NS(TI8X_TEE_CONNECTOR, bus::ti8x, tee_connector_device) diff --git a/src/devices/bus/ti8x/tispeaker.cpp b/src/devices/bus/ti8x/tispeaker.cpp index ed9ec36a5ec..ec0e9865a57 100644 --- a/src/devices/bus/ti8x/tispeaker.cpp +++ b/src/devices/bus/ti8x/tispeaker.cpp @@ -11,7 +11,7 @@ DEFINE_DEVICE_TYPE_NS(TI8X_SPEAKER_STEREO, bus::ti8x, stereo_speaker_device, "ti DEFINE_DEVICE_TYPE_NS(TI8X_SPEAKER_MONO, bus::ti8x, mono_speaker_device, "ti8x_mspkr", "TI-8x Speaker (Mono)") -namespace bus { namespace ti8x { +namespace bus::ti8x { stereo_speaker_device::stereo_speaker_device( machine_config const &mconfig, @@ -99,4 +99,4 @@ WRITE_LINE_MEMBER(mono_speaker_device::input_ring) m_speaker->level_w((m_tip_state || m_ring_state) ? 1 : 0); } -} } // namespace bus::ti8x +} // namespace bus::ti8x diff --git a/src/devices/bus/ti8x/tispeaker.h b/src/devices/bus/ti8x/tispeaker.h index 157c94ab060..da05d8f112f 100644 --- a/src/devices/bus/ti8x/tispeaker.h +++ b/src/devices/bus/ti8x/tispeaker.h @@ -9,7 +9,7 @@ #include "sound/spkrdev.h" -namespace bus { namespace ti8x { +namespace bus::ti8x { class stereo_speaker_device : public device_t, public device_ti8x_link_port_interface { @@ -46,7 +46,7 @@ private: bool m_tip_state, m_ring_state; }; -} } // namespace bus::ti8x +} // namespace bus::ti8x DECLARE_DEVICE_TYPE_NS(TI8X_SPEAKER_STEREO, bus::ti8x, stereo_speaker_device) diff --git a/src/devices/bus/ti99/colorbus/busmouse.cpp b/src/devices/bus/ti99/colorbus/busmouse.cpp index 701be4ee398..1c3e1dcbac2 100644 --- a/src/devices/bus/ti99/colorbus/busmouse.cpp +++ b/src/devices/bus/ti99/colorbus/busmouse.cpp @@ -25,7 +25,7 @@ DEFINE_DEVICE_TYPE_NS(V9938_BUSMOUSE, bus::ti99::colorbus, v9938_busmouse_device, "v9938_busmouse", "V9938 Bus Mouse") -namespace bus { namespace ti99 { namespace colorbus { +namespace bus::ti99::colorbus { v9938_busmouse_device::v9938_busmouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, V9938_BUSMOUSE, tag, owner, clock), @@ -100,4 +100,5 @@ ioport_constructor v9938_busmouse_device::device_input_ports() const { return INPUT_PORTS_NAME( busmouse ); } -} } } // end namespace bus::ti99::colorbus + +} // end namespace bus::ti99::colorbus diff --git a/src/devices/bus/ti99/colorbus/busmouse.h b/src/devices/bus/ti99/colorbus/busmouse.h index 1a76e26e561..d12e550fa11 100644 --- a/src/devices/bus/ti99/colorbus/busmouse.h +++ b/src/devices/bus/ti99/colorbus/busmouse.h @@ -17,7 +17,7 @@ #include "colorbus.h" -namespace bus { namespace ti99 { namespace colorbus { +namespace bus::ti99::colorbus { class v9938_busmouse_device : public device_t, public device_v9938_colorbus_interface { @@ -37,7 +37,8 @@ private: int m_last_y; int m_bstate; }; -} } } // end namespace bus::ti99::colorbus + +} // end namespace bus::ti99::colorbus DECLARE_DEVICE_TYPE_NS(V9938_BUSMOUSE, bus::ti99::colorbus, v9938_busmouse_device) diff --git a/src/devices/bus/ti99/colorbus/colorbus.cpp b/src/devices/bus/ti99/colorbus/colorbus.cpp index 5cc4226496b..8d3dbf23071 100644 --- a/src/devices/bus/ti99/colorbus/colorbus.cpp +++ b/src/devices/bus/ti99/colorbus/colorbus.cpp @@ -23,7 +23,7 @@ DEFINE_DEVICE_TYPE_NS(V9938_COLORBUS, bus::ti99::colorbus, v9938_colorbus_device, "v9938_colorbus", "V9938 Color bus") -namespace bus { namespace ti99 { namespace colorbus { +namespace bus::ti99::colorbus { v9938_colorbus_device::v9938_colorbus_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, V9938_COLORBUS, tag, owner, clock), @@ -67,7 +67,7 @@ void device_v9938_colorbus_interface::interface_config_complete() m_colorbus = dynamic_cast<v9938_colorbus_device*>(device().owner()); } -} } } // end namespace bus::ti99::colorbus +} // end namespace bus::ti99::colorbus void ti99_colorbus_options(device_slot_interface &device) { diff --git a/src/devices/bus/ti99/colorbus/colorbus.h b/src/devices/bus/ti99/colorbus/colorbus.h index 9eff5d82acb..edd088b480a 100644 --- a/src/devices/bus/ti99/colorbus/colorbus.h +++ b/src/devices/bus/ti99/colorbus/colorbus.h @@ -21,7 +21,7 @@ #define TIGEN_V9938_TAG "vdp" #define COLORBUS_TAG "colorbus" -namespace bus { namespace ti99 { namespace colorbus { +namespace bus::ti99::colorbus { class v9938_colorbus_device; @@ -72,7 +72,7 @@ private: devcb_write_line m_extra_button; }; -} } } // end namespace bus::ti99::colorbus +} // end namespace bus::ti99::colorbus DECLARE_DEVICE_TYPE_NS(V9938_COLORBUS, bus::ti99::colorbus, v9938_colorbus_device) diff --git a/src/devices/bus/ti99/gromport/cartridges.cpp b/src/devices/bus/ti99/gromport/cartridges.cpp index 3735d850ec4..e84e6b939a3 100644 --- a/src/devices/bus/ti99/gromport/cartridges.cpp +++ b/src/devices/bus/ti99/gromport/cartridges.cpp @@ -31,7 +31,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_CART, bus::ti99::gromport, ti99_cartridge_device, "ti99cart", "TI-99 cartridge") -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { #define CARTGROM_TAG "grom_contents" #define CARTROM_TAG "rom_contents" @@ -1874,5 +1874,4 @@ ti99_cartridge_device::rpk* ti99_cartridge_device::rpk_reader::open(emu_options return newrpk; } -} } } // end namespace bus::ti99::gromport - +} // end namespace bus::ti99::gromport diff --git a/src/devices/bus/ti99/gromport/cartridges.h b/src/devices/bus/ti99/gromport/cartridges.h index f6e2e991d56..db2de6b2672 100644 --- a/src/devices/bus/ti99/gromport/cartridges.h +++ b/src/devices/bus/ti99/gromport/cartridges.h @@ -15,7 +15,7 @@ #include "unzip.h" #include "xmlfile.h" -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { class ti99_cartridge_pcb; @@ -372,7 +372,8 @@ private: bool m_grom_read_mode; bool m_grom_address_mode; }; -} } } // end namespace bus::ti99::gromport + +} // end namespace bus::ti99::gromport DECLARE_DEVICE_TYPE_NS(TI99_CART, bus::ti99::gromport, ti99_cartridge_device) diff --git a/src/devices/bus/ti99/gromport/gkracker.cpp b/src/devices/bus/ti99/gromport/gkracker.cpp index 65125f247db..91544460541 100644 --- a/src/devices/bus/ti99/gromport/gkracker.cpp +++ b/src/devices/bus/ti99/gromport/gkracker.cpp @@ -106,7 +106,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_GROMPORT_GK, bus::ti99::gromport, ti99_gkracker_device, "ti99_gkracker", "Miller's Graphics GRAM Kracker") -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { enum { @@ -470,5 +470,6 @@ ioport_constructor ti99_gkracker_device::device_input_ports() const { return INPUT_PORTS_NAME(gkracker); } -} } } // end namespace bus::ti99::gromport + +} // end namespace bus::ti99::gromport diff --git a/src/devices/bus/ti99/gromport/gkracker.h b/src/devices/bus/ti99/gromport/gkracker.h index 925a3121d9f..c80049ac22b 100644 --- a/src/devices/bus/ti99/gromport/gkracker.h +++ b/src/devices/bus/ti99/gromport/gkracker.h @@ -10,7 +10,7 @@ #pragma once #include "cartridges.h" -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { class ti99_gkracker_device : public cartridge_connector_device, public device_nvram_interface { @@ -64,7 +64,7 @@ private: }; -} } } // end namespace bus::ti99::gromport +} // end namespace bus::ti99::gromport DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT_GK, bus::ti99::gromport, ti99_gkracker_device) diff --git a/src/devices/bus/ti99/gromport/gromport.cpp b/src/devices/bus/ti99/gromport/gromport.cpp index 65c6f15d284..0fb1ff03e65 100644 --- a/src/devices/bus/ti99/gromport/gromport.cpp +++ b/src/devices/bus/ti99/gromport/gromport.cpp @@ -123,7 +123,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_GROMPORT, bus::ti99::gromport, gromport_device, "gromport", "TI-99 Cartridge port") -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { gromport_device::gromport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_GROMPORT, tag, owner, clock), @@ -288,7 +288,7 @@ void cartridge_connector_device::device_config_complete() m_gromport = static_cast<gromport_device*>(owner()); } -} } } // end namespace bus::ti99::gromport +} // end namespace bus::ti99::gromport void ti99_gromport_options(device_slot_interface &device) { diff --git a/src/devices/bus/ti99/gromport/gromport.h b/src/devices/bus/ti99/gromport/gromport.h index 3f332e84a51..74c844d7ed7 100644 --- a/src/devices/bus/ti99/gromport/gromport.h +++ b/src/devices/bus/ti99/gromport/gromport.h @@ -14,7 +14,7 @@ #define TI99_GROMPORT_TAG "gromport" -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { struct pcb_type { @@ -102,7 +102,7 @@ protected: bool m_grom_selected; }; -} } } // end namespace bus::ti99::gromport +} // end namespace bus::ti99::gromport DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT, bus::ti99::gromport, gromport_device) diff --git a/src/devices/bus/ti99/gromport/multiconn.cpp b/src/devices/bus/ti99/gromport/multiconn.cpp index 0ccd432a62a..f5b948143b0 100644 --- a/src/devices/bus/ti99/gromport/multiconn.cpp +++ b/src/devices/bus/ti99/gromport/multiconn.cpp @@ -51,7 +51,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_GROMPORT_MULTI, bus::ti99::gromport, ti99_multi_cart_conn_device, "ti99_mcartconn", "TI-99 Multi-cartridge extender") -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { #define AUTO -1 @@ -330,5 +330,5 @@ ioport_constructor ti99_multi_cart_conn_device::device_input_ports() const return INPUT_PORTS_NAME(multi_slot); } -} } } // end namespace bus::ti99::gromport +} // end namespace bus::ti99::gromport diff --git a/src/devices/bus/ti99/gromport/multiconn.h b/src/devices/bus/ti99/gromport/multiconn.h index a941d94579f..517224eff14 100644 --- a/src/devices/bus/ti99/gromport/multiconn.h +++ b/src/devices/bus/ti99/gromport/multiconn.h @@ -15,7 +15,7 @@ #pragma once #include "cartridges.h" -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { class ti99_multi_cart_conn_device : public cartridge_connector_device { @@ -55,7 +55,7 @@ private: int get_active_slot(bool changebase, offs_t offset); }; -} } } // end namespace bus::ti99::gromport +} // end namespace bus::ti99::gromport DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT_MULTI, bus::ti99::gromport, ti99_multi_cart_conn_device) diff --git a/src/devices/bus/ti99/gromport/singleconn.cpp b/src/devices/bus/ti99/gromport/singleconn.cpp index c2b04558c3a..ce07dba59f5 100644 --- a/src/devices/bus/ti99/gromport/singleconn.cpp +++ b/src/devices/bus/ti99/gromport/singleconn.cpp @@ -11,7 +11,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_GROMPORT_SINGLE, bus::ti99::gromport, ti99_single_cart_conn_device, "ti99_scartconn", "TI-99 Standard cartridge connector") -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { ti99_single_cart_conn_device::ti99_single_cart_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cartridge_connector_device(mconfig, TI99_GROMPORT_SINGLE, tag, owner, clock), @@ -88,5 +88,4 @@ void ti99_single_cart_conn_device::device_add_mconfig(machine_config &config) TI99_CART(config, "cartridge", 0); } -} } } // end namespace bus::ti99::gromport - +} // end namespace bus::ti99::gromport diff --git a/src/devices/bus/ti99/gromport/singleconn.h b/src/devices/bus/ti99/gromport/singleconn.h index 3e102eef036..40627a07867 100644 --- a/src/devices/bus/ti99/gromport/singleconn.h +++ b/src/devices/bus/ti99/gromport/singleconn.h @@ -11,7 +11,7 @@ #include "cartridges.h" -namespace bus { namespace ti99 { namespace gromport { +namespace bus::ti99::gromport { class ti99_single_cart_conn_device : public cartridge_connector_device { @@ -36,7 +36,8 @@ protected: private: ti99_cartridge_device *m_cartridge; }; -} } } // end namespace bus::ti99::gromport + +} // end namespace bus::ti99::gromport DECLARE_DEVICE_TYPE_NS(TI99_GROMPORT_SINGLE, bus::ti99::gromport, ti99_single_cart_conn_device) diff --git a/src/devices/bus/ti99/internal/992board.cpp b/src/devices/bus/ti99/internal/992board.cpp index 2f01c025cb6..10c065ed7ac 100644 --- a/src/devices/bus/ti99/internal/992board.cpp +++ b/src/devices/bus/ti99/internal/992board.cpp @@ -137,7 +137,7 @@ DEFINE_DEVICE_TYPE_NS(IO99232, bus::ti99::internal, io992_32_device, "io992_32", DEFINE_DEVICE_TYPE_NS(TI992_EXPPORT, bus::ti99::internal, ti992_expport_device, "ti992_expport", "TI-99/2 Expansion Port") DEFINE_DEVICE_TYPE_NS(TI992_RAM32K, bus::ti99::internal, ti992_expram_device, "ti992_ram32k", "TI-99/2 RAM Expansion 32K") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { video992_device::video992_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), @@ -521,7 +521,7 @@ void io992_device::cruwrite(offs_t offset, uint8_t data) LOGMASKED(LOG_BANK, "set bank = %d\n", data); m_set_rom_bank(data==1); } - // no break + [[fallthrough]]; case 0xe002: case 0xe004: case 0xe006: @@ -676,7 +676,7 @@ void ti992_expram_device::device_add_mconfig(machine_config &config) m_ram->set_default_value(0); } -} } } +} // namespace bus::ti99::internal void ti992_expport_options(device_slot_interface &device) { diff --git a/src/devices/bus/ti99/internal/992board.h b/src/devices/bus/ti99/internal/992board.h index 83f42035839..4269632688c 100644 --- a/src/devices/bus/ti99/internal/992board.h +++ b/src/devices/bus/ti99/internal/992board.h @@ -27,7 +27,7 @@ #define TI992_VDC_TAG "vdc" #define TI992_HEXBUS_TAG "hexbus" -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { class video992_device : public device_t, public device_video_interface @@ -220,7 +220,7 @@ private: }; -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(TI992_EXPPORT, bus::ti99::internal, ti992_expport_device) diff --git a/src/devices/bus/ti99/internal/998board.cpp b/src/devices/bus/ti99/internal/998board.cpp index 70b60c27f26..32a018b540c 100644 --- a/src/devices/bus/ti99/internal/998board.cpp +++ b/src/devices/bus/ti99/internal/998board.cpp @@ -134,7 +134,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_MOFETTA, bus::ti99::internal, mofetta_device, "ti998_ DEFINE_DEVICE_TYPE_NS(TI99_OSO, bus::ti99::internal, oso_device, "ti998_oso", "TI-99/8 Hexbus interface") DEFINE_DEVICE_TYPE_NS(TI99_AMIGO, bus::ti99::internal, amigo_device, "ti998_amigo", "TI-99/8 Address space mapper") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { enum { @@ -2748,5 +2748,4 @@ void oso_device::device_start() save_item(NAME(m_xmit)); } -} } } // end namespace bus::ti99::internal - +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/998board.h b/src/devices/bus/ti99/internal/998board.h index cfe8c7050ad..86c5da12787 100644 --- a/src/devices/bus/ti99/internal/998board.h +++ b/src/devices/bus/ti99/internal/998board.h @@ -87,7 +87,7 @@ // -------------------------------------------------- -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { class mainboard8_device; @@ -697,7 +697,7 @@ private: uint8_t* m_pascalrom = nullptr; }; -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(TI99_MAINBOARD8, bus::ti99::internal, mainboard8_device) DECLARE_DEVICE_TYPE_NS(TI99_VAQUERRO, bus::ti99::internal, vaquerro_device) diff --git a/src/devices/bus/ti99/internal/buffram.cpp b/src/devices/bus/ti99/internal/buffram.cpp index e96bafa7af1..338313d4733 100644 --- a/src/devices/bus/ti99/internal/buffram.cpp +++ b/src/devices/bus/ti99/internal/buffram.cpp @@ -18,7 +18,7 @@ DEFINE_DEVICE_TYPE_NS(BUFF_RAM, bus::ti99::internal, buffered_ram_device, BUFFRAM_TAG, "Buffered SRAM") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { // ========== Buffered SRAM ============ @@ -58,4 +58,4 @@ void buffered_ram_device::nvram_write(emu_file &file) file.write(m_mem.get(), m_size); } -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/buffram.h b/src/devices/bus/ti99/internal/buffram.h index d69d9be74e9..ad44ba3dd2a 100644 --- a/src/devices/bus/ti99/internal/buffram.h +++ b/src/devices/bus/ti99/internal/buffram.h @@ -14,7 +14,7 @@ #pragma once -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { // =========== Buffered RAM ================ class buffered_ram_device : public device_t, public device_nvram_interface @@ -43,7 +43,7 @@ private: }; -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(BUFF_RAM, bus::ti99::internal, buffered_ram_device) diff --git a/src/devices/bus/ti99/internal/datamux.cpp b/src/devices/bus/ti99/internal/datamux.cpp index 90bf2447bec..53092cf187e 100644 --- a/src/devices/bus/ti99/internal/datamux.cpp +++ b/src/devices/bus/ti99/internal/datamux.cpp @@ -84,7 +84,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_DATAMUX, bus::ti99::internal, datamux_device, "ti99_datamux", "TI-99 Databus multiplexer") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { /* Constructor @@ -632,5 +632,4 @@ ioport_constructor datamux_device::device_input_ports() const return INPUT_PORTS_NAME(datamux); } -} } } // end namespace bus::ti99::internal - +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/datamux.h b/src/devices/bus/ti99/internal/datamux.h index 4e0e07bb50a..db1c9d18035 100644 --- a/src/devices/bus/ti99/internal/datamux.h +++ b/src/devices/bus/ti99/internal/datamux.h @@ -33,7 +33,7 @@ #define TI99_SOUNDCHIP_TAG "soundchip" #define TI99_VDP_TAG "vdp" -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { /* Main class @@ -147,7 +147,7 @@ private: /******************************************************************************/ -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(TI99_DATAMUX, bus::ti99::internal, datamux_device) diff --git a/src/devices/bus/ti99/internal/evpcconn.cpp b/src/devices/bus/ti99/internal/evpcconn.cpp index 244092fbd11..366a3ad4c94 100644 --- a/src/devices/bus/ti99/internal/evpcconn.cpp +++ b/src/devices/bus/ti99/internal/evpcconn.cpp @@ -24,7 +24,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_EVPCCONN, bus::ti99::internal, evpc_clock_connector, "ti99_evpc_clock", "EVPC clock connector") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { evpc_clock_connector::evpc_clock_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_EVPCCONN, tag, owner, clock), @@ -41,5 +41,6 @@ void evpc_clock_connector::device_start() { m_vdpint.resolve(); } -} } } // end namespace bus::ti99::internal + +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/evpcconn.h b/src/devices/bus/ti99/internal/evpcconn.h index a15c5a5a2a6..4216b7e0028 100644 --- a/src/devices/bus/ti99/internal/evpcconn.h +++ b/src/devices/bus/ti99/internal/evpcconn.h @@ -13,7 +13,7 @@ #define TI99_EVPC_CONN_TAG "evpc_conn" -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { class evpc_clock_connector : public device_t { @@ -29,7 +29,7 @@ private: devcb_write_line m_vdpint; }; -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(TI99_EVPCCONN, bus::ti99::internal, evpc_clock_connector) diff --git a/src/devices/bus/ti99/internal/genboard.cpp b/src/devices/bus/ti99/internal/genboard.cpp index e985735021a..f56e931b143 100644 --- a/src/devices/bus/ti99/internal/genboard.cpp +++ b/src/devices/bus/ti99/internal/genboard.cpp @@ -438,7 +438,7 @@ DEFINE_DEVICE_TYPE_NS(GENEVE_GATE_ARRAY, bus::ti99::internal, geneve_gate_array_ DEFINE_DEVICE_TYPE_NS(GENMOD_DECODER, bus::ti99::internal, genmod_decoder_device, "genmod_decoder", "GenMod decoder circuit") DEFINE_DEVICE_TYPE_NS(GENEVE_PAL, bus::ti99::internal, geneve_pal_device, "geneve_pal", "Geneve PAL circuit") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { geneve_gate_array_device::geneve_gate_array_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), @@ -1520,5 +1520,4 @@ void genmod_decoder_device::device_start() save_item(NAME(m_sndready)); } -} } } // end namespace bus::ti99::internal - +} // end namespace bus::ti99::internal diff --git a/src/devices/bus/ti99/internal/genboard.h b/src/devices/bus/ti99/internal/genboard.h index 3af2dc0cc7f..7e0df8d9892 100644 --- a/src/devices/bus/ti99/internal/genboard.h +++ b/src/devices/bus/ti99/internal/genboard.h @@ -45,7 +45,7 @@ enum #define GENEVE_PFM512A_TAG "pfm512a" #define GENEVE_KEYBOARD_CONN_TAG "keybconn" -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { /*****************************************************************************/ @@ -318,7 +318,7 @@ private: int m_sndready; }; -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(GENEVE_GATE_ARRAY, bus::ti99::internal, geneve_gate_array_device) DECLARE_DEVICE_TYPE_NS(GENEVE_PAL, bus::ti99::internal, geneve_pal_device) diff --git a/src/devices/bus/ti99/internal/ioport.cpp b/src/devices/bus/ti99/internal/ioport.cpp index db72623116a..a6049e72a6b 100644 --- a/src/devices/bus/ti99/internal/ioport.cpp +++ b/src/devices/bus/ti99/internal/ioport.cpp @@ -82,7 +82,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_IOPORT, bus::ti99::internal, ioport_device, "ti99_ioport", "TI-99 I/O Port") -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { ioport_device::ioport_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_IOPORT, tag, owner, clock), @@ -171,7 +171,7 @@ WRITE_LINE_MEMBER(ioport_attached_device::set_ready) m_ioport->m_console_ready(state); } -} } } // end namespace bus::ti99::internal +} // end namespace bus::ti99::internal void ti99_ioport_options_plain(device_slot_interface &device) { diff --git a/src/devices/bus/ti99/internal/ioport.h b/src/devices/bus/ti99/internal/ioport.h index 8e5493c7ca2..5c08beec760 100644 --- a/src/devices/bus/ti99/internal/ioport.h +++ b/src/devices/bus/ti99/internal/ioport.h @@ -11,7 +11,7 @@ #define TI99_IOPORT_TAG "ioport" -namespace bus { namespace ti99 { namespace internal { +namespace bus::ti99::internal { extern const device_type IOPORT; @@ -96,7 +96,8 @@ protected: private: ioport_attached_device* m_connected; }; -} } } // end namespace bus::ti99::internal + +} // end namespace bus::ti99::internal DECLARE_DEVICE_TYPE_NS(TI99_IOPORT, bus::ti99::internal, ioport_device) diff --git a/src/devices/bus/ti99/joyport/handset.cpp b/src/devices/bus/ti99/joyport/handset.cpp index 829b5bca087..07a78dab1f2 100644 --- a/src/devices/bus/ti99/joyport/handset.cpp +++ b/src/devices/bus/ti99/joyport/handset.cpp @@ -52,7 +52,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_JOYSTICK, bus::ti99::joyport, ti99_twin_joystick_device, "ti99_twinjoy", "TI-99/4(A) Twin Joysticks") DEFINE_DEVICE_TYPE_NS(TI99_HANDSET, bus::ti99::joyport, ti99_handset_device, "ti99_handset", "TI-99/4 IR handset") -namespace bus { namespace ti99 { namespace joyport { +namespace bus::ti99::joyport { #define TRACE_HANDSET 0 #define TRACE_JOYSTICK 0 @@ -545,4 +545,5 @@ ioport_constructor ti99_twin_joystick_device::device_input_ports() const { return INPUT_PORTS_NAME( joysticks ); } -} } } // end namespace bus::ti99::joyport + +} // end namespace bus::ti99::joyport diff --git a/src/devices/bus/ti99/joyport/handset.h b/src/devices/bus/ti99/joyport/handset.h index bdeda83899c..a1726cd8d80 100644 --- a/src/devices/bus/ti99/joyport/handset.h +++ b/src/devices/bus/ti99/joyport/handset.h @@ -21,7 +21,7 @@ #include "joyport.h" -namespace bus { namespace ti99 { namespace joyport { +namespace bus::ti99::joyport { class ti99_handset_device : public device_t, public device_ti99_joyport_interface { @@ -79,7 +79,8 @@ private: // and then routed back to the port via the joystick int m_joystick; }; -} } } // end namespace bus::ti99::joyport + +} // end namespace bus::ti99::joyport DECLARE_DEVICE_TYPE_NS(TI99_HANDSET, bus::ti99::joyport, ti99_handset_device) DECLARE_DEVICE_TYPE_NS(TI99_JOYSTICK, bus::ti99::joyport, ti99_twin_joystick_device) diff --git a/src/devices/bus/ti99/joyport/joyport.cpp b/src/devices/bus/ti99/joyport/joyport.cpp index 0505c524ef8..92680ab2c09 100644 --- a/src/devices/bus/ti99/joyport/joyport.cpp +++ b/src/devices/bus/ti99/joyport/joyport.cpp @@ -42,7 +42,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_JOYPORT, bus::ti99::joyport, joyport_device, "ti99_joyport", "TI-99 Joystick port") -namespace bus { namespace ti99 { namespace joyport { +namespace bus::ti99::joyport { device_ti99_joyport_interface::device_ti99_joyport_interface(const machine_config &config, device_t &device) : device_interface(device, "ti99joyport"), @@ -109,7 +109,7 @@ void device_ti99_joyport_interface::interface_config_complete() m_joyport = dynamic_cast<joyport_device*>(device().owner()); } -} } } // end namespace bus::ti99::joyport +} // end namespace bus::ti99::joyport void ti99_joyport_options_plain(device_slot_interface &device) { diff --git a/src/devices/bus/ti99/joyport/joyport.h b/src/devices/bus/ti99/joyport/joyport.h index f7a7696a546..40f7b358ac6 100644 --- a/src/devices/bus/ti99/joyport/joyport.h +++ b/src/devices/bus/ti99/joyport/joyport.h @@ -22,7 +22,7 @@ #pragma once -namespace bus { namespace ti99 { namespace joyport { +namespace bus::ti99::joyport { enum { @@ -84,7 +84,7 @@ private: device_ti99_joyport_interface* m_connected; }; -} } } // end namespace bus::ti99::joyport +} // end namespace bus::ti99::joyport DECLARE_DEVICE_TYPE_NS(TI99_JOYPORT, bus::ti99::joyport, joyport_device) diff --git a/src/devices/bus/ti99/joyport/mecmouse.cpp b/src/devices/bus/ti99/joyport/mecmouse.cpp index 51be546a467..e21f3a540a2 100644 --- a/src/devices/bus/ti99/joyport/mecmouse.cpp +++ b/src/devices/bus/ti99/joyport/mecmouse.cpp @@ -53,7 +53,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_MECMOUSE, bus::ti99::joyport, mecmouse_device, "ti99_mecmouse", "TI-99 Mechatronics Mouse") -namespace bus { namespace ti99 { namespace joyport { +namespace bus::ti99::joyport { #define POLL_TIMER 1 @@ -208,5 +208,4 @@ ioport_constructor mecmouse_device::device_input_ports() const return INPUT_PORTS_NAME( mecmouse ); } -} } } // end namespace bus::ti99::joyport - +} // end namespace bus::ti99::joyport diff --git a/src/devices/bus/ti99/joyport/mecmouse.h b/src/devices/bus/ti99/joyport/mecmouse.h index 6d859376cd7..cd0320b0750 100644 --- a/src/devices/bus/ti99/joyport/mecmouse.h +++ b/src/devices/bus/ti99/joyport/mecmouse.h @@ -16,7 +16,7 @@ #include "joyport.h" -namespace bus { namespace ti99 { namespace joyport { +namespace bus::ti99::joyport { class mecmouse_device : public device_t, public device_ti99_joyport_interface { @@ -44,7 +44,8 @@ private: emu_timer *m_poll_timer; }; -} } } // end namespace bus::ti99::joyport + +} // end namespace bus::ti99::joyport DECLARE_DEVICE_TYPE_NS(TI99_MECMOUSE, bus::ti99::joyport, mecmouse_device) diff --git a/src/devices/bus/ti99/peb/bwg.cpp b/src/devices/bus/ti99/peb/bwg.cpp index 055e926aec2..28c416426af 100644 --- a/src/devices/bus/ti99/peb/bwg.cpp +++ b/src/devices/bus/ti99/peb/bwg.cpp @@ -65,7 +65,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_BWG, bus::ti99::peb, snug_bwg_device, "ti99_bwg", "SNUG BwG Floppy Controller") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { // ---------------------------------- @@ -653,4 +653,4 @@ const tiny_rom_entry *snug_bwg_device::device_rom_region() const return ROM_NAME( bwg_fdc ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/bwg.h b/src/devices/bus/ti99/peb/bwg.h index 10df3695151..e3bca967eac 100644 --- a/src/devices/bus/ti99/peb/bwg.h +++ b/src/devices/bus/ti99/peb/bwg.h @@ -24,7 +24,7 @@ #include "machine/74259.h" #include "machine/74123.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class snug_bwg_device : public device_t, public device_ti99_peribox_card_interface { @@ -132,7 +132,7 @@ private: required_device<ttl74123_device> m_motormf; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_BWG, bus::ti99::peb, snug_bwg_device) diff --git a/src/devices/bus/ti99/peb/cc_fdc.cpp b/src/devices/bus/ti99/peb/cc_fdc.cpp index 9ef1f1531d9..7255871b921 100644 --- a/src/devices/bus/ti99/peb/cc_fdc.cpp +++ b/src/devices/bus/ti99/peb/cc_fdc.cpp @@ -68,7 +68,7 @@ DEFINE_DEVICE_TYPE_NS(CCDCC_PALU1, bus::ti99::peb, ccdcc_palu1_device, CCDCC_PAL DEFINE_DEVICE_TYPE_NS(CCFDC_PALU12, bus::ti99::peb, ccfdc_palu12_device, CCFDC_PALU12_TAG, "CorComp FDC PAL u12") DEFINE_DEVICE_TYPE_NS(CCFDC_PALU6, bus::ti99::peb, ccfdc_palu6_device, CCFDC_PALU6_TAG, "CorComp FDC PAL u6") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { // ---------------------------------- @@ -826,4 +826,5 @@ void ccfdc_palu6_device::device_config_complete() m_board = static_cast<corcomp_fdca_device*>(owner()); m_decpal = static_cast<ccfdc_dec_pal_device*>(owner()->subdevice(CCFDC_PALU12_TAG)); } -} } } // end namespace bus::ti99::peb + +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/cc_fdc.h b/src/devices/bus/ti99/peb/cc_fdc.h index db945a2387e..daca16f5249 100644 --- a/src/devices/bus/ti99/peb/cc_fdc.h +++ b/src/devices/bus/ti99/peb/cc_fdc.h @@ -22,7 +22,7 @@ #include "machine/tms9901.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ccfdc_dec_pal_device; class ccfdc_sel_pal_device; @@ -240,7 +240,7 @@ private: void device_config_complete() override; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_CCDCC, bus::ti99::peb, corcomp_dcc_device) DECLARE_DEVICE_TYPE_NS(TI99_CCFDC, bus::ti99::peb, corcomp_fdca_device) diff --git a/src/devices/bus/ti99/peb/evpc.cpp b/src/devices/bus/ti99/peb/evpc.cpp index 4db8abf047d..0a830d18eed 100644 --- a/src/devices/bus/ti99/peb/evpc.cpp +++ b/src/devices/bus/ti99/peb/evpc.cpp @@ -54,7 +54,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_EVPC, bus::ti99::peb, snug_enhanced_video_device, "ti99_evpc", "SNUG Enhanced Video Processor Card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define NOVRAM_SIZE 256 #define EVPC_CRU_BASE 0x1400 @@ -519,6 +519,4 @@ void snug_enhanced_video_device::device_add_mconfig(machine_config& config) V9938_COLORBUS(config, m_colorbus, 0, ti99_colorbus_options, nullptr); } -} } } // end namespace bus::ti99::peb - - +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/evpc.h b/src/devices/bus/ti99/peb/evpc.h index ea78debe8d3..98e73f50bda 100644 --- a/src/devices/bus/ti99/peb/evpc.h +++ b/src/devices/bus/ti99/peb/evpc.h @@ -24,7 +24,7 @@ #include "bus/ti99/colorbus/colorbus.h" #include "bus/ti99/internal/evpcconn.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class snug_enhanced_video_device : public device_t, public device_ti99_peribox_card_interface, public device_nvram_interface { @@ -88,7 +88,7 @@ private: optional_device<bus::ti99::internal::evpc_clock_connector> m_console_conn; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_EVPC, bus::ti99::peb, snug_enhanced_video_device) diff --git a/src/devices/bus/ti99/peb/forti.cpp b/src/devices/bus/ti99/peb/forti.cpp index 0206e863a94..25b0ce0a3a0 100644 --- a/src/devices/bus/ti99/peb/forti.cpp +++ b/src/devices/bus/ti99/peb/forti.cpp @@ -43,7 +43,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_FORTI, bus::ti99::peb, forti_device, "ti99_forti", "FORTi Sound Card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { forti_device::forti_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock): device_t(mconfig, TI99_FORTI, tag, owner, clock), @@ -130,4 +130,4 @@ void forti_device::device_reset() { } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/forti.h b/src/devices/bus/ti99/peb/forti.h index 5c70bd45117..7328c965eea 100644 --- a/src/devices/bus/ti99/peb/forti.h +++ b/src/devices/bus/ti99/peb/forti.h @@ -20,7 +20,7 @@ #include "sound/sn76496.h" #include "speaker.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class forti_device : public device_t, public device_ti99_peribox_card_interface { @@ -45,7 +45,7 @@ private: required_device<sn94624_device> m_generator4; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_FORTI, bus::ti99::peb, forti_device) diff --git a/src/devices/bus/ti99/peb/hfdc.cpp b/src/devices/bus/ti99/peb/hfdc.cpp index 8659e111d69..4cd6b926d4b 100644 --- a/src/devices/bus/ti99/peb/hfdc.cpp +++ b/src/devices/bus/ti99/peb/hfdc.cpp @@ -76,7 +76,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_HFDC, bus::ti99::peb, myarc_hfdc_device, "ti99_hfdc", "Myarc Hard and Floppy Disk Controller") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define BUFFER "ram" #define FDC_TAG "hdc9234" @@ -1088,4 +1088,4 @@ ioport_constructor myarc_hfdc_device::device_input_ports() const return INPUT_PORTS_NAME( ti99_hfdc ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/hfdc.h b/src/devices/bus/ti99/peb/hfdc.h index 84e42a07e05..927d761e6cd 100644 --- a/src/devices/bus/ti99/peb/hfdc.h +++ b/src/devices/bus/ti99/peb/hfdc.h @@ -27,7 +27,7 @@ #include "machine/hdc92x4.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { /* Implementation for modern floppy system. @@ -187,7 +187,7 @@ private: int m_readyflags; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_HFDC, bus::ti99::peb, myarc_hfdc_device) diff --git a/src/devices/bus/ti99/peb/horizon.cpp b/src/devices/bus/ti99/peb/horizon.cpp index 5cf60c8574f..e335389220d 100644 --- a/src/devices/bus/ti99/peb/horizon.cpp +++ b/src/devices/bus/ti99/peb/horizon.cpp @@ -141,7 +141,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_HORIZON, bus::ti99::peb, horizon_ramdisk_device, "ti99_horizon", "Horizon 4000B RAMdisk") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define CRULATCH1_TAG "u4_latch" #define CRULATCH2_TAG "u3_latch" @@ -586,4 +586,4 @@ ioport_constructor horizon_ramdisk_device::device_input_ports() const return INPUT_PORTS_NAME(horizon); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/horizon.h b/src/devices/bus/ti99/peb/horizon.h index 0d9372d9109..8e5c9a6133d 100644 --- a/src/devices/bus/ti99/peb/horizon.h +++ b/src/devices/bus/ti99/peb/horizon.h @@ -20,7 +20,7 @@ #include "machine/ram.h" #include "machine/74259.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class horizon_ramdisk_device : public device_t, public device_ti99_peribox_card_interface, public device_nvram_interface { @@ -77,7 +77,7 @@ private: int m_current_page; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_HORIZON, bus::ti99::peb, horizon_ramdisk_device) diff --git a/src/devices/bus/ti99/peb/hsgpl.cpp b/src/devices/bus/ti99/peb/hsgpl.cpp index 9ac2a30bd83..cc5f4b0feee 100644 --- a/src/devices/bus/ti99/peb/hsgpl.cpp +++ b/src/devices/bus/ti99/peb/hsgpl.cpp @@ -138,7 +138,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_HSGPL, bus::ti99::peb, snug_high_speed_gpl_device, "ti99_hsgpl", "SNUG High-speed GPL card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define CRU_BASE 0x1B00 #define SUPERCART_BASE 0x0800 @@ -717,4 +717,4 @@ ioport_constructor snug_high_speed_gpl_device::device_input_ports() const return INPUT_PORTS_NAME(ti99_hsgpl); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/hsgpl.h b/src/devices/bus/ti99/peb/hsgpl.h index a27c4a55205..6d946b1ac64 100644 --- a/src/devices/bus/ti99/peb/hsgpl.h +++ b/src/devices/bus/ti99/peb/hsgpl.h @@ -22,7 +22,7 @@ #include "machine/at29x.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class snug_high_speed_gpl_device : public device_t, public device_ti99_peribox_card_interface { @@ -81,7 +81,7 @@ private: int m_grom_address; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_HSGPL, bus::ti99::peb, snug_high_speed_gpl_device) diff --git a/src/devices/bus/ti99/peb/memex.cpp b/src/devices/bus/ti99/peb/memex.cpp index 7206d2ccee3..44db15aa6af 100644 --- a/src/devices/bus/ti99/peb/memex.cpp +++ b/src/devices/bus/ti99/peb/memex.cpp @@ -27,7 +27,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_MEMEX, bus::ti99::peb, geneve_memex_device, "ti99_memex", "Geneve memory expansion card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define RAMREGION "ram2meg" @@ -181,4 +181,4 @@ ioport_constructor geneve_memex_device::device_input_ports() const return INPUT_PORTS_NAME( memex ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/memex.h b/src/devices/bus/ti99/peb/memex.h index 7e13895f476..32c56326d47 100644 --- a/src/devices/bus/ti99/peb/memex.h +++ b/src/devices/bus/ti99/peb/memex.h @@ -18,8 +18,7 @@ #include "peribox.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { - +namespace bus::ti99::peb { class geneve_memex_device : public device_t, public device_ti99_peribox_card_interface { @@ -42,7 +41,8 @@ private: required_device<ram_device> m_ram; uint8_t m_switches; }; -} } } // end namespace bus::ti99::peb + +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_MEMEX, bus::ti99::peb, geneve_memex_device) diff --git a/src/devices/bus/ti99/peb/myarcfdc.cpp b/src/devices/bus/ti99/peb/myarcfdc.cpp index dde010e99a3..c25495a3650 100644 --- a/src/devices/bus/ti99/peb/myarcfdc.cpp +++ b/src/devices/bus/ti99/peb/myarcfdc.cpp @@ -50,7 +50,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_DDCC1, bus::ti99::peb, myarc_fdc_device, "ti99_ddcc1", "Myarc Disk Controller Card") DEFINE_DEVICE_TYPE_NS(DDCC1_PAL, bus::ti99::peb, ddcc1_pal_device, PAL_TAG, "Myarc DDCC-1 PAL u1") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { // ---------------------------------- @@ -494,4 +494,4 @@ void ddcc1_pal_device::device_config_complete() m_board = static_cast<myarc_fdc_device*>(owner()); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/myarcfdc.h b/src/devices/bus/ti99/peb/myarcfdc.h index 4a0293c8b24..f588bb5176f 100644 --- a/src/devices/bus/ti99/peb/myarcfdc.h +++ b/src/devices/bus/ti99/peb/myarcfdc.h @@ -20,7 +20,7 @@ #include "machine/74259.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ddcc1_pal_device; @@ -125,7 +125,7 @@ private: myarc_fdc_device* m_board; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_DDCC1, bus::ti99::peb, myarc_fdc_device) DECLARE_DEVICE_TYPE_NS(DDCC1_PAL, bus::ti99::peb, ddcc1_pal_device) diff --git a/src/devices/bus/ti99/peb/myarcmem.cpp b/src/devices/bus/ti99/peb/myarcmem.cpp index 9a825bcccc1..20d2bd5af4e 100644 --- a/src/devices/bus/ti99/peb/myarcmem.cpp +++ b/src/devices/bus/ti99/peb/myarcmem.cpp @@ -32,7 +32,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_MYARCMEM, bus::ti99::peb, myarc_memory_expansion_device, "ti99_myarcmem", "Myarc Memory expansion card MEXP-1") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { /* This card has two CRU bases where it answers. */ #define MYARCMEM_CRU_BASE1 0x1000 @@ -211,4 +211,4 @@ ioport_constructor myarc_memory_expansion_device::device_input_ports() const return INPUT_PORTS_NAME(myarc_exp); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/myarcmem.h b/src/devices/bus/ti99/peb/myarcmem.h index 33ccac4c2b5..b641dfafcc3 100644 --- a/src/devices/bus/ti99/peb/myarcmem.h +++ b/src/devices/bus/ti99/peb/myarcmem.h @@ -18,7 +18,7 @@ #include "peribox.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class myarc_memory_expansion_device : public device_t, public device_ti99_peribox_card_interface { @@ -45,7 +45,7 @@ private: int m_size; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_MYARCMEM, bus::ti99::peb, myarc_memory_expansion_device) diff --git a/src/devices/bus/ti99/peb/pcode.cpp b/src/devices/bus/ti99/peb/pcode.cpp index 1fc0c85df47..48618f2dbea 100644 --- a/src/devices/bus/ti99/peb/pcode.cpp +++ b/src/devices/bus/ti99/peb/pcode.cpp @@ -88,7 +88,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_P_CODE, bus::ti99::peb, ti_pcode_card_device, "ti99_pcode", "TI-99 P-Code Card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define PCODE_GROM_TAG "pcode_grom" #define PCODE_ROM_TAG "pcode_rom" @@ -356,4 +356,4 @@ ioport_constructor ti_pcode_card_device::device_input_ports() const return INPUT_PORTS_NAME( ti99_pcode ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/pcode.h b/src/devices/bus/ti99/peb/pcode.h index 7462c559461..c8afea6b053 100644 --- a/src/devices/bus/ti99/peb/pcode.h +++ b/src/devices/bus/ti99/peb/pcode.h @@ -21,7 +21,7 @@ #include "machine/74259.h" #include "machine/tmc0430.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ti_pcode_card_device : public device_t, public device_ti99_peribox_card_interface { @@ -73,7 +73,7 @@ private: int m_address; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_P_CODE, bus::ti99::peb, ti_pcode_card_device) diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp index dd7a5591102..13b58cc36e7 100644 --- a/src/devices/bus/ti99/peb/peribox.cpp +++ b/src/devices/bus/ti99/peb/peribox.cpp @@ -228,7 +228,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_PERIBOX_GENMOD, bus::ti99::peb, peribox_genmod_devic // Single slot of the PEB DEFINE_DEVICE_TYPE_NS(TI99_PERIBOX_SLOT, bus::ti99::peb, peribox_slot_device, "peribox_slot", "TI P-Box slot") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define PEBSLOT2 "slot2" #define PEBSLOT3 "slot3" @@ -800,4 +800,4 @@ bool device_ti99_peribox_card_interface::in_cart_space(offs_t offset, bool amade return (offset & 0x0e000)==0x06000; } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/peribox.h b/src/devices/bus/ti99/peb/peribox.h index 3bf9f15aed5..1deca0a26c6 100644 --- a/src/devices/bus/ti99/peb/peribox.h +++ b/src/devices/bus/ti99/peb/peribox.h @@ -21,7 +21,7 @@ #define TI_PERIBOX_TAG "peb" #define TI99_DSRROM "dsrrom" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class peribox_slot_device; class device_ti99_peribox_card_interface; @@ -261,7 +261,7 @@ private: const char* card_name() { return m_card->device().tag(); } }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX, bus::ti99::peb, peribox_device) DECLARE_DEVICE_TYPE_NS(TI99_PERIBOX_EV, bus::ti99::peb, peribox_ev_device) diff --git a/src/devices/bus/ti99/peb/pgram.cpp b/src/devices/bus/ti99/peb/pgram.cpp index ab2226330a9..47ea13db0bb 100644 --- a/src/devices/bus/ti99/peb/pgram.cpp +++ b/src/devices/bus/ti99/peb/pgram.cpp @@ -143,7 +143,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_PGRAM, bus::ti99::peb, pgram_device, "ti99_pgram", "PGRAM(+) memory card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { pgram_device::pgram_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock): device_t(mconfig, TI99_PGRAM, tag, owner, clock), @@ -561,4 +561,4 @@ ioport_constructor pgram_device::device_input_ports() const return INPUT_PORTS_NAME( pgram_switches ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/pgram.h b/src/devices/bus/ti99/peb/pgram.h index 74ba37c76fd..68238f5a6b2 100644 --- a/src/devices/bus/ti99/peb/pgram.h +++ b/src/devices/bus/ti99/peb/pgram.h @@ -24,7 +24,7 @@ #include "machine/74161.h" #include "bus/ti99/internal/buffram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class pgram_device : public device_t, public device_ti99_peribox_card_interface { @@ -80,7 +80,7 @@ private: bool m_lowbyte; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_PGRAM, bus::ti99::peb, pgram_device) diff --git a/src/devices/bus/ti99/peb/samsmem.cpp b/src/devices/bus/ti99/peb/samsmem.cpp index c882887061a..2c895e35130 100644 --- a/src/devices/bus/ti99/peb/samsmem.cpp +++ b/src/devices/bus/ti99/peb/samsmem.cpp @@ -30,7 +30,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_SAMSMEM, bus::ti99::peb, sams_memory_expansion_device, "ti99_sams", "SuperAMS memory expansion card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define SAMS_CRU_BASE 0x1e00 @@ -144,4 +144,4 @@ void sams_memory_expansion_device::device_reset() for (auto & elem : m_mapper) elem = 0; } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/samsmem.h b/src/devices/bus/ti99/peb/samsmem.h index bd0dddd2fa8..8cf3105cc85 100644 --- a/src/devices/bus/ti99/peb/samsmem.h +++ b/src/devices/bus/ti99/peb/samsmem.h @@ -21,7 +21,7 @@ #include "machine/74259.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class sams_memory_expansion_device : public device_t, public device_ti99_peribox_card_interface { @@ -51,7 +51,7 @@ private: bool m_access_mapper; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_SAMSMEM, bus::ti99::peb, sams_memory_expansion_device) diff --git a/src/devices/bus/ti99/peb/sidmaster.cpp b/src/devices/bus/ti99/peb/sidmaster.cpp index 426b3f00346..5d6db281b22 100644 --- a/src/devices/bus/ti99/peb/sidmaster.cpp +++ b/src/devices/bus/ti99/peb/sidmaster.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_SIDMASTER, bus::ti99::peb, sidmaster_device, "ti99_sidmaster", "SID Master 99") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { sidmaster_device::sidmaster_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, TI99_SIDMASTER, tag, owner, clock), @@ -95,4 +95,4 @@ void sidmaster_device::device_reset() } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/sidmaster.h b/src/devices/bus/ti99/peb/sidmaster.h index fb31384571f..63965c9c5d0 100644 --- a/src/devices/bus/ti99/peb/sidmaster.h +++ b/src/devices/bus/ti99/peb/sidmaster.h @@ -19,7 +19,7 @@ #include "sound/mos6581.h" #include "speaker.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class sidmaster_device : public device_t, public device_ti99_peribox_card_interface { @@ -40,7 +40,7 @@ private: required_device<mos6581_device> m_sid; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_SIDMASTER, bus::ti99::peb, sidmaster_device) diff --git a/src/devices/bus/ti99/peb/spchsyn.cpp b/src/devices/bus/ti99/peb/spchsyn.cpp index cf7d03add57..7c6fd56fbfb 100644 --- a/src/devices/bus/ti99/peb/spchsyn.cpp +++ b/src/devices/bus/ti99/peb/spchsyn.cpp @@ -38,7 +38,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_SPEECH, bus::ti99::peb, ti_speech_synthesizer_device, "ti99_speech", "TI-99 Speech synthesizer (on adapter card)") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { /****************************************************************************/ @@ -189,5 +189,5 @@ const tiny_rom_entry *ti_speech_synthesizer_device::device_rom_region() const return ROM_NAME( ti99_speech ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/spchsyn.h b/src/devices/bus/ti99/peb/spchsyn.h index 5a73172dbb3..5bf71658e4b 100644 --- a/src/devices/bus/ti99/peb/spchsyn.h +++ b/src/devices/bus/ti99/peb/spchsyn.h @@ -19,7 +19,7 @@ #include "sound/tms5220.h" #include "machine/tms6100.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ti_speech_synthesizer_device : public device_t, public device_ti99_peribox_card_interface { @@ -48,7 +48,7 @@ private: bool m_dec_high; // Decode the AMA/AMB/ABC address lines }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_SPEECH, bus::ti99::peb, ti_speech_synthesizer_device) diff --git a/src/devices/bus/ti99/peb/ti_32kmem.cpp b/src/devices/bus/ti99/peb/ti_32kmem.cpp index eefb6d906fa..ee17e86ba7b 100644 --- a/src/devices/bus/ti99/peb/ti_32kmem.cpp +++ b/src/devices/bus/ti99/peb/ti_32kmem.cpp @@ -33,7 +33,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_32KMEM, bus::ti99::peb, ti_32k_expcard_device, "ti99_32kmem", "TI-99 32KiB memory expansion card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define RAMREGION "ram32k" @@ -107,4 +107,4 @@ void ti_32k_expcard_device::device_add_mconfig(machine_config &config) m_ram->set_default_value(0); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/ti_32kmem.h b/src/devices/bus/ti99/peb/ti_32kmem.h index caf4e2cd055..275f85fc6a7 100644 --- a/src/devices/bus/ti99/peb/ti_32kmem.h +++ b/src/devices/bus/ti99/peb/ti_32kmem.h @@ -19,7 +19,7 @@ #include "peribox.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ti_32k_expcard_device : public device_t, public device_ti99_peribox_card_interface { @@ -39,7 +39,7 @@ private: required_device<ram_device> m_ram; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_32KMEM, bus::ti99::peb, ti_32k_expcard_device) diff --git a/src/devices/bus/ti99/peb/ti_fdc.cpp b/src/devices/bus/ti99/peb/ti_fdc.cpp index 92f450b6627..a214c265eca 100644 --- a/src/devices/bus/ti99/peb/ti_fdc.cpp +++ b/src/devices/bus/ti99/peb/ti_fdc.cpp @@ -34,7 +34,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_FDC, bus::ti99::peb, ti_fdc_device, "ti99_fdc", "TI-99 Standard DSSD Floppy Controller") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { // ---------------------------------- #define FDC_TAG "fd1771" @@ -429,4 +429,4 @@ const tiny_rom_entry *ti_fdc_device::device_rom_region() const return ROM_NAME( ti_fdc ); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/ti_fdc.h b/src/devices/bus/ti99/peb/ti_fdc.h index 8088fdf9010..e0217b623e1 100644 --- a/src/devices/bus/ti99/peb/ti_fdc.h +++ b/src/devices/bus/ti99/peb/ti_fdc.h @@ -22,7 +22,7 @@ #include "imagedev/floppy.h" #include "machine/74123.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ti_fdc_device : public device_t, public device_ti99_peribox_card_interface { @@ -111,7 +111,7 @@ private: int m_sel_floppy; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_FDC, bus::ti99::peb, ti_fdc_device) diff --git a/src/devices/bus/ti99/peb/ti_rs232.cpp b/src/devices/bus/ti99/peb/ti_rs232.cpp index 675a013f483..a88b0124e67 100644 --- a/src/devices/bus/ti99/peb/ti_rs232.cpp +++ b/src/devices/bus/ti99/peb/ti_rs232.cpp @@ -122,7 +122,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_RS232, bus::ti99::peb, ti_rs232_pio_device, DEFINE_DEVICE_TYPE_NS(TI99_RS232_DEV, bus::ti99::peb, ti_rs232_attached_device, "ti99_rs232_atttached", "TI-99 Serial attached device") DEFINE_DEVICE_TYPE_NS(TI99_PIO_DEV, bus::ti99::peb, ti_pio_attached_device, "ti99_pio_attached", "TI-99 Parallel attached device") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define SENILA_0_BIT 0x80 #define SENILA_1_BIT 0x40 @@ -1130,4 +1130,4 @@ ioport_constructor ti_rs232_pio_device::device_input_ports() const return INPUT_PORTS_NAME(ti_rs232); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/ti_rs232.h b/src/devices/bus/ti99/peb/ti_rs232.h index 62edd2f8437..6716722dc9f 100644 --- a/src/devices/bus/ti99/peb/ti_rs232.h +++ b/src/devices/bus/ti99/peb/ti_rs232.h @@ -19,7 +19,7 @@ #include "machine/74259.h" #include "machine/tms9902.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class ti_pio_attached_device; class ti_rs232_attached_device; @@ -176,7 +176,7 @@ protected: void call_unload() override; }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_RS232, bus::ti99::peb, ti_rs232_pio_device) DECLARE_DEVICE_TYPE_NS(TI99_RS232_DEV, bus::ti99::peb, ti_rs232_attached_device) diff --git a/src/devices/bus/ti99/peb/tn_ide.cpp b/src/devices/bus/ti99/peb/tn_ide.cpp index 54e4cdf926a..f16f86c4823 100644 --- a/src/devices/bus/ti99/peb/tn_ide.cpp +++ b/src/devices/bus/ti99/peb/tn_ide.cpp @@ -146,7 +146,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_IDE, bus::ti99::peb, nouspikel_ide_card_device, "ti99 #define ATALATCHODD_TAG "atalatch_odd" #define RAM512_TAG "sram512" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { enum { @@ -733,4 +733,4 @@ ioport_constructor nouspikel_ide_card_device::device_input_ports() const return INPUT_PORTS_NAME(tn_ide); } -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/tn_ide.h b/src/devices/bus/ti99/peb/tn_ide.h index ded43865d74..cfed79c26ad 100644 --- a/src/devices/bus/ti99/peb/tn_ide.h +++ b/src/devices/bus/ti99/peb/tn_ide.h @@ -24,7 +24,7 @@ #include "machine/74259.h" #include "machine/74543.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class nouspikel_ide_card_device : public device_t, public device_ti99_peribox_card_interface { @@ -75,7 +75,7 @@ private: void decode(offs_t offset, bool& mmap, bool& sramsel, bool& xramsel, bool& rtcsel, bool& cs1fx, bool& cs3fx); }; -} } } // end namespace bus::ti99::peb +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_IDE, bus::ti99::peb, nouspikel_ide_card_device) diff --git a/src/devices/bus/ti99/peb/tn_usbsm.cpp b/src/devices/bus/ti99/peb/tn_usbsm.cpp index c37f7ec75b1..3e48e328772 100644 --- a/src/devices/bus/ti99/peb/tn_usbsm.cpp +++ b/src/devices/bus/ti99/peb/tn_usbsm.cpp @@ -50,7 +50,7 @@ DEFINE_DEVICE_TYPE_NS(TI99_USBSM, bus::ti99::peb, nouspikel_usb_smartmedia_device, "ti99_usbsm", "Nouspikel USB/Smartmedia card") -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { #define STRATA_TAG "strata" @@ -367,4 +367,5 @@ ioport_constructor nouspikel_usb_smartmedia_device::device_input_ports() const { return INPUT_PORTS_NAME(tn_usbsm); } -} } } // end namespace bus::ti99::peb + +} // end namespace bus::ti99::peb diff --git a/src/devices/bus/ti99/peb/tn_usbsm.h b/src/devices/bus/ti99/peb/tn_usbsm.h index 7ba08addf95..314e9ec5a5a 100644 --- a/src/devices/bus/ti99/peb/tn_usbsm.h +++ b/src/devices/bus/ti99/peb/tn_usbsm.h @@ -21,7 +21,7 @@ #include "machine/strata.h" #include "machine/ram.h" -namespace bus { namespace ti99 { namespace peb { +namespace bus::ti99::peb { class nouspikel_usb_smartmedia_device : public device_t, public device_ti99_peribox_card_interface { @@ -59,7 +59,8 @@ private: required_device<smartmedia_image_device> m_smartmedia; required_device<strataflash_device> m_flash; }; -} } } // end namespace bus::ti99::peb + +} // end namespace bus::ti99::peb DECLARE_DEVICE_TYPE_NS(TI99_USBSM, bus::ti99::peb, nouspikel_usb_smartmedia_device) diff --git a/src/devices/cpu/alpha/alphad.cpp b/src/devices/cpu/alpha/alphad.cpp index 4bd759e53c3..97f9dc6fb40 100644 --- a/src/devices/cpu/alpha/alphad.cpp +++ b/src/devices/cpu/alpha/alphad.cpp @@ -594,6 +594,7 @@ offs_t alpha_disassembler::disassemble(std::ostream &stream, offs_t pc, const da default: UNKNOWN("intm*"); break; } + break; case 0x14: // ITFP* (integer to floating) switch ((instruction >> 5) & 0x7ff) { diff --git a/src/devices/cpu/arm/armdasm.cpp b/src/devices/cpu/arm/armdasm.cpp index b56e60161af..fba5804b6ae 100644 --- a/src/devices/cpu/arm/armdasm.cpp +++ b/src/devices/cpu/arm/armdasm.cpp @@ -206,6 +206,7 @@ offs_t arm_disassembler::disassemble(std::ostream &stream, offs_t pc, const data /* look for mov pc,lr */ if (((opcode >> 12) & 0x0f) == 15 && ((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02000000) == 0) dasmflags = STEP_OUT; + [[fallthrough]]; case 0x0f: WriteDataProcessingOperand(stream, opcode, true, false, pc); break; diff --git a/src/devices/cpu/arm7/arm7dasm.cpp b/src/devices/cpu/arm7/arm7dasm.cpp index 61dbeada549..e5c9520cea4 100644 --- a/src/devices/cpu/arm7/arm7dasm.cpp +++ b/src/devices/cpu/arm7/arm7dasm.cpp @@ -502,6 +502,7 @@ u32 arm7_disassembler::arm7_disasm( std::ostream &stream, uint32_t pc, uint32_t /* look for mov pc,lr */ if (((opcode >> 12) & 0x0f) == 15 && ((opcode >> 0) & 0x0f) == 14 && (opcode & 0x02000000) == 0) dasmflags = STEP_OUT; + [[fallthrough]]; case 0x0f: WriteDataProcessingOperand(stream, opcode, 1, 0, 1); break; diff --git a/src/devices/cpu/h8/h8make.py b/src/devices/cpu/h8/h8make.py index 99883e92c2a..e89bc6ff725 100644 --- a/src/devices/cpu/h8/h8make.py +++ b/src/devices/cpu/h8/h8make.py @@ -82,6 +82,7 @@ def save_partial_one(f, t, name, source): for line in source: if has_memory(line): print("\tif(icount <= bcount) { inst_substate = %d; return; }" % substate, file=f) + print("\t[[fallthrough]];", file=f) print("case %d:;" % substate, file=f) print(line, file=f) substate += 1 diff --git a/src/devices/cpu/hd61700/hd61700d.cpp b/src/devices/cpu/hd61700/hd61700d.cpp index 44bbcd5b1a5..ceb21dbb221 100644 --- a/src/devices/cpu/hd61700/hd61700d.cpp +++ b/src/devices/cpu/hd61700/hd61700d.cpp @@ -242,6 +242,7 @@ void hd61700_disassembler::dasm_arg(std::ostream &stream, uint8_t op, offs_t pc, case OP_IM8_: pos ++; + [[fallthrough]]; case OP_IM8: util::stream_format( stream, "0x%02x", opread(pc, pos, opcodes) ); pos ++; diff --git a/src/devices/cpu/i86/i186.cpp b/src/devices/cpu/i86/i186.cpp index b530af629b7..ee0500e0fc9 100644 --- a/src/devices/cpu/i86/i186.cpp +++ b/src/devices/cpu/i86/i186.cpp @@ -566,7 +566,7 @@ void i80186_cpu_device::execute_run() break; } } - // through to default + [[fallthrough]]; default: if(!common_op(op)) { diff --git a/src/devices/cpu/m6502/m6502make.py b/src/devices/cpu/m6502/m6502make.py index 422b5a8ab74..bd2ef7328a3 100755 --- a/src/devices/cpu/m6502/m6502make.py +++ b/src/devices/cpu/m6502/m6502make.py @@ -103,6 +103,7 @@ case %(substate)s:; PARTIAL_MEMORY="""\ \tif(icount == 0) { inst_substate = %(substate)s; return; } +\t[[fallthrough]]; case %(substate)s: %(ins)s \ticount--; diff --git a/src/devices/cpu/m68000/m68kmmu.h b/src/devices/cpu/m68000/m68kmmu.h index 1fe0ac02c7c..b65e1e332ba 100644 --- a/src/devices/cpu/m68000/m68kmmu.h +++ b/src/devices/cpu/m68000/m68kmmu.h @@ -1140,7 +1140,7 @@ void m68851_pmove_put(u32 ea, u16 modes) break; } // fall through; unknown PMOVE mode unless MC68020 with MC68851 - + [[fallthrough]]; default: logerror("680x0: PMOVE to unknown MMU register %x, PC %x\n", (modes>>10) & 7, m_pc); break; diff --git a/src/devices/cpu/mips/mips3.cpp b/src/devices/cpu/mips/mips3.cpp index 34bb1a86741..97155147ff5 100644 --- a/src/devices/cpu/mips/mips3.cpp +++ b/src/devices/cpu/mips/mips3.cpp @@ -5234,15 +5234,15 @@ void mips3_device::execute_run() break; } case 0x35: /* LDC1 */ - if (!(SR & SR_COP1)) - { - m_badcop_value = 1; - generate_exception(EXCEPTION_BADCOP, 1); + if (!(SR & SR_COP1)) + { + m_badcop_value = 1; + generate_exception(EXCEPTION_BADCOP, 1); + break; + } + if (RDOUBLE(SIMMVAL+RSVAL32, &temp64)) + set_cop1_reg64(RTREG, temp64); break; - } - if (RDOUBLE(SIMMVAL+RSVAL32, &temp64)) - set_cop1_reg64(RTREG, temp64); - break; case 0x36: handle_ldc2(op); break; case 0x37: /* LD */ if (RDOUBLE(SIMMVAL+RSVAL32, &temp64) && RTREG) RTVAL64 = temp64; break; case 0x38: /* SC */ diff --git a/src/devices/cpu/mips/mips3fe.cpp b/src/devices/cpu/mips/mips3fe.cpp index 77b72c9b48b..8d6e0982bc0 100644 --- a/src/devices/cpu/mips/mips3fe.cpp +++ b/src/devices/cpu/mips/mips3fe.cpp @@ -217,6 +217,7 @@ bool mips3_frontend::describe(opcode_desc &desc, const opcode_desc *prev) case 0x33: // PREF if (m_mips3->m_flavor < mips3_device::MIPS3_TYPE_MIPS_IV) return false; + [[fallthrough]]; case 0x2f: // CACHE // effective no-op return true; @@ -253,6 +254,7 @@ bool mips3_frontend::describe_special(uint32_t op, opcode_desc &desc) if (m_mips3->m_flavor < mips3_device::MIPS3_TYPE_MIPS_IV) return false; desc.regin[0] |= REGFLAG_R(RDREG); + [[fallthrough]]; case 0x04: // SLLV case 0x06: // SRLV case 0x07: // SRAV @@ -596,6 +598,7 @@ bool mips3_frontend::describe_cop1(uint32_t op, opcode_desc &desc) case 0x13: // MOVN - MIPS IV if (m_mips3->m_flavor < mips3_device::MIPS3_TYPE_MIPS_IV) return false; + [[fallthrough]]; case 0x00: // ADD case 0x01: // SUB case 0x02: // MUL @@ -608,6 +611,7 @@ bool mips3_frontend::describe_cop1(uint32_t op, opcode_desc &desc) case 0x16: // RSQRT - MIPS IV if (m_mips3->m_flavor < mips3_device::MIPS3_TYPE_MIPS_IV) return false; + [[fallthrough]]; case 0x04: // SQRT case 0x05: // ABS case 0x06: // MOV diff --git a/src/devices/cpu/nanoprocessor/nanoprocessor.cpp b/src/devices/cpu/nanoprocessor/nanoprocessor.cpp index 198ce26b619..ad54f006bfa 100644 --- a/src/devices/cpu/nanoprocessor/nanoprocessor.cpp +++ b/src/devices/cpu/nanoprocessor/nanoprocessor.cpp @@ -322,7 +322,7 @@ void hp_nanoprocessor_device::execute_one(uint8_t opcode) // RTE dc_set(HP_NANO_IE_DC); // Intentional fall-through to RTI! - + [[fallthrough]]; case 0xb0: // RTI m_reg_PA = m_reg_ISR; @@ -342,7 +342,7 @@ void hp_nanoprocessor_device::execute_one(uint8_t opcode) // RSE dc_set(HP_NANO_IE_DC); // Intentional fall-through to RTS! - + [[fallthrough]]; case 0xb8: // RTS { @@ -424,7 +424,7 @@ void hp_nanoprocessor_device::execute_one(uint8_t opcode) // JAS m_reg_SSR = pa_offset(1); // Intentional fall-through to JAI! - + [[fallthrough]]; case 0x90: // JAI // On HP doc there's a mysterious warning about JAI: diff --git a/src/devices/cpu/pdp1/tx0.cpp b/src/devices/cpu/pdp1/tx0.cpp index 19ec75f223b..1ad69693168 100644 --- a/src/devices/cpu/pdp1/tx0.cpp +++ b/src/devices/cpu/pdp1/tx0.cpp @@ -710,6 +710,7 @@ void tx0_8kw_device::execute_instruction_8kw() case 21: /* TRansfer indeXed */ indexed_address_eval(); + [[fallthrough]]; case 20: /* TRAnsfer */ PC = MAR & 0017777; m_cycle = 0; /* instruction only takes one cycle if branch @@ -815,6 +816,7 @@ void tx0_8kw_device::execute_instruction_8kw() { case 1: /* STore indeXed */ indexed_address_eval(); + [[fallthrough]]; case 0: /* STOre */ tx0_write(MAR, (MBR = AC)); break; @@ -853,6 +855,7 @@ void tx0_8kw_device::execute_instruction_8kw() case 5: /* Store Lr indeXed */ indexed_address_eval(); + [[fallthrough]]; case 4: /* Store LR */ tx0_write(MAR, (MBR = LR)); break; @@ -863,6 +866,7 @@ void tx0_8kw_device::execute_instruction_8kw() case 9: /* ADd indeXed */ indexed_address_eval(); + [[fallthrough]]; case 8: /* ADD */ MBR = tx0_read(MAR); @@ -890,12 +894,14 @@ void tx0_8kw_device::execute_instruction_8kw() case 13: /* Load Lr indeXed */ indexed_address_eval(); + [[fallthrough]]; case 12: /* Load LR */ LR = MBR = tx0_read(MAR); break; case 15: /* Load Ac indeXed */ indexed_address_eval(); + [[fallthrough]]; case 14: /* LoaD Ac */ AC = MBR = tx0_read(MAR); break; diff --git a/src/devices/cpu/sh/sh4.cpp b/src/devices/cpu/sh/sh4.cpp index 0d212e7ffe2..acfd0dbfc8a 100644 --- a/src/devices/cpu/sh/sh4.cpp +++ b/src/devices/cpu/sh/sh4.cpp @@ -2260,6 +2260,7 @@ void sh34_base_device::state_import(const device_state_entry &entry) { case STATE_GENPC: m_sh2_state->pc = m_debugger_temp; + [[fallthrough]]; case SH4_PC: m_sh2_state->m_delay = 0; break; diff --git a/src/devices/cpu/sh/sh_fe.cpp b/src/devices/cpu/sh/sh_fe.cpp index efee8bf506f..45f85f46732 100644 --- a/src/devices/cpu/sh/sh_fe.cpp +++ b/src/devices/cpu/sh/sh_fe.cpp @@ -88,7 +88,7 @@ bool sh_frontend::describe(opcode_desc &desc, const opcode_desc *prev) case 11: // BSR desc.regout[1] |= REGFLAG_PR; - // (intentional fallthrough - BSR is BRA with the addition of PR = the return address) + [[fallthrough]]; // BSR is BRA with the addition of PR = the return address case 10: // BRA { int32_t disp = ((int32_t)opcode << 20) >> 20; diff --git a/src/devices/cpu/sparc/sparcdasm.cpp b/src/devices/cpu/sparc/sparcdasm.cpp index 584b5ab427a..d3b7d291087 100644 --- a/src/devices/cpu/sparc/sparcdasm.cpp +++ b/src/devices/cpu/sparc/sparcdasm.cpp @@ -676,13 +676,17 @@ sparc_disassembler::sparc_disassembler(const config *conf, unsigned version, vis { case vis_3b: add_vis_op_desc(VIS3B_OP_DESC); + [[fallthrough]]; case vis_3: add_fpop1_desc(VIS3_FPOP1_DESC); add_vis_op_desc(VIS3_OP_DESC); + [[fallthrough]]; case vis_2p: add_asi_desc(VIS2P_ASI_DESC); + [[fallthrough]]; case vis_2: add_vis_op_desc(VIS2_OP_DESC); + [[fallthrough]]; case vis_1: m_op_field_width = std::max(m_op_field_width, 12); add_vis_op_desc(VIS1_OP_DESC); diff --git a/src/devices/cpu/tms9900/9900dasm.cpp b/src/devices/cpu/tms9900/9900dasm.cpp index 3808d8e14fe..633e1abe690 100644 --- a/src/devices/cpu/tms9900/9900dasm.cpp +++ b/src/devices/cpu/tms9900/9900dasm.cpp @@ -692,6 +692,7 @@ offs_t tms9900_disassembler::disassemble(std::ostream &stream, offs_t pc, const default: osd_printf_error("debbugger internal error, file %s, line %d\n", __FILE__, __LINE__); + [[fallthrough]]; case illegal: util::stream_format(stream, "data >%04x", OP); break; diff --git a/src/devices/cpu/z180/z180dasm.cpp b/src/devices/cpu/z180/z180dasm.cpp index c6dc3ea1706..4c47711b852 100644 --- a/src/devices/cpu/z180/z180dasm.cpp +++ b/src/devices/cpu/z180/z180dasm.cpp @@ -467,6 +467,7 @@ offs_t z180_disassembler::disassemble(std::ostream &stream, offs_t pc, const dat break; case 'X': offset = (int8_t) params.r8(pos++); + [[fallthrough]]; case 'Y': util::stream_format(stream,"(%s%c$%02x)", ixy, sign(offset), offs(offset)); break; diff --git a/src/devices/machine/68340sim.cpp b/src/devices/machine/68340sim.cpp index 9f351cade15..7e1f8457224 100644 --- a/src/devices/machine/68340sim.cpp +++ b/src/devices/machine/68340sim.cpp @@ -241,6 +241,7 @@ uint8_t m68340_cpu_device::m68340_internal_sim_ports_r(offs_t offset) case m68340_sim::REG_PORTB1: LOGR("- %08x %s %04x (PORTB1 - Port B Data 1)\n", m_ppc, FUNCNAME, offset); // Fallthrough to mirror register + [[fallthrough]]; case m68340_sim::REG_PORTB: LOGR("- %08x %s %04x (PORTB - Port B Data 0)\n", m_ppc, FUNCNAME, offset); sim.m_portb &= sim.m_ddrb; @@ -317,6 +318,7 @@ void m68340_cpu_device::m68340_internal_sim_ports_w(offs_t offset, uint8_t data) case m68340_sim::REG_PORTB1: LOGDATA("- %08x %04x, %02x (PORTB1 - Port B Data - mirror)\n", m_ppc, offset,data); // Falling through to mirrored register portb + [[fallthrough]]; case m68340_sim::REG_PORTB: LOGDATA("- %08x %04x, %02x (PORTB - Port B Data)\n", m_ppc, offset,data); sim.m_portb = (data & sim.m_ddrb & sim.m_pparb); diff --git a/src/devices/machine/terminal.cpp b/src/devices/machine/terminal.cpp index ccb101d8036..ed1dd4d001f 100644 --- a/src/devices/machine/terminal.cpp +++ b/src/devices/machine/terminal.cpp @@ -220,7 +220,7 @@ void generic_terminal_device::term_write(uint8_t data) case 0x0d: // carriage return m_x_pos = 0; if (!(options & 0x080)) break; - + [[fallthrough]]; case 0x0a: // linefeed m_y_pos++; if (m_y_pos >= m_height) diff --git a/src/devices/sound/disc_dev.hxx b/src/devices/sound/disc_dev.hxx index e340f4004a7..e18d4d36711 100644 --- a/src/devices/sound/disc_dev.hxx +++ b/src/devices/sound/disc_dev.hxx @@ -633,10 +633,12 @@ DISCRETE_STEP(dsd_555_cc) { case 1: r_discharge = DSD_555_CC__RDIS; + [[fallthrough]]; case 0: break; case 3: r_discharge = RES_2_PARALLEL(DSD_555_CC__RDIS, DSD_555_CC__RGND); + [[fallthrough]]; case 2: r_charge = DSD_555_CC__RGND; vi = i * r_charge; @@ -944,10 +946,12 @@ DISCRETE_RESET(dsd_555_cc) { case 1: r_discharge = DSD_555_CC__RDIS; + [[fallthrough]]; case 0: break; case 3: r_discharge = RES_2_PARALLEL(DSD_555_CC__RDIS, DSD_555_CC__RGND); + [[fallthrough]]; case 2: r_charge = DSD_555_CC__RGND; break; diff --git a/src/devices/sound/disc_flt.hxx b/src/devices/sound/disc_flt.hxx index 66b28bdeac4..32669a6cdc4 100644 --- a/src/devices/sound/disc_flt.hxx +++ b/src/devices/sound/disc_flt.hxx @@ -469,6 +469,7 @@ DISCRETE_RESET(dst_op_amp_filt) m_rTotal = info->r1; else m_rTotal = RES_2_PARALLEL(info->r1, info->r2); + [[fallthrough]]; case DISC_OP_AMP_FILTER_IS_BAND_PASS_1M: { double fc = 1.0 / (2 * M_PI * sqrt(m_rTotal * info->rF * info->c1 * info->c2)); diff --git a/src/devices/sound/disc_mth.hxx b/src/devices/sound/disc_mth.hxx index cb423b175d1..d37de22784f 100644 --- a/src/devices/sound/disc_mth.hxx +++ b/src/devices/sound/disc_mth.hxx @@ -1057,6 +1057,7 @@ DISCRETE_STEP(dst_mixer) break; } /* else, fall through and just use the resistor value */ + [[fallthrough]]; case DISC_MIXER_IS_OP_AMP: rTemp2 = rTemp; break; @@ -1219,6 +1220,7 @@ DISCRETE_RESET(dst_mixer) break; } /* else, fall through and just use the resistor value */ + [[fallthrough]]; case DISC_MIXER_IS_OP_AMP: rTemp = info->r[bit]; break; diff --git a/src/devices/sound/i5000.cpp b/src/devices/sound/i5000.cpp index 6978b9336f3..3f194ef74c5 100644 --- a/src/devices/sound/i5000.cpp +++ b/src/devices/sound/i5000.cpp @@ -224,6 +224,7 @@ void i5000snd_device::write_reg16(uint8_t reg, uint16_t data) default: logerror("i5000snd: channel %d unknown sample param %04X!\n", ch, param); // fall through (take settings from 0x0184) + [[fallthrough]]; // 4-bit ADPCM case 0x0184: m_channels[ch].freq_min = 0x100; diff --git a/src/devices/video/ef9345.cpp b/src/devices/video/ef9345.cpp index 4b8907d0da7..3671d012d38 100644 --- a/src/devices/video/ef9345.cpp +++ b/src/devices/video/ef9345.cpp @@ -738,6 +738,7 @@ void ef9345_device::makechar(uint16_t x, uint16_t y) makechar_16x40(x, y); break; } + [[fallthrough]]; case MODE8x80: logerror("Unemulated EF9345 mode: %02x\n", m_char_mode); break; diff --git a/src/devices/video/voodoo.cpp b/src/devices/video/voodoo.cpp index ebc9555f25c..bedd957c81d 100644 --- a/src/devices/video/voodoo.cpp +++ b/src/devices/video/voodoo.cpp @@ -2751,36 +2751,42 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat /* Vertex data is 12.4 formatted fixed point */ case fvertexAx: data = float_to_int32(data, 4); + [[fallthrough]]; case vertexAx: if (chips & 1) vd->fbi.ax = (int16_t)data; break; case fvertexAy: data = float_to_int32(data, 4); + [[fallthrough]]; case vertexAy: if (chips & 1) vd->fbi.ay = (int16_t)data; break; case fvertexBx: data = float_to_int32(data, 4); + [[fallthrough]]; case vertexBx: if (chips & 1) vd->fbi.bx = (int16_t)data; break; case fvertexBy: data = float_to_int32(data, 4); + [[fallthrough]]; case vertexBy: if (chips & 1) vd->fbi.by = (int16_t)data; break; case fvertexCx: data = float_to_int32(data, 4); + [[fallthrough]]; case vertexCx: if (chips & 1) vd->fbi.cx = (int16_t)data; break; case fvertexCy: data = float_to_int32(data, 4); + [[fallthrough]]; case vertexCy: if (chips & 1) vd->fbi.cy = (int16_t)data; break; @@ -2788,72 +2794,84 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat /* RGB data is 12.12 formatted fixed point */ case fstartR: data = float_to_int32(data, 12); + [[fallthrough]]; case startR: if (chips & 1) vd->fbi.startr = (int32_t)(data << 8) >> 8; break; case fstartG: data = float_to_int32(data, 12); + [[fallthrough]]; case startG: if (chips & 1) vd->fbi.startg = (int32_t)(data << 8) >> 8; break; case fstartB: data = float_to_int32(data, 12); + [[fallthrough]]; case startB: if (chips & 1) vd->fbi.startb = (int32_t)(data << 8) >> 8; break; case fstartA: data = float_to_int32(data, 12); + [[fallthrough]]; case startA: if (chips & 1) vd->fbi.starta = (int32_t)(data << 8) >> 8; break; case fdRdX: data = float_to_int32(data, 12); + [[fallthrough]]; case dRdX: if (chips & 1) vd->fbi.drdx = (int32_t)(data << 8) >> 8; break; case fdGdX: data = float_to_int32(data, 12); + [[fallthrough]]; case dGdX: if (chips & 1) vd->fbi.dgdx = (int32_t)(data << 8) >> 8; break; case fdBdX: data = float_to_int32(data, 12); + [[fallthrough]]; case dBdX: if (chips & 1) vd->fbi.dbdx = (int32_t)(data << 8) >> 8; break; case fdAdX: data = float_to_int32(data, 12); + [[fallthrough]]; case dAdX: if (chips & 1) vd->fbi.dadx = (int32_t)(data << 8) >> 8; break; case fdRdY: data = float_to_int32(data, 12); + [[fallthrough]]; case dRdY: if (chips & 1) vd->fbi.drdy = (int32_t)(data << 8) >> 8; break; case fdGdY: data = float_to_int32(data, 12); + [[fallthrough]]; case dGdY: if (chips & 1) vd->fbi.dgdy = (int32_t)(data << 8) >> 8; break; case fdBdY: data = float_to_int32(data, 12); + [[fallthrough]]; case dBdY: if (chips & 1) vd->fbi.dbdy = (int32_t)(data << 8) >> 8; break; case fdAdY: data = float_to_int32(data, 12); + [[fallthrough]]; case dAdY: if (chips & 1) vd->fbi.dady = (int32_t)(data << 8) >> 8; break; @@ -2861,18 +2879,21 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat /* Z data is 20.12 formatted fixed point */ case fstartZ: data = float_to_int32(data, 12); + [[fallthrough]]; case startZ: if (chips & 1) vd->fbi.startz = (int32_t)data; break; case fdZdX: data = float_to_int32(data, 12); + [[fallthrough]]; case dZdX: if (chips & 1) vd->fbi.dzdx = (int32_t)data; break; case fdZdY: data = float_to_int32(data, 12); + [[fallthrough]]; case dZdY: if (chips & 1) vd->fbi.dzdy = (int32_t)data; break; @@ -3437,8 +3458,7 @@ int32_t voodoo_device::register_w(voodoo_device *vd, offs_t offset, uint32_t dat case clipLowYHighY: case clipLeftRight: poly_wait(vd->poly, vd->regnames[regnum]); - /* fall through to default implementation */ - + [[fallthrough]]; /* by default, just feed the data to the chips */ default: default_case: diff --git a/src/devices/video/zeus2.cpp b/src/devices/video/zeus2.cpp index c585373c74e..f57b3f53dda 100644 --- a/src/devices/video/zeus2.cpp +++ b/src/devices/video/zeus2.cpp @@ -1205,6 +1205,7 @@ bool zeus2_device::zeus2_fifo_process(const uint32_t *data, int numwords) return true; } // Drop through to 0x05 command + [[fallthrough]]; /* 0x05: write 32-bit value to low registers */ case 0x05: if (numwords < 2) @@ -1472,15 +1473,13 @@ void zeus2_device::zeus2_draw_model(uint32_t baseaddr, uint16_t count, int logit logerror(" end cmd 00\n"); case 0x21: /* thegrid */ case 0x22: /* crusnexo */ - { // Sets 0x68 (uv float offset) and texture line and mode // In reality this sets internal registers that are used in the // zeus2 microcode to set these registers m_zeusbase[0x68] = (databuffer[0] >> 16) & 0xff; texdata = databuffer[1]; if (logit) - logerror(" (0x68)=%02X texMode=%08X\n", m_zeusbase[0x68], texdata); - } + logerror(" (0x68)=%02X texMode=%08X\n", m_zeusbase[0x68], texdata); break; case 0x31: /* thegrid */ diff --git a/src/emu/addrmap.h b/src/emu/addrmap.h index 1795f9808a5..229db15caa1 100644 --- a/src/emu/addrmap.h +++ b/src/emu/addrmap.h @@ -87,11 +87,13 @@ class address_map_entry } template <typename T, typename U> - static std::enable_if_t<std::is_convertible<std::add_pointer_t<U>, std::add_pointer_t<T> >::value, T *> make_pointer(U &obj) - { return &downcast<T &>(obj); } - template <typename T, typename U> - static std::enable_if_t<!std::is_convertible<std::add_pointer_t<U>, std::add_pointer_t<T> >::value, T *> make_pointer(U &obj) - { return &dynamic_cast<T &>(obj); } + static T *make_pointer(U &obj) + { + if constexpr (std::is_convertible_v<std::add_pointer_t<U>, std::add_pointer_t<T> >) + return &downcast<T &>(obj); + else + return &dynamic_cast<T &>(obj); + } template <typename T> static std::enable_if_t<emu::detail::is_device_implementation<T>::value, const char *> get_tag(T &obj) { return obj.tag(); } template <typename T> static std::enable_if_t<emu::detail::is_device_interface<T>::value, const char *> get_tag(T &obj) { return obj.device().tag(); } diff --git a/src/emu/debug/dvmemory.cpp b/src/emu/debug/dvmemory.cpp index fe1b9da419a..4e9b8506a62 100644 --- a/src/emu/debug/dvmemory.cpp +++ b/src/emu/debug/dvmemory.cpp @@ -490,25 +490,25 @@ void debug_view_memory::view_char(int chval) break; default: - { - static const char hexvals[] = "0123456789abcdef"; - char *hexchar = (char *)strchr(hexvals, tolower(chval)); - if (hexchar == nullptr) - break; + { + static const char hexvals[] = "0123456789abcdef"; + char *hexchar = (char *)strchr(hexvals, tolower(chval)); + if (hexchar == nullptr) + break; - const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); - offs_t address = (source.m_space != nullptr) ? source.m_space->byte_to_address(pos.m_address) : pos.m_address; - u64 data; - bool ismapped = read(m_bytes_per_chunk, address, data); - if (!ismapped) - break; + const debug_view_memory_source &source = downcast<const debug_view_memory_source &>(*m_source); + offs_t address = (source.m_space != nullptr) ? source.m_space->byte_to_address(pos.m_address) : pos.m_address; + u64 data; + bool ismapped = read(m_bytes_per_chunk, address, data); + if (!ismapped) + break; - data &= ~(u64(0x0f) << pos.m_shift); - data |= u64(hexchar - hexvals) << pos.m_shift; - write(m_bytes_per_chunk, address, data); + data &= ~(u64(0x0f) << pos.m_shift); + data |= u64(hexchar - hexvals) << pos.m_shift; + write(m_bytes_per_chunk, address, data); + } // fall through to the right-arrow press - } - + [[fallthrough]]; case DCH_RIGHT: if (pos.m_shift == 0 && pos.m_address != m_maxaddr) { diff --git a/src/emu/devcb.h b/src/emu/devcb.h index 816ce6b3810..685671c34cd 100644 --- a/src/emu/devcb.h +++ b/src/emu/devcb.h @@ -48,12 +48,12 @@ typedef device_delegate<int ()> read_line_delegate; typedef device_delegate<void (int)> write_line_delegate; -namespace emu { namespace detail { +namespace emu::detail { -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read_line_delegate, std::remove_reference_t<T> > > > { using type = read_line_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write_line_delegate, std::remove_reference_t<T> > > > { using type = write_line_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read_line_delegate, std::remove_reference_t<T> > > > { using type = read_line_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write_line_delegate, std::remove_reference_t<T> > > > { using type = write_line_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -} } // namespace emu::detail +} // namespace emu::detail //************************************************************************** @@ -70,10 +70,6 @@ public: virtual void validity_check(validity_checker &valid) const = 0; protected: - // This is in C++17 but not C++14 - template <typename... T> struct void_wrapper { using type = void; }; - template <typename... T> using void_t = typename void_wrapper<T...>::type; - // Intermediate is larger of input and output, mask is forced to unsigned template <typename T, typename U, typename Enable = void> struct intermediate; template <typename T, typename U> struct intermediate<T, U, std::enable_if_t<sizeof(T) >= sizeof(U)> > { using type = T; }; @@ -112,8 +108,13 @@ protected: // Working with devices and interfaces template <typename T> static std::enable_if_t<emu::detail::is_device_implementation<T>::value, const char *> get_tag(T &obj) { return obj.tag(); } template <typename T> static std::enable_if_t<emu::detail::is_device_interface<T>::value, const char *> get_tag(T &obj) { return obj.device().tag(); } - template <typename T, typename U> static std::enable_if_t<std::is_convertible<std::add_pointer_t<U>, std::add_pointer_t<T> >::value, T &> cast_reference(U &obj) { return downcast<T &>(obj); } - template <typename T, typename U> static std::enable_if_t<!std::is_convertible<std::add_pointer_t<U>, std::add_pointer_t<T> >::value, T &> cast_reference(U &obj) { return dynamic_cast<T &>(obj); } + template <typename T, typename U> static T &cast_reference(U &obj) + { + if constexpr (std::is_convertible_v<std::add_pointer_t<U>, std::add_pointer_t<T> >) + return downcast<T &>(obj); + else + return dynamic_cast<T &>(obj); + } /// \brief Base transform helper /// @@ -223,19 +224,19 @@ protected: // Detecting candidates for read delegates template <typename T, typename Enable = void> struct is_read_method { static constexpr bool value = false; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read8s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read16s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read32s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read64s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read8sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read16sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read32sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read64sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read8smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read16smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read32smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read64smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_read_method<T, void_t<emu::detail::rw_device_class_t<read_line_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read8s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read16s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read32s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read64s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read8sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read16sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read32sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read64sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read8smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read16smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read32smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read64smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_read_method<T, std::void_t<emu::detail::rw_device_class_t<read_line_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; // Invoking read callbacks template <typename Result, typename T> static std::enable_if_t<is_read_form1<Result, T>::value, mask_t<read_result_t<Result, T>, Result> > invoke_read(T const &cb, offs_t offset, std::make_unsigned_t<Result> mem_mask) { return std::make_unsigned_t<read_result_t<Result, T> >(cb(offset, mem_mask)); } @@ -273,26 +274,26 @@ protected: template <typename Input, typename Func, typename Enable = void> struct is_write_form1 { static constexpr bool value = false; }; template <typename Input, typename Func, typename Enable = void> struct is_write_form2 { static constexpr bool value = false; }; template <typename Input, typename Func, typename Enable = void> struct is_write_form3 { static constexpr bool value = false; }; - template <typename Input, typename Func> struct is_write_form1<Input, Func, void_t<std::result_of_t<Func (offs_t, Input, std::make_unsigned_t<Input>)> > > { static constexpr bool value = true; }; - template <typename Input, typename Func> struct is_write_form2<Input, Func, void_t<std::result_of_t<Func (offs_t, Input)> > > { static constexpr bool value = true; }; - template <typename Input, typename Func> struct is_write_form3<Input, Func, void_t<std::result_of_t<Func (Input)> > > { static constexpr bool value = true; }; + template <typename Input, typename Func> struct is_write_form1<Input, Func, std::void_t<std::result_of_t<Func (offs_t, Input, std::make_unsigned_t<Input>)> > > { static constexpr bool value = true; }; + template <typename Input, typename Func> struct is_write_form2<Input, Func, std::void_t<std::result_of_t<Func (offs_t, Input)> > > { static constexpr bool value = true; }; + template <typename Input, typename Func> struct is_write_form3<Input, Func, std::void_t<std::result_of_t<Func (Input)> > > { static constexpr bool value = true; }; template <typename Input, typename Func> struct is_write { static constexpr bool value = is_write_form1<Input, Func>::value || is_write_form2<Input, Func>::value || is_write_form3<Input, Func>::value; }; // Detecting candidates for write delegates template <typename T, typename Enable = void> struct is_write_method { static constexpr bool value = false; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write8s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write16s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write32s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write64s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write8sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write16sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write32sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write64sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write8smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write16smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write32smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write64smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; - template <typename T> struct is_write_method<T, void_t<emu::detail::rw_device_class_t<write_line_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write8s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write16s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write32s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write64s_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write8sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write16sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write32sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write64sm_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write8smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write16smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write32smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write64smo_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; + template <typename T> struct is_write_method<T, std::void_t<emu::detail::rw_device_class_t<write_line_delegate, std::remove_reference_t<T> > > > { static constexpr bool value = true; }; // Invoking write callbacks template <typename Input, typename T> static std::enable_if_t<is_write_form1<Input, T>::value> invoke_write(T const &cb, offs_t &offset, Input data, std::make_unsigned_t<Input> mem_mask) { return cb(offset, data, mem_mask); } diff --git a/src/emu/devdelegate.cpp b/src/emu/devdelegate.cpp index 9bc627f49f2..7f50f3112e1 100644 --- a/src/emu/devdelegate.cpp +++ b/src/emu/devdelegate.cpp @@ -12,7 +12,7 @@ #include "devdelegate.h" -namespace emu { namespace detail { +namespace emu::detail { delegate_late_bind &device_delegate_helper::bound_object() const { @@ -31,4 +31,4 @@ void device_delegate_helper::set_tag(char const *tag) m_tag = tag; } -} } // namespace emu::detail +} // namespace emu::detail diff --git a/src/emu/device.cpp b/src/emu/device.cpp index 7196b75e18f..f22d0842db3 100644 --- a/src/emu/device.cpp +++ b/src/emu/device.cpp @@ -20,7 +20,7 @@ // DEVICE TYPE REGISTRATION //************************************************************************** -namespace emu { namespace detail { +namespace emu::detail { namespace { @@ -66,7 +66,7 @@ device_type_impl_base *device_registrar::register_device(device_type_impl_base & return nullptr; } -} } // namespace emu::detail +} // namespace emu::detail emu::detail::device_registrar const registered_device_types; diff --git a/src/emu/device.h b/src/emu/device.h index 53534fe60d5..fa973c56556 100644 --- a/src/emu/device.h +++ b/src/emu/device.h @@ -64,7 +64,7 @@ static const char DEVICE_SELF_OWNER[] = "^"; // TYPE DEFINITIONS //************************************************************************** -namespace emu { namespace detail { +namespace emu::detail { class device_type_impl_base; @@ -310,7 +310,7 @@ public: inline device_registrar::const_iterator &device_registrar::const_iterator::operator++() { m_type = m_type->m_next; return *this; } -} } // namespace emu::detail +} // namespace emu::detail // device types @@ -341,6 +341,7 @@ constexpr auto driver_device_creator = &emu::detail::driver_tag_func<DriverClass extern template class device_finder<Class, true>; #define DECLARE_DEVICE_TYPE_NS(Type, Namespace, Class) \ + namespace Namespace { class Class; } \ extern emu::detail::device_type_impl<Namespace::Class> const &Type; \ extern template class device_finder<Namespace::Class, false>; \ extern template class device_finder<Namespace::Class, true>; diff --git a/src/emu/device.ipp b/src/emu/device.ipp index 12448724dcc..820f81093d0 100644 --- a/src/emu/device.ipp +++ b/src/emu/device.ipp @@ -28,7 +28,7 @@ typedef device_delegate<void (u32)> clock_update_delegate; // MEMBER TEMPLATES //************************************************************************** -namespace emu { namespace detail { +namespace emu::detail { template <class DeviceClass> template <typename... Params> inline DeviceClass &device_type_impl<DeviceClass>::operator()(machine_config &mconfig, char const *tag, Params &&... args) const @@ -73,7 +73,7 @@ inline void device_delegate_helper::set_tag(device_finder<DeviceClass, Required> std::tie(m_base, m_tag) = finder.finder_target(); } -} } // namespace emu::detail +} // namespace emu::detail template <typename Format, typename... Params> @@ -104,17 +104,13 @@ inline void device_t::logerror(Format &&fmt, Params &&... args) const } template <typename T, typename Ret, typename... Params> -inline std::enable_if_t<device_memory_interface::is_related_class<device_t, T>::value> device_memory_interface::set_addrmap(int spacenum, Ret (T::*func)(Params... args)) +inline void device_memory_interface::set_addrmap(int spacenum, Ret (T::*func)(Params... args)) { device_t &dev(device().mconfig().current_device()); - set_addrmap(spacenum, address_map_constructor(func, dev.tag(), &downcast<T &>(dev))); -} - -template <typename T, typename Ret, typename... Params> -inline std::enable_if_t<!device_memory_interface::is_related_class<device_t, T>::value> device_memory_interface::set_addrmap(int spacenum, Ret (T::*func)(Params... args)) -{ - device_t &dev(device().mconfig().current_device()); - set_addrmap(spacenum, address_map_constructor(func, dev.tag(), &dynamic_cast<T &>(dev))); + if constexpr (is_related_class<device_t, T>::value) + set_addrmap(spacenum, address_map_constructor(func, dev.tag(), &downcast<T &>(dev))); + else + set_addrmap(spacenum, address_map_constructor(func, dev.tag(), &dynamic_cast<T &>(dev))); } #endif // MAME_EMU_DEVICE_IPP diff --git a/src/emu/dimemory.h b/src/emu/dimemory.h index ed177882d37..1c0d14ebe45 100644 --- a/src/emu/dimemory.h +++ b/src/emu/dimemory.h @@ -76,9 +76,7 @@ public: template <typename T, typename U, typename Ret, typename... Params> std::enable_if_t<is_unrelated_interface<T, U>::value> set_addrmap(int spacenum, T &obj, Ret (U::*func)(Params...)) { set_addrmap(spacenum, address_map_constructor(func, obj.device().tag(), &dynamic_cast<U &>(obj))); } template <typename T, typename Ret, typename... Params> - std::enable_if_t<is_related_class<device_t, T>::value> set_addrmap(int spacenum, Ret (T::*func)(Params...)); - template <typename T, typename Ret, typename... Params> - std::enable_if_t<!is_related_class<device_t, T>::value> set_addrmap(int spacenum, Ret (T::*func)(Params...)); + void set_addrmap(int spacenum, Ret (T::*func)(Params...)); void set_addrmap(int spacenum, address_map_constructor map); // basic information getters diff --git a/src/emu/distate.cpp b/src/emu/distate.cpp index 06e3d1947af..e01609615d4 100644 --- a/src/emu/distate.cpp +++ b/src/emu/distate.cpp @@ -331,7 +331,7 @@ std::string device_state_entry::format(const char *string, bool maxout) const width--; } // fall through to unsigned case - + [[fallthrough]]; // u outputs as unsigned decimal case 'u': if (width == 0) diff --git a/src/emu/emucore.h b/src/emu/emucore.h index 5a2446637c8..d161dde9672 100644 --- a/src/emu/emucore.h +++ b/src/emu/emucore.h @@ -288,18 +288,19 @@ private: [[noreturn]] void report_bad_device_cast(const device_t *dev, const std::type_info &src_type, const std::type_info &dst_type); template <typename Dest, typename Source> -inline std::enable_if_t<std::is_base_of<device_t, Source>::value> report_bad_cast(Source *const src) +inline void report_bad_cast(Source *src) { - if (src) report_bad_device_cast(src, typeid(Source), typeid(Dest)); - else report_bad_cast(typeid(Source), typeid(Dest)); -} - -template <typename Dest, typename Source> -inline std::enable_if_t<!std::is_base_of<device_t, Source>::value> report_bad_cast(Source *const src) -{ - device_t const *dev(dynamic_cast<device_t const *>(src)); - if (dev) report_bad_device_cast(dev, typeid(Source), typeid(Dest)); - else report_bad_cast(typeid(Source), typeid(Dest)); + if constexpr (std::is_base_of_v<device_t, Source>) + { + if (src) report_bad_device_cast(src, typeid(Source), typeid(Dest)); + else report_bad_cast(typeid(Source), typeid(Dest)); + } + else + { + device_t const *dev(dynamic_cast<device_t const *>(src)); + if (dev) report_bad_device_cast(dev, typeid(Source), typeid(Dest)); + else report_bad_cast(typeid(Source), typeid(Dest)); + } } // template function for casting from a base class to a derived class that is checked diff --git a/src/emu/emufwd.h b/src/emu/emufwd.h index b09eb098221..be33acf32ed 100644 --- a/src/emu/emufwd.h +++ b/src/emu/emufwd.h @@ -56,7 +56,7 @@ namespace util { class archive_file; } struct wav_file; // declared in xmlfile.h -namespace util { namespace xml { class data_node; } } +namespace util::xml { class data_node; } @@ -181,7 +181,7 @@ struct ioport_port_live; class running_machine; // declared in mconfig.h -namespace emu { namespace detail { class machine_config_replace; } } +namespace emu::detail { class machine_config_replace; } class machine_config; // declared in natkeyboard.h diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp index aab74d45f64..e1ebb6fe215 100644 --- a/src/emu/emumem.cpp +++ b/src/emu/emumem.cpp @@ -1034,7 +1034,7 @@ void memory_manager::initialize() void *memory_manager::allocate_memory(device_t &dev, int spacenum, std::string name, u8 width, size_t bytes) { - void *const ptr = m_datablocks.emplace(m_datablocks.end(), malloc(bytes))->get(); + void *const ptr = m_datablocks.emplace_back(malloc(bytes)).get(); memset(ptr, 0, bytes); machine().save().save_memory(&dev, "memory", dev.tag(), spacenum, name.c_str(), ptr, width/8, u32(bytes) / (width/8)); return ptr; @@ -1564,7 +1564,7 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w if (readorwrite == read_or_write::WRITE) return; // fall through to the RAM case otherwise - + [[fallthrough]]; case AMH_RAM: install_ram_generic(entry.m_addrstart, entry.m_addrend, entry.m_addrmirror, readorwrite, entry.m_memory); break; diff --git a/src/emu/emumem.h b/src/emu/emumem.h index 6c336a9243f..1270d1e264a 100644 --- a/src/emu/emumem.h +++ b/src/emu/emumem.h @@ -154,11 +154,7 @@ using write32smo_delegate = device_delegate<void (u32)>; using write64smo_delegate = device_delegate<void (u64)>; -namespace emu { namespace detail { - -// TODO: replace with std::void_t when we move to C++17 -template <typename... T> struct void_wrapper { using type = void; }; -template <typename... T> using void_t = typename void_wrapper<T...>::type; +namespace emu::detail { template <typename D, typename T, typename Enable = void> struct rw_device_class { }; @@ -172,54 +168,54 @@ struct rw_device_class<D, Ret (*)(T &, Params...), std::enable_if_t<std::is_cons template <typename D, typename T> using rw_device_class_t = typename rw_device_class<D, T>::type; template <typename T, typename Enable = void> struct rw_delegate_type; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read8_delegate, std::remove_reference_t<T> > > > { using type = read8_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read16_delegate, std::remove_reference_t<T> > > > { using type = read16_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read32_delegate, std::remove_reference_t<T> > > > { using type = read32_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read64_delegate, std::remove_reference_t<T> > > > { using type = read64_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read8m_delegate, std::remove_reference_t<T> > > > { using type = read8m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read16m_delegate, std::remove_reference_t<T> > > > { using type = read16m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read32m_delegate, std::remove_reference_t<T> > > > { using type = read32m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read64m_delegate, std::remove_reference_t<T> > > > { using type = read64m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read8s_delegate, std::remove_reference_t<T> > > > { using type = read8s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read16s_delegate, std::remove_reference_t<T> > > > { using type = read16s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read32s_delegate, std::remove_reference_t<T> > > > { using type = read32s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read64s_delegate, std::remove_reference_t<T> > > > { using type = read64s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read8sm_delegate, std::remove_reference_t<T> > > > { using type = read8sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read16sm_delegate, std::remove_reference_t<T> > > > { using type = read16sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read32sm_delegate, std::remove_reference_t<T> > > > { using type = read32sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read64sm_delegate, std::remove_reference_t<T> > > > { using type = read64sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read8mo_delegate, std::remove_reference_t<T> > > > { using type = read8mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read16mo_delegate, std::remove_reference_t<T> > > > { using type = read16mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read32mo_delegate, std::remove_reference_t<T> > > > { using type = read32mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read64mo_delegate, std::remove_reference_t<T> > > > { using type = read64mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read8smo_delegate, std::remove_reference_t<T> > > > { using type = read8smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read16smo_delegate, std::remove_reference_t<T> > > > { using type = read16smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read32smo_delegate, std::remove_reference_t<T> > > > { using type = read32smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<read64smo_delegate, std::remove_reference_t<T> > > > { using type = read64smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write8_delegate, std::remove_reference_t<T> > > > { using type = write8_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write16_delegate, std::remove_reference_t<T> > > > { using type = write16_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write32_delegate, std::remove_reference_t<T> > > > { using type = write32_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write64_delegate, std::remove_reference_t<T> > > > { using type = write64_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write8m_delegate, std::remove_reference_t<T> > > > { using type = write8m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write16m_delegate, std::remove_reference_t<T> > > > { using type = write16m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write32m_delegate, std::remove_reference_t<T> > > > { using type = write32m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write64m_delegate, std::remove_reference_t<T> > > > { using type = write64m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write8s_delegate, std::remove_reference_t<T> > > > { using type = write8s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write16s_delegate, std::remove_reference_t<T> > > > { using type = write16s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write32s_delegate, std::remove_reference_t<T> > > > { using type = write32s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write64s_delegate, std::remove_reference_t<T> > > > { using type = write64s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write8sm_delegate, std::remove_reference_t<T> > > > { using type = write8sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write16sm_delegate, std::remove_reference_t<T> > > > { using type = write16sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write32sm_delegate, std::remove_reference_t<T> > > > { using type = write32sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write64sm_delegate, std::remove_reference_t<T> > > > { using type = write64sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write8mo_delegate, std::remove_reference_t<T> > > > { using type = write8mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write16mo_delegate, std::remove_reference_t<T> > > > { using type = write16mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write32mo_delegate, std::remove_reference_t<T> > > > { using type = write32mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write64mo_delegate, std::remove_reference_t<T> > > > { using type = write64mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write8smo_delegate, std::remove_reference_t<T> > > > { using type = write8smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write16smo_delegate, std::remove_reference_t<T> > > > { using type = write16smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write32smo_delegate, std::remove_reference_t<T> > > > { using type = write32smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; -template <typename T> struct rw_delegate_type<T, void_t<rw_device_class_t<write64smo_delegate, std::remove_reference_t<T> > > > { using type = write64smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read8_delegate, std::remove_reference_t<T> > > > { using type = read8_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read16_delegate, std::remove_reference_t<T> > > > { using type = read16_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read32_delegate, std::remove_reference_t<T> > > > { using type = read32_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read64_delegate, std::remove_reference_t<T> > > > { using type = read64_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read8m_delegate, std::remove_reference_t<T> > > > { using type = read8m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read16m_delegate, std::remove_reference_t<T> > > > { using type = read16m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read32m_delegate, std::remove_reference_t<T> > > > { using type = read32m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read64m_delegate, std::remove_reference_t<T> > > > { using type = read64m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read8s_delegate, std::remove_reference_t<T> > > > { using type = read8s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read16s_delegate, std::remove_reference_t<T> > > > { using type = read16s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read32s_delegate, std::remove_reference_t<T> > > > { using type = read32s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read64s_delegate, std::remove_reference_t<T> > > > { using type = read64s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read8sm_delegate, std::remove_reference_t<T> > > > { using type = read8sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read16sm_delegate, std::remove_reference_t<T> > > > { using type = read16sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read32sm_delegate, std::remove_reference_t<T> > > > { using type = read32sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read64sm_delegate, std::remove_reference_t<T> > > > { using type = read64sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read8mo_delegate, std::remove_reference_t<T> > > > { using type = read8mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read16mo_delegate, std::remove_reference_t<T> > > > { using type = read16mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read32mo_delegate, std::remove_reference_t<T> > > > { using type = read32mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read64mo_delegate, std::remove_reference_t<T> > > > { using type = read64mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read8smo_delegate, std::remove_reference_t<T> > > > { using type = read8smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read16smo_delegate, std::remove_reference_t<T> > > > { using type = read16smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read32smo_delegate, std::remove_reference_t<T> > > > { using type = read32smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<read64smo_delegate, std::remove_reference_t<T> > > > { using type = read64smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write8_delegate, std::remove_reference_t<T> > > > { using type = write8_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write16_delegate, std::remove_reference_t<T> > > > { using type = write16_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write32_delegate, std::remove_reference_t<T> > > > { using type = write32_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write64_delegate, std::remove_reference_t<T> > > > { using type = write64_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write8m_delegate, std::remove_reference_t<T> > > > { using type = write8m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write16m_delegate, std::remove_reference_t<T> > > > { using type = write16m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write32m_delegate, std::remove_reference_t<T> > > > { using type = write32m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write64m_delegate, std::remove_reference_t<T> > > > { using type = write64m_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write8s_delegate, std::remove_reference_t<T> > > > { using type = write8s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write16s_delegate, std::remove_reference_t<T> > > > { using type = write16s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write32s_delegate, std::remove_reference_t<T> > > > { using type = write32s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write64s_delegate, std::remove_reference_t<T> > > > { using type = write64s_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write8sm_delegate, std::remove_reference_t<T> > > > { using type = write8sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write16sm_delegate, std::remove_reference_t<T> > > > { using type = write16sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write32sm_delegate, std::remove_reference_t<T> > > > { using type = write32sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write64sm_delegate, std::remove_reference_t<T> > > > { using type = write64sm_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write8mo_delegate, std::remove_reference_t<T> > > > { using type = write8mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write16mo_delegate, std::remove_reference_t<T> > > > { using type = write16mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write32mo_delegate, std::remove_reference_t<T> > > > { using type = write32mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write64mo_delegate, std::remove_reference_t<T> > > > { using type = write64mo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write8smo_delegate, std::remove_reference_t<T> > > > { using type = write8smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write16smo_delegate, std::remove_reference_t<T> > > > { using type = write16smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write32smo_delegate, std::remove_reference_t<T> > > > { using type = write32smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; +template <typename T> struct rw_delegate_type<T, std::void_t<rw_device_class_t<write64smo_delegate, std::remove_reference_t<T> > > > { using type = write64smo_delegate; using device_class = rw_device_class_t<type, std::remove_reference_t<T> >; }; template <typename T> using rw_delegate_type_t = typename rw_delegate_type<T>::type; template <typename T> using rw_delegate_device_class_t = typename rw_delegate_type<T>::device_class; @@ -456,7 +452,7 @@ constexpr int handler_entry_dispatch_lowbits(int highbits, int width, int ashift width + ashift; } -} } // namespace emu::detail +} // namespace emu::detail // ======================> memory_units_descritor forwards declaration @@ -992,7 +988,7 @@ template<int Level, int Width, int AddrShift, endianness_t Endian> void dispatch // memory_access_specific does uncached but faster accesses by shortcutting the address_space virtual call -namespace emu { namespace detail { +namespace emu::detail { template<int Level, int Width, int AddrShift, endianness_t Endian> class memory_access_specific { @@ -1166,7 +1162,8 @@ private: void set(address_space *space, std::pair<void *, void *> rw); }; -}} + +} // namespace emu::detail // ======================> memory_access cache/specific type dispatcher diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h index 9a8f8b3695b..c600ca06665 100644 --- a/src/emu/mconfig.h +++ b/src/emu/mconfig.h @@ -31,7 +31,7 @@ // TYPE DEFINITIONS //************************************************************************** -namespace emu { namespace detail { +namespace emu::detail { class machine_config_replace { @@ -43,7 +43,7 @@ private: friend class ::machine_config; }; -} } // namesapce emu::detail +} // namespace emu::detail /// \brief Internal layout description diff --git a/src/emu/render.h b/src/emu/render.h index 72e47c4b05f..f2e95164b63 100644 --- a/src/emu/render.h +++ b/src/emu/render.h @@ -172,7 +172,7 @@ struct render_texinfo }; -namespace emu { namespace render { namespace detail { +namespace emu::render::detail { struct bounds_step { @@ -198,7 +198,7 @@ using color_vector = std::vector<color_step>; class layout_environment; class view_environment; -} } } // namespace emu::render::detail +} // namespace emu::render::detail // ======================> render_layer_config diff --git a/src/emu/rendlay.cpp b/src/emu/rendlay.cpp index d5b2e960834..4f06932e321 100644 --- a/src/emu/rendlay.cpp +++ b/src/emu/rendlay.cpp @@ -138,7 +138,7 @@ class layout_reference_error : public std::out_of_range { using std::out_of_rang } // anonymous namespace -namespace emu { namespace render { namespace detail { +namespace emu::render::detail { class layout_environment { @@ -955,7 +955,7 @@ public: u32 visibility_mask() const { return m_visibility_mask; } }; -} } } // namespace emu::render::detail +} // namespace emu::render::detail namespace { @@ -1170,7 +1170,7 @@ layout_element::layout_element(environment &env, util::xml::data_node const &ele throw layout_syntax_error(util::string_format("unknown element component %s", compnode->get_name())); // insert the new component into the list - component const &newcomp(**m_complist.emplace(m_complist.end(), make_func->second(env, *compnode))); + component const &newcomp(*m_complist.emplace_back(make_func->second(env, *compnode))); // accumulate bounds if (first) diff --git a/src/emu/video/resnet.h b/src/emu/video/resnet.h index acc62bece79..638f9909255 100644 --- a/src/emu/video/resnet.h +++ b/src/emu/video/resnet.h @@ -161,7 +161,7 @@ void compute_res_net_all(std::vector<rgb_t> &rgb, const u8 *prom, const res_net_ /* legacy interface */ -namespace emu { namespace detail { +namespace emu::detail { template <std::size_t I, typename T, std::size_t N, typename U> constexpr auto combine_weights(T const (&tab)[N], U w) { return tab[I] * w; } @@ -169,7 +169,7 @@ constexpr auto combine_weights(T const (&tab)[N], U w) { return tab[I] * w; } template <std::size_t I, typename T, std::size_t N, typename U, typename... V> constexpr auto combine_weights(T const (&tab)[N], U w0, V... w) { return (tab[I] * w0) + combine_weights<I + 1>(tab, w...); } -} } // namespace emu::detail +} // namespace emu::detail double compute_resistor_weights( int minval, int maxval, double scaler, diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp index daf6461b0f4..39846db0099 100644 --- a/src/frontend/mame/cheat.cpp +++ b/src/frontend/mame/cheat.cpp @@ -160,7 +160,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols, util::xml::data_node::int_format const format(itemnode->get_attribute_int_format("value")); // allocate and append a new item - item &curitem(*m_itemlist.emplace(m_itemlist.end(), itemnode->get_value(), value, format)); + item &curitem(m_itemlist.emplace_back(itemnode->get_value(), value, format)); // ensure the maximum expands to suit m_maxval = std::max(m_maxval, curitem.value()); diff --git a/src/frontend/mame/luaengine.cpp b/src/frontend/mame/luaengine.cpp index 9afe6827cfd..e0660cb8e5b 100644 --- a/src/frontend/mame/luaengine.cpp +++ b/src/frontend/mame/luaengine.cpp @@ -976,7 +976,7 @@ void lua_engine::initialize() * file:fullpath() - */ - auto file_type = emu.create_simple_usertype<emu_file>(sol::call_constructor, sol::initializers( + auto file_type = emu.new_usertype<emu_file>(sol::call_constructor, sol::initializers( [](emu_file &file, u32 flags) { new (&file) emu_file(flags); }, [](emu_file &file, const char *path, u32 flags) { new (&file) emu_file(path, flags); }, [](emu_file &file, const char *mode) { @@ -1066,7 +1066,7 @@ void lua_engine::initialize() file_type.set("size", &emu_file::size); file_type.set("filename", &emu_file::filename); file_type.set("fullpath", &emu_file::fullpath); - emu.set_usertype("file", file_type); + emu.set("file", file_type); /* thread library @@ -1083,7 +1083,7 @@ void lua_engine::initialize() * thread.yield - check if thread is yielded */ - auto thread_type = emu.create_simple_usertype<context>(sol::call_constructor, sol::constructors<sol::types<>>()); + auto thread_type = emu.new_usertype<context>(sol::call_constructor, sol::constructors<sol::types<>>()); thread_type.set("start", [](context &ctx, const char *scr) { std::string script(scr); if(ctx.busy) @@ -1136,7 +1136,7 @@ void lua_engine::initialize() })); thread_type.set("busy", sol::readonly(&context::busy)); thread_type.set("yield", sol::readonly(&context::yield)); - emu.set_usertype("thread", thread_type); + emu.set("thread", thread_type); /* save_item library @@ -1151,7 +1151,7 @@ void lua_engine::initialize() * item:write(offset, value) - write entry value by index */ - auto item_type = emu.create_simple_usertype<save_item>(sol::call_constructor, sol::initializers([this](save_item &item, int index) { + auto item_type = emu.new_usertype<save_item>(sol::call_constructor, sol::initializers([this](save_item &item, int index) { if(machine().save().indexed_item(index, item.base, item.size, item.valcount, item.blockcount, item.stride)) { item.count = item.valcount * item.blockcount; @@ -1236,7 +1236,7 @@ void lua_engine::initialize() break; } }); - emu.set_usertype("item", item_type); + emu.set("item", item_type); /* core_options library @@ -1252,7 +1252,7 @@ void lua_engine::initialize() * options.entries[] - get table of option entries (k=name, v=core_options::entry) */ - auto core_options_type = sol().registry().create_simple_usertype<core_options>("new", sol::no_constructor); + auto core_options_type = sol().registry().new_usertype<core_options>("new", sol::no_constructor); core_options_type.set("help", &core_options::output_help); core_options_type.set("command", &core_options::command); core_options_type.set("entries", sol::property([this](core_options &options) { @@ -1275,7 +1275,7 @@ void lua_engine::initialize() } return table; })); - sol().registry().set_usertype("core_options", core_options_type); + sol().registry().set("core_options", core_options_type); /* core_options::entry library @@ -1291,7 +1291,7 @@ void lua_engine::initialize() * entry:has_range() - are min and max valid for entry */ - auto core_options_entry_type = sol().registry().create_simple_usertype<core_options::entry>("new", sol::no_constructor); + auto core_options_entry_type = sol().registry().new_usertype<core_options::entry>("new", sol::no_constructor); core_options_entry_type.set("value", sol::overload( [this](core_options::entry &e, bool val) { if(e.type() != OPTION_BOOLEAN) @@ -1337,7 +1337,7 @@ void lua_engine::initialize() core_options_entry_type.set("minimum", &core_options::entry::minimum); core_options_entry_type.set("maximum", &core_options::entry::maximum); core_options_entry_type.set("has_range", &core_options::entry::has_range); - sol().registry().set_usertype("core_options_entry", core_options_entry_type); + sol().registry().set("core_options_entry", core_options_entry_type); /* running_machine library @@ -1377,7 +1377,7 @@ void lua_engine::initialize() * machine.images[] - get available image devices table (k=type, v=device_image_interface) */ - auto machine_type = sol().registry().create_simple_usertype<running_machine>("new", sol::no_constructor); + auto machine_type = sol().registry().new_usertype<running_machine>("new", sol::no_constructor); machine_type.set("exit", &running_machine::schedule_exit); machine_type.set("hard_reset", &running_machine::schedule_hard_reset); machine_type.set("soft_reset", &running_machine::schedule_soft_reset); @@ -1466,7 +1466,7 @@ void lua_engine::initialize() [](running_machine &m, const char *str) { m.popmessage("%s", str); }, [](running_machine &m) { m.popmessage(); })); machine_type.set("logerror", [](running_machine &m, const char *str) { m.logerror("[luaengine] %s\n", str); } ); - sol().registry().set_usertype("machine", machine_type); + sol().registry().set("machine", machine_type); /* game_driver library @@ -1495,7 +1495,7 @@ void lua_engine::initialize() * driver.is_incomplete - official system with blatantly incomplete hardware/software */ - auto game_driver_type = sol().registry().create_simple_usertype<game_driver>("new", sol::no_constructor); + auto game_driver_type = sol().registry().new_usertype<game_driver>("new", sol::no_constructor); game_driver_type.set("source_file", sol::property([] (game_driver const &driver) { return &driver.type.source()[0]; })); game_driver_type.set("parent", sol::readonly(&game_driver::parent)); game_driver_type.set("name", sol::property([] (game_driver const &driver) { return &driver.name[0]; })); @@ -1555,7 +1555,7 @@ void lua_engine::initialize() game_driver_type.set("no_sound_hw", sol::property([](game_driver const &driver) { return (driver.flags & machine_flags::NO_SOUND_HW) > 0; })); game_driver_type.set("mechanical", sol::property([](game_driver const &driver) { return (driver.flags & machine_flags::MECHANICAL) > 0; })); game_driver_type.set("is_incomplete", sol::property([](game_driver const &driver) { return (driver.flags & machine_flags::IS_INCOMPLETE) > 0; } )); - sol().registry().set_usertype("game_driver", game_driver_type); + sol().registry().set("game_driver", game_driver_type); /* debugger_manager library (requires debugger to be active) @@ -1572,7 +1572,7 @@ void lua_engine::initialize() struct wrap_textbuf { wrap_textbuf(const text_buffer &buf) : textbuf(buf) { } std::reference_wrapper<const text_buffer> textbuf; }; - auto debugger_type = sol().registry().create_simple_usertype<debugger_manager>("new", sol::no_constructor); + auto debugger_type = sol().registry().new_usertype<debugger_manager>("new", sol::no_constructor); debugger_type.set("command", [](debugger_manager &debug, const std::string &cmd) { debug.console().execute_command(cmd, false); }); debugger_type.set("consolelog", sol::property([](debugger_manager &debug) { return wrap_textbuf(debug.console().get_console_textbuf()); })); debugger_type.set("errorlog", sol::property([](debugger_manager &debug) { return wrap_textbuf(debug.console().get_errorlog_textbuf()); })); @@ -1589,7 +1589,7 @@ void lua_engine::initialize() else debug.cpu().set_execution_running(); })); - sol().registry().set_usertype("debugger", debugger_type); + sol().registry().set("debugger", debugger_type); /* wrap_textbuf library (requires debugger to be active) @@ -1624,7 +1624,7 @@ void lua_engine::initialize() * debug:wplist(space)[] - table of watchpoints (k=index, v=watchpoint) */ - auto device_debug_type = sol().registry().create_simple_usertype<device_debug>("new", sol::no_constructor); + auto device_debug_type = sol().registry().new_usertype<device_debug>("new", sol::no_constructor); device_debug_type.set("step", [](device_debug &dev, sol::object num) { int steps = 1; if(num.is<int>()) @@ -1682,7 +1682,7 @@ void lua_engine::initialize() } return table; }); - sol().registry().set_usertype("device_debug", device_debug_type); + sol().registry().set("device_debug", device_debug_type); /* device_t library @@ -1701,7 +1701,7 @@ void lua_engine::initialize() * device.roms[] - device rom entry table (k=name, v=rom_entry) */ - auto device_type = sol().registry().create_simple_usertype<device_t>("new", sol::no_constructor); + auto device_type = sol().registry().new_usertype<device_t>("new", sol::no_constructor); device_type.set("name", &device_t::name); device_type.set("shortname", &device_t::shortname); device_type.set("tag", &device_t::tag); @@ -1761,7 +1761,7 @@ void lua_engine::initialize() table[rom.name()] = rom; return table; })); - sol().registry().set_usertype("device", device_type); + sol().registry().set("device", device_type); /* addr_space library @@ -1790,7 +1790,7 @@ void lua_engine::initialize() * space.map[] - table of address map entries (k=index, v=address_map_entry) */ - auto addr_space_type = sol().registry().create_simple_usertype<addr_space>(sol::call_constructor, sol::constructors<sol::types<address_space &, device_memory_interface &>>()); + auto addr_space_type = sol().registry().new_usertype<addr_space>(sol::call_constructor, sol::constructors<sol::types<address_space &, device_memory_interface &>>()); addr_space_type.set("read_i8", &addr_space::mem_read<int8_t>); addr_space_type.set("read_u8", &addr_space::mem_read<uint8_t>); addr_space_type.set("read_i16", &addr_space::mem_read<int16_t>); @@ -1939,7 +1939,7 @@ void lua_engine::initialize() } return map; })); - sol().registry().set_usertype("addr_space", addr_space_type); + sol().registry().set("addr_space", addr_space_type); /* ioport_manager library @@ -1953,7 +1953,7 @@ void lua_engine::initialize() * ioport.ports[] - ioports table (k=tag, v=ioport_port) */ - auto ioport_manager_type = sol().registry().create_simple_usertype<ioport_manager>("new", sol::no_constructor); + auto ioport_manager_type = sol().registry().new_usertype<ioport_manager>("new", sol::no_constructor); ioport_manager_type.set("count_players", &ioport_manager::count_players); ioport_manager_type.set("natkeyboard", &ioport_manager::natkeyboard); ioport_manager_type.set("type_group", [](ioport_manager &im, ioport_type type, int player) { @@ -1968,7 +1968,7 @@ void lua_engine::initialize() ioport_manager_type.set("type_seq", [](ioport_manager &m, ioport_type type, int player, input_seq_type seqtype) { return sol::make_user(m.type_seq(type, player, seqtype)); }); - sol().registry().set_usertype("ioport", ioport_manager_type); + sol().registry().set("ioport", ioport_manager_type); /* natural_keyboard library @@ -1983,13 +1983,13 @@ void lua_engine::initialize() * natkeyboard.in_use - is the natural keyboard in use? */ - auto natkeyboard_type = sol().registry().create_simple_usertype<natural_keyboard>("new", sol::no_constructor); + auto natkeyboard_type = sol().registry().new_usertype<natural_keyboard>("new", sol::no_constructor); natkeyboard_type.set("empty", sol::property(&natural_keyboard::empty)); natkeyboard_type.set("in_use", sol::property(&natural_keyboard::in_use, &natural_keyboard::set_in_use)); natkeyboard_type.set("paste", &natural_keyboard::paste); natkeyboard_type.set("post", [](natural_keyboard &nat, const std::string &text) { nat.post_utf8(text); }); natkeyboard_type.set("post_coded", [](natural_keyboard &nat, const std::string &text) { nat.post_coded(text); }); - sol().registry().set_usertype("natkeyboard", natkeyboard_type); + sol().registry().set("natkeyboard", natkeyboard_type); /* ioport_port library @@ -2006,7 +2006,7 @@ void lua_engine::initialize() * port.fields[] - get ioport_field table (k=name, v=ioport_field) */ - auto ioport_port_type = sol().registry().create_simple_usertype<ioport_port>("new", sol::no_constructor); + auto ioport_port_type = sol().registry().new_usertype<ioport_port>("new", sol::no_constructor); ioport_port_type.set("tag", &ioport_port::tag); ioport_port_type.set("active", &ioport_port::active); ioport_port_type.set("live", &ioport_port::live); @@ -2033,7 +2033,7 @@ void lua_engine::initialize() } return f_table; })); - sol().registry().set_usertype("ioport_port", ioport_port_type); + sol().registry().set("ioport_port", ioport_port_type); /* ioport_field library @@ -2078,7 +2078,7 @@ void lua_engine::initialize() * field.settings[] - ioport_setting table (k=value, v=name) */ - auto ioport_field_type = sol().registry().create_simple_usertype<ioport_field>("new", sol::no_constructor); + auto ioport_field_type = sol().registry().new_usertype<ioport_field>("new", sol::no_constructor); ioport_field_type.set("set_value", &ioport_field::set_value); ioport_field_type.set("set_input_seq", [](ioport_field &f, const std::string &seq_type_string, sol::user<input_seq> seq) { input_seq_type seq_type = s_seq_type_parser(seq_type_string); @@ -2164,7 +2164,7 @@ void lua_engine::initialize() result[setting.value()] = setting.name(); return result; })); - sol().registry().set_usertype("ioport_field", ioport_field_type); + sol().registry().set("ioport_field", ioport_field_type); /* ioport_field_live library @@ -2211,7 +2211,7 @@ void lua_engine::initialize() * video.throttle_rate - throttle rate */ - auto video_type = sol().registry().create_simple_usertype<video_manager>("new", sol::no_constructor); + auto video_type = sol().registry().new_usertype<video_manager>("new", sol::no_constructor); video_type.set("begin_recording", sol::overload( [this](video_manager &vm, const char *filename, const char *format_string) { std::string fn = process_snapshot_filename(machine(), filename); @@ -2259,7 +2259,7 @@ void lua_engine::initialize() video_type.set("frameskip", sol::property(&video_manager::frameskip, &video_manager::set_frameskip)); video_type.set("throttled", sol::property(&video_manager::throttled, &video_manager::set_throttled)); video_type.set("throttle_rate", sol::property(&video_manager::throttle_rate, &video_manager::set_throttle_rate)); - sol().registry().set_usertype("video", video_type); + sol().registry().set("video", video_type); /* sound_manager library @@ -2275,7 +2275,7 @@ void lua_engine::initialize() * sound.attenuation - sound attenuation */ - auto sound_type = sol().registry().create_simple_usertype<sound_manager>("new", sol::no_constructor); + auto sound_type = sol().registry().new_usertype<sound_manager>("new", sol::no_constructor); sound_type.set("start_recording", &sound_manager::start_recording); sound_type.set("stop_recording", &sound_manager::stop_recording); sound_type.set("ui_mute", &sound_manager::ui_mute); @@ -2291,7 +2291,7 @@ void lua_engine::initialize() return sol::make_reference(L, sol::stack_reference(L, -1)); }); sound_type.set("attenuation", sol::property(&sound_manager::attenuation, &sound_manager::set_attenuation)); - sol().registry().set_usertype("sound", sound_type); + sol().registry().set("sound", sound_type); /* input_manager library @@ -2314,7 +2314,7 @@ void lua_engine::initialize() * input.device_classes - returns device classes */ - auto input_type = sol().registry().create_simple_usertype<input_manager>("new", sol::no_constructor); + auto input_type = sol().registry().new_usertype<input_manager>("new", sol::no_constructor); input_type.set("code_from_token", [](input_manager &input, const char *token) { return sol::make_user(input.code_from_token(token)); }); input_type.set("code_pressed", [](input_manager &input, sol::user<input_code> code) { return input.code_pressed(code); }); input_type.set("code_to_token", [](input_manager &input, sol::user<input_code> code) { return input.code_to_token(code); }); @@ -2379,7 +2379,7 @@ void lua_engine::initialize() } return result; })); - sol().registry().set_usertype("input", input_type); + sol().registry().set("input", input_type); /* input_class library @@ -2392,7 +2392,7 @@ void lua_engine::initialize() * devclass.devices[] */ - auto input_class_type = sol().registry().create_simple_usertype<input_class>("new", sol::no_constructor); + auto input_class_type = sol().registry().new_usertype<input_class>("new", sol::no_constructor); input_class_type.set("name", sol::property(&input_class::name)); input_class_type.set("enabled", sol::property(&input_class::enabled, &input_class::enable)); input_class_type.set("multi", sol::property(&input_class::multi, &input_class::set_multi)); @@ -2407,7 +2407,7 @@ void lua_engine::initialize() } return result; })); - sol().registry().set_usertype("input_class", input_class_type); + sol().registry().set("input_class", input_class_type); /* input_device library @@ -2419,7 +2419,7 @@ void lua_engine::initialize() * device.items[] */ - auto input_device_type = sol().registry().create_simple_usertype<input_device>("new", sol::no_constructor); + auto input_device_type = sol().registry().new_usertype<input_device>("new", sol::no_constructor); input_device_type.set("name", sol::property(&input_device::name)); input_device_type.set("id", sol::property(&input_device::id)); input_device_type.set("devindex", sol::property(&input_device::devindex)); @@ -2433,7 +2433,7 @@ void lua_engine::initialize() } return result; })); - sol().registry().set_usertype("input_device", input_device_type); + sol().registry().set("input_device", input_device_type); /* input_device_item library @@ -2444,14 +2444,14 @@ void lua_engine::initialize() * item:code() */ - auto input_device_item_type = sol().registry().create_simple_usertype<input_device_item>("new", sol::no_constructor); + auto input_device_item_type = sol().registry().new_usertype<input_device_item>("new", sol::no_constructor); input_device_item_type.set("name", sol::property(&input_device_item::name)); input_device_item_type.set("token", sol::property(&input_device_item::token)); input_device_item_type.set("code", [](input_device_item &item) { input_code code(item.device().devclass(), item.device().devindex(), item.itemclass(), ITEM_MODIFIER_NONE, item.itemid()); return sol::make_user(code); }); - sol().registry().set_usertype("input_device_item", input_device_item_type); + sol().registry().set("input_device_item", input_device_item_type); /* ui_input_manager library @@ -2463,7 +2463,7 @@ void lua_engine::initialize() * uiinput.presses_enabled - enable/disable ui key presses */ - auto uiinput_type = sol().registry().create_simple_usertype<ui_input_manager>("new", sol::no_constructor); + auto uiinput_type = sol().registry().new_usertype<ui_input_manager>("new", sol::no_constructor); uiinput_type.set("find_mouse", [](ui_input_manager &ui) { int32_t x, y; bool button; @@ -2472,7 +2472,7 @@ void lua_engine::initialize() }); uiinput_type.set("pressed", &ui_input_manager::pressed); uiinput_type.set("presses_enabled", sol::property(&ui_input_manager::presses_enabled, &ui_input_manager::set_presses_enabled)); - sol().registry().set_usertype("uiinput", uiinput_type); + sol().registry().set("uiinput", uiinput_type); /* render_target library @@ -2496,7 +2496,7 @@ void lua_engine::initialize() * target.zoom - enable zoom */ - auto target_type = sol().registry().create_simple_usertype<render_target>("new", sol::no_constructor); + auto target_type = sol().registry().new_usertype<render_target>("new", sol::no_constructor); target_type.set("view_bounds", [](render_target &rt) { const render_bounds b = rt.current_view().bounds(); return std::tuple<float, float, float, float>(b.x0, b.x1, b.y0, b.y1); @@ -2513,7 +2513,7 @@ void lua_engine::initialize() target_type.set("orientation", sol::property(&render_target::orientation, &render_target::set_orientation)); target_type.set("screen_overlay", sol::property(&render_target::screen_overlay_enabled, &render_target::set_screen_overlay_enabled)); target_type.set("zoom", sol::property(&render_target::zoom_to_screen, &render_target::set_zoom_to_screen)); - sol().registry().set_usertype("target", target_type); + sol().registry().set("target", target_type); /* render_container library @@ -2528,14 +2528,14 @@ void lua_engine::initialize() * container:is_empty() */ - auto render_container_type = sol().registry().create_simple_usertype<render_container>("new", sol::no_constructor); + auto render_container_type = sol().registry().new_usertype<render_container>("new", sol::no_constructor); render_container_type.set("orientation", &render_container::orientation); render_container_type.set("xscale", &render_container::xscale); render_container_type.set("yscale", &render_container::yscale); render_container_type.set("xoffset", &render_container::xoffset); render_container_type.set("yoffset", &render_container::yoffset); render_container_type.set("is_empty", &render_container::is_empty); - sol().registry().set_usertype("render_container", render_container_type); + sol().registry().set("render_container", render_container_type); /* render_manager library @@ -2549,7 +2549,7 @@ void lua_engine::initialize() * render.targets[] - render_target table */ - auto render_type = sol().registry().create_simple_usertype<render_manager>("new", sol::no_constructor); + auto render_type = sol().registry().new_usertype<render_manager>("new", sol::no_constructor); render_type.set("max_update_rate", &render_manager::max_update_rate); render_type.set("ui_target", &render_manager::ui_target); render_type.set("ui_container", &render_manager::ui_container); @@ -2560,7 +2560,7 @@ void lua_engine::initialize() target_table[tc++] = &curr_rt; return target_table; })); - sol().registry().set_usertype("render", render_type); + sol().registry().set("render", render_type); /* screen_device library @@ -2590,7 +2590,7 @@ void lua_engine::initialize() * screen:time_until_pos(vpos, hpos) - get the time until this screen pos is reached */ - auto screen_dev_type = sol().registry().create_simple_usertype<screen_device>("new", sol::no_constructor); + auto screen_dev_type = sol().registry().new_usertype<screen_device>("new", sol::no_constructor); screen_dev_type.set("draw_box", [](screen_device &sdev, float x1, float y1, float x2, float y2, uint32_t bgcolor, uint32_t fgcolor) { int sc_width = sdev.visible_area().width(); int sc_height = sdev.visible_area().height(); @@ -2717,7 +2717,7 @@ void lua_engine::initialize() return sol::make_reference(L, sol::stack_reference(L, -1)); }); screen_dev_type.set("time_until_pos", [](screen_device &sdev, int vpos, int hpos) { return sdev.time_until_pos(vpos, hpos).as_double(); }); - sol().registry().set_usertype("screen_dev", screen_dev_type); + sol().registry().set("screen_dev", screen_dev_type); /* mame_ui_manager library @@ -2736,7 +2736,7 @@ void lua_engine::initialize() * ui.show_profiler - profiler display enabled */ - auto ui_type = sol().registry().create_simple_usertype<mame_ui_manager>("new", sol::no_constructor); + auto ui_type = sol().registry().new_usertype<mame_ui_manager>("new", sol::no_constructor); ui_type.set("is_menu_active", &mame_ui_manager::is_menu_active); ui_type.set("options", [](mame_ui_manager &m) { return static_cast<core_options *>(&m.options()); }); ui_type.set("show_fps", sol::property(&mame_ui_manager::show_fps, &mame_ui_manager::set_show_fps)); @@ -2747,7 +2747,7 @@ void lua_engine::initialize() // sol converts char32_t to a string ui_type.set("get_char_width", [](mame_ui_manager &m, uint32_t utf8char) { return m.get_char_width(utf8char); }); ui_type.set("set_aggressive_input_focus", [](mame_ui_manager &m, bool aggressive_focus) { osd_set_aggressive_input_focus(aggressive_focus); }); - sol().registry().set_usertype("ui", ui_type); + sol().registry().set("ui", ui_type); /* device_state_entry library @@ -2761,7 +2761,7 @@ void lua_engine::initialize() * state.value - get device state value */ - auto dev_space_type = sol().registry().create_simple_usertype<device_state_entry>("new", sol::no_constructor); + auto dev_space_type = sol().registry().new_usertype<device_state_entry>("new", sol::no_constructor); dev_space_type.set("name", &device_state_entry::symbol); dev_space_type.set("value", sol::property( [this](device_state_entry &entry) -> uint64_t { @@ -2783,7 +2783,7 @@ void lua_engine::initialize() })); dev_space_type.set("is_visible", &device_state_entry::visible); dev_space_type.set("is_divider", &device_state_entry::divider); - sol().registry().set_usertype("dev_space", dev_space_type); + sol().registry().set("dev_space", dev_space_type); /* rom_entry library @@ -2797,13 +2797,13 @@ void lua_engine::initialize() * rom:flags() - see romentry.h */ - auto rom_entry_type = sol().registry().create_simple_usertype<rom_entry>("new", sol::no_constructor); + auto rom_entry_type = sol().registry().new_usertype<rom_entry>("new", sol::no_constructor); rom_entry_type.set("name", &rom_entry::name); rom_entry_type.set("hashdata", &rom_entry::hashdata); rom_entry_type.set("offset", &rom_entry::get_offset); rom_entry_type.set("length", &rom_entry::get_length); rom_entry_type.set("flags", &rom_entry::get_flags); - sol().registry().set_usertype("rom_entry", rom_entry_type); + sol().registry().set("rom_entry", rom_entry_type); /* memory_manager library @@ -2815,7 +2815,7 @@ void lua_engine::initialize() * memory.shares[] - table of memory shares (k=tag, v=memory_share) */ - auto memory_type = sol().registry().create_simple_usertype<memory_manager>("new", sol::no_constructor); + auto memory_type = sol().registry().new_usertype<memory_manager>("new", sol::no_constructor); memory_type.set("banks", sol::property([this](memory_manager &mm) { sol::table table = sol().create_table(); for (auto &bank : mm.banks()) @@ -2834,7 +2834,7 @@ void lua_engine::initialize() table[share.first] = share.second.get(); return table; })); - sol().registry().set_usertype("memory", memory_type); + sol().registry().set("memory", memory_type); /* memory_region library @@ -2848,7 +2848,7 @@ void lua_engine::initialize() * region.size */ - auto region_type = sol().registry().create_simple_usertype<memory_region>("new", sol::no_constructor); + auto region_type = sol().registry().new_usertype<memory_region>("new", sol::no_constructor); region_type.set("read_i8", ®ion_read<int8_t>); region_type.set("read_u8", ®ion_read<uint8_t>); region_type.set("read_i16", ®ion_read<int16_t>); @@ -2866,7 +2866,7 @@ void lua_engine::initialize() region_type.set("write_i64", ®ion_write<int64_t>); region_type.set("write_u64", ®ion_write<uint64_t>); region_type.set("size", sol::property(&memory_region::bytes)); - sol().registry().set_usertype("region", region_type); + sol().registry().set("region", region_type); /* memory_share library @@ -2880,7 +2880,7 @@ void lua_engine::initialize() * region.size */ - auto share_type = sol().registry().create_simple_usertype<memory_share>("new", sol::no_constructor); + auto share_type = sol().registry().new_usertype<memory_share>("new", sol::no_constructor); share_type.set("read_i8", &share_read<int8_t>); share_type.set("read_u8", &share_read<uint8_t>); share_type.set("read_i16", &share_read<int16_t>); @@ -2898,7 +2898,7 @@ void lua_engine::initialize() share_type.set("write_i64", &share_write<int64_t>); share_type.set("write_u64", &share_write<uint64_t>); share_type.set("size", sol::property(&memory_share::bytes)); - sol().registry().set_usertype("share", share_type); + sol().registry().set("share", share_type); /* output_manager library @@ -2913,7 +2913,7 @@ void lua_engine::initialize() * outputs:id_to_name(index) - get name for index */ - auto output_type = sol().registry().create_simple_usertype<output_manager>("new", sol::no_constructor); + auto output_type = sol().registry().new_usertype<output_manager>("new", sol::no_constructor); output_type.set("set_value", &output_manager::set_value); output_type.set("set_indexed_value", [](output_manager &o, char const *basename, int index, int value) { o.set_value(util::string_format("%s%d", basename, index).c_str(), value); @@ -2924,7 +2924,7 @@ void lua_engine::initialize() }); output_type.set("name_to_id", &output_manager::name_to_id); output_type.set("id_to_name", &output_manager::id_to_name); - sol().registry().set_usertype("output", output_type); + sol().registry().set("output", output_type); /* device_image_interface library @@ -2956,7 +2956,7 @@ void lua_engine::initialize() * image.must_be_loaded */ - auto image_type = sol().registry().create_simple_usertype<device_image_interface>("new", sol::no_constructor); + auto image_type = sol().registry().new_usertype<device_image_interface>("new", sol::no_constructor); image_type.set("exists", &device_image_interface::exists); image_type.set("filename", &device_image_interface::filename); image_type.set("longname", &device_image_interface::longname); @@ -2982,7 +2982,7 @@ void lua_engine::initialize() image_type.set("is_creatable", sol::property(&device_image_interface::is_creatable)); image_type.set("is_reset_on_load", sol::property(&device_image_interface::is_reset_on_load)); image_type.set("must_be_loaded", sol::property(&device_image_interface::must_be_loaded)); - sol().registry().set_usertype("image", image_type); + sol().registry().set("image", image_type); /* mame_machine_manager library diff --git a/src/frontend/mame/luaengine.h b/src/frontend/mame/luaengine.h index 28bf3b60ca2..a158b496bdd 100644 --- a/src/frontend/mame/luaengine.h +++ b/src/frontend/mame/luaengine.h @@ -22,9 +22,8 @@ #pragma GCC diagnostic ignored "-Wnoexcept-type" #endif -#define SOL_SAFE_USERTYPE -//#define SOL_CHECK_ARGUMENTS -#include "sol2/sol.hpp" +#define SOL_SAFE_USERTYPE 1 +#include "sol/sol.hpp" struct lua_State; diff --git a/src/frontend/mame/ui/filesel.cpp b/src/frontend/mame/ui/filesel.cpp index 19567b33659..2461cd9d231 100644 --- a/src/frontend/mame/ui/filesel.cpp +++ b/src/frontend/mame/ui/filesel.cpp @@ -202,7 +202,7 @@ menu_file_selector::file_selector_entry &menu_file_selector::append_entry( entry.fullpath = std::move(entry_fullpath); // find the end of the list - return *m_entrylist.emplace(m_entrylist.end(), std::move(entry)); + return m_entrylist.emplace_back(std::move(entry)); } diff --git a/src/frontend/mame/ui/inputmap.cpp b/src/frontend/mame/ui/inputmap.cpp index bfb68e40da0..c0a36642e5d 100644 --- a/src/frontend/mame/ui/inputmap.cpp +++ b/src/frontend/mame/ui/inputmap.cpp @@ -84,7 +84,7 @@ void menu_input_general::populate(float &customtop, float &custombottom) for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) { // build an entry for the standard sequence - input_item_data &item(*data.emplace(data.end())); + input_item_data &item(data.emplace_back()); item.ref = &entry; item.seqtype = seqtype; item.seq = machine().ioport().type_seq(entry.type(), entry.player(), seqtype); @@ -155,7 +155,7 @@ void menu_input_specific::populate(float &customtop, float &custombottom) for (input_seq_type seqtype = SEQ_TYPE_STANDARD; seqtype < SEQ_TYPE_TOTAL; ++seqtype) { // build an entry for the standard sequence - input_item_data &item(*data.emplace(data.end())); + input_item_data &item(data.emplace_back()); item.ref = &field; item.seqtype = seqtype; item.seq = field.seq(seqtype); diff --git a/src/frontend/mame/ui/miscmenu.cpp b/src/frontend/mame/ui/miscmenu.cpp index 5cdff331c21..e5c5d1862ae 100644 --- a/src/frontend/mame/ui/miscmenu.cpp +++ b/src/frontend/mame/ui/miscmenu.cpp @@ -367,7 +367,7 @@ void menu_crosshair::populate(float &customtop, float &custombottom) if (crosshair.is_used()) { // CROSSHAIR_ITEM_VIS - allocate a data item and fill it - crosshair_item_data &visdata(*m_data.emplace(m_data.end())); + crosshair_item_data &visdata(m_data.emplace_back()); visdata.crosshair = &crosshair; visdata.type = CROSSHAIR_ITEM_VIS; visdata.player = player; @@ -376,7 +376,7 @@ void menu_crosshair::populate(float &customtop, float &custombottom) visdata.defvalue = CROSSHAIR_VISIBILITY_DEFAULT; // CROSSHAIR_ITEM_PIC - allocate a data item and fill it - crosshair_item_data &picdata(*m_data.emplace(m_data.end())); + crosshair_item_data &picdata(m_data.emplace_back()); picdata.crosshair = &crosshair; picdata.type = CROSSHAIR_ITEM_PIC; picdata.player = player; @@ -385,7 +385,7 @@ void menu_crosshair::populate(float &customtop, float &custombottom) } // CROSSHAIR_ITEM_AUTO_TIME - allocate a data item and fill it - crosshair_item_data &timedata(*m_data.emplace(m_data.end())); + crosshair_item_data &timedata(m_data.emplace_back()); timedata.type = CROSSHAIR_ITEM_AUTO_TIME; timedata.min = CROSSHAIR_VISIBILITY_AUTOTIME_MIN; timedata.max = CROSSHAIR_VISIBILITY_AUTOTIME_MAX; diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp index bc6dee9cd47..fb3ecc1cacd 100644 --- a/src/frontend/mame/ui/viewgfx.cpp +++ b/src/frontend/mame/ui/viewgfx.cpp @@ -307,9 +307,8 @@ again: break; } - // fall through... state.mode++; - + [[fallthrough]]; case UI_GFX_GFXSET: // if we have graphics sets, display them if (state.gfxset.devcount > 0) @@ -318,9 +317,8 @@ again: break; } - // fall through... state.mode++; - + [[fallthrough]]; case UI_GFX_TILEMAP: // if we have tilemaps, display them if (mui.machine().tilemap().count() > 0) diff --git a/src/lib/formats/jvc_dsk.cpp b/src/lib/formats/jvc_dsk.cpp index 960c384fdb7..b9ef776ef87 100644 --- a/src/lib/formats/jvc_dsk.cpp +++ b/src/lib/formats/jvc_dsk.cpp @@ -152,13 +152,13 @@ bool jvc_format::parse_header(io_generic *io, int &header_size, int &tracks, int osd_printf_info("jvc_format: sector attribute flag unsupported\n"); return false; case 4: base_sector_id = header[3]; - // no break + [[fallthrough]]; case 3: sector_size = 128 << header[2]; - // no break + [[fallthrough]]; case 2: heads = header[1]; - // no break + [[fallthrough]]; case 1: sectors = header[0]; - // no break + [[fallthrough]]; case 0: tracks = (size - header_size) / sector_size / sectors / heads; break; } diff --git a/src/lib/formats/td0_dsk.cpp b/src/lib/formats/td0_dsk.cpp index 4dc3ed53cbf..20902fd011e 100644 --- a/src/lib/formats/td0_dsk.cpp +++ b/src/lib/formats/td0_dsk.cpp @@ -874,7 +874,8 @@ bool td0_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) return false; // single side hd? break; } - /* no break; could be qd, won't know until tracks are counted */ + // could be qd, won't know until tracks are counted + [[fallthrough]]; case 1: if(head_count == 2) image->set_variant(floppy_image::DSDD); @@ -891,7 +892,7 @@ bool td0_format::load(io_generic *io, uint32_t form_factor, floppy_image *image) break; } else image->set_variant(floppy_image::SSDD); - break; + break; // FIXME: comment below says "no break" but this is a breal /* no break */ case 3: if(head_count == 2) diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp index d7668c7822a..81ac77d4468 100644 --- a/src/lib/netlist/devices/nld_4316.cpp +++ b/src/lib/netlist/devices/nld_4316.cpp @@ -25,7 +25,7 @@ #include "analog/nlid_twoterm.h" #include "solver/nld_solver.h" -namespace netlist { namespace devices { +namespace netlist::devices { // FIXME: tristate outputs? @@ -67,5 +67,4 @@ namespace netlist { namespace devices { NETLIB_DEVICE_IMPL(CD4316_GATE, "CD4316_GATE", "") -} // namespace devices - } // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/util/chd.cpp b/src/lib/util/chd.cpp index daad423147a..7d3e2c7c5c8 100644 --- a/src/lib/util/chd.cpp +++ b/src/lib/util/chd.cpp @@ -2218,6 +2218,7 @@ void chd_file::decompress_v5_map() // pseudo-types; convert into base types case COMPRESSION_SELF_1: last_self++; + [[fallthrough]]; case COMPRESSION_SELF_0: rawmap[0] = COMPRESSION_SELF; offset = last_self; @@ -2230,6 +2231,7 @@ void chd_file::decompress_v5_map() case COMPRESSION_PARENT_1: last_parent += m_hunkbytes / m_unitbytes; + [[fallthrough]]; case COMPRESSION_PARENT_0: rawmap[0] = COMPRESSION_PARENT; offset = last_parent; diff --git a/src/lib/util/coretmpl.h b/src/lib/util/coretmpl.h index a06c4fb8a46..e2e221e7374 100644 --- a/src/lib/util/coretmpl.h +++ b/src/lib/util/coretmpl.h @@ -25,6 +25,7 @@ #include <list> #include <map> #include <memory> +#include <numeric> #include <set> #include <stdexcept> #include <tuple> @@ -1050,18 +1051,11 @@ constexpr std::enable_if_t<std::is_signed<T>::value, T> iabs(T v) noexcept } -// returns greatest common divisor of a and b using the Euclidean algorithm -template <typename M, typename N> -constexpr std::common_type_t<M, N> euclid_gcd(M a, N b) -{ - return b ? euclid_gcd(b, a % b) : a; -} - // reduce a fraction template <typename M, typename N> inline void reduce_fraction(M &num, N &den) { - auto const div(euclid_gcd(num, den)); + auto const div(std::gcd(num, den)); if (div) { num /= div; @@ -1069,6 +1063,6 @@ inline void reduce_fraction(M &num, N &den) } } -}; // namespace util +} // namespace util #endif // MAME_UTIL_CORETMPL_H diff --git a/src/lib/util/strformat.h b/src/lib/util/strformat.h index 98c599f4ad6..2ed90669284 100644 --- a/src/lib/util/strformat.h +++ b/src/lib/util/strformat.h @@ -543,6 +543,7 @@ public: case conversion::octal: case conversion::hexadecimal: m_positive_sign = positive_sign::none; + [[fallthrough]]; case conversion::signed_decimal: if (0 <= m_precision) m_zero_pad = false; @@ -579,8 +580,6 @@ private: { static constexpr bool value = std::is_integral<U>::value && std::is_signed<U>::value; }; template <typename U> struct unsigned_integer_semantics { static constexpr bool value = std::is_integral<U>::value && !std::is_signed<U>::value; }; - template <typename U> struct default_semantics - { static constexpr bool value = !signed_integer_semantics<U>::value && !unsigned_integer_semantics<U>::value; }; static void apply_signed(Stream &str, char16_t const &value) { @@ -632,186 +631,187 @@ private: public: template <typename U> - static void apply(std::enable_if_t<signed_integer_semantics<U>::value, Stream> &str, format_flags const &flags, U const &value) + static void apply(Stream &str, format_flags const &flags, U const &value) { - switch (flags.get_conversion()) + if constexpr (signed_integer_semantics<U>::value) { - case format_flags::conversion::signed_decimal: - switch (flags.get_length()) + switch (flags.get_conversion()) { - case format_flags::length::character: - str << int(static_cast<signed char>(value)); - break; - case format_flags::length::short_integer: - str << short(value); - break; - case format_flags::length::long_integer: - str << long(value); - break; - case format_flags::length::long_long_integer: - str << static_cast<long long>(value); - break; - case format_flags::length::integer_maximum: - str << std::intmax_t(value); - break; - case format_flags::length::size_type: - str << std::make_signed_t<std::size_t>(value); - break; - case format_flags::length::pointer_difference: - str << std::make_signed_t<std::ptrdiff_t>(value); - break; - case format_flags::length::integer_32: - str << std::uint32_t(std::int32_t(value)); - break; - case format_flags::length::integer_64: - str << std::int64_t(value); - break; - default: - apply_signed(str, value); - } - break; - case format_flags::conversion::unsigned_decimal: - case format_flags::conversion::octal: - case format_flags::conversion::hexadecimal: - switch (flags.get_length()) - { - case format_flags::length::character: - str << unsigned(static_cast<unsigned char>(static_cast<signed char>(value))); - break; - case format_flags::length::short_integer: - str << static_cast<unsigned short>(short(value)); - break; - case format_flags::length::long_integer: - str << static_cast<unsigned long>(long(value)); - break; - case format_flags::length::long_long_integer: - str << static_cast<unsigned long long>(static_cast<long long>(value)); - break; - case format_flags::length::integer_maximum: - str << std::uintmax_t(std::intmax_t(value)); - break; - case format_flags::length::size_type: - str << std::make_unsigned_t<std::size_t>(std::make_signed_t<std::size_t>(value)); + case format_flags::conversion::signed_decimal: + switch (flags.get_length()) + { + case format_flags::length::character: + str << int(static_cast<signed char>(value)); + break; + case format_flags::length::short_integer: + str << short(value); + break; + case format_flags::length::long_integer: + str << long(value); + break; + case format_flags::length::long_long_integer: + str << static_cast<long long>(value); + break; + case format_flags::length::integer_maximum: + str << std::intmax_t(value); + break; + case format_flags::length::size_type: + str << std::make_signed_t<std::size_t>(value); + break; + case format_flags::length::pointer_difference: + str << std::make_signed_t<std::ptrdiff_t>(value); + break; + case format_flags::length::integer_32: + str << std::uint32_t(std::int32_t(value)); + break; + case format_flags::length::integer_64: + str << std::int64_t(value); + break; + default: + apply_signed(str, value); + } break; - case format_flags::length::pointer_difference: - str << std::make_unsigned_t<std::ptrdiff_t>(std::make_signed_t<std::ptrdiff_t>(value)); + case format_flags::conversion::unsigned_decimal: + case format_flags::conversion::octal: + case format_flags::conversion::hexadecimal: + switch (flags.get_length()) + { + case format_flags::length::character: + str << unsigned(static_cast<unsigned char>(static_cast<signed char>(value))); + break; + case format_flags::length::short_integer: + str << static_cast<unsigned short>(short(value)); + break; + case format_flags::length::long_integer: + str << static_cast<unsigned long>(long(value)); + break; + case format_flags::length::long_long_integer: + str << static_cast<unsigned long long>(static_cast<long long>(value)); + break; + case format_flags::length::integer_maximum: + str << std::uintmax_t(std::intmax_t(value)); + break; + case format_flags::length::size_type: + str << std::make_unsigned_t<std::size_t>(std::make_signed_t<std::size_t>(value)); + break; + case format_flags::length::pointer_difference: + str << std::make_unsigned_t<std::ptrdiff_t>(std::make_signed_t<std::ptrdiff_t>(value)); + break; + case format_flags::length::integer_32: + str << std::uint32_t(std::int32_t(value)); + break; + case format_flags::length::integer_64: + str << std::uint64_t(std::int64_t(value)); + break; + default: + apply_unsigned(str, value); + } break; - case format_flags::length::integer_32: - str << std::uint32_t(std::int32_t(value)); + case format_flags::conversion::character: + if (std::is_signed<typename Stream::char_type>::value) + str << typename Stream::char_type(value); + else + str << typename Stream::char_type(std::make_signed_t<typename Stream::char_type>(value)); break; - case format_flags::length::integer_64: - str << std::uint64_t(std::int64_t(value)); + case format_flags::conversion::pointer: + str << reinterpret_cast<void const *>(std::uintptr_t(std::intptr_t(value))); break; default: - apply_unsigned(str, value); + str << value; } - break; - case format_flags::conversion::character: - if (std::is_signed<typename Stream::char_type>::value) - str << typename Stream::char_type(value); - else - str << typename Stream::char_type(std::make_signed_t<typename Stream::char_type>(value)); - break; - case format_flags::conversion::pointer: - str << reinterpret_cast<void const *>(std::uintptr_t(std::intptr_t(value))); - break; - default: - str << value; } - } - template <typename U> - static void apply(std::enable_if_t<unsigned_integer_semantics<U>::value, Stream> &str, format_flags const &flags, U const &value) - { - switch (flags.get_conversion()) + else if constexpr (unsigned_integer_semantics<U>::value) { - case format_flags::conversion::signed_decimal: - switch (flags.get_length()) - { - case format_flags::length::character: - str << int(static_cast<signed char>(static_cast<unsigned char>(value))); - break; - case format_flags::length::short_integer: - str << short(static_cast<unsigned short>(value)); - break; - case format_flags::length::long_integer: - str << long(static_cast<unsigned long>(value)); - break; - case format_flags::length::long_long_integer: - str << static_cast<long long>(static_cast<unsigned long long>(value)); - break; - case format_flags::length::integer_maximum: - str << std::intmax_t(std::uintmax_t(value)); - break; - case format_flags::length::size_type: - str << std::make_signed_t<std::size_t>(std::make_unsigned_t<std::size_t>(value)); - break; - case format_flags::length::pointer_difference: - str << std::make_signed_t<std::ptrdiff_t>(std::make_unsigned_t<std::ptrdiff_t>(value)); - break; - case format_flags::length::integer_32: - str << std::int32_t(std::uint32_t(value)); - break; - case format_flags::length::integer_64: - str << std::int64_t(std::uint64_t(value)); - break; - default: - apply_signed(str, value); - } - break; - case format_flags::conversion::unsigned_decimal: - case format_flags::conversion::octal: - case format_flags::conversion::hexadecimal: - switch (flags.get_length()) + switch (flags.get_conversion()) { - case format_flags::length::character: - str << unsigned(static_cast<unsigned char>(value)); - break; - case format_flags::length::short_integer: - str << static_cast<unsigned short>(value); - break; - case format_flags::length::long_integer: - str << static_cast<unsigned long>(value); - break; - case format_flags::length::long_long_integer: - str << static_cast<unsigned long long>(value); - break; - case format_flags::length::integer_maximum: - str << std::uintmax_t(value); - break; - case format_flags::length::size_type: - str << std::make_unsigned_t<std::size_t>(value); + case format_flags::conversion::signed_decimal: + switch (flags.get_length()) + { + case format_flags::length::character: + str << int(static_cast<signed char>(static_cast<unsigned char>(value))); + break; + case format_flags::length::short_integer: + str << short(static_cast<unsigned short>(value)); + break; + case format_flags::length::long_integer: + str << long(static_cast<unsigned long>(value)); + break; + case format_flags::length::long_long_integer: + str << static_cast<long long>(static_cast<unsigned long long>(value)); + break; + case format_flags::length::integer_maximum: + str << std::intmax_t(std::uintmax_t(value)); + break; + case format_flags::length::size_type: + str << std::make_signed_t<std::size_t>(std::make_unsigned_t<std::size_t>(value)); + break; + case format_flags::length::pointer_difference: + str << std::make_signed_t<std::ptrdiff_t>(std::make_unsigned_t<std::ptrdiff_t>(value)); + break; + case format_flags::length::integer_32: + str << std::int32_t(std::uint32_t(value)); + break; + case format_flags::length::integer_64: + str << std::int64_t(std::uint64_t(value)); + break; + default: + apply_signed(str, value); + } break; - case format_flags::length::pointer_difference: - str << std::make_unsigned_t<std::ptrdiff_t>(value); + case format_flags::conversion::unsigned_decimal: + case format_flags::conversion::octal: + case format_flags::conversion::hexadecimal: + switch (flags.get_length()) + { + case format_flags::length::character: + str << unsigned(static_cast<unsigned char>(value)); + break; + case format_flags::length::short_integer: + str << static_cast<unsigned short>(value); + break; + case format_flags::length::long_integer: + str << static_cast<unsigned long>(value); + break; + case format_flags::length::long_long_integer: + str << static_cast<unsigned long long>(value); + break; + case format_flags::length::integer_maximum: + str << std::uintmax_t(value); + break; + case format_flags::length::size_type: + str << std::make_unsigned_t<std::size_t>(value); + break; + case format_flags::length::pointer_difference: + str << std::make_unsigned_t<std::ptrdiff_t>(value); + break; + case format_flags::length::integer_32: + str << std::uint32_t(std::int32_t(value)); + break; + case format_flags::length::integer_64: + str << std::int64_t(value); + break; + default: + apply_unsigned(str, value); + } break; - case format_flags::length::integer_32: - str << std::uint32_t(std::int32_t(value)); + case format_flags::conversion::character: + if (std::is_signed<typename Stream::char_type>::value) + str << typename Stream::char_type(value); + else + str << typename Stream::char_type(std::make_signed_t<typename Stream::char_type>(value)); break; - case format_flags::length::integer_64: - str << std::int64_t(value); + case format_flags::conversion::pointer: + str << reinterpret_cast<void const *>(std::uintptr_t(value)); break; default: - apply_unsigned(str, value); + str << value; } - break; - case format_flags::conversion::character: - if (std::is_signed<typename Stream::char_type>::value) - str << typename Stream::char_type(value); - else - str << typename Stream::char_type(std::make_signed_t<typename Stream::char_type>(value)); - break; - case format_flags::conversion::pointer: - str << reinterpret_cast<void const *>(std::uintptr_t(value)); - break; - default: + } + else + { str << value; } } - template <typename U> - static void apply(std::enable_if_t<default_semantics<U>::value, Stream> &str, format_flags const &flags, U const &value) - { - str << value; - } static void apply(Stream &str, format_flags const &flags, bool value) { switch (flags.get_conversion()) @@ -834,36 +834,34 @@ public: } } template <typename CharT, typename Traits, typename Allocator> - static void apply(std::enable_if_t<std::is_same<CharT, typename Stream::char_type>::value, Stream> &str, format_flags const &flags, std::basic_string<CharT, Traits, Allocator> const &value) + static void apply(Stream &str, format_flags const &flags, std::basic_string<CharT, Traits, Allocator> const &value) { int const precision(flags.get_precision()); if ((0 <= precision) && (value.size() > unsigned(precision))) { - unsigned width(flags.get_field_width()); - bool const pad(unsigned(precision) < width); - typename Stream::fmtflags const adjust(str.flags() & Stream::adjustfield); - if (!pad || (Stream::left == adjust)) str.write(&*value.begin(), unsigned(precision)); - if (pad) + if constexpr (std::is_same_v<CharT, typename Stream::char_type>) + { + unsigned width(flags.get_field_width()); + bool const pad(unsigned(precision) < width); + typename Stream::fmtflags const adjust(str.flags() & Stream::adjustfield); + if (!pad || (Stream::left == adjust)) str.write(&*value.begin(), unsigned(precision)); + if (pad) + { + for (width -= precision; 0U < width; --width) str.put(str.fill()); + if (Stream::left != adjust) str.write(&*value.begin(), unsigned(precision)); + } + str.width(0); + } + else { - for (width -= precision; 0U < width; --width) str.put(str.fill()); - if (Stream::left != adjust) str.write(&*value.begin(), unsigned(precision)); + str << value.substr(0, unsigned(precision)); } - str.width(0); } else { str << value; } } - template <typename CharT, typename Traits, typename Allocator> - static void apply(std::enable_if_t<!std::is_same<CharT, typename Stream::char_type>::value, Stream> &str, format_flags const &flags, std::basic_string<CharT, Traits, Allocator> const &value) - { - int const precision(flags.get_precision()); - if ((0 <= precision) && (value.size() > unsigned(precision))) - str << value.substr(0, unsigned(precision)); - else - str << value; - } }; template <typename Stream, typename T> @@ -875,46 +873,48 @@ protected: public: template <typename U> - static void apply(std::enable_if_t<string_semantics<U>::value, Stream> &str, format_flags const &flags, U const *value) + static void apply(Stream &str, format_flags const &flags, U const *value) { - switch (flags.get_conversion()) + if constexpr (string_semantics<U>::value) { - case format_flags::conversion::string: + switch (flags.get_conversion()) { - int precision(flags.get_precision()); - if (0 <= flags.get_precision()) + case format_flags::conversion::string: { - std::streamsize cnt(0); - for ( ; (0 < precision) && (U(format_chars<U>::nul) != value[cnt]); --precision, ++cnt) { } - unsigned width(flags.get_field_width()); - bool const pad(std::make_unsigned_t<std::streamsize>(cnt) < width); - typename Stream::fmtflags const adjust(str.flags() & Stream::adjustfield); - if (!pad || (Stream::left == adjust)) str.write(value, cnt); - if (pad) + int precision(flags.get_precision()); + if (0 <= flags.get_precision()) { - for (width -= cnt; 0U < width; --width) str.put(str.fill()); - if (Stream::left != adjust) str.write(value, cnt); + std::streamsize cnt(0); + for ( ; (0 < precision) && (U(format_chars<U>::nul) != value[cnt]); --precision, ++cnt) { } + unsigned width(flags.get_field_width()); + bool const pad(std::make_unsigned_t<std::streamsize>(cnt) < width); + typename Stream::fmtflags const adjust(str.flags() & Stream::adjustfield); + if (!pad || (Stream::left == adjust)) str.write(value, cnt); + if (pad) + { + for (width -= cnt; 0U < width; --width) str.put(str.fill()); + if (Stream::left != adjust) str.write(value, cnt); + } + str.width(0); + } + else + { + str << value; } - str.width(0); - } - else - { - str << value; } + break; + case format_flags::conversion::pointer: + str << reinterpret_cast<void const *>(const_cast<std::remove_volatile_t<U> *>(value)); + break; + default: + str << value; } - break; - case format_flags::conversion::pointer: + } + else + { str << reinterpret_cast<void const *>(const_cast<std::remove_volatile_t<U> *>(value)); - break; - default: - str << value; } } - template <typename U> - static void apply(std::enable_if_t<!string_semantics<U>::value, Stream> &str, format_flags const &flags, U const *value) - { - str << reinterpret_cast<void const *>(const_cast<std::remove_volatile_t<U> *>(value)); - } }; template <typename Stream, typename T, std::size_t N> @@ -947,23 +947,24 @@ private: { static constexpr bool value = std::is_convertible<U const, unsigned>::value && std::is_unsigned<U>::value; }; template <typename U> struct use_signed_cast { static constexpr bool value = !use_unsigned_cast<U>::value && std::is_convertible<U const, int>::value; }; - template <typename U> struct disable - { static constexpr bool value = !use_unsigned_cast<U>::value && !use_signed_cast<U>::value; }; public: - template <typename U> static std::enable_if_t<use_unsigned_cast<U>::value, bool> apply(U const &value, int &result) - { - result = int(unsigned(value)); - return true; - } - template <typename U> static std::enable_if_t<use_signed_cast<U>::value, bool> apply(U const &value, int &result) - { - result = int(value); - return true; - } - template <typename U> static std::enable_if_t<disable<U>::value, bool> apply(U const &value, int &result) + template <typename U> static bool apply(U const &value, int &result) { - return false; + if constexpr (use_unsigned_cast<U>::value) + { + result = int(unsigned(value)); + return true; + } + else if constexpr (use_signed_cast<U>::value) + { + result = int(value); + return true; + } + else + { + return false; + } } }; @@ -984,24 +985,25 @@ private: { static constexpr bool value = is_non_const_ptr<U>::value && is_unsigned_ptr<U>::value && std::is_convertible<std::make_unsigned_t<std::streamoff>, std::remove_pointer_t<U> >::value; }; template <typename U> struct use_signed_cast { static constexpr bool value = is_non_const_ptr<U>::value && !use_unsigned_cast<U>::value && std::is_convertible<std::streamoff, std::remove_pointer_t<U> >::value; }; - template <typename U> struct disable - { static constexpr bool value = !use_unsigned_cast<U>::value && !use_signed_cast<U>::value; }; public: - template <typename U> static std::enable_if_t<use_unsigned_cast<U>::value, bool> apply(U const &value, std::streamoff data) - { - *value = std::remove_pointer_t<U>(std::make_unsigned_t<std::streamoff>(data)); - return true; - } - template <typename U> static std::enable_if_t<use_signed_cast<U>::value, bool> apply(U const &value, std::streamoff data) - { - *value = std::remove_pointer_t<U>(std::make_signed_t<std::streamoff>(data)); - return true; - } - template <typename U> static std::enable_if_t<disable<U>::value, bool> apply(U const &value, std::streamoff data) + template <typename U> static bool apply(U const &value, std::streamoff data) { - assert(false); // inappropriate type for storing characters written so far - return false; + if constexpr (use_unsigned_cast<U>::value) + { + *value = std::remove_pointer_t<U>(std::make_unsigned_t<std::streamoff>(data)); + return true; + } + else if constexpr (use_signed_cast<U>::value) + { + *value = std::remove_pointer_t<U>(std::make_signed_t<std::streamoff>(data)); + return true; + } + else + { + assert(false); // inappropriate type for storing characters written so far + return false; + } } }; @@ -1429,38 +1431,45 @@ public: break; case format_helper::X: flags.set_uppercase(); + [[fallthrough]]; case format_helper::x: flags.set_conversion(format_flags::conversion::hexadecimal); break; case format_helper::E: flags.set_uppercase(); + [[fallthrough]]; case format_helper::e: flags.set_conversion(format_flags::conversion::scientific_decimal); break; case format_helper::F: flags.set_uppercase(); + [[fallthrough]]; case format_helper::f: flags.set_conversion(format_flags::conversion::fixed_decimal); break; case format_helper::G: flags.set_uppercase(); + [[fallthrough]]; case format_helper::g: flags.set_conversion(format_flags::conversion::floating_decimal); break; case format_helper::A: flags.set_uppercase(); + [[fallthrough]]; case format_helper::a: flags.set_conversion(format_flags::conversion::scientific_hexadecimal); break; case format_helper::C: if (format_flags::length::unspecified == flags.get_length()) flags.set_length(format_flags::length::long_integer); + [[fallthrough]]; case format_helper::c: flags.set_conversion(format_flags::conversion::character); break; case format_helper::S: if (format_flags::length::unspecified == flags.get_length()) flags.set_length(format_flags::length::long_integer); + [[fallthrough]]; case format_helper::s: flags.set_conversion(format_flags::conversion::string); break; diff --git a/src/lib/util/xmlfile.cpp b/src/lib/util/xmlfile.cpp index 8ee3c33fe26..2660137e1bb 100644 --- a/src/lib/util/xmlfile.cpp +++ b/src/lib/util/xmlfile.cpp @@ -22,7 +22,7 @@ #include <sstream> -namespace util { namespace xml { +namespace util::xml { namespace { @@ -1019,5 +1019,4 @@ void data_node::write_recursive(int indent, util::core_file &file) const } } - -} } // namespace util::xml +} // namespace util::xml diff --git a/src/lib/util/xmlfile.h b/src/lib/util/xmlfile.h index 814c27aaede..ac4e9864f13 100644 --- a/src/lib/util/xmlfile.h +++ b/src/lib/util/xmlfile.h @@ -7,12 +7,11 @@ XML file parsing code. ***************************************************************************/ - -#pragma once - #ifndef MAME_LIB_UTIL_XMLFILE_H #define MAME_LIB_UTIL_XMLFILE_H +#pragma once + #include "osdcore.h" #include "corefile.h" @@ -25,7 +24,7 @@ struct XML_ParserStruct; -namespace util { namespace xml { +namespace util::xml { /*************************************************************************** CONSTANTS @@ -246,6 +245,6 @@ private: /* normalize a string into something that can be written to an XML file */ const char *normalize_string(const char *string); -} } // namespace util::xml +} // namespace util::xml -#endif /* MAME_LIB_UTIL_XMLFILE_H */ +#endif // MAME_LIB_UTIL_XMLFILE_H diff --git a/src/mame/drivers/bfm_swp.cpp b/src/mame/drivers/bfm_swp.cpp index 598ce7e1b8f..d07adf71b52 100644 --- a/src/mame/drivers/bfm_swp.cpp +++ b/src/mame/drivers/bfm_swp.cpp @@ -168,13 +168,10 @@ void bfm_swp_state::bfm_swp_mem_w(offs_t offset, uint32_t data, uint32_t mem_mas { default: logerror("%08x maincpu write access offset %08x data %08x mem_mask %08x cs %d\n", pc, offset*4, data, mem_mask, cs); - + [[fallthrough]]; case 2: offset&=0x3fff; COMBINE_DATA(&m_mainram[offset]); - break; - - } } diff --git a/src/mame/drivers/cxhumax.cpp b/src/mame/drivers/cxhumax.cpp index af6404fbc39..dfdc0d779a7 100644 --- a/src/mame/drivers/cxhumax.cpp +++ b/src/mame/drivers/cxhumax.cpp @@ -684,7 +684,7 @@ uint32_t cxhumax_state::cx_i2c1_r(offs_t offset) switch(offset) { case I2C_STAT_REG: data |= m_i2cmem->read_sda()<<3; - // fall + [[fallthrough]]; default: data |= m_i2c1_regs[offset]; break; } @@ -745,7 +745,7 @@ void cxhumax_state::cx_i2c1_w(offs_t offset, uint32_t data, uint32_t mem_mask) case I2C_STAT_REG: /* The interrupt status bit may be cleared by writing (anything) to the status register, which also clears the acknowledge status. */ data&=~(I2C_WACK_BIT|I2C_INT_BIT); - // fall + [[fallthrough]]; default: COMBINE_DATA(&m_i2c1_regs[offset]); } diff --git a/src/mame/drivers/fmtowns.cpp b/src/mame/drivers/fmtowns.cpp index c14b2494112..4a0f1629860 100644 --- a/src/mame/drivers/fmtowns.cpp +++ b/src/mame/drivers/fmtowns.cpp @@ -1896,6 +1896,7 @@ uint8_t towns_state::towns_cdrom_r(offs_t offset) { return towns_cdrom_read_byte_software(); } + [[fallthrough]]; default: return 0x00; } diff --git a/src/mame/drivers/mpu5.cpp b/src/mame/drivers/mpu5.cpp index eeaff542d81..a61b076d025 100644 --- a/src/mame/drivers/mpu5.cpp +++ b/src/mame/drivers/mpu5.cpp @@ -196,41 +196,33 @@ uint32_t mpu5_state::mpu5_mem_r(offs_t offset, uint32_t mem_mask) switch ( cs ) { case 2: - { switch (addr & 0xf0) { case 0xd0: - { logerror("%08x PIC read\n", pc); break; - } + case 0xe0: - { logerror("%08x DUART read\n", pc); break; - } case 0xf0: - { return asic_r32(offset&3,mem_mask); - } default: - logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs); - break; + logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs); } - } - break; + break; case 3: case 4: offset &=0x3fff; - return (m_mainram[offset]); - - case 1:if (offset < 0x100000) // make sure to log an error instead of crashing when reading beyond end of region - return m_cpuregion[offset]; - + return m_mainram[offset]; + case 1: + if (offset < 0x100000) // make sure to log an error instead of crashing when reading beyond end of region + return m_cpuregion[offset]; + [[fallthrough]]; default: logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs); @@ -245,7 +237,6 @@ void mpu5_state::asic_w8(offs_t offset, uint8_t data) switch (offset) { case 0x03: - { if (m_led_strobe_temp != data) { m_led_strobe_temp = data; @@ -253,36 +244,35 @@ void mpu5_state::asic_w8(offs_t offset, uint8_t data) switch (m_led_strobe_temp) { case 0x00: - m_led_strobe = 0; - break; + m_led_strobe = 0; + break; case 0x01: - m_led_strobe = 1; - break; + m_led_strobe = 1; + break; case 0x02: - m_led_strobe = 2; - break; + m_led_strobe = 2; + break; case 0x04: - m_led_strobe = 3; - break; + m_led_strobe = 3; + break; case 0x08: - m_led_strobe = 4; - break; + m_led_strobe = 4; + break; case 0x10: - m_led_strobe = 5; - break; + m_led_strobe = 5; + break; case 0x20: - m_led_strobe = 6; - break; + m_led_strobe = 6; + break; case 0x40: - m_led_strobe = 7; - break; + m_led_strobe = 7; + break; case 0x80: - m_led_strobe = 8; - break; + m_led_strobe = 8; + break; } } break; - } case 0x09: { @@ -292,22 +282,17 @@ void mpu5_state::asic_w8(offs_t offset, uint8_t data) m_sec->cs_w(~data&0x04); } case 0x0b: - { - output().set_value("statuslamp1", ((data&0x10) != 0)); - - output().set_value("statuslamp2", ((data&0x20) != 0)); + output().set_value("statuslamp1", BIT(data, 4)); + output().set_value("statuslamp2", BIT(data, 5)); if (data & 0x40) { -// m_dsp_pin =1; + //m_dsp_pin = 1; } - } - break; + break; + default: - { - int pc = m_maincpu->pc(); - logerror("%08x maincpu write to ASIC - offset %01x data %02x\n", pc, offset, data); - } + logerror("%s: maincpu write to ASIC - offset %01x data %02x\n", machine().describe_context(), offset, data); } } diff --git a/src/mame/drivers/pluto5.cpp b/src/mame/drivers/pluto5.cpp index 838b935ccb1..3ef4d55c4a0 100644 --- a/src/mame/drivers/pluto5.cpp +++ b/src/mame/drivers/pluto5.cpp @@ -215,9 +215,10 @@ uint32_t pluto5_state::pluto5_mem_r(offs_t offset, uint32_t mem_mask) switch ( cs ) { - case 1:if (offset < 0x100000) // If reading beyond end of region, log error instead of crashing - return m_cpuregion[offset]; - + case 1: + if (offset < 0x100000) // If reading beyond end of region, log error instead of crashing + return m_cpuregion[offset]; + [[fallthrough]]; default: logerror("%08x maincpu read access offset %08x mem_mask %08x cs %d\n", pc, offset*4, mem_mask, cs); diff --git a/src/mame/drivers/spaceg.cpp b/src/mame/drivers/spaceg.cpp index 5c8e169c2d0..128022f6b77 100644 --- a/src/mame/drivers/spaceg.cpp +++ b/src/mame/drivers/spaceg.cpp @@ -283,7 +283,7 @@ void spaceg_state::zvideoram_w(offs_t offset, uint8_t data) // draw case 0: vram_data &= ~(0xff00 >> xoff); - // (fall through) + [[fallthrough]]; case 1: vram_data |= sdata; diff --git a/src/mame/drivers/ti99_8.cpp b/src/mame/drivers/ti99_8.cpp index 00a461d5614..010821b54e7 100644 --- a/src/mame/drivers/ti99_8.cpp +++ b/src/mame/drivers/ti99_8.cpp @@ -465,19 +465,19 @@ uint8_t ti99_8_state::psi_input(offs_t offset) case tms9901_device::INT6: if (m_keyboard_column >= 14) return BIT(m_joyport->read_port(),0); - + [[fallthrough]]; case tms9901_device::INT7_P15: if (m_keyboard_column >= 14) return BIT(m_joyport->read_port(),4); - + [[fallthrough]]; case tms9901_device::INT8_P14: if (m_keyboard_column >= 14) return BIT(m_joyport->read_port(),1); - + [[fallthrough]]; case tms9901_device::INT9_P13: if (m_keyboard_column >= 14) return BIT(m_joyport->read_port(),2); - + [[fallthrough]]; case tms9901_device::INT10_P12: if (m_keyboard_column >= 14) return BIT(m_joyport->read_port(),3); diff --git a/src/mame/machine/315_5649.cpp b/src/mame/machine/315_5649.cpp index 909715294f7..42331720431 100644 --- a/src/mame/machine/315_5649.cpp +++ b/src/mame/machine/315_5649.cpp @@ -100,6 +100,7 @@ uint8_t sega_315_5649_device::read(offs_t offset) m_port_value[6] = (m_port_value[6] & 0xf8) | ((m_port_value[6] + 1) & 7); break; } + [[fallthrough]]; case 0x00: case 0x01: case 0x02: diff --git a/src/mame/machine/gb.cpp b/src/mame/machine/gb.cpp index d7b3deb6c4b..4c742715d0c 100644 --- a/src/mame/machine/gb.cpp +++ b/src/mame/machine/gb.cpp @@ -244,6 +244,7 @@ void gb_state::gb_io_w(offs_t offset, uint8_t data) case 0x00: case 0x01: m_sio_count = 0; + break; case 0x80: /* enabled & external clock */ m_sio_count = 16; break; diff --git a/src/mame/machine/konamigx.cpp b/src/mame/machine/konamigx.cpp index 53ad766b79f..50b1ac1d09b 100644 --- a/src/mame/machine/konamigx.cpp +++ b/src/mame/machine/konamigx.cpp @@ -195,6 +195,7 @@ void konamigx_state::K053990_martchmp_word_w(offs_t offset, uint16_t data, uint1 { case 0xffff: // word copy element_size = 2; + [[fallthrough]]; case 0xff00: // byte copy src_addr = m_prot_data[0x0]; src_addr |= m_prot_data[0x1]<<16 & 0xff0000; diff --git a/src/mame/machine/lynx.cpp b/src/mame/machine/lynx.cpp index 7da6ae8f077..d8da6e304f8 100644 --- a/src/mame/machine/lynx.cpp +++ b/src/mame/machine/lynx.cpp @@ -717,9 +717,11 @@ void lynx_state::lynx_blitter() case 0x30: // width, height, tilt, stretch m_blitter.tilt = lynx_read_ram(m_blitter.scb + SCB_TILT) | (lynx_read_ram(m_blitter.scb + SCB_TILT + 1) << 8); m_blitter.memory_accesses+=2; + [[fallthrough]]; case 0x20: // width, height, stretch m_blitter.stretch = lynx_read_ram(m_blitter.scb + SCB_STRETCH) | (lynx_read_ram(m_blitter.scb + SCB_STRETCH + 1) << 8); m_blitter.memory_accesses+=2; + [[fallthrough]]; case 0x10: // width, height m_blitter.width = lynx_read_ram(m_blitter.scb + SCB_SPRHSIZ) | (lynx_read_ram(m_blitter.scb + SCB_SPRHSIZ + 1) << 8); m_blitter.height = lynx_read_ram(m_blitter.scb + SCB_SPRVSIZ) | (lynx_read_ram(m_blitter.scb + SCB_SPRVSIZ + 1) << 8); diff --git a/src/mame/machine/mathbox.cpp b/src/mame/machine/mathbox.cpp index d78fb2538d2..957bc606779 100644 --- a/src/mame/machine/mathbox.cpp +++ b/src/mame/machine/mathbox.cpp @@ -143,6 +143,7 @@ void mathbox_device::go_w(offs_t offset, uint8_t data) REG7 += REG2; /* fall into command 12 */ + [[fallthrough]]; case 0x12: @@ -174,6 +175,7 @@ void mathbox_device::go_w(offs_t offset, uint8_t data) REG9 &= 0xff00; /* fall into command 13 */ + [[fallthrough]]; case 0x13: LOG(("\nR7: %04x R8: %04x R9: %04x\n", REG7, REG8, REG9)); @@ -264,6 +266,7 @@ void mathbox_device::go_w(offs_t offset, uint8_t data) REG3 = -REG3; /* fall into command 1e */ + [[fallthrough]]; case 0x1e: /* result = max (REG2, REG3) + 3/8 * min (REG2, REG3) */ diff --git a/src/mame/machine/micro3d.cpp b/src/mame/machine/micro3d.cpp index aaeb2e83c9a..8d8b60f1659 100644 --- a/src/mame/machine/micro3d.cpp +++ b/src/mame/machine/micro3d.cpp @@ -185,9 +185,9 @@ void micro3d_state::micro3d_mac2_w(uint32_t data) case 0x00: break; case 0x04: break; - case 0x0b: cnt += 0x100; - case 0x0a: cnt += 0x100; - case 0x09: cnt += 0x100; + case 0x0b: cnt += 0x100; [[fallthrough]]; + case 0x0a: cnt += 0x100; [[fallthrough]]; + case 0x09: cnt += 0x100; [[fallthrough]]; case 0x08: { int i; @@ -225,8 +225,8 @@ void micro3d_state::micro3d_mac2_w(uint32_t data) break; } - case 0x0e: cnt += 0x100; - case 0x0d: cnt += 0x100; + case 0x0e: cnt += 0x100; [[fallthrough]]; + case 0x0d: cnt += 0x100; [[fallthrough]]; case 0x0c: { int i; @@ -277,7 +277,7 @@ void micro3d_state::micro3d_mac2_w(uint32_t data) break; } /* Dot product of SRAM vectors with single SRAM vector */ - case 0x11: cnt += 0x100; + case 0x11: cnt += 0x100; [[fallthrough]]; case 0x10: { micro3d_vtx v2; @@ -302,8 +302,8 @@ void micro3d_state::micro3d_mac2_w(uint32_t data) break; } /* Dot product of SRAM vectors with SRAM vectors */ - case 0x16: cnt += 0x100; - case 0x15: cnt += 0x100; + case 0x16: cnt += 0x100; [[fallthrough]]; + case 0x15: cnt += 0x100; [[fallthrough]]; case 0x14: { for (int i = 0; i <= cnt; ++i) diff --git a/src/mame/video/boogwing.cpp b/src/mame/video/boogwing.cpp index 5095b54e964..d70d8f684d6 100644 --- a/src/mame/video/boogwing.cpp +++ b/src/mame/video/boogwing.cpp @@ -156,26 +156,23 @@ void boogwing_state::mix_boogwing(screen_device &screen, bitmap_rgb32 &bitmap, c switch (priority) { case 0x02: - { - // Sprite vs playfield - if ((pix2 & 0x600) == 0x600) - pri2 = 4; - else if ((pix2 & 0x600) == 0x400) - pri2 = 16; - else - pri2 = 64; - } + // Sprite vs playfield + if ((pix2 & 0x600) == 0x600) + pri2 = 4; + else if ((pix2 & 0x600) == 0x400) + pri2 = 16; + else + pri2 = 64; break; case 0x03: pri3 = 32; + [[fallthrough]]; default: - { - if ((pix2 & 0x400) == 0x400) - pri2 = 16; - else - pri2 = 64; - } + if ((pix2 & 0x400) == 0x400) + pri2 = 16; + else + pri2 = 64; break; } diff --git a/src/mame/video/dynax_blitter_rev2.cpp b/src/mame/video/dynax_blitter_rev2.cpp index 2d5343ae916..237a06876d9 100644 --- a/src/mame/video/dynax_blitter_rev2.cpp +++ b/src/mame/video/dynax_blitter_rev2.cpp @@ -192,13 +192,11 @@ u32 dynax_blitter_rev2_device::blitter_draw(u32 src, int pen, int x, int y) case 0xd: // Skip X pixels x = sx + read_byte(src++); src &= 0xfffff; - /* fall through into next case */ - + [[fallthrough]]; case 0xc: // Draw N pixels cmd = read_byte(src++); src &= 0xfffff; - /* fall through into next case */ - + [[fallthrough]]; case 0xb: case 0xa: case 0x9: diff --git a/src/mame/video/hnayayoi.cpp b/src/mame/video/hnayayoi.cpp index 8afb5f9359b..8e81d73f708 100644 --- a/src/mame/video/hnayayoi.cpp +++ b/src/mame/video/hnayayoi.cpp @@ -143,8 +143,7 @@ void hnayayoi_state::dynax_blitter_rev1_start_w(uint8_t data) return; } x = sx + rom[m_blit_src++]; - /* fall through into next case */ - + [[fallthrough]]; case 0xc: if (m_blit_src >= romlen) { @@ -152,8 +151,7 @@ void hnayayoi_state::dynax_blitter_rev1_start_w(uint8_t data) return; } cmd = rom[m_blit_src++]; - /* fall through into next case */ - + [[fallthrough]]; case 0xb: case 0xa: case 0x9: diff --git a/src/mame/video/konamigx.cpp b/src/mame/video/konamigx.cpp index 3f246d148c8..a024bc3f372 100644 --- a/src/mame/video/konamigx.cpp +++ b/src/mame/video/konamigx.cpp @@ -582,7 +582,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap, // Dadandarn zcode suppression case 1: zcode = 0; - break; + break; // Daisukiss bad shadow filter case 4: @@ -591,7 +591,7 @@ void konamigx_state::konamigx_mixer(screen_device &screen, bitmap_rgb32 &bitmap, // Tokkae shadow masking (INACCURATE) case 5: if (spri < spri_min) spri = spri_min; - break; + break; } /* diff --git a/src/mame/video/midzeus.cpp b/src/mame/video/midzeus.cpp index a75ac49ba13..f03b9d7e3f6 100644 --- a/src/mame/video/midzeus.cpp +++ b/src/mame/video/midzeus.cpp @@ -870,7 +870,6 @@ int midzeus_state::zeus_fifo_process(const uint32_t *data, int numwords) /* 0x28: same for mk4b */ /* 0x30: same for invasn */ case 0x25: - { /* 0x25 is used differently in mk4b. What determines this? */ if (m_is_mk4b) { @@ -879,7 +878,7 @@ int midzeus_state::zeus_fifo_process(const uint32_t *data, int numwords) break; } - } + [[fallthrough]]; case 0x28: case 0x30: if (numwords < 4 || ((data[0] & 0x808000) && numwords < 10)) diff --git a/src/mame/video/rmnimbus.cpp b/src/mame/video/rmnimbus.cpp index c7b4d385d02..4798f151c98 100644 --- a/src/mame/video/rmnimbus.cpp +++ b/src/mame/video/rmnimbus.cpp @@ -222,6 +222,7 @@ void rmnimbus_state::nimbus_video_io_w(offs_t offset, uint16_t data, uint16_t me case 0x09: colours = FILL_WORD(FG_COLOUR); + [[fallthrough]]; case 0x01: m_x = data; break; @@ -233,6 +234,7 @@ void rmnimbus_state::nimbus_video_io_w(offs_t offset, uint16_t data, uint16_t me case 0x0B: colours = FILL_WORD(FG_COLOUR); + [[fallthrough]]; case 0x03: m_x = data; m_y++; @@ -245,12 +247,14 @@ void rmnimbus_state::nimbus_video_io_w(offs_t offset, uint16_t data, uint16_t me case 0x0E: colours = FILL_WORD(FG_COLOUR); + [[fallthrough]]; case 0x06: m_y = data; break; case 0x0F: colours = FILL_WORD(FG_COLOUR); + [[fallthrough]]; case 0x07: m_y = data; m_x++; diff --git a/src/mame/video/stic.cpp b/src/mame/video/stic.cpp index df3499999ce..55331e94abd 100644 --- a/src/mame/video/stic.cpp +++ b/src/mame/video/stic.cpp @@ -1190,7 +1190,7 @@ uint16_t stic_device::read(offs_t offset) case STIC_GMR: m_color_stack_mode = 1; //logerror("Setting color stack mode\n"); - /*** fall through ***/ + [[fallthrough]]; case STIC_DER: return 0x3FFF; case STIC_CSR + CSR0: diff --git a/src/mame/video/taito_f3.cpp b/src/mame/video/taito_f3.cpp index 5318be6c6f9..9656f15d1f1 100644 --- a/src/mame/video/taito_f3.cpp +++ b/src/mame/video/taito_f3.cpp @@ -1382,10 +1382,10 @@ inline void taito_f3_state::draw_scanlines( switch (skip_layer_num) { - case 0: GET_PIXMAP_POINTER(0) - case 1: GET_PIXMAP_POINTER(1) - case 2: GET_PIXMAP_POINTER(2) - case 3: GET_PIXMAP_POINTER(3) + case 0: GET_PIXMAP_POINTER(0) [[fallthrough]]; + case 1: GET_PIXMAP_POINTER(1) [[fallthrough]]; + case 2: GET_PIXMAP_POINTER(2) [[fallthrough]]; + case 3: GET_PIXMAP_POINTER(3) [[fallthrough]]; case 4: GET_PIXMAP_POINTER(4) } @@ -1397,11 +1397,11 @@ inline void taito_f3_state::draw_scanlines( u8 sprite_pri; switch (skip_layer_num) { - case 0: UPDATE_PIXMAP_SP(0) UPDATE_PIXMAP_LP(0) - case 1: UPDATE_PIXMAP_SP(1) UPDATE_PIXMAP_LP(1) - case 2: UPDATE_PIXMAP_SP(2) UPDATE_PIXMAP_LP(2) - case 3: UPDATE_PIXMAP_SP(3) UPDATE_PIXMAP_LP(3) - case 4: UPDATE_PIXMAP_SP(4) UPDATE_PIXMAP_LP(4) + case 0: UPDATE_PIXMAP_SP(0) UPDATE_PIXMAP_LP(0) [[fallthrough]]; + case 1: UPDATE_PIXMAP_SP(1) UPDATE_PIXMAP_LP(1) [[fallthrough]]; + case 2: UPDATE_PIXMAP_SP(2) UPDATE_PIXMAP_LP(2) [[fallthrough]]; + case 3: UPDATE_PIXMAP_SP(3) UPDATE_PIXMAP_LP(3) [[fallthrough]]; + case 4: UPDATE_PIXMAP_SP(4) UPDATE_PIXMAP_LP(4) [[fallthrough]]; case 5: UPDATE_PIXMAP_SP(5) if (!bgcolor) { if (!(m_pval & 0xf0)) { *dsti = 0; break; } } else dpix_bg(bgcolor); @@ -1416,10 +1416,10 @@ inline void taito_f3_state::draw_scanlines( switch (skip_layer_num) { - case 0: CULC_PIXMAP_POINTER(0) - case 1: CULC_PIXMAP_POINTER(1) - case 2: CULC_PIXMAP_POINTER(2) - case 3: CULC_PIXMAP_POINTER(3) + case 0: CULC_PIXMAP_POINTER(0) [[fallthrough]]; + case 1: CULC_PIXMAP_POINTER(1) [[fallthrough]]; + case 2: CULC_PIXMAP_POINTER(2) [[fallthrough]]; + case 3: CULC_PIXMAP_POINTER(3) [[fallthrough]]; case 4: CULC_PIXMAP_POINTER(4) } } @@ -2552,38 +2552,38 @@ inline void taito_f3_state::f3_drawgfx(bitmap_rgb32 &dest_bmp, const rectangle & { int c; u8 p; - case 31: PSET_O NEXT_P - case 30: PSET_O NEXT_P - case 29: PSET_O NEXT_P - case 28: PSET_O NEXT_P - case 27: PSET_O NEXT_P - case 26: PSET_O NEXT_P - case 25: PSET_O NEXT_P - case 24: PSET_O NEXT_P - case 23: PSET_O NEXT_P - case 22: PSET_O NEXT_P - case 21: PSET_O NEXT_P - case 20: PSET_O NEXT_P - case 19: PSET_O NEXT_P - case 18: PSET_O NEXT_P - case 17: PSET_O NEXT_P + case 31: PSET_O NEXT_P [[fallthrough]]; + case 30: PSET_O NEXT_P [[fallthrough]]; + case 29: PSET_O NEXT_P [[fallthrough]]; + case 28: PSET_O NEXT_P [[fallthrough]]; + case 27: PSET_O NEXT_P [[fallthrough]]; + case 26: PSET_O NEXT_P [[fallthrough]]; + case 25: PSET_O NEXT_P [[fallthrough]]; + case 24: PSET_O NEXT_P [[fallthrough]]; + case 23: PSET_O NEXT_P [[fallthrough]]; + case 22: PSET_O NEXT_P [[fallthrough]]; + case 21: PSET_O NEXT_P [[fallthrough]]; + case 20: PSET_O NEXT_P [[fallthrough]]; + case 19: PSET_O NEXT_P [[fallthrough]]; + case 18: PSET_O NEXT_P [[fallthrough]]; + case 17: PSET_O NEXT_P [[fallthrough]]; case 16: PSET_O break; - case 15: PSET_T NEXT_P - case 14: PSET_T NEXT_P - case 13: PSET_T NEXT_P - case 12: PSET_T NEXT_P - case 11: PSET_T NEXT_P - case 10: PSET_T NEXT_P - case 9: PSET_T NEXT_P - case 8: PSET_T NEXT_P - case 7: PSET_T NEXT_P - case 6: PSET_T NEXT_P - case 5: PSET_T NEXT_P - case 4: PSET_T NEXT_P - case 3: PSET_T NEXT_P - case 2: PSET_T NEXT_P - case 1: PSET_T NEXT_P + case 15: PSET_T NEXT_P [[fallthrough]]; + case 14: PSET_T NEXT_P [[fallthrough]]; + case 13: PSET_T NEXT_P [[fallthrough]]; + case 12: PSET_T NEXT_P [[fallthrough]]; + case 11: PSET_T NEXT_P [[fallthrough]]; + case 10: PSET_T NEXT_P [[fallthrough]]; + case 9: PSET_T NEXT_P [[fallthrough]]; + case 8: PSET_T NEXT_P [[fallthrough]]; + case 7: PSET_T NEXT_P [[fallthrough]]; + case 6: PSET_T NEXT_P [[fallthrough]]; + case 5: PSET_T NEXT_P [[fallthrough]]; + case 4: PSET_T NEXT_P [[fallthrough]]; + case 3: PSET_T NEXT_P [[fallthrough]]; + case 2: PSET_T NEXT_P [[fallthrough]]; + case 1: PSET_T NEXT_P [[fallthrough]]; case 0: PSET_T } diff --git a/src/mame/video/vtvideo.cpp b/src/mame/video/vtvideo.cpp index 3429879e962..7480691e83b 100644 --- a/src/mame/video/vtvideo.cpp +++ b/src/mame/video/vtvideo.cpp @@ -843,7 +843,7 @@ int rainbow_video_device::MHFU(int ASK) if (MHFU_FLAG == true) if (MHFU_counter < 254) MHFU_counter++; - + [[fallthrough]]; case MHFU_VALUE: return MHFU_counter; diff --git a/src/osd/modules/debugger/win/debugviewinfo.cpp b/src/osd/modules/debugger/win/debugviewinfo.cpp index 1b824a04b8c..d40684c5f99 100644 --- a/src/osd/modules/debugger/win/debugviewinfo.cpp +++ b/src/osd/modules/debugger/win/debugviewinfo.cpp @@ -604,7 +604,7 @@ LRESULT debugview_info::view_proc(UINT message, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: if (wparam != VK_F10) return DefWindowProc(m_wnd, message, wparam, lparam); - // (fall through) + [[fallthrough]]; case WM_KEYDOWN: { if (m_owner.handle_key(wparam, lparam)) diff --git a/src/osd/modules/debugger/win/debugwininfo.cpp b/src/osd/modules/debugger/win/debugwininfo.cpp index e684e1f32fa..e3926a22139 100644 --- a/src/osd/modules/debugger/win/debugwininfo.cpp +++ b/src/osd/modules/debugger/win/debugwininfo.cpp @@ -300,6 +300,7 @@ bool debugwin_info::handle_command(WPARAM wparam, LPARAM lparam) case ID_RUN_AND_HIDE: debugger().hide_all(); + [[fallthrough]]; case ID_RUN: machine().debugger().console().get_visible_cpu()->debug()->go(); return true; diff --git a/src/osd/modules/debugger/win/editwininfo.cpp b/src/osd/modules/debugger/win/editwininfo.cpp index 61717439c25..bff429a4f7a 100644 --- a/src/osd/modules/debugger/win/editwininfo.cpp +++ b/src/osd/modules/debugger/win/editwininfo.cpp @@ -114,7 +114,7 @@ LRESULT editwin_info::edit_proc(UINT message, WPARAM wparam, LPARAM lparam) case WM_SYSKEYDOWN: if (wparam != VK_F10) return CallWindowProc(m_original_editproc, m_editwnd, message, wparam, lparam); - // (fall through) + [[fallthrough]]; case WM_KEYDOWN: switch (wparam) { diff --git a/src/osd/modules/output/win32_output.cpp b/src/osd/modules/output/win32_output.cpp index 98731b32164..a7a36861989 100644 --- a/src/osd/modules/output/win32_output.cpp +++ b/src/osd/modules/output/win32_output.cpp @@ -231,6 +231,7 @@ static LRESULT CALLBACK output_window_proc(HWND wnd, UINT message, WPARAM wparam output.machine().pause(); else if (lparam == 0 && output.machine().paused()) output.machine().resume(); + break; case IM_MAME_SAVESTATE: if (lparam == 0) output.machine().schedule_load("auto"); diff --git a/src/osd/windows/window.cpp b/src/osd/windows/window.cpp index 5a292f78ff6..176472b28ef 100644 --- a/src/osd/windows/window.cpp +++ b/src/osd/windows/window.cpp @@ -1280,6 +1280,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR // pause the system when we start a menu or resize case WM_ENTERSIZEMOVE: window->m_resize_state = RESIZE_STATE_RESIZING; + [[fallthrough]]; case WM_ENTERMENULOOP: winwindow_ui_pause(window->machine(), TRUE); break; @@ -1287,6 +1288,7 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR // unpause the system when we stop a menu or resize and force a redraw case WM_EXITSIZEMOVE: window->m_resize_state = RESIZE_STATE_PENDING; + [[fallthrough]]; case WM_EXITMENULOOP: winwindow_ui_pause(window->machine(), FALSE); InvalidateRect(wnd, nullptr, FALSE); diff --git a/src/tools/imgtool/modules/amiga.cpp b/src/tools/imgtool/modules/amiga.cpp index a840cac5648..b4f005cb6f5 100644 --- a/src/tools/imgtool/modules/amiga.cpp +++ b/src/tools/imgtool/modules/amiga.cpp @@ -1979,6 +1979,7 @@ static imgtoolerr_t amiga_image_nextenum(imgtool::directory &enumeration, imgtoo case ST_LINKDIR: ent.directory = 1; + [[fallthrough]]; case ST_LINKFILE: { diff --git a/src/tools/srcclean.cpp b/src/tools/srcclean.cpp index 331eab21bae..2cf5bf36519 100644 --- a/src/tools/srcclean.cpp +++ b/src/tools/srcclean.cpp @@ -1247,6 +1247,7 @@ void cpp_cleaner::process_line_comment(char32_t ch) break; } m_parse_state = parse_state::DEFAULT; + [[fallthrough]]; default: output_character(ch); } @@ -1350,12 +1351,14 @@ void cpp_cleaner::process_numeric(char32_t ch) case UPPERCASE_B: ++m_uppercase_radix; ch = LOWERCASE_B; + [[fallthrough]]; case LOWERCASE_B: m_radix = 2U; break; case UPPERCASE_X: ++m_uppercase_radix; ch = LOWERCASE_X; + [[fallthrough]]; case LOWERCASE_X: m_radix = 16U; break; @@ -1616,6 +1619,7 @@ void lua_cleaner::process_default(char32_t ch) m_block_line = m_input_line; m_block_level = m_long_bracket_level; m_parse_state = parse_state::LONG_STRING_CONSTANT; + [[fallthrough]]; default: m_long_bracket_level = -1; } @@ -1643,6 +1647,7 @@ void lua_cleaner::process_short_comment(char32_t ch) m_block_level = m_long_bracket_level; m_parse_state = parse_state::LONG_COMMENT; set_tab_limit(); + [[fallthrough]]; default: m_long_bracket_level = -1; } |