From fce6de9d16ffdc52fcbd45321d7730f9066e08e4 Mon Sep 17 00:00:00 2001 From: dxl <41547105+hp9k@users.noreply.github.com> Date: Sun, 7 Oct 2018 16:52:39 +0200 Subject: [PATCH] hp_dio: add namespace (nw) (#3939) * hp_dio: add namespace (nw) * hp_dio: add comment on closing namespace brackets (nw) --- src/devices/bus/hp_dio/hp98543.cpp | 9 ++++++-- src/devices/bus/hp_dio/hp98543.h | 8 +++++++- src/devices/bus/hp_dio/hp98544.cpp | 7 +++++-- src/devices/bus/hp_dio/hp98544.h | 8 +++++++- src/devices/bus/hp_dio/hp98603a.cpp | 8 +++++++- src/devices/bus/hp_dio/hp98603a.h | 8 +++++++- src/devices/bus/hp_dio/hp98603b.cpp | 8 +++++++- src/devices/bus/hp_dio/hp98603b.h | 8 +++++++- src/devices/bus/hp_dio/hp98644.cpp | 7 ++++++- src/devices/bus/hp_dio/hp98644.h | 8 +++++++- src/devices/bus/hp_dio/hp_dio.cpp | 27 +++++++++--------------- src/devices/bus/hp_dio/hp_dio.h | 32 ++++++++++++++--------------- 12 files changed, 93 insertions(+), 45 deletions(-) diff --git a/src/devices/bus/hp_dio/hp98543.cpp b/src/devices/bus/hp_dio/hp98543.cpp index b9d75b5a7eb..00de8cc43f9 100644 --- a/src/devices/bus/hp_dio/hp98543.cpp +++ b/src/devices/bus/hp_dio/hp98543.cpp @@ -21,7 +21,10 @@ ROM_START(hp98543) ROM_LOAD("1818-3907.bin", 0x000000, 0x002000, CRC(5e2bf02a) SHA1(9ba9391cf39624ef8027ce42c84e100344b2a2b8)) ROM_END -DEFINE_DEVICE_TYPE(HPDIO_98543, dio16_98543_device, "dio98543", "HP98543 medium-res color DIO video card") +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 { MACHINE_CONFIG_START(dio16_98543_device::device_add_mconfig) MCFG_SCREEN_ADD(HP98543_SCREEN_NAME, RASTER) @@ -53,7 +56,6 @@ MACHINE_CONFIG_START(dio16_98543_device::device_add_mconfig) MCFG_DEVICE_ADD("nereid", NEREID, 0) MACHINE_CONFIG_END - const tiny_rom_entry *dio16_98543_device::device_rom_region() const { return ROM_NAME(hp98543); @@ -190,3 +192,6 @@ uint32_t dio16_98543_device::screen_update(screen_device &screen, bitmap_rgb32 & } return 0; } + +} // 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 c1b9a5762bf..e676cfe5867 100644 --- a/src/devices/bus/hp_dio/hp98543.h +++ b/src/devices/bus/hp_dio/hp98543.h @@ -11,6 +11,9 @@ #include "video/nereid.h" #include "machine/ram.h" +namespace bus { + namespace hp_dio { + class dio16_98543_device : public device_t, public device_dio16_card_interface, @@ -57,7 +60,10 @@ private: }; +} // namespace bus::hp_dio +} // namespace bus + // device type definition -DECLARE_DEVICE_TYPE(HPDIO_98543, dio16_98543_device) +DECLARE_DEVICE_TYPE_NS(HPDIO_98543, bus::hp_dio, dio16_98543_device) #endif // MAME_BUS_HPDIO_98543_H diff --git a/src/devices/bus/hp_dio/hp98544.cpp b/src/devices/bus/hp_dio/hp98544.cpp index 824a393ddd2..b797c859df4 100644 --- a/src/devices/bus/hp_dio/hp98544.cpp +++ b/src/devices/bus/hp_dio/hp98544.cpp @@ -24,8 +24,10 @@ ROM_END // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(HPDIO_98544, dio16_98544_device, "dio98544", "HP98544 high-res monochrome DIO video card") +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 { //------------------------------------------------- // device_add_mconfig - add device configuration @@ -156,4 +158,5 @@ uint32_t dio16_98544_device::screen_update(screen_device &screen, bitmap_rgb32 & return 0; } - +} // 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 74e12905834..ab53db6933c 100644 --- a/src/devices/bus/hp_dio/hp98544.h +++ b/src/devices/bus/hp_dio/hp98544.h @@ -14,6 +14,9 @@ // ======================> dio16_98544_device +namespace bus { + namespace hp_dio { + class dio16_98544_device : public device_t, public device_dio16_card_interface, @@ -52,7 +55,10 @@ private: required_shared_ptr m_vram; }; +} // namespace bus::hp_dio +} // namespace bus + // device type definition -DECLARE_DEVICE_TYPE(HPDIO_98544, dio16_98544_device) +DECLARE_DEVICE_TYPE_NS(HPDIO_98544, bus::hp_dio, dio16_98544_device) #endif // MAME_BUS_HPDIO_98544_H diff --git a/src/devices/bus/hp_dio/hp98603a.cpp b/src/devices/bus/hp_dio/hp98603a.cpp index 330d051b735..bcd5fe3536c 100644 --- a/src/devices/bus/hp_dio/hp98603a.cpp +++ b/src/devices/bus/hp_dio/hp98603a.cpp @@ -9,10 +9,13 @@ #include "emu.h" #include "hp98603a.h" -DEFINE_DEVICE_TYPE(HPDIO_98603A, dio16_98603a_device, "dio98603a", "HP98603A BASIC 4.0 ROM card") +DEFINE_DEVICE_TYPE_NS(HPDIO_98603A, bus::hp_dio, dio16_98603a_device, "dio98603a", "HP98603A BASIC 4.0 ROM card") #define HP98603A_ROM_REGION "98603a_rom" +namespace bus { + namespace hp_dio { + ROM_START(hp98603a) ROM_REGION(0x80000, HP98603A_ROM_REGION, 0) ROM_LOAD16_BYTE("98603_80001.bin", 0x00001, 32768, CRC(5d8c9657) SHA1(f5d89e7f8a61072f362532d1b5e05f5b5e3f42b3)) @@ -75,3 +78,6 @@ READ16_MEMBER(dio16_98603a_device::rom_r) WRITE16_MEMBER(dio16_98603a_device::rom_w) { } + +} // 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 30a501b1b39..1d08cf83e0b 100644 --- a/src/devices/bus/hp_dio/hp98603a.h +++ b/src/devices/bus/hp_dio/hp98603a.h @@ -8,6 +8,9 @@ #include "hp_dio.h" +namespace bus { + namespace hp_dio { + class dio16_98603a_device : public device_t, public device_dio16_card_interface @@ -33,6 +36,9 @@ private: uint8_t *m_rom; }; -DECLARE_DEVICE_TYPE(HPDIO_98603A, dio16_98603a_device) +} // namespace bus::hp_dio +} // namespace bus + +DECLARE_DEVICE_TYPE_NS(HPDIO_98603A, bus::hp_dio, dio16_98603a_device) #endif // MAME_BUS_HPDIO_98603A_H diff --git a/src/devices/bus/hp_dio/hp98603b.cpp b/src/devices/bus/hp_dio/hp98603b.cpp index 4a91ddcdb51..4da45470d0e 100644 --- a/src/devices/bus/hp_dio/hp98603b.cpp +++ b/src/devices/bus/hp_dio/hp98603b.cpp @@ -9,10 +9,13 @@ #include "emu.h" #include "hp98603b.h" -DEFINE_DEVICE_TYPE(HPDIO_98603B, dio16_98603b_device, "dio98603b", "HP98603 BASIC ROM card") +DEFINE_DEVICE_TYPE_NS(HPDIO_98603B, bus::hp_dio, dio16_98603b_device, "dio98603b", "HP98603 BASIC ROM card") #define HP98603B_ROM_REGION "98603b_rom" +namespace bus { + namespace hp_dio { + ROM_START(hp98603b) ROM_REGION(0x100000, HP98603B_ROM_REGION, 0) @@ -69,3 +72,6 @@ READ16_MEMBER(dio16_98603b_device::rom_r) WRITE16_MEMBER(dio16_98603b_device::rom_w) { } + +} // 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 8d1780432a5..ea16286c98e 100644 --- a/src/devices/bus/hp_dio/hp98603b.h +++ b/src/devices/bus/hp_dio/hp98603b.h @@ -8,6 +8,9 @@ #include "hp_dio.h" +namespace bus { + namespace hp_dio { + class dio16_98603b_device : public device_t, public device_dio16_card_interface @@ -33,6 +36,9 @@ private: uint8_t *m_rom; }; -DECLARE_DEVICE_TYPE(HPDIO_98603B, dio16_98603b_device) +} // namespace bus::hp_dio +} // namespace bus + +DECLARE_DEVICE_TYPE_NS(HPDIO_98603B, bus::hp_dio, dio16_98603b_device) #endif // MAME_BUS_HPDIO_98603B_H diff --git a/src/devices/bus/hp_dio/hp98644.cpp b/src/devices/bus/hp_dio/hp98644.cpp index 5ac97e3826b..09d70616ae7 100644 --- a/src/devices/bus/hp_dio/hp98644.cpp +++ b/src/devices/bus/hp_dio/hp98644.cpp @@ -15,8 +15,10 @@ // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(HPDIO_98644, dio16_98644_device, "dio98644", "HP98644A Asynchronous Serial Interface") +DEFINE_DEVICE_TYPE_NS(HPDIO_98644, bus::hp_dio, dio16_98644_device, "dio98644", "HP98644A Asynchronous Serial Interface") +namespace bus { + namespace hp_dio { //------------------------------------------------- // device_add_mconfig - add device configuration @@ -226,3 +228,6 @@ WRITE16_MEMBER(dio16_98644_device::io_w) break; } } + +} // 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 94bb4437fae..c4ad925fc30 100644 --- a/src/devices/bus/hp_dio/hp98644.h +++ b/src/devices/bus/hp_dio/hp98644.h @@ -15,6 +15,9 @@ // ======================> dio16_98644_device +namespace bus { + namespace hp_dio { + class dio16_98644_device : public device_t, public device_dio16_card_interface @@ -49,7 +52,10 @@ private: uint8_t m_data; }; +} // namespace bus::hp_dio +} // namespace bus + // device type definition -DECLARE_DEVICE_TYPE(HPDIO_98644, dio16_98644_device) +DECLARE_DEVICE_TYPE_NS(HPDIO_98644, bus::hp_dio, dio16_98644_device) #endif // MAME_BUS_HPDIO_98644_H diff --git a/src/devices/bus/hp_dio/hp_dio.cpp b/src/devices/bus/hp_dio/hp_dio.cpp index e6bccba3460..e487fa5b396 100644 --- a/src/devices/bus/hp_dio/hp_dio.cpp +++ b/src/devices/bus/hp_dio/hp_dio.cpp @@ -13,7 +13,13 @@ // GLOBAL VARIABLES //************************************************************************** -DEFINE_DEVICE_TYPE(DIO16_SLOT, dio16_slot_device, "dio16_slot", "16-bit DIO slot") +DEFINE_DEVICE_TYPE_NS(DIO16_SLOT, bus::hp_dio, dio16_slot_device, "dio16_slot", "16-bit DIO slot") +DEFINE_DEVICE_TYPE_NS(DIO32_SLOT, bus::hp_dio, dio32_slot_device, "dio32_slot", "32-bit DIO-II 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 { //************************************************************************** // LIVE DEVICE @@ -52,14 +58,6 @@ void dio16_slot_device::device_start() throw emu_fatalerror("dio16_slot_device: card device %s (%s) does not implement device_dio16_card_interface\n", card->tag(), card->name()); } - - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - -DEFINE_DEVICE_TYPE(DIO32_SLOT, dio32_slot_device, "dio32_slot", "32-bit DIO-II slot") - //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -81,13 +79,6 @@ void dio32_slot_device::device_start() dio16_slot_device::device_start(); } - -//************************************************************************** -// GLOBAL VARIABLES -//************************************************************************** - -DEFINE_DEVICE_TYPE(DIO16, dio16_device, "dio16", "16-bit DIO bus") - //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -200,7 +191,7 @@ void device_dio16_card_interface::interface_pre_start() // DIO32 DEVICE //************************************************************************** -DEFINE_DEVICE_TYPE(DIO32, dio32_device, "dio32", "32-bit DIO-II bus") + dio32_device::dio32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : dio16_device(mconfig, DIO32, tag, owner, clock) @@ -233,3 +224,5 @@ void device_dio32_card_interface::interface_pre_start() if (m_dio_dev && !dynamic_cast(m_dio_dev)) throw emu_fatalerror("device_dio32_card_interface: DIO32 device %s (%s) in DIO16 slot %s\n", device().tag(), device().name(), m_dio_dev->name()); } +} +} diff --git a/src/devices/bus/hp_dio/hp_dio.h b/src/devices/bus/hp_dio/hp_dio.h index b63b44c0482..9596c15107d 100644 --- a/src/devices/bus/hp_dio/hp_dio.h +++ b/src/devices/bus/hp_dio/hp_dio.h @@ -17,26 +17,28 @@ #pragma once +namespace bus { + namespace hp_dio { //************************************************************************** // INTERFACE CONFIGURATION MACROS //************************************************************************** #define MCFG_DIO16_CPU(_cputag) \ - downcast(*device).set_cputag(_cputag); + downcast(*device).set_cputag(_cputag); #define MCFG_DIO32_CPU(_cputag) \ - downcast(*device).set_cputag(_cputag); + downcast(*device).set_cputag(_cputag); #define MCFG_ISA_OUT_IRQ3_CB(_devcb) \ - downcast(*device).set_out_irq3_callback(DEVCB_##_devcb); + downcast(*device).set_out_irq3_callback(DEVCB_##_devcb); #define MCFG_ISA_OUT_IRQ4_CB(_devcb) \ - downcast(*device).set_out_irq4_callback(DEVCB_##_devcb); + downcast(*device).set_out_irq4_callback(DEVCB_##_devcb); #define MCFG_ISA_OUT_IRQ5_CB(_devcb) \ - downcast(*device).set_out_irq5_callback(DEVCB_##_devcb); + downcast(*device).set_out_irq5_callback(DEVCB_##_devcb); #define MCFG_ISA_OUT_IRQ6_CB(_devcb) \ - downcast(*device).set_out_irq6_callback(DEVCB_##_devcb); + downcast(*device).set_out_irq6_callback(DEVCB_##_devcb); //************************************************************************** // TYPE DEFINITIONS @@ -75,8 +77,6 @@ protected: required_device m_dio; }; -// device type definition -DECLARE_DEVICE_TYPE(DIO16_SLOT, dio16_slot_device) class device_dio16_card_interface; // ======================> dio16_device @@ -133,10 +133,6 @@ protected: devcb_write_line m_out_irq6_cb; }; - -// device type definition -DECLARE_DEVICE_TYPE(DIO16, dio16_device) - // ======================> device_dio16_card_interface // class representing interface-specific live dio16 card @@ -189,8 +185,6 @@ protected: }; -// device type definition -DECLARE_DEVICE_TYPE(DIO32_SLOT, dio32_slot_device) // ======================> dio32_device class dio32_device : public dio16_device @@ -207,8 +201,6 @@ protected: }; -// device type definition -DECLARE_DEVICE_TYPE(DIO32, dio32_device) // ======================> device_dio32_card_interface @@ -227,5 +219,13 @@ protected: dio32_device &dio() { assert(m_dio_dev); return downcast(*m_dio_dev); } }; +} // namespace bus::hp_dio +} // namespace bus + +// device type definition +DECLARE_DEVICE_TYPE_NS(DIO16_SLOT, bus::hp_dio, dio16_slot_device) +DECLARE_DEVICE_TYPE_NS(DIO32, bus::hp_dio, dio32_device) +DECLARE_DEVICE_TYPE_NS(DIO32_SLOT, bus::hp_dio, dio32_slot_device) +DECLARE_DEVICE_TYPE_NS(DIO16, bus::hp_dio, dio16_device) #endif // MAME_BUS_HPDIO_HPDIO_H