summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/nes
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-05-07 23:18:47 +1000
committer Vas Crabb <vas@vastheman.com>2017-05-14 21:44:11 +1000
commit0f0d39ef81562c75e79176dd3bebb1e491ca39d5 (patch)
tree201cee7fdf55ee800f83859a92efd2cfe66cf2b3 /src/devices/bus/nes
parente6c4be2b4d71c7a6c95be0bae111eb416ff0f9e7 (diff)
Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are: * Short name, full name and source file are no longer members of device_t, they are part of the device type * MACHINE_COFIG_START no longer needs a driver class * MACHINE_CONFIG_DERIVED_CLASS is no longer necessary * Specify the state class you want in the GAME/COMP/CONS line * The compiler will work out the base class where the driver init member is declared * There is one static device type object per driver rather than one per machine configuration Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type. * DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders. * DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type. Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types. * These macros declare storage for the static data, and instantiate the device type and device finder templates. The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate. Things I've actually messed with substantially: * More descriptive names for a lot of devices * Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes * Changed DECO BSMT2000 ready callback into a device delegate * Untangled Microprose 3D noise from driver state * Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices * Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly * Started to break out common parts of Samsung ARM SoC devices * Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++ * Tried to make Z180 table allocation/setup a bit safer * Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant * Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size * Imporved encapsulation of Z80DART channels * Refactored the SPC7110 bit table generator loop to make it more readable * Added wrappers for SNES PPU operations so members can be made protected * Factored out some boilerplate for YM chips with PSG * toaplan2 gfx * stic/intv resolution * Video System video * Out Run/Y-board sprite alignment * GIC video hookup * Amstrad CPC ROM box members * IQ151 ROM cart region * MSX cart IRQ callback resolution time * SMS passthrough control devices starting subslots I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo). And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros. It feels like an uphill battle trying to get this stuff under control while more of it's added.
Diffstat (limited to 'src/devices/bus/nes')
-rw-r--r--src/devices/bus/nes/2a03pur.cpp4
-rw-r--r--src/devices/bus/nes/2a03pur.h14
-rw-r--r--src/devices/bus/nes/act53.cpp8
-rw-r--r--src/devices/bus/nes/act53.h20
-rw-r--r--src/devices/bus/nes/aladdin.cpp47
-rw-r--r--src/devices/bus/nes/aladdin.h31
-rw-r--r--src/devices/bus/nes/ave.cpp14
-rw-r--r--src/devices/bus/nes/ave.h35
-rw-r--r--src/devices/bus/nes/bandai.cpp50
-rw-r--r--src/devices/bus/nes/bandai.h60
-rw-r--r--src/devices/bus/nes/benshieng.cpp8
-rw-r--r--src/devices/bus/nes/benshieng.h14
-rw-r--r--src/devices/bus/nes/bootleg.cpp118
-rw-r--r--src/devices/bus/nes/bootleg.h201
-rw-r--r--src/devices/bus/nes/camerica.cpp16
-rw-r--r--src/devices/bus/nes/camerica.h35
-rw-r--r--src/devices/bus/nes/cne.cpp12
-rw-r--r--src/devices/bus/nes/cne.h35
-rw-r--r--src/devices/bus/nes/cony.cpp34
-rw-r--r--src/devices/bus/nes/cony.h34
-rw-r--r--src/devices/bus/nes/datach.cpp49
-rw-r--r--src/devices/bus/nes/datach.h31
-rw-r--r--src/devices/bus/nes/discrete.cpp16
-rw-r--r--src/devices/bus/nes/discrete.h41
-rw-r--r--src/devices/bus/nes/disksys.cpp17
-rw-r--r--src/devices/bus/nes/disksys.h24
-rw-r--r--src/devices/bus/nes/event.cpp18
-rw-r--r--src/devices/bus/nes/event.h27
-rw-r--r--src/devices/bus/nes/ggenie.cpp10
-rw-r--r--src/devices/bus/nes/ggenie.h16
-rw-r--r--src/devices/bus/nes/henggedianzi.cpp14
-rw-r--r--src/devices/bus/nes/henggedianzi.h36
-rw-r--r--src/devices/bus/nes/hes.cpp4
-rw-r--r--src/devices/bus/nes/hes.h16
-rw-r--r--src/devices/bus/nes/hosenkan.cpp20
-rw-r--r--src/devices/bus/nes/hosenkan.h20
-rw-r--r--src/devices/bus/nes/irem.cpp24
-rw-r--r--src/devices/bus/nes/irem.h50
-rw-r--r--src/devices/bus/nes/jaleco.cpp86
-rw-r--r--src/devices/bus/nes/jaleco.h98
-rw-r--r--src/devices/bus/nes/jy.cpp28
-rw-r--r--src/devices/bus/nes/jy.h30
-rw-r--r--src/devices/bus/nes/kaiser.cpp52
-rw-r--r--src/devices/bus/nes/kaiser.h92
-rw-r--r--src/devices/bus/nes/karastudio.cpp32
-rw-r--r--src/devices/bus/nes/karastudio.h33
-rw-r--r--src/devices/bus/nes/konami.cpp38
-rw-r--r--src/devices/bus/nes/konami.h71
-rw-r--r--src/devices/bus/nes/legacy.cpp20
-rw-r--r--src/devices/bus/nes/legacy.h35
-rw-r--r--src/devices/bus/nes/mmc1.cpp24
-rw-r--r--src/devices/bus/nes/mmc1.h30
-rw-r--r--src/devices/bus/nes/mmc2.cpp19
-rw-r--r--src/devices/bus/nes/mmc2.h23
-rw-r--r--src/devices/bus/nes/mmc3.cpp41
-rw-r--r--src/devices/bus/nes/mmc3.h37
-rw-r--r--src/devices/bus/nes/mmc3_clones.cpp176
-rw-r--r--src/devices/bus/nes/mmc3_clones.h216
-rw-r--r--src/devices/bus/nes/mmc5.cpp16
-rw-r--r--src/devices/bus/nes/mmc5.h16
-rw-r--r--src/devices/bus/nes/multigame.cpp222
-rw-r--r--src/devices/bus/nes/multigame.h386
-rw-r--r--src/devices/bus/nes/namcot.cpp48
-rw-r--r--src/devices/bus/nes/namcot.h63
-rw-r--r--src/devices/bus/nes/nanjing.cpp12
-rw-r--r--src/devices/bus/nes/nanjing.h19
-rw-r--r--src/devices/bus/nes/nes_carts.cpp55
-rw-r--r--src/devices/bus/nes/nes_carts.h63
-rw-r--r--src/devices/bus/nes/nes_slot.cpp68
-rw-r--r--src/devices/bus/nes/nes_slot.h15
-rw-r--r--src/devices/bus/nes/ntdec.cpp12
-rw-r--r--src/devices/bus/nes/ntdec.h27
-rw-r--r--src/devices/bus/nes/nxrom.cpp62
-rw-r--r--src/devices/bus/nes/nxrom.h96
-rw-r--r--src/devices/bus/nes/pirate.cpp84
-rw-r--r--src/devices/bus/nes/pirate.h146
-rw-r--r--src/devices/bus/nes/pt554.cpp6
-rw-r--r--src/devices/bus/nes/pt554.h12
-rw-r--r--src/devices/bus/nes/racermate.cpp8
-rw-r--r--src/devices/bus/nes/racermate.h11
-rw-r--r--src/devices/bus/nes/rcm.cpp22
-rw-r--r--src/devices/bus/nes/rcm.h50
-rw-r--r--src/devices/bus/nes/rexsoft.cpp14
-rw-r--r--src/devices/bus/nes/rexsoft.h25
-rw-r--r--src/devices/bus/nes/sachen.cpp70
-rw-r--r--src/devices/bus/nes/sachen.h105
-rw-r--r--src/devices/bus/nes/somari.cpp16
-rw-r--r--src/devices/bus/nes/somari.h18
-rw-r--r--src/devices/bus/nes/subor.cpp20
-rw-r--r--src/devices/bus/nes/subor.h28
-rw-r--r--src/devices/bus/nes/sunsoft.cpp44
-rw-r--r--src/devices/bus/nes/sunsoft.h64
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.cpp29
-rw-r--r--src/devices/bus/nes/sunsoft_dcs.h33
-rw-r--r--src/devices/bus/nes/taito.cpp30
-rw-r--r--src/devices/bus/nes/taito.h45
-rw-r--r--src/devices/bus/nes/tengen.cpp22
-rw-r--r--src/devices/bus/nes/tengen.h34
-rw-r--r--src/devices/bus/nes/txc.cpp24
-rw-r--r--src/devices/bus/nes/txc.h40
-rw-r--r--src/devices/bus/nes/waixing.cpp102
-rw-r--r--src/devices/bus/nes/waixing.h123
-rw-r--r--src/devices/bus/nes/zemina.cpp4
-rw-r--r--src/devices/bus/nes/zemina.h4
104 files changed, 2658 insertions, 2159 deletions
diff --git a/src/devices/bus/nes/2a03pur.cpp b/src/devices/bus/nes/2a03pur.cpp
index 8382814efe0..43ff34758e7 100644
--- a/src/devices/bus/nes/2a03pur.cpp
+++ b/src/devices/bus/nes/2a03pur.cpp
@@ -31,11 +31,11 @@
// constructor
//-------------------------------------------------
-const device_type NES_2A03PURITANS = device_creator<nes_2a03pur_device>;
+DEFINE_DEVICE_TYPE(NES_2A03PURITANS, nes_2a03pur_device, "nes_2a03pur", "NES Cart 2A03 Puritans Album PCB")
nes_2a03pur_device::nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_2A03PURITANS, "NES Cart 2A03 Puritans Album PCB", tag, owner, clock, "nes_2a03pur", __FILE__)
+ : nes_nrom_device(mconfig, NES_2A03PURITANS, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/2a03pur.h b/src/devices/bus/nes/2a03pur.h
index 755957c0f95..d17443d8963 100644
--- a/src/devices/bus/nes/2a03pur.h
+++ b/src/devices/bus/nes/2a03pur.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_2A03PUR_H
-#define __NES_2A03PUR_H
+#ifndef MAME_BUS_NES_2A03PUR_H
+#define MAME_BUS_NES_2A03PUR_H
+
+#pragma once
#include "nxrom.h"
@@ -14,13 +16,15 @@ public:
// construction/destruction
nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[8];
};
@@ -30,4 +34,4 @@ private:
// device type definition
extern const device_type NES_2A03PURITANS;
-#endif
+#endif // MAME_BUS_NES_2A03PUR_H
diff --git a/src/devices/bus/nes/act53.cpp b/src/devices/bus/nes/act53.cpp
index 6dce9e066c3..f163be268fd 100644
--- a/src/devices/bus/nes/act53.cpp
+++ b/src/devices/bus/nes/act53.cpp
@@ -29,13 +29,13 @@
// constructor
//-------------------------------------------------
-const device_type NES_ACTION53 = device_creator<nes_action53_device>;
+DEFINE_DEVICE_TYPE(NES_ACTION53, nes_action53_device, "nes_action53", "NES Cart Action 53 PCB")
nes_action53_device::nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_ACTION53, "NES Cart Action 53 PCB", tag, owner, clock, "nes_action53", __FILE__),
- m_sel(0)
- {
+ : nes_nrom_device(mconfig, NES_ACTION53, tag, owner, clock)
+ , m_sel(0)
+{
}
diff --git a/src/devices/bus/nes/act53.h b/src/devices/bus/nes/act53.h
index 3d9c8d53155..1f299a5a5da 100644
--- a/src/devices/bus/nes/act53.h
+++ b/src/devices/bus/nes/act53.h
@@ -1,12 +1,12 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_ACTION53_H
-#define __NES_ACTION53_H
+#ifndef MAME_BUS_NES_ACT53_H
+#define MAME_BUS_NES_ACT53_H
#include "nxrom.h"
-// ======================> nes_racermate_device
+// ======================> nes_action53_device
class nes_action53_device : public nes_nrom_device
{
@@ -14,13 +14,15 @@ public:
// construction/destruction
nes_action53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_prg();
void update_mirr();
@@ -28,11 +30,7 @@ private:
uint8_t m_reg[4];
};
-
-
-
-
// device type definition
-extern const device_type NES_ACTION53;
+DECLARE_DEVICE_TYPE(NES_ACTION53, nes_action53_device)
-#endif
+#endif // MAME_BUS_NES_ACT53_H
diff --git a/src/devices/bus/nes/aladdin.cpp b/src/devices/bus/nes/aladdin.cpp
index 1e30880c03f..30adbeca9a0 100644
--- a/src/devices/bus/nes/aladdin.cpp
+++ b/src/devices/bus/nes/aladdin.cpp
@@ -39,12 +39,12 @@
//-------------------------------------------------
aladdin_cart_interface::aladdin_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr),
- m_rom_size(0),
- m_lobank(0),
- m_hibank(0),
- m_rom_mask(0xff)
+ : device_slot_card_interface(mconfig, device)
+ , m_rom(nullptr)
+ , m_rom_size(0)
+ , m_lobank(0)
+ , m_hibank(0)
+ , m_rom_mask(0xff)
{
}
@@ -64,12 +64,13 @@ READ8_MEMBER(aladdin_cart_interface::read)
// sub-cart slot device
//-------------------------------------------------
-const device_type NES_ALADDIN_SLOT = device_creator<nes_aladdin_slot_device>;
+DEFINE_DEVICE_TYPE(NES_ALADDIN_SLOT, nes_aladdin_slot_device, "nes_ade_slot", "NES Aladdin Deck Enhancer Cartridge Slot")
-nes_aladdin_slot_device::nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, NES_ALADDIN_SLOT, "NES Aladdin Deck Enhancer Cartridge Slot", tag, owner, clock, "nes_ade_slot", __FILE__),
- device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this), m_cart(nullptr)
+nes_aladdin_slot_device::nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, NES_ALADDIN_SLOT, tag, owner, clock)
+ , device_image_interface(mconfig, *this)
+ , device_slot_interface(mconfig, *this)
+ , m_cart(nullptr)
{
}
@@ -172,24 +173,24 @@ ROM_START( ade_rom )
ROM_REGION(0x40000, "aderom", ROMREGION_ERASEFF)
ROM_END
-const device_type NES_ALGN_ROM = device_creator<nes_algn_rom_device>;
-const device_type NES_ALGQ_ROM = device_creator<nes_algq_rom_device>;
+DEFINE_DEVICE_TYPE(NES_ALGN_ROM, nes_algn_rom_device, "nes_algn_rom", "NES Aladdin Deck Enhancer ALGN ROM")
+DEFINE_DEVICE_TYPE(NES_ALGQ_ROM, nes_algq_rom_device, "nes_algq_rom", "NES Aladdin Deck Enhancer ALGQ ROM")
-nes_algn_rom_device::nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- aladdin_cart_interface( mconfig, *this )
+nes_algn_rom_device::nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , aladdin_cart_interface(mconfig, *this)
{
}
nes_algn_rom_device::nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NES_ALGN_ROM, "NES Aladdin Deck Enhancer ALGN ROM", tag, owner, clock, "nes_algn_rom", __FILE__),
- aladdin_cart_interface( mconfig, *this )
+ : nes_algn_rom_device(mconfig, NES_ALGN_ROM, tag, owner, clock)
{
}
nes_algq_rom_device::nes_algq_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_algn_rom_device(mconfig, NES_ALGQ_ROM, "NES Aladdin Deck Enhancer ALGQ ROM", tag, owner, clock, "nes_algq_rom", __FILE__), m_bank_base(0)
- {
+ : nes_algn_rom_device(mconfig, NES_ALGQ_ROM, tag, owner, clock)
+ , m_bank_base(0)
+{
}
void nes_algn_rom_device::device_start()
@@ -260,11 +261,11 @@ void nes_algq_rom_device::write_prg(uint32_t offset, uint8_t data)
//
//-----------------------------------------------
-const device_type NES_ALADDIN = device_creator<nes_aladdin_device>;
+DEFINE_DEVICE_TYPE(NES_ALADDIN, nes_aladdin_device, "nes_aladdin", "NES Cart Camerica Aladdin PCB")
nes_aladdin_device::nes_aladdin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_ALADDIN, "NES Cart Camerica Aladdin PCB", tag, owner, clock, "nes_aladdin", __FILE__),
- m_subslot(*this, "ade_slot")
+ : nes_nrom_device(mconfig, NES_ALADDIN, tag, owner, clock)
+ , m_subslot(*this, "ade_slot")
{
}
diff --git a/src/devices/bus/nes/aladdin.h b/src/devices/bus/nes/aladdin.h
index 6384ec0f95a..80262b637d9 100644
--- a/src/devices/bus/nes/aladdin.h
+++ b/src/devices/bus/nes/aladdin.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_ALADDIN_H
-#define __NES_ALADDIN_H
+#ifndef MAME_BUS_NES_ALADDIN_H
+#define MAME_BUS_NES_ALADDIN_H
+
+#pragma once
#include "nxrom.h"
#include "softlist_dev.h"
@@ -19,7 +21,6 @@ class aladdin_cart_interface : public device_slot_card_interface
{
public:
// construction/destruction
- aladdin_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~aladdin_cart_interface();
// reading and writing
@@ -30,6 +31,8 @@ public:
virtual void write_prg(uint32_t offset, uint8_t data) { }
protected:
+ aladdin_cart_interface(const machine_config &mconfig, device_t &device);
+
// internal state
uint8_t *m_rom;
uint32_t m_rom_size;
@@ -38,10 +41,13 @@ protected:
// ======================> nes_aladdin_slot_device
+class nes_aladdin_device;
+
class nes_aladdin_slot_device : public device_t,
public device_image_interface,
public device_slot_interface
{
+ friend class nes_aladdin_device;
public:
// construction/destruction
nes_aladdin_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -69,11 +75,12 @@ public:
virtual DECLARE_READ8_MEMBER(read);
void write_prg(uint32_t offset, uint8_t data) { if (m_cart) m_cart->write_prg(offset, data); }
+protected:
aladdin_cart_interface* m_cart;
};
// device type definition
-extern const device_type NES_ALADDIN_SLOT;
+DECLARE_DEVICE_TYPE(NES_ALADDIN_SLOT, nes_aladdin_slot_device)
#define MCFG_ALADDIN_MINICART_ADD(_tag, _slot_intf) \
@@ -94,7 +101,6 @@ class nes_algn_rom_device : public device_t,
{
public:
// construction/destruction
- nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_algn_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// optional information overrides
@@ -103,6 +109,8 @@ public:
virtual void write_prg(uint32_t offset, uint8_t data) override;
protected:
+ nes_algn_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
@@ -129,8 +137,8 @@ protected:
};
// device type definition
-extern const device_type NES_ALGN_ROM;
-extern const device_type NES_ALGQ_ROM;
+DECLARE_DEVICE_TYPE(NES_ALGN_ROM, nes_algn_rom_device)
+DECLARE_DEVICE_TYPE(NES_ALGQ_ROM, nes_algq_rom_device)
//-----------------------------------------------
@@ -147,8 +155,6 @@ public:
// construction/destruction
nes_aladdin_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -156,11 +162,14 @@ public:
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
required_device<nes_aladdin_slot_device> m_subslot;
};
// device type definition
-extern const device_type NES_ALADDIN;
+DECLARE_DEVICE_TYPE(NES_ALADDIN, nes_aladdin_device)
-#endif
+#endif // MAME_BUS_NES_ALADDIN_H
diff --git a/src/devices/bus/nes/ave.cpp b/src/devices/bus/nes/ave.cpp
index fcc757b7651..823d66e2e57 100644
--- a/src/devices/bus/nes/ave.cpp
+++ b/src/devices/bus/nes/ave.cpp
@@ -33,24 +33,24 @@
// constructor
//-------------------------------------------------
-const device_type NES_NINA001 = device_creator<nes_nina001_device>;
-const device_type NES_NINA006 = device_creator<nes_nina006_device>;
-const device_type NES_MAXI15 = device_creator<nes_maxi15_device>;
+DEFINE_DEVICE_TYPE(NES_NINA001, nes_nina001_device, "nes_nina001", "NES Cart AVE Nina-001 PCB")
+DEFINE_DEVICE_TYPE(NES_NINA006, nes_nina006_device, "nes_nina006", "NES Cart AVE Nina-006 PCB")
+DEFINE_DEVICE_TYPE(NES_MAXI15, nes_maxi15_device, "nes_maxi15", "NES Cart AVE Maxi 15 PCB")
nes_nina001_device::nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NINA001, "NES Cart AVE Nina-001 PCB", tag, owner, clock, "nes_nina001", __FILE__)
+ : nes_nrom_device(mconfig, NES_NINA001, tag, owner, clock)
{
}
nes_nina006_device::nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NINA006, "NES Cart AVE Nina-006 PCB", tag, owner, clock, "nes_nina006", __FILE__)
+ : nes_nrom_device(mconfig, NES_NINA006, tag, owner, clock)
{
}
nes_maxi15_device::nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_MAXI15, "NES Cart AVE Maxi 15 PCB", tag, owner, clock, "nes_maxi15", __FILE__), m_reg(0), m_bank(0)
- {
+ : nes_nrom_device(mconfig, NES_MAXI15, tag, owner, clock), m_reg(0), m_bank(0)
+{
}
diff --git a/src/devices/bus/nes/ave.h b/src/devices/bus/nes/ave.h
index 7648cc7ce46..5fdd233b3c3 100644
--- a/src/devices/bus/nes/ave.h
+++ b/src/devices/bus/nes/ave.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_AVE_H
-#define __NES_AVE_H
+#ifndef MAME_BUS_NES_AVE_H
+#define MAME_BUS_NES_AVE_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_nina001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,11 +34,13 @@ public:
// construction/destruction
nes_nina006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -46,24 +52,25 @@ public:
// construction/destruction
nes_maxi15_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks();
+
uint8_t m_reg, m_bank;
};
-
-
// device type definition
-extern const device_type NES_NINA001;
-extern const device_type NES_NINA006;
-extern const device_type NES_MAXI15;
+DECLARE_DEVICE_TYPE(NES_NINA001, nes_nina001_device)
+DECLARE_DEVICE_TYPE(NES_NINA006, nes_nina006_device)
+DECLARE_DEVICE_TYPE(NES_MAXI15, nes_maxi15_device)
-#endif
+#endif // MAME_BUS_NES_AVE_H
diff --git a/src/devices/bus/nes/bandai.cpp b/src/devices/bus/nes/bandai.cpp
index e75b6401205..83ab401022b 100644
--- a/src/devices/bus/nes/bandai.cpp
+++ b/src/devices/bus/nes/bandai.cpp
@@ -17,7 +17,7 @@
* Bandai Datach Joint ROM System [mapper 157] is emulated in a separate source file
to implement also the subslot, but the PCB is basically a Bandai LZ93D50 + 24C02 EEPROM
- pcb with added barcode reader and subslot
+ PCB with added barcode reader and subslot
* Bandai Karaoke Studio [mapper 188] is emulated in a separate source file
to implement also the subslot and the mic inputs
@@ -50,58 +50,56 @@
// constructor
//-------------------------------------------------
-const device_type NES_OEKAKIDS = device_creator<nes_oekakids_device>;
-const device_type NES_FCG = device_creator<nes_fcg_device>;
-const device_type NES_LZ93D50 = device_creator<nes_lz93d50_device>;
-const device_type NES_LZ93D50_24C01 = device_creator<nes_lz93d50_24c01_device>;
-const device_type NES_LZ93D50_24C02 = device_creator<nes_lz93d50_24c02_device>;
-const device_type NES_FJUMP2 = device_creator<nes_fjump2_device>;
+DEFINE_DEVICE_TYPE(NES_OEKAKIDS, nes_oekakids_device, "nes_oeka", "NES Cart Bandai Oeka Kids PCB")
+DEFINE_DEVICE_TYPE(NES_FCG, nes_fcg_device, "nes_fcg", "NES Cart Bandai FCG PCB")
+DEFINE_DEVICE_TYPE(NES_LZ93D50, nes_lz93d50_device, "nes_lz93d50", "NES Cart Bandai LZ93D50 PCB")
+DEFINE_DEVICE_TYPE(NES_LZ93D50_24C01, nes_lz93d50_24c01_device, "nes_lz93d50_ep1", "NES Cart Bandai LZ93D50 + 24C01 PCB")
+DEFINE_DEVICE_TYPE(NES_LZ93D50_24C02, nes_lz93d50_24c02_device, "nes_lz93d50_ep2", "NES Cart Bandai LZ93D50 + 24C02 PCB")
+DEFINE_DEVICE_TYPE(NES_FJUMP2, nes_fjump2_device, "nes_fjump2", "NES Cart Bandai Famicom Jump II PCB")
nes_oekakids_device::nes_oekakids_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_OEKAKIDS, "NES Cart Bandai Oeka Kids PCB", tag, owner, clock, "nes_oeka", __FILE__), m_reg(0), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_OEKAKIDS, tag, owner, clock), m_reg(0), m_latch(0)
+{
}
-nes_fcg_device::nes_fcg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+nes_fcg_device::nes_fcg_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_fcg_device::nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FCG, "NES Cart Bandai FCG PCB", tag, owner, clock, "nes_fcg", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_fcg_device(mconfig, NES_FCG, tag, owner, clock)
+{
}
-nes_lz93d50_device::nes_lz93d50_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_fcg_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_lz93d50_device::nes_lz93d50_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_fcg_device(mconfig, type, tag, owner, clock)
{
}
nes_lz93d50_device::nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_fcg_device(mconfig, NES_LZ93D50, "NES Cart Bandai LZ93D50 PCB", tag, owner, clock, "nes_lz93d50", __FILE__)
+ : nes_lz93d50_device(mconfig, NES_LZ93D50, tag, owner, clock)
{
}
-nes_lz93d50_24c01_device::nes_lz93d50_24c01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_lz93d50_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_i2cmem(*this, "i2cmem"), m_i2c_dir(0)
- {
+nes_lz93d50_24c01_device::nes_lz93d50_24c01_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_lz93d50_device(mconfig, type, tag, owner, clock), m_i2cmem(*this, "i2cmem"), m_i2c_dir(0)
+{
}
nes_lz93d50_24c01_device::nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_lz93d50_device(mconfig, NES_LZ93D50_24C01, "NES Cart Bandai LZ93D50 + 24C01 PCB", tag, owner, clock, "nes_lz93d50_ep1", __FILE__),
- m_i2cmem(*this, "i2cmem"), m_i2c_dir(0)
- {
+ : nes_lz93d50_24c01_device(mconfig, NES_LZ93D50_24C01, tag, owner, clock)
+{
}
nes_lz93d50_24c02_device::nes_lz93d50_24c02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_lz93d50_24c01_device(mconfig, NES_LZ93D50_24C02, "NES Cart Bandai LZ93D50 + 24C02 PCB", tag, owner, clock, "nes_lz93d50_ep2", __FILE__)
+ : nes_lz93d50_24c01_device(mconfig, NES_LZ93D50_24C02, tag, owner, clock)
{
}
nes_fjump2_device::nes_fjump2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_lz93d50_device(mconfig, NES_FJUMP2, "NES Cart Bandai Famicom Jump II PCB", tag, owner, clock, "nes_fjump2", __FILE__)
+ : nes_lz93d50_device(mconfig, NES_FJUMP2, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/bandai.h b/src/devices/bus/nes/bandai.h
index 108c6fb96cc..17a1fed1b79 100644
--- a/src/devices/bus/nes/bandai.h
+++ b/src/devices/bus/nes/bandai.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_BANDAI_H
-#define __NES_BANDAI_H
+#ifndef MAME_BUS_NES_BANDAI_H
+#define MAME_BUS_NES_BANDAI_H
+
+#pragma once
#include "nxrom.h"
#include "machine/i2cmem.h"
@@ -15,8 +17,6 @@ public:
// construction/destruction
nes_oekakids_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual DECLARE_READ8_MEMBER(nt_r) override;
virtual DECLARE_WRITE8_MEMBER(nt_w) override;
@@ -26,8 +26,13 @@ public:
virtual void ppu_latch(offs_t offset) override;
// TODO: add oeka kids controller emulation
+
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
void update_chr();
+
uint8_t m_reg, m_latch;
};
@@ -38,11 +43,8 @@ class nes_fcg_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_fcg_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_fcg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(fcg_write);
virtual DECLARE_WRITE8_MEMBER(write_m) override;
@@ -50,10 +52,16 @@ public:
virtual void pcb_reset() override;
protected:
- uint16_t m_irq_count;
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
+ nes_fcg_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ uint16_t m_irq_count;
int m_irq_enable;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
};
@@ -64,11 +72,13 @@ class nes_lz93d50_device : public nes_fcg_device
{
public:
// construction/destruction
- nes_lz93d50_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_lz93d50_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
virtual DECLARE_WRITE8_MEMBER(write_h) override { fcg_write(space, offset, data, mem_mask); }
+
+protected:
+ nes_lz93d50_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
};
@@ -78,17 +88,20 @@ class nes_lz93d50_24c01_device : public nes_lz93d50_device
{
public:
// construction/destruction
- nes_lz93d50_24c01_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_lz93d50_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ nes_lz93d50_24c01_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
// TODO: fix EEPROM I/O emulation
required_device<i2cmem_device> m_i2cmem;
uint8_t m_i2c_dir;
@@ -116,8 +129,6 @@ public:
// construction/destruction
nes_fjump2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -125,17 +136,20 @@ public:
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
void set_prg();
uint8_t m_reg[5];
};
// device type definition
-extern const device_type NES_OEKAKIDS;
-extern const device_type NES_FCG;
-extern const device_type NES_LZ93D50;
-extern const device_type NES_LZ93D50_24C01;
-extern const device_type NES_LZ93D50_24C02;
-extern const device_type NES_FJUMP2;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_OEKAKIDS, nes_oekakids_device)
+DECLARE_DEVICE_TYPE(NES_FCG, nes_fcg_device)
+DECLARE_DEVICE_TYPE(NES_LZ93D50, nes_lz93d50_device)
+DECLARE_DEVICE_TYPE(NES_LZ93D50_24C01, nes_lz93d50_24c01_device)
+DECLARE_DEVICE_TYPE(NES_LZ93D50_24C02, nes_lz93d50_24c02_device)
+DECLARE_DEVICE_TYPE(NES_FJUMP2, nes_fjump2_device)
+
+#endif // MAME_BUS_NES_BANDAI_H
diff --git a/src/devices/bus/nes/benshieng.cpp b/src/devices/bus/nes/benshieng.cpp
index 0d41c8b3ae0..921d7c5b56f 100644
--- a/src/devices/bus/nes/benshieng.cpp
+++ b/src/devices/bus/nes/benshieng.cpp
@@ -28,13 +28,13 @@
// constructor
//-------------------------------------------------
-const device_type NES_BENSHIENG = device_creator<nes_benshieng_device>;
+DEFINE_DEVICE_TYPE(NES_BENSHIENG, nes_benshieng_device, "nes_benshieng", "NES Cart Benshieng PCB")
nes_benshieng_device::nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BENSHIENG, "NES Cart Benshieng PCB", tag, owner, clock, "nes_benshieng", __FILE__),
- m_dipsetting(0)
- {
+ : nes_nrom_device(mconfig, NES_BENSHIENG, tag, owner, clock)
+ , m_dipsetting(0)
+{
}
diff --git a/src/devices/bus/nes/benshieng.h b/src/devices/bus/nes/benshieng.h
index 1989c26ad15..2cf39af6cf7 100644
--- a/src/devices/bus/nes/benshieng.h
+++ b/src/devices/bus/nes/benshieng.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_BENSHIENG_H
-#define __NES_BENSHIENG_H
+#ifndef MAME_BUS_NES_BENSHIENG_H
+#define MAME_BUS_NES_BENSHIENG_H
+
+#pragma once
#include "nxrom.h"
@@ -14,12 +16,14 @@ public:
// construction/destruction
nes_benshieng_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks();
uint8_t m_dipsetting;
@@ -31,4 +35,4 @@ private:
// device type definition
extern const device_type NES_BENSHIENG;
-#endif
+#endif // MAME_BUS_NES_BENSHIENG_H
diff --git a/src/devices/bus/nes/bootleg.cpp b/src/devices/bus/nes/bootleg.cpp
index f38e92d8e97..d47699a8e57 100644
--- a/src/devices/bus/nes/bootleg.cpp
+++ b/src/devices/bus/nes/bootleg.cpp
@@ -22,7 +22,7 @@
#include "bootleg.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#include "screen.h"
@@ -39,131 +39,131 @@
// constructor
//-------------------------------------------------
-const device_type NES_AX5705 = device_creator<nes_ax5705_device>;
-const device_type NES_SC127 = device_creator<nes_sc127_device>;
-const device_type NES_MARIOBABY = device_creator<nes_mbaby_device>;
-const device_type NES_ASN = device_creator<nes_asn_device>;
-const device_type NES_SMB3PIRATE = device_creator<nes_smb3p_device>;
-const device_type NES_BTL_DNINJA = device_creator<nes_btl_dn_device>;
-const device_type NES_WHIRLWIND_2706 = device_creator<nes_whirl2706_device>;
-const device_type NES_SMB2J = device_creator<nes_smb2j_device>;
-const device_type NES_SMB2JA = device_creator<nes_smb2ja_device>;
-const device_type NES_SMB2JB = device_creator<nes_smb2jb_device>;
-const device_type NES_09034A = device_creator<nes_09034a_device>;
-const device_type NES_TOBIDASE = device_creator<nes_tobidase_device>;
-const device_type NES_LH32 = device_creator<nes_lh32_device>;
-const device_type NES_LH10 = device_creator<nes_lh10_device>;
-const device_type NES_LH53 = device_creator<nes_lh53_device>;
-const device_type NES_2708 = device_creator<nes_2708_device>;
-const device_type NES_AC08 = device_creator<nes_ac08_device>;
-const device_type NES_UNL_BB = device_creator<nes_unl_bb_device>;
-const device_type NES_MMALEE = device_creator<nes_mmalee_device>;
-const device_type NES_SHUIGUAN = device_creator<nes_shuiguan_device>;
-const device_type NES_RT01 = device_creator<nes_rt01_device>;
+DEFINE_DEVICE_TYPE(NES_AX5705, nes_ax5705_device, "nes_ax5705", "NES Cart AX5705 PCB")
+DEFINE_DEVICE_TYPE(NES_SC127, nes_sc127_device, "nes_sc127", "NES Cart SC-127 PCB")
+DEFINE_DEVICE_TYPE(NES_MARIOBABY, nes_mbaby_device, "nes_mbaby", "NES Cart Mario Baby Bootleg PCB")
+DEFINE_DEVICE_TYPE(NES_ASN, nes_asn_device, "nes_asn", "NES Cart Ai Senshi Nicol Bootleg PCB")
+DEFINE_DEVICE_TYPE(NES_SMB3PIRATE, nes_smb3p_device, "nes_smb3p", "NES Cart Super Mario Bros. 3 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_BTL_DNINJA, nes_btl_dn_device, "nes_btl_dn", "NES Cart DragonNinja Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_WHIRLWIND_2706, nes_whirl2706_device, "nes_whirl2706", "NES Cart Whilwind 2706 PCB")
+DEFINE_DEVICE_TYPE(NES_SMB2J, nes_smb2j_device, "nes_smb2j", "NES Cart Super Mario Bros. 2 Jpn PCB")
+DEFINE_DEVICE_TYPE(NES_SMB2JA, nes_smb2ja_device, "nes_smb2ja", "NES Cart Super Mario Bros. 2 Jpn (Alt) PCB")
+DEFINE_DEVICE_TYPE(NES_SMB2JB, nes_smb2jb_device, "nes_smb2jb", "NES Cart Super Mario Bros. 2 Jpn (Alt 2) PCB")
+DEFINE_DEVICE_TYPE(NES_09034A, nes_09034a_device, "nes_09034a", "NES Cart 09-034A PCB")
+DEFINE_DEVICE_TYPE(NES_TOBIDASE, nes_tobidase_device, "nes_tobidase", "NES Cart Tobidase Daisakusen Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_LH32, nes_lh32_device, "nes_lh32", "NES Cart LH-32 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_LH10, nes_lh10_device, "nes_lh10", "NES Cart LH-10 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_LH53, nes_lh53_device, "nes_lh53", "NES Cart LH-53 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_2708, nes_2708_device, "nes_2708", "NES Cart BTL-2708 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_AC08, nes_ac08_device, "nes_ac08", "NES Cart AC08 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_UNL_BB, nes_unl_bb_device, "nes_unl_bb", "NES Cart FDS+CHR Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_MMALEE, nes_mmalee_device, "nes_mmalee", "NES Cart Super Mario Bros. Malee 2 Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_SHUIGUAN, nes_shuiguan_device, "nes_shuiguan", "NES Cart Shui Guan Pipe Pirate PCB")
+DEFINE_DEVICE_TYPE(NES_RT01, nes_rt01_device, "nes_rt01", "NES Cart RT-01 PCB")
nes_ax5705_device::nes_ax5705_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_AX5705, "NES Cart AX5705 PCB", tag, owner, clock, "nes_ax5705", __FILE__)
+ : nes_nrom_device(mconfig, NES_AX5705, tag, owner, clock)
{
}
nes_sc127_device::nes_sc127_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SC127, "NES Cart SC-127 PCB", tag, owner, clock, "nes_sc127", __FILE__), m_irq_count(0), m_irq_enable(0)
- {
+ : nes_nrom_device(mconfig, NES_SC127, tag, owner, clock), m_irq_count(0), m_irq_enable(0)
+{
}
nes_mbaby_device::nes_mbaby_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_MARIOBABY, "NES Cart Mario Baby Bootleg PCB", tag, owner, clock, "nes_mbaby", __FILE__), m_latch(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_MARIOBABY, tag, owner, clock), m_latch(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_asn_device::nes_asn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_ASN, "NES Cart Ai Senshi Nicol Bootleg PCB", tag, owner, clock, "nes_asn", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_ASN, tag, owner, clock), m_latch(0)
+{
}
nes_smb3p_device::nes_smb3p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SMB3PIRATE, "NES Cart Super Mario Bros. 3 Pirate PCB", tag, owner, clock, "nes_smb3p", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_SMB3PIRATE, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_btl_dn_device::nes_btl_dn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BTL_DNINJA, "NES Cart DragonNinja Pirate PCB", tag, owner, clock, "nes_btl_dn", __FILE__), m_irq_count(0)
- {
+ : nes_nrom_device(mconfig, NES_BTL_DNINJA, tag, owner, clock), m_irq_count(0)
+{
}
nes_whirl2706_device::nes_whirl2706_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WHIRLWIND_2706, "NES Cart Whirlwind 2706 PCB", tag, owner, clock, "nes_whirl2706", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_WHIRLWIND_2706, tag, owner, clock), m_latch(0)
+{
}
nes_smb2j_device::nes_smb2j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SMB2J, "NES Cart Super Mario Bros. 2 Jpn PCB", tag, owner, clock, "nes_smb2j", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_SMB2J, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_smb2ja_device::nes_smb2ja_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SMB2JA, "NES Cart Super Mario Bros. 2 Jpn (Alt) PCB", tag, owner, clock, "nes_smb2ja", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_SMB2JA, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_smb2jb_device::nes_smb2jb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SMB2JB, "NES Cart Super Mario Bros. 2 Jpn (Alt 2) PCB", tag, owner, clock, "nes_smb2jb", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_SMB2JB, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_09034a_device::nes_09034a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_09034A, "NES Cart 09-034A PCB", tag, owner, clock, "nes_09034a", __FILE__), m_reg(0)
- {
+ : nes_nrom_device(mconfig, NES_09034A, tag, owner, clock), m_reg(0)
+{
}
nes_tobidase_device::nes_tobidase_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TOBIDASE, "NES Cart Tobidase Daisakusen Pirate PCB", tag, owner, clock, "nes_tobidase", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_TOBIDASE, tag, owner, clock), m_latch(0)
+{
}
nes_lh32_device::nes_lh32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_LH32, "NES Cart LH-32 Pirate PCB", tag, owner, clock, "nes_lh32", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_LH32, tag, owner, clock), m_latch(0)
+{
}
nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_LH10, "NES Cart LH-10 Pirate PCB", tag, owner, clock, "nes_lh10", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_LH10, tag, owner, clock), m_latch(0)
+{
}
nes_lh53_device::nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_LH53, "NES Cart LH-53 Pirate PCB", tag, owner, clock, "nes_lh53", __FILE__), m_irq_count(0), m_irq_enable(0), m_reg(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_LH53, tag, owner, clock), m_irq_count(0), m_irq_enable(0), m_reg(0), irq_timer(nullptr)
+{
}
nes_2708_device::nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_2708, "NES Cart BTL-2708 Pirate PCB", tag, owner, clock, "nes_2708", __FILE__)
+ : nes_nrom_device(mconfig, NES_2708, tag, owner, clock)
{
}
nes_ac08_device::nes_ac08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_AC08, "NES Cart AC08 Pirate PCB", tag, owner, clock, "nes_ac08", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_AC08, tag, owner, clock), m_latch(0)
+{
}
nes_unl_bb_device::nes_unl_bb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_UNL_BB, "NES Cart FDS+CHR Pirate PCB", tag, owner, clock, "nes_unl_bb", __FILE__)
+ : nes_nrom_device(mconfig, NES_UNL_BB, tag, owner, clock)
{
}
nes_mmalee_device::nes_mmalee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_MMALEE, "NES Cart Super Mario Bros. Malee 2 Pirate PCB", tag, owner, clock, "nes_mmalee", __FILE__)
+ : nes_nrom_device(mconfig, NES_MMALEE, tag, owner, clock)
{
}
nes_shuiguan_device::nes_shuiguan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SHUIGUAN, "NES Cart Shui Guan Pipe Pirate PCB", tag, owner, clock, "nes_shuiguan", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+ : nes_nrom_device(mconfig, NES_SHUIGUAN, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
{
}
nes_rt01_device::nes_rt01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_RT01, "NES Cart RT-01 PCB", tag, owner, clock, "nes_rt01", __FILE__)
+ : nes_nrom_device(mconfig, NES_RT01, tag, owner, clock)
{
}
@@ -640,7 +640,7 @@ WRITE8_MEMBER(nes_ax5705_device::write_h)
void nes_sc127_device::hblank_irq(int scanline, int vblank, int blanked)
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE && m_irq_enable)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE && m_irq_enable)
{
m_irq_count--;
diff --git a/src/devices/bus/nes/bootleg.h b/src/devices/bus/nes/bootleg.h
index 5e2457d2fef..a048f0955d4 100644
--- a/src/devices/bus/nes/bootleg.h
+++ b/src/devices/bus/nes/bootleg.h
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_BTL_H
-#define __NES_BTL_H
+#ifndef MAME_BUS_NES_BOOTLEG_H
+#define MAME_BUS_NES_BOOTLEG_H
#include "nxrom.h"
@@ -14,12 +14,14 @@ public:
// construction/destruction
nes_ax5705_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void set_prg();
uint8_t m_mmc_prg_bank[2];
@@ -34,14 +36,15 @@ class nes_sc127_device : public nes_nrom_device
public:
// construction/destruction
nes_sc127_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -55,20 +58,22 @@ class nes_mbaby_device : public nes_nrom_device
public:
// construction/destruction
nes_mbaby_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
uint8_t m_latch;
int m_irq_enable;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
attotime timer_freq;
};
@@ -82,13 +87,15 @@ public:
// construction/destruction
nes_asn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -102,13 +109,15 @@ public:
// construction/destruction
nes_smb3p_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -125,14 +134,15 @@ class nes_btl_dn_device : public nes_nrom_device
public:
// construction/destruction
nes_btl_dn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count;
};
@@ -146,13 +156,15 @@ public:
// construction/destruction
nes_whirl2706_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -166,9 +178,6 @@ public:
// construction/destruction
nes_smb2j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_ex) override;
@@ -177,6 +186,11 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -193,15 +207,16 @@ class nes_smb2ja_device : public nes_nrom_device
public:
// construction/destruction
nes_smb2ja_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -218,16 +233,17 @@ class nes_smb2jb_device : public nes_nrom_device
public:
// construction/destruction
nes_smb2jb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_ex) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -245,13 +261,15 @@ public:
// construction/destruction
nes_09034a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_ex) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
};
@@ -265,13 +283,15 @@ public:
// construction/destruction
nes_tobidase_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -285,8 +305,6 @@ public:
// construction/destruction
nes_lh32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
@@ -294,6 +312,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -307,14 +329,16 @@ public:
// construction/destruction
nes_lh10_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_prg();
uint8_t m_latch;
@@ -330,9 +354,6 @@ public:
// construction/destruction
nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override {}
@@ -340,6 +361,11 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -359,8 +385,6 @@ public:
// construction/destruction
nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
@@ -368,6 +392,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[2];
};
@@ -380,14 +408,16 @@ public:
// nes_ac08_device/destruction
nes_ac08_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_ex) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -399,14 +429,15 @@ class nes_unl_bb_device : public nes_nrom_device
public:
// construction/destruction
nes_unl_bb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[2];
};
@@ -419,12 +450,14 @@ public:
// construction/destruction
nes_mmalee_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
// ======================> nes_shuiguan_device
@@ -435,14 +468,16 @@ public:
// construction/destruction
nes_shuiguan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -461,37 +496,39 @@ public:
// construction/destruction
nes_rt01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
// device type definition
-extern const device_type NES_AX5705;
-extern const device_type NES_SC127;
-extern const device_type NES_MARIOBABY;
-extern const device_type NES_ASN;
-extern const device_type NES_SMB3PIRATE;
-extern const device_type NES_BTL_DNINJA;
-extern const device_type NES_WHIRLWIND_2706;
-extern const device_type NES_SMB2J;
-extern const device_type NES_SMB2JA;
-extern const device_type NES_SMB2JB;
-extern const device_type NES_09034A;
-extern const device_type NES_TOBIDASE;
-extern const device_type NES_LH32;
-extern const device_type NES_LH10;
-extern const device_type NES_LH53;
-extern const device_type NES_2708;
-extern const device_type NES_AC08;
-extern const device_type NES_UNL_BB;
-extern const device_type NES_MMALEE;
-extern const device_type NES_SHUIGUAN;
-extern const device_type NES_RT01;
-
-
-#endif
+DECLARE_DEVICE_TYPE(NES_AX5705, nes_ax5705_device)
+DECLARE_DEVICE_TYPE(NES_SC127, nes_sc127_device)
+DECLARE_DEVICE_TYPE(NES_MARIOBABY, nes_mbaby_device)
+DECLARE_DEVICE_TYPE(NES_ASN, nes_asn_device)
+DECLARE_DEVICE_TYPE(NES_SMB3PIRATE, nes_smb3p_device)
+DECLARE_DEVICE_TYPE(NES_BTL_DNINJA, nes_btl_dn_device)
+DECLARE_DEVICE_TYPE(NES_WHIRLWIND_2706, nes_whirl2706_device)
+DECLARE_DEVICE_TYPE(NES_SMB2J, nes_smb2j_device)
+DECLARE_DEVICE_TYPE(NES_SMB2JA, nes_smb2ja_device)
+DECLARE_DEVICE_TYPE(NES_SMB2JB, nes_smb2jb_device)
+DECLARE_DEVICE_TYPE(NES_09034A, nes_09034a_device)
+DECLARE_DEVICE_TYPE(NES_TOBIDASE, nes_tobidase_device)
+DECLARE_DEVICE_TYPE(NES_LH32, nes_lh32_device)
+DECLARE_DEVICE_TYPE(NES_LH10, nes_lh10_device)
+DECLARE_DEVICE_TYPE(NES_LH53, nes_lh53_device)
+DECLARE_DEVICE_TYPE(NES_2708, nes_2708_device)
+DECLARE_DEVICE_TYPE(NES_AC08, nes_ac08_device)
+DECLARE_DEVICE_TYPE(NES_UNL_BB, nes_unl_bb_device)
+DECLARE_DEVICE_TYPE(NES_MMALEE, nes_mmalee_device)
+DECLARE_DEVICE_TYPE(NES_SHUIGUAN, nes_shuiguan_device)
+DECLARE_DEVICE_TYPE(NES_RT01, nes_rt01_device)
+
+
+#endif // MAME_BUS_NES_BOOTLEG_H
diff --git a/src/devices/bus/nes/camerica.cpp b/src/devices/bus/nes/camerica.cpp
index ca4e31bc11f..7b9d413f6c9 100644
--- a/src/devices/bus/nes/camerica.cpp
+++ b/src/devices/bus/nes/camerica.cpp
@@ -41,24 +41,24 @@
// constructor
//-------------------------------------------------
-const device_type NES_BF9093 = device_creator<nes_bf9093_device>;
-const device_type NES_BF9096 = device_creator<nes_bf9096_device>;
-const device_type NES_GOLDEN5 = device_creator<nes_golden5_device>;
+DEFINE_DEVICE_TYPE(NES_BF9093, nes_bf9093_device, "nes_bf9093", "NES Cart Camerica BF9093 PCB")
+DEFINE_DEVICE_TYPE(NES_BF9096, nes_bf9096_device, "nes_bf9096", "NES Cart Camerica BF9096 PCB")
+DEFINE_DEVICE_TYPE(NES_GOLDEN5, nes_golden5_device, "nes_golden5", "NES Cart Camerica Golden 5 PCB")
nes_bf9093_device::nes_bf9093_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BF9093, "NES Cart Camerica BF9093 PCB", tag, owner, clock, "nes_bf9093", __FILE__)
+ : nes_nrom_device(mconfig, NES_BF9093, tag, owner, clock)
{
}
nes_bf9096_device::nes_bf9096_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BF9096, "NES Cart Camerica BF9096 PCB", tag, owner, clock, "nes_bf9096", __FILE__), m_bank_base(0), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_BF9096, tag, owner, clock), m_bank_base(0), m_latch(0)
+{
}
nes_golden5_device::nes_golden5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GOLDEN5, "NES Cart Camerica Golden 5 PCB", tag, owner, clock, "nes_golden5", __FILE__), m_bank_base(0), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_GOLDEN5, tag, owner, clock), m_bank_base(0), m_latch(0)
+{
}
diff --git a/src/devices/bus/nes/camerica.h b/src/devices/bus/nes/camerica.h
index ba3b103b0d5..b7a4782c342 100644
--- a/src/devices/bus/nes/camerica.h
+++ b/src/devices/bus/nes/camerica.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_CAMERICA_H
-#define __NES_CAMERICA_H
+#ifndef MAME_BUS_NES_CAMERICA_H
+#define MAME_BUS_NES_CAMERICA_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_bf9093_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,13 +34,15 @@ public:
// construction/destruction
nes_bf9096_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override { write_h(space, offset, data, mem_mask); }
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_bank_base, m_latch;
};
@@ -50,23 +56,22 @@ public:
// construction/destruction
nes_golden5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_bank_base, m_latch;
};
-
-
-
// device type definition
-extern const device_type NES_BF9093;
-extern const device_type NES_BF9096;
-extern const device_type NES_GOLDEN5;
+DECLARE_DEVICE_TYPE(NES_BF9093, nes_bf9093_device)
+DECLARE_DEVICE_TYPE(NES_BF9096, nes_bf9096_device)
+DECLARE_DEVICE_TYPE(NES_GOLDEN5, nes_golden5_device)
-#endif
+#endif // MAME_BUS_NES_CAMERICA_H
diff --git a/src/devices/bus/nes/cne.cpp b/src/devices/bus/nes/cne.cpp
index 616814bbdc2..1f0ad793937 100644
--- a/src/devices/bus/nes/cne.cpp
+++ b/src/devices/bus/nes/cne.cpp
@@ -32,23 +32,23 @@
// constructor
//-------------------------------------------------
-const device_type NES_CNE_DECATHL = device_creator<nes_cne_decathl_device>;
-const device_type NES_CNE_FSB = device_creator<nes_cne_fsb_device>;
-const device_type NES_CNE_SHLZ = device_creator<nes_cne_shlz_device>;
+DEFINE_DEVICE_TYPE(NES_CNE_DECATHL, nes_cne_decathl_device, "nes_cne_deca", "NES Cart C&E Decathlon PCB")
+DEFINE_DEVICE_TYPE(NES_CNE_FSB, nes_cne_fsb_device, "nes_cne_fsb", "NES Cart C&E Feng Shen Bang PCB")
+DEFINE_DEVICE_TYPE(NES_CNE_SHLZ, nes_cne_shlz_device, "nes_cne_shlz", "NES Cart C&E Sheng Huo Lie Zhuan PCB")
nes_cne_decathl_device::nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CNE_DECATHL, "NES Cart C&E Decathlon PCB", tag, owner, clock, "nes_cne_deca", __FILE__)
+ : nes_nrom_device(mconfig, NES_CNE_DECATHL, tag, owner, clock)
{
}
nes_cne_fsb_device::nes_cne_fsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CNE_FSB, "NES Cart C&E Feng Shen Bang PCB", tag, owner, clock, "nes_cne_fsb", __FILE__)
+ : nes_nrom_device(mconfig, NES_CNE_FSB, tag, owner, clock)
{
}
nes_cne_shlz_device::nes_cne_shlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CNE_SHLZ, "NES Cart C&E Sheng Huo Lie Zhuan PCB", tag, owner, clock, "nes_cne_shlz", __FILE__)
+ : nes_nrom_device(mconfig, NES_CNE_SHLZ, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/cne.h b/src/devices/bus/nes/cne.h
index 558067f2862..d5e117c791a 100644
--- a/src/devices/bus/nes/cne.h
+++ b/src/devices/bus/nes/cne.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_CNE_H
-#define __NES_CNE_H
+#ifndef MAME_BUS_NES_CNE_H
+#define MAME_BUS_NES_CNE_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_cne_decathl_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,12 +34,14 @@ public:
// construction/destruction
nes_cne_fsb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -47,20 +53,19 @@ public:
// construction/destruction
nes_cne_shlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
-};
-
-
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+};
// device type definition
-extern const device_type NES_CNE_DECATHL;
-extern const device_type NES_CNE_FSB;
-extern const device_type NES_CNE_SHLZ;
+DECLARE_DEVICE_TYPE(NES_CNE_DECATHL, nes_cne_decathl_device)
+DECLARE_DEVICE_TYPE(NES_CNE_FSB, nes_cne_fsb_device)
+DECLARE_DEVICE_TYPE(NES_CNE_SHLZ, nes_cne_shlz_device)
-#endif
+#endif // MAME_BUS_NES_CNE_H
diff --git a/src/devices/bus/nes/cony.cpp b/src/devices/bus/nes/cony.cpp
index 3dbb66a7fb0..552941a6ac9 100644
--- a/src/devices/bus/nes/cony.cpp
+++ b/src/devices/bus/nes/cony.cpp
@@ -35,29 +35,29 @@
// constructor
//-------------------------------------------------
-const device_type NES_CONY = device_creator<nes_cony_device>;
-const device_type NES_YOKO = device_creator<nes_yoko_device>;
-
-
-nes_cony_device::nes_cony_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_irq_count(0),
- m_irq_enable(0),
- irq_timer(nullptr),
- m_latch1(0),
- m_latch2(0),
- m_extra1(0)
- {
+DEFINE_DEVICE_TYPE(NES_CONY, nes_cony_device, "nes_cony", "NES Cart Cony PCB")
+DEFINE_DEVICE_TYPE(NES_YOKO, nes_yoko_device, "nes_yoko", "NES Cart Yoko PCB")
+
+
+nes_cony_device::nes_cony_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock)
+ , m_irq_count(0)
+ , m_irq_enable(0)
+ , irq_timer(nullptr)
+ , m_latch1(0)
+ , m_latch2(0)
+ , m_extra1(0)
+{
}
nes_cony_device::nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CONY, "NES Cart Cony PCB", tag, owner, clock, "nes_cony", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch1(0), m_latch2(0), m_extra1(0)
- {
+ : nes_cony_device(mconfig, NES_CONY, tag, owner, clock)
+{
}
nes_yoko_device::nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_cony_device(mconfig, NES_YOKO, "NES Cart Yoko PCB", tag, owner, clock, "nes_yoko", __FILE__), m_extra2(0)
- {
+ : nes_cony_device(mconfig, NES_YOKO, tag, owner, clock), m_extra2(0)
+{
}
diff --git a/src/devices/bus/nes/cony.h b/src/devices/bus/nes/cony.h
index 406952b69cb..b7b759a7fe1 100644
--- a/src/devices/bus/nes/cony.h
+++ b/src/devices/bus/nes/cony.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_CONY_H
-#define __NES_CONY_H
+#ifndef MAME_BUS_NES_CONY_H
+#define MAME_BUS_NES_CONY_H
+
+#pragma once
#include "nxrom.h"
@@ -12,12 +14,8 @@ class nes_cony_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_cony_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_cony_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -25,13 +23,20 @@ public:
virtual void pcb_reset() override;
protected:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
+ nes_cony_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
virtual void set_prg();
virtual void set_chr();
uint16_t m_irq_count;
int m_irq_enable;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
uint8_t m_latch1, m_latch2;
@@ -49,14 +54,16 @@ public:
// construction/destruction
nes_yoko_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
virtual void set_prg() override;
virtual void set_chr() override;
@@ -65,11 +72,8 @@ private:
};
-
-
-
// device type definition
-extern const device_type NES_CONY;
-extern const device_type NES_YOKO;
+DECLARE_DEVICE_TYPE(NES_CONY, nes_cony_device)
+DECLARE_DEVICE_TYPE(NES_YOKO, nes_yoko_device)
-#endif
+#endif // MAME_BUS_NES_CONY_H
diff --git a/src/devices/bus/nes/datach.cpp b/src/devices/bus/nes/datach.cpp
index e0cbe5ffbeb..d1600ec8fb2 100644
--- a/src/devices/bus/nes/datach.cpp
+++ b/src/devices/bus/nes/datach.cpp
@@ -43,10 +43,10 @@
//-------------------------------------------------
datach_cart_interface::datach_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_i2cmem(*this, "i2cmem"),
- m_rom(nullptr), m_bank(0)
- {
+ : device_slot_card_interface(mconfig, device)
+ , m_i2cmem(*this, "i2cmem")
+ , m_rom(nullptr), m_bank(0)
+{
}
datach_cart_interface::~datach_cart_interface()
@@ -65,12 +65,13 @@ READ8_MEMBER(datach_cart_interface::read)
// sub-cart slot device
//-------------------------------------------------
-const device_type NES_DATACH_SLOT = device_creator<nes_datach_slot_device>;
+DEFINE_DEVICE_TYPE(NES_DATACH_SLOT, nes_datach_slot_device, "nes_datach_slot", "NES Datach Cartridge Slot")
-nes_datach_slot_device::nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, NES_DATACH_SLOT, "NES Datach Cartridge Slot", tag, owner, clock, "nes_datach_slot", __FILE__),
- device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this), m_cart(nullptr)
+nes_datach_slot_device::nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, NES_DATACH_SLOT, tag, owner, clock)
+ , device_image_interface(mconfig, *this)
+ , device_slot_interface(mconfig, *this)
+ , m_cart(nullptr)
{
}
@@ -159,23 +160,22 @@ ROM_START( datach_rom )
ROM_REGION(0x40000, "datachrom", ROMREGION_ERASEFF)
ROM_END
-const device_type NES_DATACH_ROM = device_creator<nes_datach_rom_device>;
-const device_type NES_DATACH_24C01 = device_creator<nes_datach_24c01_device>;
+DEFINE_DEVICE_TYPE(NES_DATACH_ROM, nes_datach_rom_device, "nes_datach_rom", "NES Datach ROM")
+DEFINE_DEVICE_TYPE(NES_DATACH_24C01, nes_datach_24c01_device, "nes_datach_ep1", "NES Datach + 24C01 PCB")
-nes_datach_rom_device::nes_datach_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- datach_cart_interface( mconfig, *this )
+nes_datach_rom_device::nes_datach_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock)
+ , datach_cart_interface(mconfig, *this)
{
}
nes_datach_rom_device::nes_datach_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NES_DATACH_ROM, "NES Datach ROM", tag, owner, clock, "nes_datach_rom", __FILE__),
- datach_cart_interface( mconfig, *this )
+ : nes_datach_rom_device(mconfig, NES_DATACH_ROM, tag, owner, clock)
{
}
nes_datach_24c01_device::nes_datach_24c01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_datach_rom_device(mconfig, NES_DATACH_24C01, "NES Datach + 24C01 PCB", tag, owner, clock, "nes_datach_ep1", __FILE__)
+ : nes_datach_rom_device(mconfig, NES_DATACH_24C01, tag, owner, clock)
{
}
@@ -218,15 +218,18 @@ machine_config_constructor nes_datach_24c01_device::device_mconfig_additions() c
//
//---------------------------------
-const device_type NES_DATACH = device_creator<nes_datach_device>;
+DEFINE_DEVICE_TYPE(NES_DATACH, nes_datach_device, "nes_datach", "NES Cart Bandai Datach PCB")
nes_datach_device::nes_datach_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_lz93d50_device(mconfig, NES_DATACH, "NES Cart Bandai Datach PCB", tag, owner, clock, "nes_datach", __FILE__), m_datach_latch(0),
- m_i2cmem(*this, "i2cmem"),
- m_reader(*this, "datach"),
- m_subslot(*this, "datach_slot"), m_i2c_dir(0), m_i2c_in_use(0), serial_timer(nullptr)
- {
+ : nes_lz93d50_device(mconfig, NES_DATACH, tag, owner, clock)
+ , m_datach_latch(0)
+ , m_i2cmem(*this, "i2cmem")
+ , m_reader(*this, "datach")
+ , m_subslot(*this, "datach_slot")
+ , m_i2c_dir(0), m_i2c_in_use(0)
+ , serial_timer(nullptr)
+{
}
diff --git a/src/devices/bus/nes/datach.h b/src/devices/bus/nes/datach.h
index 404b86732da..17a3ece97e8 100644
--- a/src/devices/bus/nes/datach.h
+++ b/src/devices/bus/nes/datach.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_DATACH_H
-#define __NES_DATACH_H
+#ifndef MAME_BUS_NES_DATACH_H
+#define MAME_BUS_NES_DATACH_H
+
+#pragma once
#include "bandai.h"
#include "softlist_dev.h"
@@ -20,7 +22,6 @@ class datach_cart_interface : public device_slot_card_interface
{
public:
// construction/destruction
- datach_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~datach_cart_interface();
// reading and writing
@@ -29,9 +30,11 @@ public:
uint8_t *get_cart_base() { return m_rom; }
void write_prg_bank(uint8_t bank) { m_bank = bank; }
+protected:
+ datach_cart_interface(const machine_config &mconfig, device_t &device);
+
optional_device<i2cmem_device> m_i2cmem;
-protected:
// internal state
uint8_t *m_rom;
// ROM is accessed via two 16K banks, but only the first one can be switched
@@ -40,10 +43,13 @@ protected:
// ======================> nes_datach_slot_device
+class nes_datach_device;
+
class nes_datach_slot_device : public device_t,
public device_image_interface,
public device_slot_interface
{
+ friend class nes_datach_device;
public:
// construction/destruction
nes_datach_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -71,11 +77,12 @@ public:
virtual DECLARE_READ8_MEMBER(read);
void write_prg_bank(uint8_t bank) { if (m_cart) m_cart->write_prg_bank(bank); }
+protected:
datach_cart_interface* m_cart;
};
// device type definition
-extern const device_type NES_DATACH_SLOT;
+DECLARE_DEVICE_TYPE(NES_DATACH_SLOT, nes_datach_slot_device)
#define MCFG_DATACH_MINICART_ADD(_tag, _slot_intf) \
@@ -91,12 +98,10 @@ extern const device_type NES_DATACH_SLOT;
// ======================> nes_datach_rom_device
-class nes_datach_rom_device : public device_t,
- public datach_cart_interface
+class nes_datach_rom_device : public device_t, public datach_cart_interface
{
public:
// construction/destruction
- nes_datach_rom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_datach_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// optional information overrides
@@ -104,6 +109,8 @@ public:
virtual uint8_t* get_cart_base();
protected:
+ nes_datach_rom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
@@ -122,8 +129,8 @@ public:
};
// device type definition
-extern const device_type NES_DATACH_ROM;
-extern const device_type NES_DATACH_24C01;
+DECLARE_DEVICE_TYPE(NES_DATACH_ROM, nes_datach_rom_device)
+DECLARE_DEVICE_TYPE(NES_DATACH_24C01, nes_datach_24c01_device)
//---------------------------------
@@ -164,6 +171,6 @@ protected:
// device type definition
-extern const device_type NES_DATACH;
+DECLARE_DEVICE_TYPE(NES_DATACH, nes_datach_device)
-#endif
+#endif // MAME_BUS_NES_DATACH_H
diff --git a/src/devices/bus/nes/discrete.cpp b/src/devices/bus/nes/discrete.cpp
index 99751d689a1..2e1f6a4c81b 100644
--- a/src/devices/bus/nes/discrete.cpp
+++ b/src/devices/bus/nes/discrete.cpp
@@ -35,29 +35,29 @@
// constructor
//-------------------------------------------------
-const device_type NES_74X161X161X32 = device_creator<nes_74x161x161x32_device>;
-const device_type NES_74X139X74 = device_creator<nes_74x139x74_device>;
-const device_type NES_74X377 = device_creator<nes_74x377_device>;
-const device_type NES_74X161X138 = device_creator<nes_74x161x138_device>;
+DEFINE_DEVICE_TYPE(NES_74X161X161X32, nes_74x161x161x32_device, "nes_74x161", "NES Cart Discrete Logic (74*161/161/32) PCB")
+DEFINE_DEVICE_TYPE(NES_74X139X74, nes_74x139x74_device, "nes_74x139", "NES Cart Discrete Logic (74*139/74) PCB")
+DEFINE_DEVICE_TYPE(NES_74X377, nes_74x377_device, "nes_74x377", "NES Cart Discrete Logic (74*377) PCB")
+DEFINE_DEVICE_TYPE(NES_74X161X138, nes_74x161x138_device, "nes_bitcorp_dis", "NES Cart Discrete Logic (74*161/138) PCB")
nes_74x161x161x32_device::nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_74X161X161X32, "NES Cart Discrete Logic (74*161/161/32) PCB", tag, owner, clock, "nes_74x161", __FILE__)
+ : nes_nrom_device(mconfig, NES_74X161X161X32, tag, owner, clock)
{
}
nes_74x139x74_device::nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_74X139X74, "NES Cart Discrete Logic (74*139/74) PCB", tag, owner, clock, "nes_74x139", __FILE__)
+ : nes_nrom_device(mconfig, NES_74X139X74, tag, owner, clock)
{
}
nes_74x377_device::nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_74X377, "NES Cart Discrete Logic (74*377) PCB", tag, owner, clock, "nes_74x377", __FILE__)
+ : nes_nrom_device(mconfig, NES_74X377, tag, owner, clock)
{
}
nes_74x161x138_device::nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_74X161X138, "NES Cart Discrete Logic (74*161/138) PCB", tag, owner, clock, "nes_bitcorp_dis", __FILE__)
+ : nes_nrom_device(mconfig, NES_74X161X138, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/discrete.h b/src/devices/bus/nes/discrete.h
index 7448e62b727..51576a77e41 100644
--- a/src/devices/bus/nes/discrete.h
+++ b/src/devices/bus/nes/discrete.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_DISCRETE_H
-#define __NES_DISCRETE_H
+#ifndef MAME_BUS_NES_DISCRETE_H
+#define MAME_BUS_NES_DISCRETE_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_74x161x161x32_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,11 +34,13 @@ public:
// construction/destruction
nes_74x139x74_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -46,11 +52,13 @@ public:
// construction/destruction
nes_74x377_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -62,19 +70,20 @@ public:
// construction/destruction
nes_74x161x138_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
-};
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+};
// device type definition
-extern const device_type NES_74X161X161X32;
-extern const device_type NES_74X139X74;
-extern const device_type NES_74X377;
-extern const device_type NES_74X161X138;
+DECLARE_DEVICE_TYPE(NES_74X161X161X32, nes_74x161x161x32_device)
+DECLARE_DEVICE_TYPE(NES_74X139X74, nes_74x139x74_device)
+DECLARE_DEVICE_TYPE(NES_74X377, nes_74x377_device)
+DECLARE_DEVICE_TYPE(NES_74X161X138, nes_74x161x138_device)
-#endif
+#endif // MAME_BUS_NES_DISCRETE_H
diff --git a/src/devices/bus/nes/disksys.cpp b/src/devices/bus/nes/disksys.cpp
index 11ad8c7c7a9..24594848e76 100644
--- a/src/devices/bus/nes/disksys.cpp
+++ b/src/devices/bus/nes/disksys.cpp
@@ -100,15 +100,18 @@ void nes_disksys_device::unload_proc(device_image_interface &image)
//
//------------------------------------------------
-const device_type NES_DISKSYS = device_creator<nes_disksys_device>;
+DEFINE_DEVICE_TYPE(NES_DISKSYS, nes_disksys_device, "fc_disksys", "FC RAM Expansion + Disk System PCB")
nes_disksys_device::nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_DISKSYS, "FC RAM Expansion + Disk System PCB", tag, owner, clock, "fc_disksys", __FILE__), m_2c33_rom(nullptr),
- m_fds_data(nullptr),
- m_disk(*this, FLOPPY_0), irq_timer(nullptr), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_transfer(0), m_fds_motor_on(0), m_fds_door_closed(0), m_fds_current_side(0), m_fds_head_position(0), m_fds_status0(0), m_read_mode(0), m_drive_ready(0),
- m_fds_sides(0), m_fds_last_side(0), m_fds_count(0)
- {
+ : nes_nrom_device(mconfig, NES_DISKSYS, tag, owner, clock)
+ , m_2c33_rom(*this, "drive")
+ , m_fds_data(nullptr)
+ , m_disk(*this, FLOPPY_0)
+ , irq_timer(nullptr)
+ , m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_transfer(0), m_fds_motor_on(0), m_fds_door_closed(0), m_fds_current_side(0), m_fds_head_position(0), m_fds_status0(0), m_read_mode(0), m_drive_ready(0)
+ , m_fds_sides(0), m_fds_last_side(0), m_fds_count(0)
+{
}
@@ -116,8 +119,6 @@ void nes_disksys_device::device_start()
{
common_start();
- m_2c33_rom = (uint8_t*)memregion("drive")->base();
-
m_disk->floppy_install_load_proc(nes_disksys_device::load_proc);
m_disk->floppy_install_unload_proc(nes_disksys_device::unload_proc);
diff --git a/src/devices/bus/nes/disksys.h b/src/devices/bus/nes/disksys.h
index 5f05125061b..863400ebe70 100644
--- a/src/devices/bus/nes/disksys.h
+++ b/src/devices/bus/nes/disksys.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_DISKSYS_H
-#define __NES_DISKSYS_H
+#ifndef MAME_BUS_NES_DISKSYS_H
+#define MAME_BUS_NES_DISKSYS_H
+
+#pragma once
#include "nxrom.h"
#include "imagedev/flopdrv.h"
@@ -15,10 +17,7 @@ public:
// construction/destruction
nes_disksys_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual const tiny_rom_entry *device_rom_region() const override;
virtual DECLARE_READ8_MEMBER(read_ex) override;
@@ -33,11 +32,17 @@ public:
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ required_region_ptr<uint8_t> m_2c33_rom;
+
+private:
static void load_proc(device_image_interface &image, bool is_created);
static void unload_proc(device_image_interface &image);
-private:
- uint8_t *m_2c33_rom;
std::unique_ptr<uint8_t[]> m_fds_data; // here, we store a copy of the disk
required_device<legacy_floppy_image_device> m_disk;
@@ -64,8 +69,7 @@ private:
};
-
// device type definition
-extern const device_type NES_DISKSYS;
+DECLARE_DEVICE_TYPE(NES_DISKSYS, nes_disksys_device)
-#endif
+#endif // MAME_BUS_NES_DISKSYS_H
diff --git a/src/devices/bus/nes/event.cpp b/src/devices/bus/nes/event.cpp
index 2440926cd1a..3f6065f449d 100644
--- a/src/devices/bus/nes/event.cpp
+++ b/src/devices/bus/nes/event.cpp
@@ -32,18 +32,18 @@
// constructor
//-------------------------------------------------
-const device_type NES_EVENT = device_creator<nes_event_device>;
+DEFINE_DEVICE_TYPE(NES_EVENT, nes_event_device, "nes_event", "NES Cart Event PCB")
nes_event_device::nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sxrom_device(mconfig, NES_EVENT, "NES Cart Event PCB", tag, owner, clock, "nes_event", __FILE__),
- m_dsw(*this, "DIPSW"),
- m_nwc_init(0),
- event_timer(nullptr),
- m_timer_count(0),
- m_timer_on(0),
- m_timer_enabled(0)
- {
+ : nes_sxrom_device(mconfig, NES_EVENT, tag, owner, clock)
+ , m_dsw(*this, "DIPSW")
+ , m_nwc_init(0)
+ , event_timer(nullptr)
+ , m_timer_count(0)
+ , m_timer_on(0)
+ , m_timer_enabled(0)
+{
}
diff --git a/src/devices/bus/nes/event.h b/src/devices/bus/nes/event.h
index af154b7fffc..b4b67614b50 100644
--- a/src/devices/bus/nes/event.h
+++ b/src/devices/bus/nes/event.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_EVENT_H
-#define __NES_EVENT_H
+#ifndef MAEM_BUS_NES_EVENT_H
+#define MAEM_BUS_NES_EVENT_H
+
+#pragma once
#include "mmc1.h"
@@ -14,22 +16,25 @@ public:
// construction/destruction
nes_event_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual ioport_constructor device_input_ports() const override;
- virtual void update_regs(int reg) override;
-
- required_ioport m_dsw;
virtual void pcb_reset() override;
protected:
+ static constexpr device_timer_id TIMER_EVENT = 0;
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ virtual void update_regs(int reg) override;
virtual void set_prg() override;
virtual void set_chr() override;
+
+ required_ioport m_dsw;
+
int m_nwc_init;
- static const device_timer_id TIMER_EVENT = 0;
emu_timer *event_timer;
attotime timer_freq;
@@ -39,6 +44,6 @@ protected:
// device type definition
-extern const device_type NES_EVENT;
+DECLARE_DEVICE_TYPE(NES_EVENT, nes_event_device)
-#endif
+#endif // MAEM_BUS_NES_EVENT_H
diff --git a/src/devices/bus/nes/ggenie.cpp b/src/devices/bus/nes/ggenie.cpp
index 2064b6e014b..6b6c2c1ecd8 100644
--- a/src/devices/bus/nes/ggenie.cpp
+++ b/src/devices/bus/nes/ggenie.cpp
@@ -30,14 +30,14 @@
// constructor
//-------------------------------------------------
-const device_type NES_GGENIE = device_creator<nes_ggenie_device>;
+DEFINE_DEVICE_TYPE(NES_GGENIE, nes_ggenie_device, "nes_ggenie", "NES Cart Game Genie PCB")
nes_ggenie_device::nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GGENIE, "NES Cart Game Genie PCB", tag, owner, clock, "nes_ggenie", __FILE__),
- m_ggslot(*this, "gg_slot"),
- m_gg_bypass(0)
- {
+ : nes_nrom_device(mconfig, NES_GGENIE, tag, owner, clock)
+ , m_ggslot(*this, "gg_slot")
+ , m_gg_bypass(0)
+{
}
diff --git a/src/devices/bus/nes/ggenie.h b/src/devices/bus/nes/ggenie.h
index 2a1289c4865..761e53f4f51 100644
--- a/src/devices/bus/nes/ggenie.h
+++ b/src/devices/bus/nes/ggenie.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_GGENIE_H
-#define __NES_GGENIE_H
+#ifndef MAME_BUS_NES_GGENIE_H
+#define MAME_BUS_NES_GGENIE_H
+
+#pragma once
#include "nxrom.h"
@@ -14,8 +16,6 @@ public:
// construction/destruction
nes_ggenie_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
@@ -38,6 +38,9 @@ public:
virtual void pcb_start(running_machine &machine, uint8_t *ciram_ptr, bool cart_mounted) override;
private:
+ // device-level overrides
+ virtual void device_start() override;
+
// emulate the Game Genie!
required_device<nes_cart_slot_device> m_ggslot;
@@ -51,8 +54,7 @@ private:
};
-
// device type definition
-extern const device_type NES_GGENIE;
+DECLARE_DEVICE_TYPE(NES_GGENIE, nes_ggenie_device)
-#endif
+#endif // MAME_BUS_NES_GGENIE_H
diff --git a/src/devices/bus/nes/henggedianzi.cpp b/src/devices/bus/nes/henggedianzi.cpp
index eb69e5b3d94..0ef0d2b8ab0 100644
--- a/src/devices/bus/nes/henggedianzi.cpp
+++ b/src/devices/bus/nes/henggedianzi.cpp
@@ -38,24 +38,24 @@
// constructor
//-------------------------------------------------
-const device_type NES_HENGG_SRICH = device_creator<nes_hengg_srich_device>;
-const device_type NES_HENGG_XHZS = device_creator<nes_hengg_xhzs_device>;
-const device_type NES_HENGG_SHJY3 = device_creator<nes_hengg_shjy3_device>;
+DEFINE_DEVICE_TYPE(NES_HENGG_SRICH, nes_hengg_srich_device, "nes_hengg_srich", "NES Cart Henggedianzi Super Rich PCB")
+DEFINE_DEVICE_TYPE(NES_HENGG_XHZS, nes_hengg_xhzs_device, "nes_hengg_xhzs", "NES Cart Henggedianzi Xing He Zhan Shi PCB")
+DEFINE_DEVICE_TYPE(NES_HENGG_SHJY3, nes_hengg_shjy3_device, "nes_hengg_shjy3", "NES Cart Henggedianzi Shen Hua Jian Yun III PCB")
nes_hengg_srich_device::nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_HENGG_SRICH, "NES Cart Henggedianzi Super Rich PCB", tag, owner, clock, "nes_hengg_srich", __FILE__)
+ : nes_nrom_device(mconfig, NES_HENGG_SRICH, tag, owner, clock)
{
}
nes_hengg_xhzs_device::nes_hengg_xhzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_HENGG_XHZS, "NES Cart Henggedianzi Xing He Zhan Shi PCB", tag, owner, clock, "nes_hengg_xhzs", __FILE__)
+ : nes_nrom_device(mconfig, NES_HENGG_XHZS, tag, owner, clock)
{
}
nes_hengg_shjy3_device::nes_hengg_shjy3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_HENGG_SHJY3, "NES Cart Henggedianzi Shen Hua Jian Yun III PCB", tag, owner, clock, "nes_hengg_shjy3", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_chr_mode(0)
- {
+ : nes_nrom_device(mconfig, NES_HENGG_SHJY3, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_chr_mode(0)
+{
}
diff --git a/src/devices/bus/nes/henggedianzi.h b/src/devices/bus/nes/henggedianzi.h
index 59bdf287e78..d74da743425 100644
--- a/src/devices/bus/nes/henggedianzi.h
+++ b/src/devices/bus/nes/henggedianzi.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_HENGGEDIANZI_H
-#define __NES_HENGGEDIANZI_H
+#ifndef MAME_BUS_NES_HENGGEDIANZI_H
+#define MAME_BUS_NES_HENGGEDIANZI_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_hengg_srich_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,12 +34,14 @@ public:
// construction/destruction
nes_hengg_xhzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -47,13 +53,15 @@ public:
// construction/destruction
nes_hengg_shjy3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks();
@@ -66,13 +74,9 @@ private:
uint8_t m_mmc_extra_bank[8];
};
-
-
-
-
// device type definition
-extern const device_type NES_HENGG_SRICH;
-extern const device_type NES_HENGG_XHZS;
-extern const device_type NES_HENGG_SHJY3;
+DECLARE_DEVICE_TYPE(NES_HENGG_SRICH, nes_hengg_srich_device)
+DECLARE_DEVICE_TYPE(NES_HENGG_XHZS, nes_hengg_xhzs_device)
+DECLARE_DEVICE_TYPE(NES_HENGG_SHJY3, nes_hengg_shjy3_device)
-#endif
+#endif // MAME_BUS_NES_HENGGEDIANZI_H
diff --git a/src/devices/bus/nes/hes.cpp b/src/devices/bus/nes/hes.cpp
index 25d34fc4677..8d1d3a7a590 100644
--- a/src/devices/bus/nes/hes.cpp
+++ b/src/devices/bus/nes/hes.cpp
@@ -30,11 +30,11 @@
// constructor
//-------------------------------------------------
-const device_type NES_HES = device_creator<nes_hes_device>;
+DEFINE_DEVICE_TYPE(NES_HES, nes_hes_device, "nes_hes", "NES Cart HES PCB")
nes_hes_device::nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_HES, "NES Cart HES PCB", tag, owner, clock, "nes_hes", __FILE__)
+ : nes_nrom_device(mconfig, NES_HES, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/hes.h b/src/devices/bus/nes/hes.h
index 5cd2ad539b8..d45d20a1a3f 100644
--- a/src/devices/bus/nes/hes.h
+++ b/src/devices/bus/nes/hes.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_HES_H
-#define __NES_HES_H
+#ifndef MAME_BUS_NES_HES_H
+#define MAME_BUS_NES_HES_H
+
+#pragma once
#include "nxrom.h"
@@ -14,15 +16,17 @@ public:
// construction/destruction
nes_hes_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
// device type definition
-extern const device_type NES_HES;
+DECLARE_DEVICE_TYPE(NES_HES, nes_hes_device)
-#endif
+#endif // MAME_BUS_NES_HES_H
diff --git a/src/devices/bus/nes/hosenkan.cpp b/src/devices/bus/nes/hosenkan.cpp
index a0eedabcd79..72d47061d43 100644
--- a/src/devices/bus/nes/hosenkan.cpp
+++ b/src/devices/bus/nes/hosenkan.cpp
@@ -13,7 +13,7 @@
#include "hosenkan.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#include "screen.h"
@@ -30,17 +30,17 @@
// constructor
//-------------------------------------------------
-const device_type NES_HOSENKAN = device_creator<nes_hosenkan_device>;
+DEFINE_DEVICE_TYPE(NES_HOSENKAN, nes_hosenkan_device, "nes_hosenkan", "NES Cart HOSENKAN PCB")
nes_hosenkan_device::nes_hosenkan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_HOSENKAN, "NES Cart HOSENKAN PCB", tag, owner, clock, "nes_hosenkan", __FILE__),
- m_irq_count(0),
- m_irq_count_latch(0),
- m_irq_clear(0),
- m_irq_enable(0),
- m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_HOSENKAN, tag, owner, clock)
+ , m_irq_count(0)
+ , m_irq_count_latch(0)
+ , m_irq_clear(0)
+ , m_irq_enable(0)
+ , m_latch(0)
+{
}
@@ -89,7 +89,7 @@ void nes_hosenkan_device::pcb_reset()
// same as MMC3!
void nes_hosenkan_device::hblank_irq( int scanline, int vblank, int blanked )
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
int prior_count = m_irq_count;
if ((m_irq_count == 0) || m_irq_clear)
diff --git a/src/devices/bus/nes/hosenkan.h b/src/devices/bus/nes/hosenkan.h
index 0d87cc6acff..153638a9cbe 100644
--- a/src/devices/bus/nes/hosenkan.h
+++ b/src/devices/bus/nes/hosenkan.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_HOSENKAN_H
-#define __NES_HOSENKAN_H
+#ifndef MAME_BUS_NES_HOSENKAN_H
+#define MAME_BUS_NES_HOSENKAN_H
+
+#pragma once
#include "nxrom.h"
@@ -14,14 +16,15 @@ public:
// construction/destruction
nes_hosenkan_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
-
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count, m_irq_count_latch;
uint8_t m_irq_clear;
@@ -30,10 +33,7 @@ private:
uint8_t m_latch;
};
-
-
// device type definition
-extern const device_type NES_HOSENKAN;
-
+DECLARE_DEVICE_TYPE(NES_HOSENKAN, nes_hosenkan_device)
-#endif
+#endif // MAME_BUS_NES_HOSENKAN_H
diff --git a/src/devices/bus/nes/irem.cpp b/src/devices/bus/nes/irem.cpp
index c780d67315d..17fd84643b7 100644
--- a/src/devices/bus/nes/irem.cpp
+++ b/src/devices/bus/nes/irem.cpp
@@ -35,36 +35,36 @@
// constructor
//-------------------------------------------------
-const device_type NES_LROG017 = device_creator<nes_lrog017_device>;
-const device_type NES_HOLYDIVR = device_creator<nes_holydivr_device>;
-const device_type NES_TAM_S1 = device_creator<nes_tam_s1_device>;
-const device_type NES_G101 = device_creator<nes_g101_device>;
-const device_type NES_H3001 = device_creator<nes_h3001_device>;
+DEFINE_DEVICE_TYPE(NES_LROG017, nes_lrog017_device, "nes_lrog017", "NES Cart Irem Discrete 74*161/161/21/138 PCB")
+DEFINE_DEVICE_TYPE(NES_HOLYDIVR, nes_holydivr_device, "nes_holydivr", "NES Cart Irem Holy Diver PCB")
+DEFINE_DEVICE_TYPE(NES_TAM_S1, nes_tam_s1_device, "nes_tam_s1", "NES Cart Irem TAM-S1 PCB")
+DEFINE_DEVICE_TYPE(NES_G101, nes_g101_device, "nes_g101", "NES Cart Irem G-101 PCB")
+DEFINE_DEVICE_TYPE(NES_H3001, nes_h3001_device, "ns_h3001", "NES Cart Irem H-3001 PCB")
nes_lrog017_device::nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_LROG017, "NES Cart Irem Discrete 74*161/161/21/138 PCB", tag, owner, clock, "nes_lrog017", __FILE__)
+ : nes_nrom_device(mconfig, NES_LROG017, tag, owner, clock)
{
}
nes_holydivr_device::nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_HOLYDIVR, "NES Cart Irem Holy Diver PCB", tag, owner, clock, "nes_holydivr", __FILE__)
+ : nes_nrom_device(mconfig, NES_HOLYDIVR, tag, owner, clock)
{
}
nes_tam_s1_device::nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TAM_S1, "NES Cart Irem TAM-S1 PCB", tag, owner, clock, "nes_tam_s1", __FILE__)
+ : nes_nrom_device(mconfig, NES_TAM_S1, tag, owner, clock)
{
}
nes_g101_device::nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_G101, "NES Cart Irem G-101 PCB", tag, owner, clock, "nes_g101", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_G101, tag, owner, clock), m_latch(0)
+{
}
nes_h3001_device::nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_H3001, "NES Cart Irem H-3001 PCB", tag, owner, clock, "nes_h3001", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_H3001, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
diff --git a/src/devices/bus/nes/irem.h b/src/devices/bus/nes/irem.h
index 3aef2278957..a50077e70a3 100644
--- a/src/devices/bus/nes/irem.h
+++ b/src/devices/bus/nes/irem.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_IREM_H
-#define __NES_IREM_H
+#ifndef MAME_BUS_NES_IREM_H
+#define MAME_BUS_NES_IREM_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_lrog017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,11 +34,13 @@ public:
// construction/destruction
nes_holydivr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -46,11 +52,13 @@ public:
// construction/destruction
nes_tam_s1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -62,13 +70,14 @@ public:
// construction/destruction
nes_g101_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_latch;
};
@@ -81,14 +90,15 @@ public:
// construction/destruction
nes_h3001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
uint16_t m_irq_count, m_irq_count_latch;
int m_irq_enable;
@@ -96,13 +106,11 @@ protected:
emu_timer *irq_timer;
};
-
-
// device type definition
-extern const device_type NES_LROG017;
-extern const device_type NES_HOLYDIVR;
-extern const device_type NES_TAM_S1;
-extern const device_type NES_G101;
-extern const device_type NES_H3001;
+DECLARE_DEVICE_TYPE(NES_LROG017, nes_lrog017_device)
+DECLARE_DEVICE_TYPE(NES_HOLYDIVR, nes_holydivr_device)
+DECLARE_DEVICE_TYPE(NES_TAM_S1, nes_tam_s1_device)
+DECLARE_DEVICE_TYPE(NES_G101, nes_g101_device)
+DECLARE_DEVICE_TYPE(NES_H3001, nes_h3001_device)
-#endif
+#endif // MAME_BUS_NES_IREM_H
diff --git a/src/devices/bus/nes/jaleco.cpp b/src/devices/bus/nes/jaleco.cpp
index 9a3ca8922fa..f537d75c696 100644
--- a/src/devices/bus/nes/jaleco.cpp
+++ b/src/devices/bus/nes/jaleco.cpp
@@ -39,104 +39,104 @@
// constructor
//-------------------------------------------------
-const device_type NES_JF11 = device_creator<nes_jf11_device>;
-const device_type NES_JF16 = device_creator<nes_jf16_device>;
-const device_type NES_JF17 = device_creator<nes_jf17_device>;
-const device_type NES_JF19 = device_creator<nes_jf19_device>;
-const device_type NES_SS88006 = device_creator<nes_ss88006_device>;
-const device_type NES_JF13 = device_creator<nes_jf13_device>;
-const device_type NES_JF17_ADPCM = device_creator<nes_jf17_adpcm_device>;
-const device_type NES_JF19_ADPCM = device_creator<nes_jf19_adpcm_device>;
-const device_type NES_JF23 = device_creator<nes_jf23_device>;
-const device_type NES_JF24 = device_creator<nes_jf24_device>;
-const device_type NES_JF29 = device_creator<nes_jf29_device>;
-const device_type NES_JF33 = device_creator<nes_jf33_device>;
+DEFINE_DEVICE_TYPE(NES_JF11, nes_jf11_device, "nes_jf11", "NES Cart Jaleco JF-11 PCB")
+DEFINE_DEVICE_TYPE(NES_JF13, nes_jf13_device, "nes_jf13", "NES Cart Jaleco JF-13 PCB")
+DEFINE_DEVICE_TYPE(NES_JF16, nes_jf16_device, "nes_jf16", "NES Cart Jaleco JF-16 PCB")
+DEFINE_DEVICE_TYPE(NES_JF17, nes_jf17_device, "nes_jf17", "NES Cart Jaleco JF-17 PCB")
+DEFINE_DEVICE_TYPE(NES_JF17_ADPCM, nes_jf17_adpcm_device, "nes_jf17_pcm", "NES Cart Jaleco JF-17 + ADPCM (Moero!! Pro Tennis) PCB")
+DEFINE_DEVICE_TYPE(NES_JF19, nes_jf19_device, "nes_jf19", "NES Cart Jaleco JF-19 (Moero!! Pro Soccer) PCB")
+DEFINE_DEVICE_TYPE(NES_JF19_ADPCM, nes_jf19_adpcm_device, "nes_jf19_pcm", "NES Cart Jaleco JF-19 + ADPCM (Moero!! Pro Yakyuu 88) PCB")
+DEFINE_DEVICE_TYPE(NES_SS88006, nes_ss88006_device, "nes_ss88006", "NES Cart Jaleco SS88006 PCB")
+DEFINE_DEVICE_TYPE(NES_JF23, nes_jf23_device, "nes_jf23", "NES Cart Jaleco JF-23 (Shin Moero Pro Yakyuu) PCB")
+DEFINE_DEVICE_TYPE(NES_JF24, nes_jf24_device, "nes_jf24", "NES Cart Jaleco JF-24 (Terao no Dosukoi Oozumou) PCB")
+DEFINE_DEVICE_TYPE(NES_JF29, nes_jf29_device, "nes_jf29", "NES Cart Jaleco JF-29 (Moe Pro! '90) PCB")
+DEFINE_DEVICE_TYPE(NES_JF33, nes_jf33_device, "nes_jf33", "NES Cart Jaleco JF-33 (Moe Pro! Saikyou-hen) PCB")
nes_jf11_device::nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_JF11, "NES Cart Jaleco JF-11 PCB", tag, owner, clock, "nes_jf11", __FILE__)
+ : nes_nrom_device(mconfig, NES_JF11, tag, owner, clock)
{
}
nes_jf13_device::nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_JF13, "NES Cart Jaleco JF-13 PCB", tag, owner, clock, "nes_jf13", __FILE__),
- m_samples(*this, "samples")
+ : nes_nrom_device(mconfig, NES_JF13, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
nes_jf16_device::nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_JF16, "NES Cart Jaleco JF-16 PCB", tag, owner, clock, "nes_jf16", __FILE__)
+ : nes_nrom_device(mconfig, NES_JF16, tag, owner, clock)
{
}
-nes_jf17_device::nes_jf17_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0)
- {
+nes_jf17_device::nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0)
+{
}
nes_jf17_device::nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_JF17, "NES Cart Jaleco JF-17 PCB", tag, owner, clock, "nes_jf17", __FILE__), m_latch(0)
- {
+ : nes_jf17_device(mconfig, NES_JF17, tag, owner, clock)
+{
}
nes_jf17_adpcm_device::nes_jf17_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jf17_device(mconfig, NES_JF17_ADPCM, "NES Cart Jaleco JF-17 + ADPCM (Moero!! Pro Tennis) PCB", tag, owner, clock, "nes_jf17_pcm", __FILE__),
- m_samples(*this, "samples")
+ : nes_jf17_device(mconfig, NES_JF17_ADPCM, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
-nes_jf19_device::nes_jf19_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_jf19_device::nes_jf19_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock)
{
}
nes_jf19_device::nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_JF19, "NES Cart Jaleco JF-19 (Moero!! Pro Soccer) PCB", tag, owner, clock, "nes_jf19", __FILE__)
+ : nes_jf19_device(mconfig, NES_JF19, tag, owner, clock)
{
}
nes_jf19_adpcm_device::nes_jf19_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jf19_device(mconfig, NES_JF19_ADPCM, "NES Cart Jaleco JF-19 + ADPCM (Moero!! Pro Yakyuu 88) PCB", tag, owner, clock, "nes_jf19_pcm", __FILE__),
- m_samples(*this, "samples")
+ : nes_jf19_device(mconfig, NES_JF19_ADPCM, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
-nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0)
- {
+nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0)
+{
}
nes_ss88006_device::nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SS88006, "NES Cart Jaleco SS88006 PCB", tag, owner, clock, "nes_ss88006", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0)
- {
+ : nes_ss88006_device(mconfig, NES_SS88006, tag, owner, clock)
+{
}
-nes_ss88006_adpcm_device::nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_ss88006_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_ss88006_adpcm_device::nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_ss88006_device(mconfig, type, tag, owner, clock)
{
}
nes_jf23_device::nes_jf23_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF23, "NES Cart Jaleco Shin Moero Pro Yakyuu PCB", tag, owner, clock, "nes_jf23", __FILE__),
- m_samples(*this, "samples")
+ : nes_ss88006_adpcm_device(mconfig, NES_JF23, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
nes_jf24_device::nes_jf24_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF24, "NES Cart Jaleco Terao no Dosukoi Oozumou PCB", tag, owner, clock, "nes_jf24", __FILE__),
- m_samples(*this, "samples")
+ : nes_ss88006_adpcm_device(mconfig, NES_JF24, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
nes_jf29_device::nes_jf29_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF29, "NES Cart Jaleco Moe Pro! '90 PCB", tag, owner, clock, "nes_jf29", __FILE__),
- m_samples(*this, "samples")
+ : nes_ss88006_adpcm_device(mconfig, NES_JF29, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
nes_jf33_device::nes_jf33_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ss88006_adpcm_device(mconfig, NES_JF33, "NES Cart Jaleco Moe Pro! Saikyou-hen PCB", tag, owner, clock, "nes_jf33", __FILE__),
- m_samples(*this, "samples")
+ : nes_ss88006_adpcm_device(mconfig, NES_JF33, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
diff --git a/src/devices/bus/nes/jaleco.h b/src/devices/bus/nes/jaleco.h
index 5ad09a78cba..5fe977bba04 100644
--- a/src/devices/bus/nes/jaleco.h
+++ b/src/devices/bus/nes/jaleco.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_JALECO_H
-#define __NES_JALECO_H
+#ifndef MAME_BUS_NES_JALECO_H
+#define MAME_BUS_NES_JALECO_H
+
+#pragma once
#include "nxrom.h"
#include "sound/samples.h"
@@ -15,11 +17,13 @@ public:
// construction/destruction
nes_jf11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -31,13 +35,15 @@ public:
// construction/destruction
nes_jf13_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
required_device<samples_device> m_samples;
};
@@ -51,11 +57,13 @@ public:
// construction/destruction
nes_jf16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -65,16 +73,18 @@ class nes_jf17_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_jf17_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_jf17_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
protected:
+ nes_jf17_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_latch;
};
@@ -101,14 +111,17 @@ class nes_jf19_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_jf19_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_jf19_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ nes_jf19_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -134,18 +147,20 @@ class nes_ss88006_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_ss88006_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_ss88006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(ss88006_write);
virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_write(space, offset, data, mem_mask); }
virtual void pcb_reset() override;
protected:
+ nes_ss88006_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
uint16_t m_irq_count, m_irq_count_latch;
uint8_t m_irq_mode;
int m_irq_enable;
@@ -164,11 +179,10 @@ protected:
class nes_ss88006_adpcm_device : public nes_ss88006_device
{
-public:
+protected:
// construction/destruction
- nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
+ nes_ss88006_adpcm_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
void ss88006_adpcm_write(address_space &space, offs_t offset, uint8_t data, samples_device *dev);
};
@@ -184,8 +198,9 @@ public:
virtual machine_config_constructor device_mconfig_additions() const override;
private:
- required_device<samples_device> m_samples;
virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); }
+
+ required_device<samples_device> m_samples;
};
@@ -200,8 +215,9 @@ public:
virtual machine_config_constructor device_mconfig_additions() const override;
private:
- required_device<samples_device> m_samples;
virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); }
+
+ required_device<samples_device> m_samples;
};
@@ -216,8 +232,9 @@ public:
virtual machine_config_constructor device_mconfig_additions() const override;
private:
- required_device<samples_device> m_samples;
virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); }
+
+ required_device<samples_device> m_samples;
};
@@ -232,25 +249,24 @@ public:
virtual machine_config_constructor device_mconfig_additions() const override;
private:
- required_device<samples_device> m_samples;
virtual DECLARE_WRITE8_MEMBER(write_h) override { ss88006_adpcm_write(space, offset, data, m_samples); }
-};
-
+ required_device<samples_device> m_samples;
+};
// device type definition
-extern const device_type NES_JF11;
-extern const device_type NES_JF13;
-extern const device_type NES_JF16;
-extern const device_type NES_JF17;
-extern const device_type NES_JF17_ADPCM;
-extern const device_type NES_JF19;
-extern const device_type NES_JF19_ADPCM;
-extern const device_type NES_SS88006;
-extern const device_type NES_JF23;
-extern const device_type NES_JF24;
-extern const device_type NES_JF29;
-extern const device_type NES_JF33;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_JF11, nes_jf11_device)
+DECLARE_DEVICE_TYPE(NES_JF13, nes_jf13_device)
+DECLARE_DEVICE_TYPE(NES_JF16, nes_jf16_device)
+DECLARE_DEVICE_TYPE(NES_JF17, nes_jf17_device)
+DECLARE_DEVICE_TYPE(NES_JF17_ADPCM, nes_jf17_adpcm_device)
+DECLARE_DEVICE_TYPE(NES_JF19, nes_jf19_device)
+DECLARE_DEVICE_TYPE(NES_JF19_ADPCM, nes_jf19_adpcm_device)
+DECLARE_DEVICE_TYPE(NES_SS88006, nes_ss88006_device)
+DECLARE_DEVICE_TYPE(NES_JF23, nes_jf23_device)
+DECLARE_DEVICE_TYPE(NES_JF24, nes_jf24_device)
+DECLARE_DEVICE_TYPE(NES_JF29, nes_jf29_device)
+DECLARE_DEVICE_TYPE(NES_JF33, nes_jf33_device)
+
+#endif // MAME_BUS_NES_JALECO_H
diff --git a/src/devices/bus/nes/jy.cpp b/src/devices/bus/nes/jy.cpp
index d7582128e80..38a30848859 100644
--- a/src/devices/bus/nes/jy.cpp
+++ b/src/devices/bus/nes/jy.cpp
@@ -22,7 +22,7 @@
#include "jy.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#ifdef NES_PCB_DEBUG
#define VERBOSE 1
@@ -37,36 +37,34 @@
// constructor
//-------------------------------------------------
-const device_type NES_JY_TYPEA = device_creator<nes_jy_typea_device>;
-const device_type NES_JY_TYPEB = device_creator<nes_jy_typeb_device>;
-const device_type NES_JY_TYPEC = device_creator<nes_jy_typec_device>;
+DEFINE_DEVICE_TYPE(NES_JY_TYPEA, nes_jy_typea_device, "nes_jya", "NES Cart JY Company Type A PCB")
+DEFINE_DEVICE_TYPE(NES_JY_TYPEB, nes_jy_typeb_device, "nes_jyb", "NES Cart JY Company Type B PCB")
+DEFINE_DEVICE_TYPE(NES_JY_TYPEC, nes_jy_typec_device, "nes_jyc", "NES Cart JY Company Type C PCB")
-nes_jy_typea_device::nes_jy_typea_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_extra_chr_bank(0), m_extra_chr_mask(0), m_bank_6000(0),
+nes_jy_typea_device::nes_jy_typea_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_extra_chr_bank(0), m_extra_chr_mask(0), m_bank_6000(0),
m_irq_mode(0), m_irq_count(0), m_irq_prescale(0), m_irq_prescale_mask(0), m_irq_flip(0), m_irq_enable(0), m_irq_up(0), m_irq_down(0), irq_timer(nullptr)
- {
+{
}
nes_jy_typea_device::nes_jy_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_JY_TYPEA, "NES Cart JY Company Type A PCB", tag, owner, clock, "nes_jya", __FILE__), m_latch(0), m_extra_chr_bank(0),
- m_extra_chr_mask(0), m_bank_6000(0), m_irq_mode(0), m_irq_count(0), m_irq_prescale(0), m_irq_prescale_mask(0), m_irq_flip(0), m_irq_enable(0), m_irq_up(0),
- m_irq_down(0), irq_timer(nullptr)
+ : nes_nrom_device(mconfig, NES_JY_TYPEA, tag, owner, clock)
{
}
-nes_jy_typeb_device::nes_jy_typeb_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_jy_typea_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_jy_typeb_device::nes_jy_typeb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_jy_typea_device(mconfig, type, tag, owner, clock)
{
}
nes_jy_typeb_device::nes_jy_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jy_typea_device(mconfig, NES_JY_TYPEB, "NES Cart JY Company Type B PCB", tag, owner, clock, "nes_jyb", __FILE__)
+ : nes_jy_typeb_device(mconfig, NES_JY_TYPEB, tag, owner, clock)
{
}
nes_jy_typec_device::nes_jy_typec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_jy_typeb_device(mconfig, NES_JY_TYPEC, "NES Cart JY Company Type C PCB", tag, owner, clock, "nes_jyc", __FILE__)
+ : nes_jy_typeb_device(mconfig, NES_JY_TYPEC, tag, owner, clock)
{
}
@@ -238,7 +236,7 @@ void nes_jy_typea_device::device_timer(emu_timer &timer, device_timer_id id, int
void nes_jy_typea_device::scanline_irq(int scanline, int vblank, int blanked)
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
irq_clock(blanked, 1);
}
diff --git a/src/devices/bus/nes/jy.h b/src/devices/bus/nes/jy.h
index 5c835e42a87..80be5d98631 100644
--- a/src/devices/bus/nes/jy.h
+++ b/src/devices/bus/nes/jy.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_JY_H
-#define __NES_JY_H
+#ifndef MAME_BUS_NES_JY_H
+#define MAME_BUS_NES_JY_H
+
+#pragma once
#include "nxrom.h"
@@ -12,12 +14,8 @@ class nes_jy_typea_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_jy_typea_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_jy_typea_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
@@ -30,6 +28,12 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_jy_typea_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
void irq_clock(int blanked, int mode);
void update_banks(int reg);
void update_prg();
@@ -69,10 +73,11 @@ class nes_jy_typeb_device : public nes_jy_typea_device
{
public:
// construction/destruction
- nes_jy_typeb_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_jy_typeb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
+ nes_jy_typeb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
void update_mirror_typeb();
virtual void update_mirror() override { update_mirror_typeb(); }
};
@@ -93,12 +98,9 @@ protected:
};
-
-
-
// device type definition
-extern const device_type NES_JY_TYPEA;
-extern const device_type NES_JY_TYPEB;
-extern const device_type NES_JY_TYPEC;
+DECLARE_DEVICE_TYPE(NES_JY_TYPEA, nes_jy_typea_device)
+DECLARE_DEVICE_TYPE(NES_JY_TYPEB, nes_jy_typeb_device)
+DECLARE_DEVICE_TYPE(NES_JY_TYPEC, nes_jy_typec_device)
-#endif
+#endif // MAME_BUS_NES_JY_H
diff --git a/src/devices/bus/nes/kaiser.cpp b/src/devices/bus/nes/kaiser.cpp
index 5f6b7776057..5ec2355dba6 100644
--- a/src/devices/bus/nes/kaiser.cpp
+++ b/src/devices/bus/nes/kaiser.cpp
@@ -48,70 +48,70 @@
// constructor
//-------------------------------------------------
-const device_type NES_KS7058 = device_creator<nes_ks7058_device>;
-const device_type NES_KS7022 = device_creator<nes_ks7022_device>;
-const device_type NES_KS7032 = device_creator<nes_ks7032_device>;
-const device_type NES_KS202 = device_creator<nes_ks202_device>;
-const device_type NES_KS7017 = device_creator<nes_ks7017_device>;
-const device_type NES_KS7012 = device_creator<nes_ks7012_device>;
-const device_type NES_KS7013B = device_creator<nes_ks7013b_device>;
-const device_type NES_KS7031 = device_creator<nes_ks7031_device>;
-const device_type NES_KS7016 = device_creator<nes_ks7016_device>;
-const device_type NES_KS7037 = device_creator<nes_ks7037_device>;
+DEFINE_DEVICE_TYPE(NES_KS7058, nes_ks7058_device, "nes_ks7058", "NES Cart Kaiser KS-7058 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7022, nes_ks7022_device, "nes_ks7022", "NES Cart Kaiser KS-7022 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7032, nes_ks7032_device, "nes_ks7032", "NES Cart Kaiser KS-7032 PCB")
+DEFINE_DEVICE_TYPE(NES_KS202, nes_ks202_device, "nes_ks202", "NES Cart Kaiser KS-202 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7017, nes_ks7017_device, "nes_ks7017", "NES Cart Kaiser KS-7017 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7012, nes_ks7012_device, "nes_ks7012", "NES Cart Kaiser KS-7012 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7013B, nes_ks7013b_device, "nes_ks7013b", "NES Cart Kaiser KS-7013B PCB")
+DEFINE_DEVICE_TYPE(NES_KS7031, nes_ks7031_device, "nes_ks7031", "NES Cart Kaiser KS-7031 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7016, nes_ks7016_device, "nes_ks7016", "NES Cart Kaiser KS-7016 PCB")
+DEFINE_DEVICE_TYPE(NES_KS7037, nes_ks7037_device, "nes_ks7037", "NES Cart Kaiser KS-7037 PCB")
nes_ks7058_device::nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7058, "NES Cart Kaiser KS-7058 PCB", tag, owner, clock, "nes_ks7058", __FILE__)
+ : nes_nrom_device(mconfig, NES_KS7058, tag, owner, clock)
{
}
nes_ks7022_device::nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7022, "NES Cart Kaiser KS-7022 PCB", tag, owner, clock, "nes_ks7022", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_KS7022, tag, owner, clock), m_latch(0)
+{
}
-nes_ks7032_device::nes_ks7032_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+nes_ks7032_device::nes_ks7032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_ks7032_device::nes_ks7032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7032, "NES Cart Kaiser KS-7032 PCB", tag, owner, clock, "nes_ks7032", __FILE__), m_latch(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_ks7032_device(mconfig, NES_KS7032, tag, owner, clock)
+{
}
nes_ks202_device::nes_ks202_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ks7032_device(mconfig, NES_KS202, "NES Cart Kaiser KS-202 PCB", tag, owner, clock, "nes_ks202", __FILE__)
+ : nes_ks7032_device(mconfig, NES_KS202, tag, owner, clock)
{
}
nes_ks7017_device::nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7017, "NES Cart Kaiser KS-7017 PCB", tag, owner, clock, "nes_ks7017", __FILE__), m_latch(0), m_irq_count(0), m_irq_status(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_KS7017, tag, owner, clock), m_latch(0), m_irq_count(0), m_irq_status(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_ks7012_device::nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7012, "NES Cart Kaiser KS-7012 PCB", tag, owner, clock, "nes_ks7012", __FILE__)
+ : nes_nrom_device(mconfig, NES_KS7012, tag, owner, clock)
{
}
nes_ks7013b_device::nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7013B, "NES Cart Kaiser KS-7013B PCB", tag, owner, clock, "nes_ks7013b", __FILE__)
+ : nes_nrom_device(mconfig, NES_KS7013B, tag, owner, clock)
{
}
nes_ks7031_device::nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7031, "NES Cart Kaiser KS-7031 PCB", tag, owner, clock, "nes_ks7031", __FILE__)
+ : nes_nrom_device(mconfig, NES_KS7031, tag, owner, clock)
{
}
nes_ks7016_device::nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7016, "NES Cart Kaiser KS-7016 PCB", tag, owner, clock, "nes_ks7016", __FILE__)
+ : nes_nrom_device(mconfig, NES_KS7016, tag, owner, clock)
{
}
nes_ks7037_device::nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KS7037, "NES Cart Kaiser KS-7037 PCB", tag, owner, clock, "nes_ks7037", __FILE__)
+ : nes_nrom_device(mconfig, NES_KS7037, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/kaiser.h b/src/devices/bus/nes/kaiser.h
index c6d094d4390..8c544059aa9 100644
--- a/src/devices/bus/nes/kaiser.h
+++ b/src/devices/bus/nes/kaiser.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_KAISER_H
-#define __NES_KAISER_H
+#ifndef MAME_BUS_NES_KAISER_H
+#define MAME_BUS_NES_KAISER_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_ks7058_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,13 +34,15 @@ public:
// construction/destruction
nes_ks7022_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -48,12 +54,8 @@ class nes_ks7032_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_ks7032_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_ks7032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(ks7032_write);
virtual DECLARE_WRITE8_MEMBER(write_h) override { ks7032_write(space, offset, data, mem_mask); }
@@ -61,6 +63,12 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_ks7032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
void prg_update();
uint8_t m_latch;
@@ -96,15 +104,17 @@ public:
// construction/destruction
nes_ks7017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_ex) override;
virtual DECLARE_WRITE8_MEMBER(write_ex) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint8_t m_latch;
@@ -125,11 +135,13 @@ public:
// construction/destruction
nes_ks7012_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
// ======================> nes_ks7013b_device
@@ -140,12 +152,14 @@ public:
// construction/destruction
nes_ks7013b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -157,14 +171,16 @@ public:
// construction/destruction
nes_ks7031_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
};
@@ -178,13 +194,15 @@ public:
// construction/destruction
nes_ks7016_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
};
@@ -197,8 +215,6 @@ public:
// construction/destruction
nes_ks7037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
@@ -206,6 +222,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_prg();
uint8_t m_latch;
@@ -213,18 +233,16 @@ private:
};
-
-
// device type definition
-extern const device_type NES_KS7058;
-extern const device_type NES_KS7022;
-extern const device_type NES_KS7032;
-extern const device_type NES_KS202;
-extern const device_type NES_KS7017;
-extern const device_type NES_KS7012;
-extern const device_type NES_KS7013B;
-extern const device_type NES_KS7031;
-extern const device_type NES_KS7016;
-extern const device_type NES_KS7037;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_KS7058, nes_ks7058_device)
+DECLARE_DEVICE_TYPE(NES_KS7022, nes_ks7022_device)
+DECLARE_DEVICE_TYPE(NES_KS7032, nes_ks7032_device)
+DECLARE_DEVICE_TYPE(NES_KS202, nes_ks202_device)
+DECLARE_DEVICE_TYPE(NES_KS7017, nes_ks7017_device)
+DECLARE_DEVICE_TYPE(NES_KS7012, nes_ks7012_device)
+DECLARE_DEVICE_TYPE(NES_KS7013B, nes_ks7013b_device)
+DECLARE_DEVICE_TYPE(NES_KS7031, nes_ks7031_device)
+DECLARE_DEVICE_TYPE(NES_KS7016, nes_ks7016_device)
+DECLARE_DEVICE_TYPE(NES_KS7037, nes_ks7037_device)
+
+#endif // MAME_BUS_NES_KAISER_H
diff --git a/src/devices/bus/nes/karastudio.cpp b/src/devices/bus/nes/karastudio.cpp
index 7ed30571e89..0aae32c0606 100644
--- a/src/devices/bus/nes/karastudio.cpp
+++ b/src/devices/bus/nes/karastudio.cpp
@@ -51,9 +51,9 @@
//-------------------------------------------------
kstudio_cart_interface::kstudio_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr), m_bank(0)
- {
+ : device_slot_card_interface(mconfig, device)
+ , m_rom(nullptr), m_bank(0)
+{
}
kstudio_cart_interface::~kstudio_cart_interface()
@@ -69,12 +69,13 @@ READ8_MEMBER(kstudio_cart_interface::read)
// sub-cart slot device
//-------------------------------------------------
-const device_type NES_KSEXPANSION_SLOT = device_creator<nes_kstudio_slot_device>;
+DEFINE_DEVICE_TYPE(NES_KSEXPANSION_SLOT, nes_kstudio_slot_device, "nes_ks_slot", "NES Karaoke Studio Expansion Slot")
-nes_kstudio_slot_device::nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, NES_KSEXPANSION_SLOT, "NES Karaoke Studio Expansion Slot", tag, owner, clock, "nes_ks_slot", __FILE__),
- device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this), m_cart(nullptr)
+nes_kstudio_slot_device::nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, NES_KSEXPANSION_SLOT, tag, owner, clock)
+ , device_image_interface(mconfig, *this)
+ , device_slot_interface(mconfig, *this)
+ , m_cart(nullptr)
{
}
@@ -142,11 +143,11 @@ ROM_START( ks_exp_rom )
ROM_REGION(0x20000, "exrom", ROMREGION_ERASEFF)
ROM_END
-const device_type NES_KSEXPANSION_ROM = device_creator<nes_kstudio_rom_device>;
+DEFINE_DEVICE_TYPE(NES_KSEXPANSION_ROM, nes_kstudio_rom_device, "nes_ks_rom", "NES Karaoke Studio Expansion ROM")
nes_kstudio_rom_device::nes_kstudio_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NES_KSEXPANSION_ROM, "NES Karaoke Studio Expansion ROM", tag, owner, clock, "nes_ks_rom", __FILE__),
- kstudio_cart_interface( mconfig, *this )
+ : device_t(mconfig, NES_KSEXPANSION_ROM, tag, owner, clock)
+ , kstudio_cart_interface( mconfig, *this )
{
}
@@ -178,13 +179,14 @@ uint8_t *nes_kstudio_rom_device::get_cart_base()
//
//------------------------------------------
-const device_type NES_KARAOKESTUDIO = device_creator<nes_karaokestudio_device>;
+DEFINE_DEVICE_TYPE(NES_KARAOKESTUDIO, nes_karaokestudio_device, "nes_karaoke", "NES Cart Bandai Karaoke Studio PCB")
nes_karaokestudio_device::nes_karaokestudio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_KARAOKESTUDIO, "NES Cart Bandai Karaoke Studio PCB", tag, owner, clock, "nes_karaoke", __FILE__), m_exp_active(0),
- m_subslot(*this, "exp_slot"),
- m_mic_ipt(*this, "MIC")
+ : nes_nrom_device(mconfig, NES_KARAOKESTUDIO, tag, owner, clock)
+ , m_exp_active(0)
+ , m_subslot(*this, "exp_slot")
+ , m_mic_ipt(*this, "MIC")
{
}
diff --git a/src/devices/bus/nes/karastudio.h b/src/devices/bus/nes/karastudio.h
index a4f8bcdb20e..148c1fd1be1 100644
--- a/src/devices/bus/nes/karastudio.h
+++ b/src/devices/bus/nes/karastudio.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_KARASTUDIO_H
-#define __NES_KARASTUDIO_H
+#ifndef MAME_BUS_NES_KARASTUDIO_H
+#define MAME_BUS_NES_KARASTUDIO_H
+
+#pragma once
#include "nxrom.h"
#include "softlist_dev.h"
@@ -19,7 +21,6 @@ class kstudio_cart_interface : public device_slot_card_interface
{
public:
// construction/destruction
- kstudio_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~kstudio_cart_interface();
// reading and writing
@@ -29,6 +30,8 @@ public:
void write_prg_bank(uint8_t bank) { m_bank = bank; }
protected:
+ kstudio_cart_interface(const machine_config &mconfig, device_t &device);
+
// internal state
uint8_t *m_rom;
// ROM is accessed via two 16K banks, but only the first one can be switched
@@ -37,18 +40,18 @@ protected:
// ======================> nes_kstudio_slot_device
+class nes_karaokestudio_device;
+
class nes_kstudio_slot_device : public device_t,
public device_image_interface,
public device_slot_interface
{
+ friend class nes_karaokestudio_device;
public:
// construction/destruction
nes_kstudio_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual ~nes_kstudio_slot_device();
- // device-level overrides
- virtual void device_start() override;
-
// image-level overrides
virtual image_init_result call_load() override;
virtual const software_list_loader &get_software_list_loader() const override { return rom_software_list_loader::instance(); }
@@ -68,11 +71,15 @@ public:
virtual DECLARE_READ8_MEMBER(read);
void write_prg_bank(uint8_t bank) { if (m_cart) m_cart->write_prg_bank(bank); }
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
kstudio_cart_interface* m_cart;
};
// device type definition
-extern const device_type NES_KSEXPANSION_SLOT;
+DECLARE_DEVICE_TYPE(NES_KSEXPANSION_SLOT, nes_kstudio_slot_device)
#define MCFG_KSTUDIO_MINICART_ADD(_tag, _slot_intf) \
@@ -106,7 +113,7 @@ protected:
};
// device type definition
-extern const device_type NES_KSEXPANSION_ROM;
+DECLARE_DEVICE_TYPE(NES_KSEXPANSION_ROM, nes_kstudio_rom_device)
//-------------------------------------------
@@ -123,10 +130,9 @@ public:
// construction/destruction
nes_karaokestudio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual ioport_constructor device_input_ports() const override;
virtual machine_config_constructor device_mconfig_additions() const override;
+
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -134,6 +140,9 @@ public:
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
int m_exp_active;
required_device<nes_kstudio_slot_device> m_subslot;
required_ioport m_mic_ipt;
@@ -141,6 +150,6 @@ protected:
// device type definition
-extern const device_type NES_KARAOKESTUDIO;
+DECLARE_DEVICE_TYPE(NES_KARAOKESTUDIO, nes_karaokestudio_device)
-#endif
+#endif // MAME_BUS_NES_KARASTUDIO_H
diff --git a/src/devices/bus/nes/konami.cpp b/src/devices/bus/nes/konami.cpp
index fd6de204003..c7c10097970 100644
--- a/src/devices/bus/nes/konami.cpp
+++ b/src/devices/bus/nes/konami.cpp
@@ -43,48 +43,46 @@
// constructor
//-------------------------------------------------
-const device_type NES_VRC1 = device_creator<nes_konami_vrc1_device>;
-const device_type NES_VRC2 = device_creator<nes_konami_vrc2_device>;
-const device_type NES_VRC3 = device_creator<nes_konami_vrc3_device>;
-const device_type NES_VRC4 = device_creator<nes_konami_vrc4_device>;
-const device_type NES_VRC6 = device_creator<nes_konami_vrc6_device>;
-const device_type NES_VRC7 = device_creator<nes_konami_vrc7_device>;
+DEFINE_DEVICE_TYPE(NES_VRC1, nes_konami_vrc1_device, "nes_vrc1", "NES Cart Konami VRC-1 PCB")
+DEFINE_DEVICE_TYPE(NES_VRC2, nes_konami_vrc2_device, "nes_vrc2", "NES Cart Konami VRC-2 PCB")
+DEFINE_DEVICE_TYPE(NES_VRC3, nes_konami_vrc3_device, "nes_vrc3", "NES Cart Konami VRC-3 PCB")
+DEFINE_DEVICE_TYPE(NES_VRC4, nes_konami_vrc4_device, "nes_vrc4", "NES Cart Konami VRC-4 PCB")
+DEFINE_DEVICE_TYPE(NES_VRC6, nes_konami_vrc6_device, "nes_vrc6", "NES Cart Konami VRC-6 PCB")
+DEFINE_DEVICE_TYPE(NES_VRC7, nes_konami_vrc7_device, "nes_vrc7", "NES Cart Konami VRC-7 PCB")
nes_konami_vrc1_device::nes_konami_vrc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_VRC1, "NES Cart Konami VRC-1 PCB", tag, owner, clock, "nes_vrc1", __FILE__)
+ : nes_nrom_device(mconfig, NES_VRC1, tag, owner, clock)
{
}
nes_konami_vrc2_device::nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_VRC2, "NES Cart Konami VRC-2 PCB", tag, owner, clock, "nes_vrc2", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_VRC2, tag, owner, clock), m_latch(0)
+{
}
nes_konami_vrc3_device::nes_konami_vrc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_VRC3, "NES Cart Konami VRC-3 PCB", tag, owner, clock, "nes_vrc3", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_VRC3, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), irq_timer(nullptr)
+{
}
-nes_konami_vrc4_device::nes_konami_vrc4_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_mmc_prg_bank(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), m_irq_prescale(0), irq_timer(nullptr)
- {
+nes_konami_vrc4_device::nes_konami_vrc4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_mmc_prg_bank(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), m_irq_prescale(0), irq_timer(nullptr)
+{
}
nes_konami_vrc4_device::nes_konami_vrc4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_VRC4, "NES Cart Konami VRC-4 PCB", tag, owner, clock, "nes_vrc4", __FILE__), m_latch(0), m_mmc_prg_bank(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0), m_irq_mode(0), m_irq_prescale(0), irq_timer(nullptr)
- {
+ : nes_konami_vrc4_device(mconfig, NES_VRC4, tag, owner, clock)
+{
}
nes_konami_vrc6_device::nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_konami_vrc4_device(mconfig, NES_VRC6, "NES Cart Konami VRC-6 PCB", tag, owner, clock, "nes_vrc6", __FILE__),
- m_vrc6snd(*this, "vrc6snd")
+ : nes_konami_vrc4_device(mconfig, NES_VRC6, tag, owner, clock), m_vrc6snd(*this, "vrc6snd")
{
}
nes_konami_vrc7_device::nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_konami_vrc4_device(mconfig, NES_VRC7, "NES Cart Konami VRC-7 PCB", tag, owner, clock, "nes_vrc7", __FILE__),
- m_ym2413(*this, "ym")
+ : nes_konami_vrc4_device(mconfig, NES_VRC7, tag, owner, clock), m_ym2413(*this, "ym")
{
}
diff --git a/src/devices/bus/nes/konami.h b/src/devices/bus/nes/konami.h
index 11a6e943bb3..ce711ef2803 100644
--- a/src/devices/bus/nes/konami.h
+++ b/src/devices/bus/nes/konami.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_KONAMI_H
-#define __NES_KONAMI_H
+#ifndef MAME_BUS_NES_KONAMI_H
+#define MAME_BUS_NES_KONAMI_H
+
+#pragma once
#include "nxrom.h"
#include "sound/vrc6.h"
@@ -16,12 +18,14 @@ public:
// construction/destruction
nes_konami_vrc1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_mmc_vrom_bank[2];
};
@@ -35,14 +39,16 @@ public:
// construction/destruction
nes_konami_vrc2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_mmc_vrom_bank[8];
uint8_t m_latch;
@@ -57,19 +63,22 @@ public:
// construction/destruction
nes_konami_vrc3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
uint16_t m_irq_count, m_irq_count_latch;
int m_irq_enable, m_irq_enable_latch;
int m_irq_mode;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
};
@@ -80,17 +89,21 @@ class nes_konami_vrc4_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_konami_vrc4_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_konami_vrc4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
protected:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
+ nes_konami_vrc4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
void set_prg();
uint8_t m_mmc_vrom_bank[8];
uint8_t m_latch, m_mmc_prg_bank;
@@ -101,7 +114,6 @@ protected:
int m_irq_mode;
int m_irq_prescale;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
};
@@ -114,11 +126,13 @@ public:
// construction/destruction
nes_konami_vrc6_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
required_device<vrc6snd_device> m_vrc6snd;
};
@@ -131,25 +145,26 @@ public:
// construction/destruction
nes_konami_vrc7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
required_device<ym2413_device> m_ym2413;
};
-
// device type definition
-extern const device_type NES_VRC1;
-extern const device_type NES_VRC2;
-extern const device_type NES_VRC3;
-extern const device_type NES_VRC4;
-extern const device_type NES_VRC6;
-extern const device_type NES_VRC7;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_VRC1, nes_konami_vrc1_device)
+DECLARE_DEVICE_TYPE(NES_VRC2, nes_konami_vrc2_device)
+DECLARE_DEVICE_TYPE(NES_VRC3, nes_konami_vrc3_device)
+DECLARE_DEVICE_TYPE(NES_VRC4, nes_konami_vrc4_device)
+DECLARE_DEVICE_TYPE(NES_VRC6, nes_konami_vrc6_device)
+DECLARE_DEVICE_TYPE(NES_VRC7, nes_konami_vrc7_device)
+
+#endif // MAME_BUS_NES_KONAMI_H
diff --git a/src/devices/bus/nes/legacy.cpp b/src/devices/bus/nes/legacy.cpp
index c5342004351..73528ede404 100644
--- a/src/devices/bus/nes/legacy.cpp
+++ b/src/devices/bus/nes/legacy.cpp
@@ -34,28 +34,28 @@
// constructor
//-------------------------------------------------
-const device_type NES_FFE3 = device_creator<nes_ffe3_device>;
-const device_type NES_FFE4 = device_creator<nes_ffe4_device>;
-const device_type NES_FFE8 = device_creator<nes_ffe8_device>;
+DEFINE_DEVICE_TYPE(NES_FFE3, nes_ffe3_device, "nes_ff3", "NES Cart FFE-3 PCB")
+DEFINE_DEVICE_TYPE(NES_FFE4, nes_ffe4_device, "nes_ff4", "NES Cart FFE-4 PCB")
+DEFINE_DEVICE_TYPE(NES_FFE8, nes_ffe8_device, "nes_ff8", "NES Cart FFE-8 PCB")
nes_ffe3_device::nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FFE3, "NES Cart FFE-3 PCB", tag, owner, clock, "nes_ff3", __FILE__)
+ : nes_nrom_device(mconfig, NES_FFE3, tag, owner, clock)
{
}
-nes_ffe4_device::nes_ffe4_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_exram_enabled(0), m_exram_bank(0)
- {
+nes_ffe4_device::nes_ffe4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_exram_enabled(0), m_exram_bank(0)
+{
}
nes_ffe4_device::nes_ffe4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FFE4, "NES Cart FFE-4 PCB", tag, owner, clock, "nes_ff4", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_exram_enabled(0), m_exram_bank(0)
- {
+ : nes_ffe4_device(mconfig, NES_FFE4, tag, owner, clock)
+{
}
nes_ffe8_device::nes_ffe8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_ffe4_device(mconfig, NES_FFE8, "NES Cart FFE-8 PCB", tag, owner, clock, "nes_ff8", __FILE__)
+ : nes_ffe4_device(mconfig, NES_FFE8, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/legacy.h b/src/devices/bus/nes/legacy.h
index 396eec92b46..91b44e108c0 100644
--- a/src/devices/bus/nes/legacy.h
+++ b/src/devices/bus/nes/legacy.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_LEGACY_H
-#define __NES_LEGACY_H
+#ifndef MAME_BUS_NES_LEGACY_H
+#define MAME_BUS_NES_LEGACY_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_ffe3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -28,12 +32,8 @@ class nes_ffe4_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_ffe4_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_ffe4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual DECLARE_READ8_MEMBER(chr_r) override;
@@ -42,10 +42,17 @@ public:
virtual void pcb_reset() override;
protected:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
+ nes_ffe4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
uint16_t m_irq_count;
int m_irq_enable;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
uint8_t m_latch;
@@ -71,11 +78,9 @@ public:
};
-
// device type definition
-extern const device_type NES_FFE3;
-extern const device_type NES_FFE4;
-extern const device_type NES_FFE8;
-
+DECLARE_DEVICE_TYPE(NES_FFE3, nes_ffe3_device)
+DECLARE_DEVICE_TYPE(NES_FFE4, nes_ffe4_device)
+DECLARE_DEVICE_TYPE(NES_FFE8, nes_ffe8_device)
-#endif
+#endif // MAME_BUS_NES_LEGACY_H
diff --git a/src/devices/bus/nes/mmc1.cpp b/src/devices/bus/nes/mmc1.cpp
index fe1680116af..d324c153782 100644
--- a/src/devices/bus/nes/mmc1.cpp
+++ b/src/devices/bus/nes/mmc1.cpp
@@ -32,35 +32,35 @@
// constructor
//-------------------------------------------------
-const device_type NES_SXROM = device_creator<nes_sxrom_device>;
-const device_type NES_SOROM = device_creator<nes_sorom_device>;
-const device_type NES_SXROM_A = device_creator<nes_sxrom_a_device>;
-const device_type NES_SOROM_A = device_creator<nes_sorom_a_device>;
+DEFINE_DEVICE_TYPE(NES_SXROM, nes_sxrom_device, "nes_sxrom", "NES Cart SxROM (MMC-1) PCB")
+DEFINE_DEVICE_TYPE(NES_SOROM, nes_sorom_device, "nes_sorom", "NES Cart SOROM (MMC-1) PCB")
+DEFINE_DEVICE_TYPE(NES_SXROM_A, nes_sxrom_a_device, "nes_sxrom_a", "NES Cart SxROM (MMC-1A) PCB")
+DEFINE_DEVICE_TYPE(NES_SOROM_A, nes_sorom_a_device, "nes_sorom_a", "NES Cart SOROM (MMC-1A) PCB")
-nes_sxrom_device::nes_sxrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_reg_write_enable(0), m_latch(0), m_count(0)
- {
+nes_sxrom_device::nes_sxrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_reg_write_enable(0), m_latch(0), m_count(0)
+{
}
nes_sxrom_device::nes_sxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SXROM, "NES Cart SxROM (MMC-1) PCB", tag, owner, clock, "nes_sxrom", __FILE__), m_reg_write_enable(0), m_latch(0), m_count(0)
- {
+ : nes_sxrom_device(mconfig, NES_SXROM, tag, owner, clock)
+{
}
nes_sorom_device::nes_sorom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sxrom_device(mconfig, NES_SOROM, "NES Cart SOROM (MMC-1) PCB", tag, owner, clock, "nes_sorom", __FILE__)
+ : nes_sxrom_device(mconfig, NES_SOROM, tag, owner, clock)
{
}
nes_sxrom_a_device::nes_sxrom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sxrom_device(mconfig, NES_SXROM_A, "NES Cart SxROM (MMC-1A) PCB", tag, owner, clock, "nes_sxrom_a", __FILE__)
+ : nes_sxrom_device(mconfig, NES_SXROM_A, tag, owner, clock)
{
}
nes_sorom_a_device::nes_sorom_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sxrom_device(mconfig, NES_SOROM_A, "NES Cart SOROM (MMC-1A) PCB", tag, owner, clock, "nes_sorom_a", __FILE__)
+ : nes_sxrom_device(mconfig, NES_SOROM_A, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/mmc1.h b/src/devices/bus/nes/mmc1.h
index 8b30b6f0bbf..dd9ecccac75 100644
--- a/src/devices/bus/nes/mmc1.h
+++ b/src/devices/bus/nes/mmc1.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MMC1_H
-#define __NES_MMC1_H
+#ifndef MAME_BUS_NES_MMC1_H
+#define MAME_BUS_NES_MMC1_H
+
+#pragma once
#include "nxrom.h"
@@ -12,20 +14,23 @@ class nes_sxrom_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_sxrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_sxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
- virtual void update_regs(int reg); // this is needed to simplify NES-EVENT pcb implementation, which handle differently some regs!
virtual void pcb_reset() override;
protected:
+ nes_sxrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
TIMER_CALLBACK_MEMBER(resync_callback);
+
+ virtual void update_regs(int reg); // this is needed to simplify NES-EVENT pcb implementation, which handle differently some regs!
virtual void set_prg();
virtual void set_chr();
@@ -70,13 +75,10 @@ public:
};
-
-
// device type definition
-extern const device_type NES_SXROM;
-extern const device_type NES_SOROM;
-extern const device_type NES_SXROM_A;
-extern const device_type NES_SOROM_A;
-
+DECLARE_DEVICE_TYPE(NES_SXROM, nes_sxrom_device)
+DECLARE_DEVICE_TYPE(NES_SOROM, nes_sorom_device)
+DECLARE_DEVICE_TYPE(NES_SXROM_A, nes_sxrom_a_device)
+DECLARE_DEVICE_TYPE(NES_SOROM_A, nes_sorom_a_device)
-#endif
+#endif // MAME_BUS_NES_MMC1_H
diff --git a/src/devices/bus/nes/mmc2.cpp b/src/devices/bus/nes/mmc2.cpp
index d1871483a68..1055ce98921 100644
--- a/src/devices/bus/nes/mmc2.cpp
+++ b/src/devices/bus/nes/mmc2.cpp
@@ -28,30 +28,27 @@
// constructor
//-------------------------------------------------
-const device_type NES_PXROM = device_creator<nes_pxrom_device>;
-const device_type NES_FXROM = device_creator<nes_fxrom_device>;
+DEFINE_DEVICE_TYPE(NES_PXROM, nes_pxrom_device, "nes_pxrom", "NES Cart PxROM (MMC-2) PCB")
+DEFINE_DEVICE_TYPE(NES_FXROM, nes_fxrom_device, "nes_fxrom", "NES Cart FxROM (MMC-2) PCB")
-nes_pxrom_device::nes_pxrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source),
- m_latch1(0),
- m_latch2(0)
- {
+nes_pxrom_device::nes_pxrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch1(0), m_latch2(0)
+{
}
nes_pxrom_device::nes_pxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_PXROM, "NES Cart PxROM (MMC-2) PCB", tag, owner, clock, "nes_pxrom", __FILE__), m_latch1(0), m_latch2(0)
- {
+ : nes_pxrom_device(mconfig, NES_PXROM, tag, owner, clock)
+{
}
nes_fxrom_device::nes_fxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_pxrom_device(mconfig, NES_FXROM, "NES Cart FxROM (MMC-4) PCB", tag, owner, clock, "nes_fxrom", __FILE__)
+ : nes_pxrom_device(mconfig, NES_FXROM, tag, owner, clock)
{
}
-
void nes_pxrom_device::device_start()
{
common_start();
diff --git a/src/devices/bus/nes/mmc2.h b/src/devices/bus/nes/mmc2.h
index ecdf5e30ed0..cfd81aa87d3 100644
--- a/src/devices/bus/nes/mmc2.h
+++ b/src/devices/bus/nes/mmc2.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MMC2_H
-#define __NES_MMC2_H
+#ifndef MAME_BUS_NES_MMC2_H
+#define MAME_BUS_NES_MMC2_H
+
+#pragma once
#include "nxrom.h"
@@ -12,11 +14,8 @@ class nes_pxrom_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_pxrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_pxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(pxrom_write);
virtual DECLARE_WRITE8_MEMBER(write_h) override { pxrom_write(space, offset, data, mem_mask); }
@@ -24,6 +23,11 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_pxrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_reg[4];
int m_latch1, m_latch2;
};
@@ -44,11 +48,8 @@ public:
};
-
-
-
// device type definition
-extern const device_type NES_PXROM;
-extern const device_type NES_FXROM;
+DECLARE_DEVICE_TYPE(NES_PXROM, nes_pxrom_device)
+DECLARE_DEVICE_TYPE(NES_FXROM, nes_fxrom_device)
-#endif
+#endif // MAME_BUS_NES_MMC2_H
diff --git a/src/devices/bus/nes/mmc3.cpp b/src/devices/bus/nes/mmc3.cpp
index 75aa036d39b..ecadb075c8e 100644
--- a/src/devices/bus/nes/mmc3.cpp
+++ b/src/devices/bus/nes/mmc3.cpp
@@ -29,7 +29,7 @@
#include "mmc3.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#include "screen.h"
@@ -46,48 +46,47 @@
// constructor
//-------------------------------------------------
-const device_type NES_TXROM = device_creator<nes_txrom_device>;
-const device_type NES_HKROM = device_creator<nes_hkrom_device>;
-const device_type NES_TXSROM = device_creator<nes_txsrom_device>;
-const device_type NES_TQROM = device_creator<nes_tqrom_device>;
-const device_type NES_QJ_PCB = device_creator<nes_qj_device>;
-const device_type NES_ZZ_PCB = device_creator<nes_zz_device>;
+DEFINE_DEVICE_TYPE(NES_TXROM, nes_txrom_device, "nes_txrom", "NES Cart TxROM (MMC-3) PCB")
+DEFINE_DEVICE_TYPE(NES_HKROM, nes_hkrom_device, "nes_hkrom", "NES Cart HKROM (MMC-6) PCB")
+DEFINE_DEVICE_TYPE(NES_TXSROM, nes_txsrom_device, "nes_txsrom", "NES Cart TxSROM PCB")
+DEFINE_DEVICE_TYPE(NES_TQROM, nes_tqrom_device, "nes_tqrom", "NES Cart TQROM PCB")
+DEFINE_DEVICE_TYPE(NES_QJ_PCB, nes_qj_device, "nes_qj", "NES Cart NES-QJ PCB")
+DEFINE_DEVICE_TYPE(NES_ZZ_PCB, nes_zz_device, "nes_zz", "NES Cart PAL-ZZ PCB")
-nes_txrom_device::nes_txrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_prg_base(0), m_prg_mask(0), m_chr_base(0), m_chr_mask(0),
- m_latch(0), m_wram_protect(0), m_alt_irq(0), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
- {
+nes_txrom_device::nes_txrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_prg_base(0), m_prg_mask(0), m_chr_base(0), m_chr_mask(0)
+ , m_latch(0), m_wram_protect(0), m_alt_irq(0), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
+{
}
nes_txrom_device::nes_txrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TXROM, "NES Cart TxROM (MMC-3) PCB", tag, owner, clock, "nes_txrom", __FILE__), m_prg_base(0), m_prg_mask(0), m_chr_base(0), m_chr_mask(0),
- m_latch(0), m_wram_protect(0), m_alt_irq(0), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
- {
+ : nes_txrom_device(mconfig, NES_TXROM, tag, owner, clock)
+{
}
nes_hkrom_device::nes_hkrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_HKROM, "NES Cart HKROM (MMC-6) PCB", tag, owner, clock, "nes_hkrom", __FILE__), m_wram_enable(0), m_mmc6_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_HKROM, tag, owner, clock), m_wram_enable(0), m_mmc6_reg(0)
+{
}
nes_txsrom_device::nes_txsrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_TXSROM, "NES Cart TxSROM PCB", tag, owner, clock, "nes_txsrom", __FILE__)
+ : nes_txrom_device(mconfig, NES_TXSROM, tag, owner, clock)
{
}
nes_tqrom_device::nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_TQROM, "NES Cart TQROM PCB", tag, owner, clock, "nes_tqrom", __FILE__)
+ : nes_txrom_device(mconfig, NES_TQROM, tag, owner, clock)
{
}
nes_qj_device::nes_qj_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_QJ_PCB, "NES Cart NES-QJ PCB", tag, owner, clock, "nes_qj", __FILE__)
+ : nes_txrom_device(mconfig, NES_QJ_PCB, tag, owner, clock)
{
}
nes_zz_device::nes_zz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_ZZ_PCB, "NES Cart PAL-ZZ PCB", tag, owner, clock, "nes_zz", __FILE__)
+ : nes_txrom_device(mconfig, NES_ZZ_PCB, tag, owner, clock)
{
}
@@ -192,7 +191,7 @@ void nes_zz_device::pcb_reset()
/* Here, IRQ counter decrements every scanline. */
void nes_txrom_device::hblank_irq(int scanline, int vblank, int blanked)
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
int prior_count = m_irq_count;
if ((m_irq_count == 0) || m_irq_clear)
diff --git a/src/devices/bus/nes/mmc3.h b/src/devices/bus/nes/mmc3.h
index 17578b92adf..d16a0000268 100644
--- a/src/devices/bus/nes/mmc3.h
+++ b/src/devices/bus/nes/mmc3.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MMC3_H
-#define __NES_MMC3_H
+#ifndef MAME_BUS_NES_MMC3_H
+#define MAME_BUS_NES_MMC3_H
+
+#pragma once
#include "nxrom.h"
@@ -12,11 +14,8 @@ class nes_txrom_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_txrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_txrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override { mmc3_start(); }
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(txrom_write);
@@ -28,6 +27,11 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_txrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override { mmc3_start(); }
+
virtual void set_prg(int prg_base, int prg_mask);
virtual void set_chr(uint8_t chr, int chr_base, int chr_mask);
void mmc3_start();
@@ -58,8 +62,6 @@ public:
// construction/destruction
nes_hkrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -67,6 +69,9 @@ public:
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
int m_wram_enable;
uint8_t m_mmc6_reg;
@@ -133,14 +138,12 @@ public:
};
-
-
// device type definition
-extern const device_type NES_TXROM;
-extern const device_type NES_HKROM;
-extern const device_type NES_TXSROM;
-extern const device_type NES_TQROM;
-extern const device_type NES_QJ_PCB;
-extern const device_type NES_ZZ_PCB;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_TXROM, nes_txrom_device)
+DECLARE_DEVICE_TYPE(NES_HKROM, nes_hkrom_device)
+DECLARE_DEVICE_TYPE(NES_TXSROM, nes_txsrom_device)
+DECLARE_DEVICE_TYPE(NES_TQROM, nes_tqrom_device)
+DECLARE_DEVICE_TYPE(NES_QJ_PCB, nes_qj_device)
+DECLARE_DEVICE_TYPE(NES_ZZ_PCB, nes_zz_device)
+
+#endif // MAME_BUS_NES_MMC3_H
diff --git a/src/devices/bus/nes/mmc3_clones.cpp b/src/devices/bus/nes/mmc3_clones.cpp
index 1485e6411ce..5d776c5d86c 100644
--- a/src/devices/bus/nes/mmc3_clones.cpp
+++ b/src/devices/bus/nes/mmc3_clones.cpp
@@ -28,221 +28,221 @@
// constructor
//-------------------------------------------------
-const device_type NES_NITRA = device_creator<nes_nitra_device>;
-const device_type NES_KS7057 = device_creator<nes_ks7057_device>;
-const device_type NES_SBROS11 = device_creator<nes_sbros11_device>;
-const device_type NES_MALISB = device_creator<nes_malisb_device>;
-const device_type NES_FAMILY4646 = device_creator<nes_family4646_device>;
-const device_type NES_PIKAY2K = device_creator<nes_pikay2k_device>;
-const device_type NES_8237 = device_creator<nes_8237_device>;
-const device_type NES_SG_LIONK = device_creator<nes_sglionk_device>;
-const device_type NES_SG_BOOG = device_creator<nes_sgboog_device>;
-const device_type NES_KASING = device_creator<nes_kasing_device>;
-const device_type NES_KAY = device_creator<nes_kay_device>;
-const device_type NES_H2288 = device_creator<nes_h2288_device>;
-const device_type NES_6035052 = device_creator<nes_6035052_device>;
-const device_type NES_TXC_TW = device_creator<nes_txc_tw_device>;
-const device_type NES_KOF97 = device_creator<nes_kof97_device>;
-const device_type NES_KOF96 = device_creator<nes_kof96_device>;
-const device_type NES_SF3 = device_creator<nes_sf3_device>;
-const device_type NES_GOUDER = device_creator<nes_gouder_device>;
-const device_type NES_SA9602B = device_creator<nes_sa9602b_device>;
-const device_type NES_SACHEN_SHERO = device_creator<nes_sachen_shero_device>;
-//const device_type NES_A9746 = device_creator<nes_a9746_device>;
-
-const device_type NES_FK23C = device_creator<nes_fk23c_device>;
-const device_type NES_FK23CA = device_creator<nes_fk23ca_device>;
-const device_type NES_S24IN1SC03 = device_creator<nes_s24in1sc03_device>;
-const device_type NES_BMC_15IN1 = device_creator<nes_bmc_15in1_device>;
-const device_type NES_BMC_SBIG7 = device_creator<nes_bmc_sbig7_device>;
-const device_type NES_BMC_HIK8 = device_creator<nes_bmc_hik8_device>;
-const device_type NES_BMC_HIK4 = device_creator<nes_bmc_hik4_device>;
-const device_type NES_BMC_MARIO7IN1 = device_creator<nes_bmc_mario7in1_device>;
-const device_type NES_BMC_GOLD7IN1 = device_creator<nes_bmc_gold7in1_device>;
-const device_type NES_BMC_GC6IN1 = device_creator<nes_bmc_gc6in1_device>;
-const device_type NES_BMC_411120C = device_creator<nes_bmc_411120c_device>;
-const device_type NES_BMC_830118C = device_creator<nes_bmc_830118c_device>;
-const device_type NES_PJOY84 = device_creator<nes_pjoy84_device>;
-const device_type NES_COOLBOY = device_creator<nes_coolboy_device>;
+DEFINE_DEVICE_TYPE(NES_NITRA, nes_nitra_device, "nes_nitra", "NES Cart Nitra PCB")
+DEFINE_DEVICE_TYPE(NES_KS7057, nes_ks7057_device, "nes_ks7057", "NES Cart KS-7057 PCB")
+DEFINE_DEVICE_TYPE(NES_SBROS11, nes_sbros11_device, "nes_smb11", "NES Cart SMB 11 PCB")
+DEFINE_DEVICE_TYPE(NES_MALISB, nes_malisb_device, "nes_malisb", "NES Cart Mali Spash Bomb PCB")
+DEFINE_DEVICE_TYPE(NES_FAMILY4646, nes_family4646_device, "nes_family4646", "NES Cart BMC-FAMILY04646 PCB")
+DEFINE_DEVICE_TYPE(NES_PIKAY2K, nes_pikay2k_device, "nes_pikay2k", "NES Cart PIKACHU Y2K PCB")
+DEFINE_DEVICE_TYPE(NES_8237, nes_8237_device, "nes_8237", "NES Cart UNL-8237 PCB")
+DEFINE_DEVICE_TYPE(NES_SG_LIONK, nes_sglionk_device, "nes_sglionk", "NES Cart SuperGame Lion King PCB")
+DEFINE_DEVICE_TYPE(NES_SG_BOOG, nes_sgboog_device, "nes_sgbooger", "NES Cart SuperGame BoogerMan PCB")
+DEFINE_DEVICE_TYPE(NES_KASING, nes_kasing_device, "nes_kasing", "NES Cart Kasing PCB")
+DEFINE_DEVICE_TYPE(NES_KAY, nes_kay_device, "nes_kay", "NES Cart KAY PCB")
+DEFINE_DEVICE_TYPE(NES_H2288, nes_h2288_device, "nes_h2288", "NES Cart H-2288 PCB")
+DEFINE_DEVICE_TYPE(NES_6035052, nes_6035052_device, "nes_6035052", "NES Cart UNL-603-5052 PCB")
+DEFINE_DEVICE_TYPE(NES_TXC_TW, nes_txc_tw_device, "nes_txc_tw", "NES Cart TXC Thunder Warrior PCB")
+DEFINE_DEVICE_TYPE(NES_KOF97, nes_kof97_device, "nes_kof97", "NES Cart KoF 97 PCB")
+DEFINE_DEVICE_TYPE(NES_KOF96, nes_kof96_device, "nes_kof96", "NES Cart KoF 96 PCB")
+DEFINE_DEVICE_TYPE(NES_SF3, nes_sf3_device, "nes_sf3", "NES Cart Super Fighter III PCB")
+DEFINE_DEVICE_TYPE(NES_GOUDER, nes_gouder_device, "nes_gouder", "NES Cart Gouder PCB")
+DEFINE_DEVICE_TYPE(NES_SA9602B, nes_sa9602b_device, "nes_sa9602b", "NES Cart SA-9602B PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_SHERO, nes_sachen_shero_device, "nes_shero", "NES Cart Street Hero PCB")
+//DEFINE_DEVICE_TYPE(NES_A9746, nes_a9746_device, "nes_bmc_a9746", "NES Cart A-9746 PCB")
+
+DEFINE_DEVICE_TYPE(NES_FK23C, nes_fk23c_device, "nes_kf23c", "NES Cart KF23C PCB")
+DEFINE_DEVICE_TYPE(NES_FK23CA, nes_fk23ca_device, "nes_kf23ca", "NES Cart KF23CA PCB")
+DEFINE_DEVICE_TYPE(NES_S24IN1SC03, nes_s24in1sc03_device, "nes_s24in1c03", "NES Cart Super 24 in 1 SC-03 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_15IN1, nes_bmc_15in1_device, "nes_bmc_15in1", "NES Cart BMC 15 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_SBIG7, nes_bmc_sbig7_device, "nes_bmc_sbig7", "NES Cart BMC Super BIG 7 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_HIK8, nes_bmc_hik8_device, "nes_bmc_hik8", "NES Cart BMC HIK 8 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_HIK4, nes_bmc_hik4_device, "nes_bmc_hik4", "NES Cart BMC HIK 4 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_MARIO7IN1, nes_bmc_mario7in1_device, "nes_bmc_mario7in1", "NES Cart BMC Mario 7 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GOLD7IN1, nes_bmc_gold7in1_device, "nes_bmc_gold7in1", "NES Cart BMC Golden 7 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GC6IN1, nes_bmc_gc6in1_device, "nes_bmc_gc6in1", "NES Cart BMC Golden Card 6 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_411120C, nes_bmc_411120c_device, "nes_bmc_411120c", "NES Cart BMC 411120C PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_830118C, nes_bmc_830118c_device, "nes_bmc_830118c", "NES Cart BMC 830118C PCB")
+DEFINE_DEVICE_TYPE(NES_PJOY84, nes_pjoy84_device, "nes_pjoy84", "NES Cart Powerjoy 84 PCB")
+DEFINE_DEVICE_TYPE(NES_COOLBOY, nes_coolboy_device, "nes_coolboy", "NES Cart CoolBoy PCB")
nes_nitra_device::nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_NITRA, "NES Cart Nitra PCB", tag, owner, clock, "nes_nitra", __FILE__)
+ : nes_txrom_device(mconfig, NES_NITRA, tag, owner, clock)
{
}
nes_ks7057_device::nes_ks7057_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_KS7057, "NES Cart KS-7057 PCB", tag, owner, clock, "nes_ks7057", __FILE__)
+ : nes_txrom_device(mconfig, NES_KS7057, tag, owner, clock)
{
}
nes_sbros11_device::nes_sbros11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SBROS11, "NES Cart SMB 11 PCB", tag, owner, clock, "nes_smb11", __FILE__)
+ : nes_txrom_device(mconfig, NES_SBROS11, tag, owner, clock)
{
}
nes_malisb_device::nes_malisb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_MALISB, "NES Cart Mali Spash Bomb PCB", tag, owner, clock, "nes_malisb", __FILE__)
+ : nes_txrom_device(mconfig, NES_MALISB, tag, owner, clock)
{
}
nes_family4646_device::nes_family4646_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_FAMILY4646, "NES Cart BMC-FAMILY-4646 PCB", tag, owner, clock, "nes_family4646", __FILE__)
+ : nes_txrom_device(mconfig, NES_FAMILY4646, tag, owner, clock)
{
}
nes_pikay2k_device::nes_pikay2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_PIKAY2K, "NES Cart PIKACHU Y2K PCB", tag, owner, clock, "nes_pikay2k", __FILE__)
+ : nes_txrom_device(mconfig, NES_PIKAY2K, tag, owner, clock)
{
}
nes_8237_device::nes_8237_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_8237, "NES Cart UNL-8237 PCB", tag, owner, clock, "nes_8237", __FILE__), m_cd_enable(0)
- {
+ : nes_txrom_device(mconfig, NES_8237, tag, owner, clock), m_cd_enable(0)
+{
}
nes_sglionk_device::nes_sglionk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SG_LIONK, "NES Cart SuperGame Lion King PCB", tag, owner, clock, "nes_sglionk", __FILE__), m_reg(0), m_reg_enabled(0)
- {
+ : nes_txrom_device(mconfig, NES_SG_LIONK, tag, owner, clock), m_reg(0), m_reg_enabled(0)
+{
}
nes_sgboog_device::nes_sgboog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SG_BOOG, "NES Cart SuperGame BoogerMan PCB", tag, owner, clock, "nes_sgbooger", __FILE__), m_mode(0)
- {
+ : nes_txrom_device(mconfig, NES_SG_BOOG, tag, owner, clock), m_mode(0)
+{
}
nes_kasing_device::nes_kasing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_KASING, "NES Cart Kasing PCB", tag, owner, clock, "nes_kasing", __FILE__), m_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_KASING, tag, owner, clock), m_reg(0)
+{
}
nes_kay_device::nes_kay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_KAY, "NES Cart KAY PCB", tag, owner, clock, "nes_kay", __FILE__), m_low_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_KAY, tag, owner, clock), m_low_reg(0)
+{
}
nes_h2288_device::nes_h2288_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_H2288, "NES Cart H-2288 PCB", tag, owner, clock, "nes_h2288", __FILE__)
+ : nes_txrom_device(mconfig, NES_H2288, tag, owner, clock)
{
}
nes_6035052_device::nes_6035052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_6035052, "NES Cart UNL-603-5052 PCB", tag, owner, clock, "nes_6035052", __FILE__), m_prot(0)
- {
+ : nes_txrom_device(mconfig, NES_6035052, tag, owner, clock), m_prot(0)
+{
}
nes_txc_tw_device::nes_txc_tw_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_TXC_TW, "NES Cart TXC Thunder Warrior PCB", tag, owner, clock, "nes_txc_tw", __FILE__)
+ : nes_txrom_device(mconfig, NES_TXC_TW, tag, owner, clock)
{
}
nes_kof97_device::nes_kof97_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_KOF97, "NES Cart KOF 97 PCB", tag, owner, clock, "nes_kof97", __FILE__)
+ : nes_txrom_device(mconfig, NES_KOF97, tag, owner, clock)
{
}
nes_kof96_device::nes_kof96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_KOF96, "NES Cart KOF 96 PCB", tag, owner, clock, "nes_kof96", __FILE__)
+ : nes_txrom_device(mconfig, NES_KOF96, tag, owner, clock)
{
}
nes_sf3_device::nes_sf3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SF3, "NES Cart Super Fighter III PCB", tag, owner, clock, "nes_sf3", __FILE__)
+ : nes_txrom_device(mconfig, NES_SF3, tag, owner, clock)
{
}
nes_gouder_device::nes_gouder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_GOUDER, "NES Cart Gouder PCB", tag, owner, clock, "nes_gouder", __FILE__)
+ : nes_txrom_device(mconfig, NES_GOUDER, tag, owner, clock)
{
}
nes_sa9602b_device::nes_sa9602b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SA9602B, "NES Cart SA-9602B PCB", tag, owner, clock, "nes_sa9602b", __FILE__), m_reg(0), m_prg_chip(0)
- {
+ : nes_txrom_device(mconfig, NES_SA9602B, tag, owner, clock), m_reg(0), m_prg_chip(0)
+{
}
nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SACHEN_SHERO, "NES Cart Street Hero PCB", tag, owner, clock, "nes_shero", __FILE__), m_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_SACHEN_SHERO, tag, owner, clock), m_reg(0)
+{
}
//nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
-// : nes_txrom_device(mconfig, NES_A9746, "NES Cart A-9746 PCB", tag, owner, clock, "nes_bmc_a9746", __FILE__)
+// : nes_txrom_device(mconfig, NES_A9746, tag, owner, clock)
//{
//}
-nes_fk23c_device::nes_fk23c_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_mmc_cmd1(0)
- {
+nes_fk23c_device::nes_fk23c_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_txrom_device(mconfig, type, tag, owner, clock), m_mmc_cmd1(0)
+{
}
nes_fk23c_device::nes_fk23c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_FK23C, "NES Cart FK23C PCB", tag, owner, clock, "nes_fk23c", __FILE__), m_mmc_cmd1(0)
- {
+ : nes_fk23c_device(mconfig, NES_FK23C, tag, owner, clock)
+{
}
nes_fk23ca_device::nes_fk23ca_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_fk23c_device(mconfig, NES_FK23CA, "NES Cart FK23CA PCB", tag, owner, clock, "nes_fk23ca", __FILE__)
+ : nes_fk23c_device(mconfig, NES_FK23CA, tag, owner, clock)
{
}
nes_s24in1sc03_device::nes_s24in1sc03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_S24IN1SC03, "NES Cart Super 24 in 1 SC-03 PCB", tag, owner, clock, "nes_s24in1c03", __FILE__)
+ : nes_txrom_device(mconfig, NES_S24IN1SC03, tag, owner, clock)
{
}
nes_bmc_15in1_device::nes_bmc_15in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_15IN1, "NES Cart BMC 15 in 1 PCB", tag, owner, clock, "nes_bmc_15in1", __FILE__)
+ : nes_txrom_device(mconfig, NES_BMC_15IN1, tag, owner, clock)
{
}
nes_bmc_sbig7_device::nes_bmc_sbig7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_SBIG7, "NES Cart BMC Super BIG 7 in 1 PCB", tag, owner, clock, "nes_bmc_sbit7", __FILE__)
+ : nes_txrom_device(mconfig, NES_BMC_SBIG7, tag, owner, clock)
{
}
nes_bmc_hik8_device::nes_bmc_hik8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_HIK8, "NES Cart BMC Super HIK 8 in 1 PCB", tag, owner, clock, "nes_bmc_hik8", __FILE__), m_count(0)
- {
+ : nes_txrom_device(mconfig, NES_BMC_HIK8, tag, owner, clock), m_count(0)
+{
}
nes_bmc_hik4_device::nes_bmc_hik4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_HIK4, "NES Cart BMC Super HIK 4 in 1 PCB", tag, owner, clock, "nes_bmc_hik4", __FILE__)
+ : nes_txrom_device(mconfig, NES_BMC_HIK4, tag, owner, clock)
{
}
nes_bmc_mario7in1_device::nes_bmc_mario7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_MARIO7IN1, "NES Cart BMC Mario 7 in 1 PCB", tag, owner, clock, "nes_bmc_mario7in1", __FILE__), m_reg_written(0)
- {
+ : nes_txrom_device(mconfig, NES_BMC_MARIO7IN1, tag, owner, clock), m_reg_written(0)
+{
}
nes_bmc_gold7in1_device::nes_bmc_gold7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_GOLD7IN1, "NES Cart BMC Golden 7 in 1 PCB", tag, owner, clock, "nes_bmc_gold7in1", __FILE__), m_reg_written(0)
- {
+ : nes_txrom_device(mconfig, NES_BMC_GOLD7IN1, tag, owner, clock), m_reg_written(0)
+{
}
nes_bmc_gc6in1_device::nes_bmc_gc6in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_GC6IN1, "NES Cart BMC Golden Card 6 in 1 PCB", tag, owner, clock, "nes_bmc_gc6in1", __FILE__)
+ : nes_txrom_device(mconfig, NES_BMC_GC6IN1, tag, owner, clock)
{
}
nes_bmc_411120c_device::nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_411120C, "NES Cart BMC 411120C PCB", tag, owner, clock, "nes_bmc_411120c", __FILE__), m_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_BMC_411120C, tag, owner, clock), m_reg(0)
+{
}
nes_bmc_830118c_device::nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_BMC_830118C, "NES Cart BMC 830118C PCB", tag, owner, clock, "nes_bmc_830118c", __FILE__), m_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_BMC_830118C, tag, owner, clock), m_reg(0)
+{
}
nes_pjoy84_device::nes_pjoy84_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_PJOY84, "NES Cart Powerjoy 84 PCB", tag, owner, clock, "nes_pjoy84", __FILE__)
+ : nes_txrom_device(mconfig, NES_PJOY84, tag, owner, clock)
{
}
nes_coolboy_device::nes_coolboy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_COOLBOY, "NES Cart CoolBoy PCB", tag, owner, clock, "nes_coolboy", __FILE__)
+ : nes_txrom_device(mconfig, NES_COOLBOY, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/mmc3_clones.h b/src/devices/bus/nes/mmc3_clones.h
index d8b6327d518..82f3daeb16b 100644
--- a/src/devices/bus/nes/mmc3_clones.h
+++ b/src/devices/bus/nes/mmc3_clones.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MMC3_CLONES_H
-#define __NES_MMC3_CLONES_H
+#ifndef MAME_BUS_NES_MMC3_CLONES_H
+#define MAME_BUS_NES_MMC3_CLONES_H
+
+#pragma once
#include "mmc3.h"
@@ -83,14 +85,16 @@ public:
// construction/destruction
nes_pikay2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[2];
};
@@ -127,13 +131,15 @@ public:
// construction/destruction
nes_sglionk_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
int m_reg_enabled;
@@ -148,8 +154,6 @@ public:
// construction/destruction
nes_sgboog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -158,6 +162,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
virtual void set_prg(int prg_base, int prg_mask) override;
uint8_t m_reg[3];
@@ -173,13 +181,15 @@ public:
// construction/destruction
nes_kasing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void prg_cb(int start, int bank) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
};
@@ -193,8 +203,6 @@ public:
// construction/destruction
nes_kay_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -203,6 +211,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_regs();
uint8_t m_reg[8];
@@ -218,8 +230,6 @@ public:
// construction/destruction
nes_h2288_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -227,6 +237,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[2]; // reg 1 is unused?
};
@@ -240,8 +254,6 @@ public:
// construction/destruction
nes_6035052_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_ex) override;
virtual DECLARE_WRITE8_MEMBER(write_ex) override;
virtual DECLARE_READ8_MEMBER(read_l) override { return read_ex(space, offset, mem_mask); }
@@ -251,6 +263,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_prot;
};
@@ -292,8 +308,6 @@ public:
// construction/destruction
nes_kof96_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override; // offset does not really count for this mapper
@@ -302,6 +316,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
};
@@ -331,14 +349,16 @@ public:
// construction/destruction
nes_gouder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void prg_cb(int start, int bank) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[5];
};
@@ -352,13 +372,15 @@ public:
// construction/destruction
nes_sa9602b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void prg_cb(int start, int bank) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
int m_prg_chip;
@@ -373,14 +395,16 @@ public:
// construction/destruction
nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
};
@@ -394,12 +418,14 @@ public:
// construction/destruction
nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset();
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks(uint8_t value);
uint8_t m_reg[3];
@@ -413,11 +439,8 @@ class nes_fk23c_device : public nes_txrom_device
{
public:
// construction/destruction
- nes_fk23c_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_fk23c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void prg_cb(int start, int bank) override;
@@ -426,6 +449,11 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_fk23c_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
void fk23c_set_prg();
void fk23c_set_chr();
uint8_t m_reg[8];
@@ -453,14 +481,16 @@ public:
// construction/destruction
nes_s24in1sc03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void prg_cb(int start, int bank) override;
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[3];
};
@@ -504,12 +534,14 @@ public:
// construction/destruction
nes_bmc_hik8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
uint8_t m_count;
@@ -539,12 +571,14 @@ public:
// construction/destruction
nes_bmc_mario7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg_written;
};
@@ -558,12 +592,14 @@ public:
// construction/destruction
nes_bmc_gold7in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg_written;
};
@@ -577,8 +613,6 @@ public:
// construction/destruction
nes_bmc_gc6in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void prg_cb(int start, int bank) override;
@@ -586,6 +620,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
};
@@ -599,14 +637,16 @@ public:
// construction/destruction
nes_bmc_411120c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void prg_cb(int start, int bank) override;
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
};
@@ -620,14 +660,16 @@ public:
// construction/destruction
nes_bmc_830118c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void prg_cb(int start, int bank) override;
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
};
@@ -641,14 +683,16 @@ public:
// construction/destruction
nes_pjoy84_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void prg_cb(int start, int bank) override;
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
inline void set_base_mask();
uint8_t m_reg[4];
@@ -663,57 +707,51 @@ public:
nes_coolboy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// device-level overrides
-// virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void prg_cb(int start, int bank) override;
virtual void chr_cb(int start, int bank, int source) override;
-// virtual void pcb_reset() override;
-
private:
-// inline void set_base_mask();
uint8_t m_reg[4];
};
-
-
// device type definition
-extern const device_type NES_NITRA;
-extern const device_type NES_KS7057;
-extern const device_type NES_SBROS11;
-extern const device_type NES_MALISB;
-extern const device_type NES_FAMILY4646;
-extern const device_type NES_PIKAY2K;
-extern const device_type NES_8237;
-extern const device_type NES_SG_LIONK;
-extern const device_type NES_SG_BOOG;
-extern const device_type NES_KASING;
-extern const device_type NES_KAY;
-extern const device_type NES_H2288;
-extern const device_type NES_6035052;
-extern const device_type NES_TXC_TW;
-extern const device_type NES_KOF97;
-extern const device_type NES_KOF96;
-extern const device_type NES_SF3;
-extern const device_type NES_GOUDER;
-extern const device_type NES_SA9602B;
-extern const device_type NES_SACHEN_SHERO;
-extern const device_type NES_A9746;
-
-extern const device_type NES_FK23C;
-extern const device_type NES_FK23CA;
-extern const device_type NES_S24IN1SC03;
-extern const device_type NES_BMC_15IN1;
-extern const device_type NES_BMC_SBIG7;
-extern const device_type NES_BMC_HIK8;
-extern const device_type NES_BMC_HIK4;
-extern const device_type NES_BMC_MARIO7IN1;
-extern const device_type NES_BMC_GOLD7IN1;
-extern const device_type NES_BMC_GC6IN1;
-extern const device_type NES_BMC_411120C;
-extern const device_type NES_BMC_830118C;
-extern const device_type NES_PJOY84;
-extern const device_type NES_COOLBOY;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_NITRA, nes_nitra_device)
+DECLARE_DEVICE_TYPE(NES_KS7057, nes_ks7057_device)
+DECLARE_DEVICE_TYPE(NES_SBROS11, nes_sbros11_device)
+DECLARE_DEVICE_TYPE(NES_MALISB, nes_malisb_device)
+DECLARE_DEVICE_TYPE(NES_FAMILY4646, nes_family4646_device)
+DECLARE_DEVICE_TYPE(NES_PIKAY2K, nes_pikay2k_device)
+DECLARE_DEVICE_TYPE(NES_8237, nes_8237_device)
+DECLARE_DEVICE_TYPE(NES_SG_LIONK, nes_sglionk_device)
+DECLARE_DEVICE_TYPE(NES_SG_BOOG, nes_sgboog_device)
+DECLARE_DEVICE_TYPE(NES_KASING, nes_kasing_device)
+DECLARE_DEVICE_TYPE(NES_KAY, nes_kay_device)
+DECLARE_DEVICE_TYPE(NES_H2288, nes_h2288_device)
+DECLARE_DEVICE_TYPE(NES_6035052, nes_6035052_device)
+DECLARE_DEVICE_TYPE(NES_TXC_TW, nes_txc_tw_device)
+DECLARE_DEVICE_TYPE(NES_KOF97, nes_kof97_device)
+DECLARE_DEVICE_TYPE(NES_KOF96, nes_kof96_device)
+DECLARE_DEVICE_TYPE(NES_SF3, nes_sf3_device)
+DECLARE_DEVICE_TYPE(NES_GOUDER, nes_gouder_device)
+DECLARE_DEVICE_TYPE(NES_SA9602B, nes_sa9602b_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_SHERO, nes_sachen_shero_device)
+DECLARE_DEVICE_TYPE(NES_A9746, nes_a9746_device)
+
+DECLARE_DEVICE_TYPE(NES_FK23C, nes_fk23c_device)
+DECLARE_DEVICE_TYPE(NES_FK23CA, nes_fk23ca_device)
+DECLARE_DEVICE_TYPE(NES_S24IN1SC03, nes_s24in1sc03_device)
+DECLARE_DEVICE_TYPE(NES_BMC_15IN1, nes_bmc_15in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_SBIG7, nes_bmc_sbig7_device)
+DECLARE_DEVICE_TYPE(NES_BMC_HIK8, nes_bmc_hik8_device)
+DECLARE_DEVICE_TYPE(NES_BMC_HIK4, nes_bmc_hik4_device)
+DECLARE_DEVICE_TYPE(NES_BMC_MARIO7IN1, nes_bmc_mario7in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GOLD7IN1, nes_bmc_gold7in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GC6IN1, nes_bmc_gc6in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_411120C, nes_bmc_411120c_device)
+DECLARE_DEVICE_TYPE(NES_BMC_830118C, nes_bmc_830118c_device)
+DECLARE_DEVICE_TYPE(NES_PJOY84, nes_pjoy84_device)
+DECLARE_DEVICE_TYPE(NES_COOLBOY, nes_coolboy_device)
+
+#endif // MAME_BUS_NES_MMC3_CLONES_H
diff --git a/src/devices/bus/nes/mmc5.cpp b/src/devices/bus/nes/mmc5.cpp
index ff0f382626b..327220fdcc5 100644
--- a/src/devices/bus/nes/mmc5.cpp
+++ b/src/devices/bus/nes/mmc5.cpp
@@ -19,7 +19,7 @@
#include "mmc5.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#include "sound/nes_apu.h" // temp hack to pass the additional sound regs to APU...
@@ -41,15 +41,15 @@ static const int m_mmc5_attrib[4] = {0x00, 0x55, 0xaa, 0xff};
// constructor
//-------------------------------------------------
-const device_type NES_EXROM = device_creator<nes_exrom_device>;
+DEFINE_DEVICE_TYPE(NES_EXROM, nes_exrom_device, "nes_exrom", "NES Cart ExROM (MMC-5) PCB")
nes_exrom_device::nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_EXROM, "NES Cart ExROM (MMC-5) PCB", tag, owner, clock, "nes_exrom", __FILE__), m_irq_count(0),
- m_irq_status(0), m_irq_enable(0), m_mult1(0), m_mult2(0), m_mmc5_scanline(0), m_vrom_page_a(0), m_vrom_page_b(0), m_floodtile(0), m_floodattr(0),
- m_prg_mode(0), m_chr_mode(0), m_wram_protect_1(0), m_wram_protect_2(0), m_exram_control(0), m_wram_base(0), m_last_chr(0), m_ex1_chr(0),
- m_split_chr(0), m_ex1_bank(0), m_high_chr(0), m_split_scr(0), m_split_rev(0), m_split_ctrl(0), m_split_yst(0), m_split_bank(0), m_vcount(0)
- {
+ : nes_nrom_device(mconfig, NES_EXROM, tag, owner, clock), m_irq_count(0)
+ , m_irq_status(0), m_irq_enable(0), m_mult1(0), m_mult2(0), m_mmc5_scanline(0), m_vrom_page_a(0), m_vrom_page_b(0), m_floodtile(0), m_floodattr(0)
+ , m_prg_mode(0), m_chr_mode(0), m_wram_protect_1(0), m_wram_protect_2(0), m_exram_control(0), m_wram_base(0), m_last_chr(0), m_ex1_chr(0)
+ , m_split_chr(0), m_ex1_bank(0), m_high_chr(0), m_split_scr(0), m_split_rev(0), m_split_ctrl(0), m_split_yst(0), m_split_bank(0), m_vcount(0)
+{
}
@@ -245,7 +245,7 @@ void nes_exrom_device::hblank_irq(int scanline, int vblank, int blanked )
// "In Frame" flag
if (scanline == 0)
m_irq_status |= 0x40;
- else if (scanline > PPU_BOTTOM_VISIBLE_SCANLINE)
+ else if (scanline > ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
m_irq_status &= ~0x40;
}
diff --git a/src/devices/bus/nes/mmc5.h b/src/devices/bus/nes/mmc5.h
index 1ca0dd1cd88..d677b875771 100644
--- a/src/devices/bus/nes/mmc5.h
+++ b/src/devices/bus/nes/mmc5.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MMC5_H
-#define __NES_MMC5_H
+#ifndef MAME_BUS_NES_MMC5_H
+#define MAME_BUS_NES_MMC5_H
+
+#pragma once
#include "nxrom.h"
@@ -14,8 +16,6 @@ public:
// construction/destruction
nes_exrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
@@ -31,6 +31,9 @@ public:
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
void set_mirror(int page, int src);
void update_prg();
@@ -86,8 +89,7 @@ protected:
};
-
// device type definition
-extern const device_type NES_EXROM;
+DECLARE_DEVICE_TYPE(NES_EXROM, nes_exrom_device)
-#endif
+#endif // MAME_BUS_NES_MMC5_H
diff --git a/src/devices/bus/nes/multigame.cpp b/src/devices/bus/nes/multigame.cpp
index 0f01641de1a..6971e68ac61 100644
--- a/src/devices/bus/nes/multigame.cpp
+++ b/src/devices/bus/nes/multigame.cpp
@@ -28,288 +28,288 @@
// constructor
//-------------------------------------------------
-const device_type NES_ACTION52 = device_creator<nes_action52_device>;
-const device_type NES_CALTRON6IN1 = device_creator<nes_caltron_device>;
-const device_type NES_RUMBLESTATION = device_creator<nes_rumblestat_device>;
-const device_type NES_SVISION16 = device_creator<nes_svision16_device>;
-const device_type NES_N625092 = device_creator<nes_n625092_device>;
-const device_type NES_A65AS = device_creator<nes_a65as_device>;
-const device_type NES_T262 = device_creator<nes_t262_device>;
-const device_type NES_NOVEL1 = device_creator<nes_novel1_device>;
-const device_type NES_NOVEL2 = device_creator<nes_novel2_device>;
-const device_type NES_STUDYNGAME = device_creator<nes_studyngame_device>;
-const device_type NES_SUPERGUN20IN1 = device_creator<nes_sgun20in1_device>;
-const device_type NES_VT5201 = device_creator<nes_vt5201_device>;
-const device_type NES_810544C = device_creator<nes_810544c_device>;
-const device_type NES_NTD03 = device_creator<nes_ntd03_device>;
-const device_type NES_BMC_GB63 = device_creator<nes_bmc_gb63_device>;
-const device_type NES_BMC_GKA = device_creator<nes_bmc_gka_device>;
-const device_type NES_BMC_GKB = device_creator<nes_bmc_gkb_device>;
-const device_type NES_BMC_WS = device_creator<nes_bmc_ws_device>;
-const device_type NES_BMC_11160 = device_creator<nes_bmc_11160_device>;
-const device_type NES_BMC_G146 = device_creator<nes_bmc_g146_device>;
-const device_type NES_BMC_8157 = device_creator<nes_bmc_8157_device>;
-const device_type NES_BMC_HIK300 = device_creator<nes_bmc_hik300_device>;
-const device_type NES_BMC_S700 = device_creator<nes_bmc_s700_device>;
-const device_type NES_BMC_BALL11 = device_creator<nes_bmc_ball11_device>;
-const device_type NES_BMC_22GAMES = device_creator<nes_bmc_22games_device>;
-const device_type NES_BMC_64Y2K = device_creator<nes_bmc_64y2k_device>;
-const device_type NES_BMC_12IN1 = device_creator<nes_bmc_12in1_device>;
-const device_type NES_BMC_20IN1 = device_creator<nes_bmc_20in1_device>;
-const device_type NES_BMC_21IN1 = device_creator<nes_bmc_21in1_device>;
-const device_type NES_BMC_31IN1 = device_creator<nes_bmc_31in1_device>;
-const device_type NES_BMC_35IN1 = device_creator<nes_bmc_35in1_device>;
-const device_type NES_BMC_36IN1 = device_creator<nes_bmc_36in1_device>;
-const device_type NES_BMC_64IN1 = device_creator<nes_bmc_64in1_device>;
-const device_type NES_BMC_70IN1 = device_creator<nes_bmc_70in1_device>;
-const device_type NES_BMC_72IN1 = device_creator<nes_bmc_72in1_device>;
-const device_type NES_BMC_76IN1 = device_creator<nes_bmc_76in1_device>;
-const device_type NES_BMC_110IN1 = device_creator<nes_bmc_110in1_device>;
-const device_type NES_BMC_150IN1 = device_creator<nes_bmc_150in1_device>;
-const device_type NES_BMC_190IN1 = device_creator<nes_bmc_190in1_device>;
-const device_type NES_BMC_800IN1 = device_creator<nes_bmc_800in1_device>;
-const device_type NES_BMC_1200IN1 = device_creator<nes_bmc_1200in1_device>;
-const device_type NES_BMC_GOLD150 = device_creator<nes_bmc_gold150_device>;
-const device_type NES_BMC_GOLD260 = device_creator<nes_bmc_gold260_device>;
-const device_type NES_BMC_CH001 = device_creator<nes_bmc_ch001_device>;
-const device_type NES_BMC_SUPER22 = device_creator<nes_bmc_super22_device>;
-const device_type NES_BMC_4IN1RESET = device_creator<nes_bmc_4in1reset_device>;
-const device_type NES_BMC_42IN1RESET = device_creator<nes_bmc_42in1reset_device>;
+DEFINE_DEVICE_TYPE(NES_ACTION52, nes_action52_device, "nes_action52", "NES Cart Action 52 PCB")
+DEFINE_DEVICE_TYPE(NES_CALTRON6IN1, nes_caltron_device, "nes_caltron", "NES Cart Caltron 6 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_RUMBLESTATION, nes_rumblestat_device, "nes_rumblestat", "NES Cart Rumblestation PCB")
+DEFINE_DEVICE_TYPE(NES_SVISION16, nes_svision16_device, "nes_svision16", "NES Cart Supervision 16 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_N625092, nes_n625092_device, "nes_n625092", "NES Cart N625092 PCB")
+DEFINE_DEVICE_TYPE(NES_A65AS, nes_a65as_device, "nes_a65as", "NES Cart A65AS PCB")
+DEFINE_DEVICE_TYPE(NES_T262, nes_t262_device, "nes_t262", "NES Cart T-262 PCB")
+DEFINE_DEVICE_TYPE(NES_NOVEL1, nes_novel1_device, "nes_novel1", "NES Cart Novel Diamond Type 1 PCB")
+DEFINE_DEVICE_TYPE(NES_NOVEL2, nes_novel2_device, "nes_novel2", "NES Cart Novel Diamond Type 2 PCB")
+DEFINE_DEVICE_TYPE(NES_STUDYNGAME, nes_studyngame_device, "nes_studyngame", "NES Cart Study n Game PCB")
+DEFINE_DEVICE_TYPE(NES_SUPERGUN20IN1, nes_sgun20in1_device, "nes_sgun20in1", "NES Cart Supergun 20 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_VT5201, nes_vt5201_device, "nes_vt5201", "NES Cart VT5201 PCB")
+DEFINE_DEVICE_TYPE(NES_810544C, nes_810544c_device, "nes_810544c", "NES Cart 810544-C-A1 PCB")
+DEFINE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device, "nes_ntd03", "NES Cart NTD-03 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GB63, nes_bmc_gb63_device, "nes_bmc_gb63", "NES Cart BMC Ghostbusters 63 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device, "nes_bmc_gka", "NES Cart BMC GK-A PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device, "nes_bmc_gkb", "NES Cart BMC GK-B PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_WS, nes_bmc_ws_device, "nes_bmc_ws", "NES Cart BMC WS PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_11160, nes_bmc_11160_device, "nes_bmc_1160", "NES Cart BMC-1160 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_G146, nes_bmc_g146_device, "nes_bmc_g146", "NES Cart BMC-G-146 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_8157, nes_bmc_8157_device, "nes_bmc_8157", "NES Cart BMC-8157 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_HIK300, nes_bmc_hik300_device, "nes_bmc_hik300", "NES Cart BMC HIK 300 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_S700, nes_bmc_s700_device, "nes_bmc_s700", "NES Cart BMC Super 700 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_BALL11, nes_bmc_ball11_device, "nes_bmc_ball11", "NES Cart BMC Ball 11 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_22GAMES, nes_bmc_22games_device, "nes_bmc_22games", "NES Cart BMC 22 Games PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_64Y2K, nes_bmc_64y2k_device, "nes_bmc_64y2k", "NES Cart BMC 64 in 1 Y2K PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_12IN1, nes_bmc_12in1_device, "nes_bmc_12in1", "NES Cart BMC 12 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_20IN1, nes_bmc_20in1_device, "nes_bmc_20in1", "NES Cart BMC 20 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_21IN1, nes_bmc_21in1_device, "nes_bmc_21in1", "NES Cart BMC 21 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_31IN1, nes_bmc_31in1_device, "nes_bmc_31in1", "NES Cart BMC 31 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_35IN1, nes_bmc_35in1_device, "nes_bmc_35in1", "NES Cart BMC 35 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_36IN1, nes_bmc_36in1_device, "nes_bmc_36in1", "NES Cart BMC 36 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_64IN1, nes_bmc_64in1_device, "nes_bmc_64in1", "NES Cart BMC 64 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_70IN1, nes_bmc_70in1_device, "nes_bmc_70in1", "NES Cart BMC 70 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_72IN1, nes_bmc_72in1_device, "nes_bmc_72in1", "NES Cart BMC 72 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_76IN1, nes_bmc_76in1_device, "nes_bmc_76in1", "NES Cart BMC 76 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_110IN1, nes_bmc_110in1_device, "nes_bmc_110in1", "NES Cart BMC 110 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_150IN1, nes_bmc_150in1_device, "nes_bmc_150in1", "NES Cart BMC 150 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_190IN1, nes_bmc_190in1_device, "nes_bmc_190in1", "NES Cart BMC 190 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device, "nes_bmc_800in1", "NES Cart BMC 800 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device, "nes_bmc_1200in1", "NES Cart BMC 1200 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device, "nes_bmc_gold150", "NES Cart BMC Golden 150 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device, "nes_bmc_gold260", "NES Cart BMC Golden 260 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_CH001, nes_bmc_ch001_device, "nes_bmc_ch001", "NES Cart BMC CH-001 PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_SUPER22, nes_bmc_super22_device, "nes_bmc_super22", "NES Cart BMC Super 22 Games PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device, "nes_bmc_4in1reset", "NES Cart BMC 4 in 1 (Reset Based) PCB")
+DEFINE_DEVICE_TYPE(NES_BMC_42IN1RESET, nes_bmc_42in1reset_device, "nes_bmc_42in1reset", "NES Cart BMC 42 in 1 (Reset Based) PCB")
nes_action52_device::nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_ACTION52, "NES Cart Action 52 PCB", tag, owner, clock, "nes_action52", __FILE__)
+ : nes_nrom_device(mconfig, NES_ACTION52, tag, owner, clock)
{
}
nes_caltron_device::nes_caltron_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CALTRON6IN1, "NES Cart Caltron 6 in 1 PCB", tag, owner, clock, "nes_caltron", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_CALTRON6IN1, tag, owner, clock), m_latch(0)
+{
}
nes_rumblestat_device::nes_rumblestat_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_RUMBLESTATION, "NES Cart Rumblestation PCB", tag, owner, clock, "nes_rumblestat", __FILE__), m_prg(0), m_chr(0)
- {
+ : nes_nrom_device(mconfig, NES_RUMBLESTATION, tag, owner, clock), m_prg(0), m_chr(0)
+{
}
nes_svision16_device::nes_svision16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SVISION16, "NES Cart Supervision 16 in 1 PCB", tag, owner, clock, "nes_svision16", __FILE__), m_latch1(0), m_latch2(0)
- {
+ : nes_nrom_device(mconfig, NES_SVISION16, tag, owner, clock), m_latch1(0), m_latch2(0)
+{
}
nes_n625092_device::nes_n625092_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_N625092, "NES Cart N625092 PCB", tag, owner, clock, "nes_n625092", __FILE__), m_latch1(0), m_latch2(0)
- {
+ : nes_nrom_device(mconfig, NES_N625092, tag, owner, clock), m_latch1(0), m_latch2(0)
+{
}
nes_a65as_device::nes_a65as_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_A65AS, "NES Cart A65AS PCB", tag, owner, clock, "nes_a65as", __FILE__)
+ : nes_nrom_device(mconfig, NES_A65AS, tag, owner, clock)
{
}
nes_t262_device::nes_t262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_T262, "NES Cart T-262 PCB", tag, owner, clock, "nes_t262", __FILE__), m_latch1(0), m_latch2(0)
- {
+ : nes_nrom_device(mconfig, NES_T262, tag, owner, clock), m_latch1(0), m_latch2(0)
+{
}
nes_novel1_device::nes_novel1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NOVEL1, "NES Cart Novel Diamond Type 1 PCB", tag, owner, clock, "nes_novel1", __FILE__)
+ : nes_nrom_device(mconfig, NES_NOVEL1, tag, owner, clock)
{
}
nes_novel2_device::nes_novel2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NOVEL2, "NES Cart Novel Diamond Type 2 PCB", tag, owner, clock, "nes_novel2", __FILE__)
+ : nes_nrom_device(mconfig, NES_NOVEL2, tag, owner, clock)
{
}
nes_studyngame_device::nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_STUDYNGAME, "NES Cart Study n Game PCB", tag, owner, clock, "nes_studyngame", __FILE__)
+ : nes_nrom_device(mconfig, NES_STUDYNGAME, tag, owner, clock)
{
}
nes_sgun20in1_device::nes_sgun20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUPERGUN20IN1, "NES Cart Supergun 20 in 1 PCB", tag, owner, clock, "nes_sgun20in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_SUPERGUN20IN1, tag, owner, clock)
{
}
nes_vt5201_device::nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_VT5201, "NES Cart VT5201 PCB", tag, owner, clock, "nes_vt5201", __FILE__), m_latch(0), m_dipsetting(0)
- {
+ : nes_nrom_device(mconfig, NES_VT5201, tag, owner, clock), m_latch(0), m_dipsetting(0)
+{
}
nes_810544c_device::nes_810544c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_810544C, "NES Cart 810544-C-A1 PCB", tag, owner, clock, "nes_810544c", __FILE__)
+ : nes_nrom_device(mconfig, NES_810544C, tag, owner, clock)
{
}
nes_ntd03_device::nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NTD03, "NES Cart NTD-03 PCB", tag, owner, clock, "nes_ntd03", __FILE__)
+ : nes_nrom_device(mconfig, NES_NTD03, tag, owner, clock)
{
}
nes_bmc_gb63_device::nes_bmc_gb63_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_GB63, "NES Cart BMC Ghostbusters 63 in 1 PCB", tag, owner, clock, "nes_bmc_gb63", __FILE__), m_latch(0), m_dipsetting(0), m_vram_disable(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_GB63, tag, owner, clock), m_latch(0), m_dipsetting(0), m_vram_disable(0)
+{
}
nes_bmc_gka_device::nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_GKA, "NES Cart BMC GK-A PCB", tag, owner, clock, "nes_bmc_gka", __FILE__), m_latch1(0), m_latch2(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_GKA, tag, owner, clock), m_latch1(0), m_latch2(0)
+{
}
nes_bmc_gkb_device::nes_bmc_gkb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_GKB, "NES Cart BMC GK-B PCB", tag, owner, clock, "nes_bmc_gkb", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_GKB, tag, owner, clock)
{
}
nes_bmc_ws_device::nes_bmc_ws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_WS, "NES Cart BMC WS PCB", tag, owner, clock, "nes_bmc_ws", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_WS, tag, owner, clock), m_latch(0)
+{
}
nes_bmc_11160_device::nes_bmc_11160_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_11160, "NES Cart BMC-11160 PCB", tag, owner, clock, "nes_bmc_11160", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_11160, tag, owner, clock)
{
}
nes_bmc_g146_device::nes_bmc_g146_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_G146, "NES Cart BMC-G-146 PCB", tag, owner, clock, "nes_bmc_g146", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_G146, tag, owner, clock)
{
}
nes_bmc_8157_device::nes_bmc_8157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_8157, "NES Cart BMC-8157 PCB", tag, owner, clock, "nes_bmc_8157", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_8157, tag, owner, clock)
{
}
nes_bmc_hik300_device::nes_bmc_hik300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_HIK300, "NES Cart BMC HIK 300 in 1 PCB", tag, owner, clock, "nes_bmc_hik300", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_HIK300, tag, owner, clock)
{
}
nes_bmc_s700_device::nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_S700, "NES Cart BMC Super 700 in 1 PCB", tag, owner, clock, "nes_bmc_s700", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_S700, tag, owner, clock)
{
}
nes_bmc_ball11_device::nes_bmc_ball11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_BALL11, "NES Cart BMC Ball 11 in 1 PCB", tag, owner, clock, "nes_bmc_ball11", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_BALL11, tag, owner, clock)
{
}
nes_bmc_22games_device::nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_22GAMES, "NES Cart BMC 22 Games PCB", tag, owner, clock, "nes_bmc_22games", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_22GAMES, tag, owner, clock)
{
}
nes_bmc_64y2k_device::nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_64Y2K, "NES Cart BMC 64 in 1 Y2K PCB", tag, owner, clock, "nes_bmc_64y2k", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_64Y2K, tag, owner, clock)
{
}
nes_bmc_12in1_device::nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_12IN1, "NES Cart BMC 12 in 1 PCB", tag, owner, clock, "nes_bmc_12in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_12IN1, tag, owner, clock)
{
}
nes_bmc_20in1_device::nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_20IN1, "NES Cart BMC 20 in 1 PCB", tag, owner, clock, "nes_bmc_20in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_20IN1, tag, owner, clock)
{
}
nes_bmc_21in1_device::nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_21IN1, "NES Cart BMC 21 in 1 PCB", tag, owner, clock, "nes_bmc_21in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_21IN1, tag, owner, clock)
{
}
nes_bmc_31in1_device::nes_bmc_31in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_31IN1, "NES Cart BMC 31 in 1 PCB", tag, owner, clock, "nes_bmc_31in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_31IN1, tag, owner, clock)
{
}
nes_bmc_35in1_device::nes_bmc_35in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_35IN1, "NES Cart BMC 35 in 1 PCB", tag, owner, clock, "nes_bmc_35in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_35IN1, tag, owner, clock)
{
}
nes_bmc_36in1_device::nes_bmc_36in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_36IN1, "NES Cart BMC 36 in 1 PCB", tag, owner, clock, "nes_bmc_36in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_36IN1, tag, owner, clock)
{
}
nes_bmc_64in1_device::nes_bmc_64in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_64IN1, "NES Cart BMC 64 in 1 PCB", tag, owner, clock, "nes_bmc_64in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_64IN1, tag, owner, clock)
{
}
nes_bmc_70in1_device::nes_bmc_70in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_70IN1, "NES Cart BMC 70 in 1 PCB", tag, owner, clock, "nes_bmc_70in1", __FILE__), m_mode(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_70IN1, tag, owner, clock), m_mode(0)
+{
}
nes_bmc_72in1_device::nes_bmc_72in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_72IN1, "NES Cart BMC 72 in 1 PCB", tag, owner, clock, "nes_bmc_72in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_72IN1, tag, owner, clock)
{
}
nes_bmc_76in1_device::nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_76IN1, "NES Cart BMC 76 in 1 PCB", tag, owner, clock, "nes_bmc_76in1", __FILE__), m_latch1(0), m_latch2(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_76IN1, tag, owner, clock), m_latch1(0), m_latch2(0)
+{
}
nes_bmc_110in1_device::nes_bmc_110in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_110IN1, "NES Cart BMC 110 in 1 PCB", tag, owner, clock, "nes_bmc_110in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_110IN1, tag, owner, clock)
{
}
nes_bmc_150in1_device::nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_150IN1, "NES Cart BMC 150 in 1 PCB", tag, owner, clock, "nes_bmc_150in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_150IN1, tag, owner, clock)
{
}
nes_bmc_190in1_device::nes_bmc_190in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_190IN1, "NES Cart BMC 190 in 1 PCB", tag, owner, clock, "nes_bmc_190in1", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_190IN1, tag, owner, clock)
{
}
nes_bmc_800in1_device::nes_bmc_800in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_800IN1, "NES Cart BMC 800 in 1 PCB", tag, owner, clock, "nes_bmc_800in1", __FILE__), m_mode(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_800IN1, tag, owner, clock), m_mode(0)
+{
}
nes_bmc_1200in1_device::nes_bmc_1200in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_1200IN1, "NES Cart BMC 1200 in 1 PCB", tag, owner, clock, "nes_bmc_1200in1", __FILE__), m_vram_protect(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_1200IN1, tag, owner, clock), m_vram_protect(0)
+{
}
nes_bmc_gold150_device::nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_GOLD150, "NES Cart BMC Golden 150 in 1 PCB", tag, owner, clock, "nes_bmc_gold150", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_GOLD150, tag, owner, clock), m_latch(0)
+{
}
nes_bmc_gold260_device::nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_GOLD260, "NES Cart BMC Golden 260 in 1 PCB", tag, owner, clock, "nes_bmc_gold260", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_GOLD260, tag, owner, clock)
{
}
nes_bmc_ch001_device::nes_bmc_ch001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_CH001, "NES Cart BMC CH-001 PCB", tag, owner, clock, "nes_bmc_ch001", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_CH001, tag, owner, clock), m_latch(0)
+{
}
nes_bmc_super22_device::nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_SUPER22, "NES Cart BMC Super 22 Games PCB", tag, owner, clock, "nes_bmc_super22", __FILE__)
+ : nes_nrom_device(mconfig, NES_BMC_SUPER22, tag, owner, clock)
{
}
nes_bmc_4in1reset_device::nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_4IN1RESET, "NES Cart BMC 4 in 1 (Reset Based) PCB", tag, owner, clock, "nes_bmc_4in1reset", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_4IN1RESET, tag, owner, clock), m_latch(0)
+{
}
nes_bmc_42in1reset_device::nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BMC_42IN1RESET, "NES Cart BMC 42 in 1 (Reset Based) PCB", tag, owner, clock, "nes_bmc_42in1reset", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_BMC_42IN1RESET, tag, owner, clock), m_latch(0)
+{
}
diff --git a/src/devices/bus/nes/multigame.h b/src/devices/bus/nes/multigame.h
index 65c803910e8..e88ec21be58 100644
--- a/src/devices/bus/nes/multigame.h
+++ b/src/devices/bus/nes/multigame.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MULTIGAME_H
-#define __NES_MULTIGAME_H
+#ifndef MAME_BUS_NES_MULTIGAME_H
+#define MAME_BUS_NES_MULTIGAME_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_action52_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,13 +34,15 @@ public:
// construction/destruction
nes_caltron_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -50,13 +56,15 @@ public:
// construction/destruction
nes_rumblestat_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_prg, m_chr;
};
@@ -70,14 +78,16 @@ public:
// construction/destruction
nes_svision16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_prg();
uint8_t m_latch1, m_latch2;
@@ -92,12 +102,14 @@ public:
// construction/destruction
nes_n625092_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void set_prg(uint8_t reg1, uint8_t reg2);
uint8_t m_latch1, m_latch2;
@@ -112,11 +124,13 @@ public:
// construction/destruction
nes_a65as_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -128,12 +142,14 @@ public:
// construction/destruction
nes_t262_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch1, m_latch2;
};
@@ -147,11 +163,13 @@ public:
// construction/destruction
nes_novel1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -163,11 +181,13 @@ public:
// construction/destruction
nes_novel2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -179,11 +199,13 @@ public:
// construction/destruction
nes_studyngame_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -195,11 +217,13 @@ public:
// construction/destruction
nes_sgun20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -211,13 +235,15 @@ public:
// construction/destruction
nes_vt5201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch, m_dipsetting;
};
@@ -231,11 +257,13 @@ public:
// construction/destruction
nes_810544c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -247,11 +275,13 @@ public:
// construction/destruction
nes_ntd03_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -263,14 +293,16 @@ public:
// construction/destruction
nes_bmc_gb63_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual DECLARE_WRITE8_MEMBER(chr_w) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks();
uint8_t m_latch, m_dipsetting;
@@ -286,12 +318,14 @@ public:
// construction/destruction
nes_bmc_gka_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch1, m_latch2;
};
@@ -305,11 +339,13 @@ public:
// construction/destruction
nes_bmc_gkb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -321,12 +357,14 @@ public:
// construction/destruction
nes_bmc_ws_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -340,11 +378,13 @@ public:
// construction/destruction
nes_bmc_11160_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -356,11 +396,13 @@ public:
// construction/destruction
nes_bmc_g146_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -372,12 +414,14 @@ public:
// construction/destruction
nes_bmc_8157_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -389,11 +433,13 @@ public:
// construction/destruction
nes_bmc_hik300_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -405,11 +451,13 @@ public:
// construction/destruction
nes_bmc_s700_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -421,13 +469,15 @@ public:
// construction/destruction
nes_bmc_ball11_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void set_banks();
uint8_t m_reg[2];
@@ -442,11 +492,13 @@ public:
// construction/destruction
nes_bmc_22games_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -458,13 +510,15 @@ public:
// construction/destruction
nes_bmc_64y2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void set_prg();
uint8_t m_reg[4];
@@ -479,12 +533,14 @@ public:
// construction/destruction
nes_bmc_12in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks();
uint8_t m_reg[3];
@@ -499,11 +555,13 @@ public:
// construction/destruction
nes_bmc_20in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -515,11 +573,13 @@ public:
// construction/destruction
nes_bmc_21in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -531,11 +591,13 @@ public:
// construction/destruction
nes_bmc_31in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -547,11 +609,13 @@ public:
// construction/destruction
nes_bmc_35in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -563,11 +627,13 @@ public:
// construction/destruction
nes_bmc_36in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -579,11 +645,13 @@ public:
// construction/destruction
nes_bmc_64in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -595,13 +663,15 @@ public:
// construction/destruction
nes_bmc_70in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_mode;
uint8_t m_reg[2];
@@ -616,11 +686,13 @@ public:
// construction/destruction
nes_bmc_72in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -632,12 +704,14 @@ public:
// construction/destruction
nes_bmc_76in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch1, m_latch2;
};
@@ -651,11 +725,13 @@ public:
// construction/destruction
nes_bmc_110in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -667,11 +743,13 @@ public:
// construction/destruction
nes_bmc_150in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -683,11 +761,13 @@ public:
// construction/destruction
nes_bmc_190in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -699,13 +779,15 @@ public:
// construction/destruction
nes_bmc_800in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_mode;
uint8_t m_reg[2];
@@ -720,13 +802,15 @@ public:
// construction/destruction
nes_bmc_1200in1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual DECLARE_WRITE8_MEMBER(chr_w) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_vram_protect;
};
@@ -740,13 +824,15 @@ public:
// construction/destruction
nes_bmc_gold150_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -760,11 +846,13 @@ public:
// construction/destruction
nes_bmc_gold260_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -776,13 +864,15 @@ public:
// construction/destruction
nes_bmc_ch001_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -796,11 +886,13 @@ public:
// construction/destruction
nes_bmc_super22_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -812,9 +904,11 @@ public:
// construction/destruction
nes_bmc_4in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ virtual void pcb_reset() override;
+
+protected:
// device-level overrides
virtual void device_start() override;
- virtual void pcb_reset() override;
private:
int m_latch;
@@ -828,67 +922,67 @@ public:
// construction/destruction
nes_bmc_42in1reset_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
int m_latch;
uint8_t m_reg[2];
};
-
// device type definition
-extern const device_type NES_ACTION52;
-extern const device_type NES_CALTRON6IN1;
-extern const device_type NES_RUMBLESTATION;
-extern const device_type NES_SVISION16;
-extern const device_type NES_N625092;
-extern const device_type NES_A65AS;
-extern const device_type NES_T262;
-extern const device_type NES_NOVEL1;
-extern const device_type NES_NOVEL2;
-extern const device_type NES_STUDYNGAME;
-extern const device_type NES_SUPERGUN20IN1;
-extern const device_type NES_VT5201;
-extern const device_type NES_810544C;
-extern const device_type NES_NTD03;
-extern const device_type NES_BMC_GB63;
-extern const device_type NES_BMC_GKA;
-extern const device_type NES_BMC_GKB;
-extern const device_type NES_BMC_WS;
-extern const device_type NES_BMC_11160;
-extern const device_type NES_BMC_G146;
-extern const device_type NES_BMC_8157;
-extern const device_type NES_BMC_HIK300;
-extern const device_type NES_BMC_S700;
-extern const device_type NES_BMC_BALL11;
-extern const device_type NES_BMC_22GAMES;
-extern const device_type NES_BMC_64Y2K;
-extern const device_type NES_BMC_12IN1;
-extern const device_type NES_BMC_20IN1;
-extern const device_type NES_BMC_21IN1;
-extern const device_type NES_BMC_31IN1;
-extern const device_type NES_BMC_35IN1;
-extern const device_type NES_BMC_36IN1;
-extern const device_type NES_BMC_64IN1;
-extern const device_type NES_BMC_70IN1;
-extern const device_type NES_BMC_72IN1;
-extern const device_type NES_BMC_76IN1;
-extern const device_type NES_BMC_110IN1;
-extern const device_type NES_BMC_150IN1;
-extern const device_type NES_BMC_190IN1;
-extern const device_type NES_BMC_800IN1;
-extern const device_type NES_BMC_1200IN1;
-extern const device_type NES_BMC_GOLD150;
-extern const device_type NES_BMC_GOLD260;
-extern const device_type NES_BMC_CH001;
-extern const device_type NES_BMC_SUPER22;
-extern const device_type NES_BMC_4IN1RESET;
-extern const device_type NES_BMC_42IN1RESET;
-
-
-#endif
+DECLARE_DEVICE_TYPE(NES_ACTION52, nes_action52_device)
+DECLARE_DEVICE_TYPE(NES_CALTRON6IN1, nes_caltron_device)
+DECLARE_DEVICE_TYPE(NES_RUMBLESTATION, nes_rumblestat_device)
+DECLARE_DEVICE_TYPE(NES_SVISION16, nes_svision16_device)
+DECLARE_DEVICE_TYPE(NES_N625092, nes_n625092_device)
+DECLARE_DEVICE_TYPE(NES_A65AS, nes_a65as_device)
+DECLARE_DEVICE_TYPE(NES_T262, nes_t262_device)
+DECLARE_DEVICE_TYPE(NES_NOVEL1, nes_novel1_device)
+DECLARE_DEVICE_TYPE(NES_NOVEL2, nes_novel2_device)
+DECLARE_DEVICE_TYPE(NES_STUDYNGAME, nes_studyngame_device)
+DECLARE_DEVICE_TYPE(NES_SUPERGUN20IN1, nes_sgun20in1_device)
+DECLARE_DEVICE_TYPE(NES_VT5201, nes_vt5201_device)
+DECLARE_DEVICE_TYPE(NES_810544C, nes_810544c_device)
+DECLARE_DEVICE_TYPE(NES_NTD03, nes_ntd03_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GB63, nes_bmc_gb63_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GKA, nes_bmc_gka_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GKB, nes_bmc_gkb_device)
+DECLARE_DEVICE_TYPE(NES_BMC_WS, nes_bmc_ws_device)
+DECLARE_DEVICE_TYPE(NES_BMC_11160, nes_bmc_11160_device)
+DECLARE_DEVICE_TYPE(NES_BMC_G146, nes_bmc_g146_device)
+DECLARE_DEVICE_TYPE(NES_BMC_8157, nes_bmc_8157_device)
+DECLARE_DEVICE_TYPE(NES_BMC_HIK300, nes_bmc_hik300_device)
+DECLARE_DEVICE_TYPE(NES_BMC_S700, nes_bmc_s700_device)
+DECLARE_DEVICE_TYPE(NES_BMC_BALL11, nes_bmc_ball11_device)
+DECLARE_DEVICE_TYPE(NES_BMC_22GAMES, nes_bmc_22games_device)
+DECLARE_DEVICE_TYPE(NES_BMC_64Y2K, nes_bmc_64y2k_device)
+DECLARE_DEVICE_TYPE(NES_BMC_12IN1, nes_bmc_12in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_20IN1, nes_bmc_20in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_21IN1, nes_bmc_21in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_31IN1, nes_bmc_31in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_35IN1, nes_bmc_35in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_36IN1, nes_bmc_36in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_64IN1, nes_bmc_64in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_70IN1, nes_bmc_70in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_72IN1, nes_bmc_72in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_76IN1, nes_bmc_76in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_110IN1, nes_bmc_110in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_150IN1, nes_bmc_150in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_190IN1, nes_bmc_190in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_800IN1, nes_bmc_800in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_1200IN1, nes_bmc_1200in1_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GOLD150, nes_bmc_gold150_device)
+DECLARE_DEVICE_TYPE(NES_BMC_GOLD260, nes_bmc_gold260_device)
+DECLARE_DEVICE_TYPE(NES_BMC_CH001, nes_bmc_ch001_device)
+DECLARE_DEVICE_TYPE(NES_BMC_SUPER22, nes_bmc_super22_device)
+DECLARE_DEVICE_TYPE(NES_BMC_4IN1RESET, nes_bmc_4in1reset_device)
+DECLARE_DEVICE_TYPE(NES_BMC_42IN1RESET, nes_bmc_42in1reset_device)
+
+#endif // MAME_BUS_NES_MULTIGAME_H
diff --git a/src/devices/bus/nes/namcot.cpp b/src/devices/bus/nes/namcot.cpp
index edb1eff11e5..59778cbbaea 100644
--- a/src/devices/bus/nes/namcot.cpp
+++ b/src/devices/bus/nes/namcot.cpp
@@ -41,52 +41,52 @@
// constructor
//-------------------------------------------------
-const device_type NES_NAMCOT3433 = device_creator<nes_namcot3433_device>;
-const device_type NES_NAMCOT3446 = device_creator<nes_namcot3446_device>;
-const device_type NES_NAMCOT3425 = device_creator<nes_namcot3425_device>;
-const device_type NES_NAMCOT175 = device_creator<nes_namcot175_device>;
-const device_type NES_NAMCOT340 = device_creator<nes_namcot340_device>;
-const device_type NES_NAMCOT163 = device_creator<nes_namcot163_device>;
+DEFINE_DEVICE_TYPE(NES_NAMCOT3433, nes_namcot3433_device, "nes_namcot3433", "NES Cart Namcot 3433 & 3443 / DxROM PCB")
+DEFINE_DEVICE_TYPE(NES_NAMCOT3446, nes_namcot3446_device, "nes_namcot3446", "NES Cart Namcot 3446 PCB")
+DEFINE_DEVICE_TYPE(NES_NAMCOT3425, nes_namcot3425_device, "nes_namcot3425", "NES Cart Namcot 3425 PCB")
+DEFINE_DEVICE_TYPE(NES_NAMCOT340, nes_namcot340_device, "nes_namcot340", "NES Cart Namcot 340 PCB")
+DEFINE_DEVICE_TYPE(NES_NAMCOT175, nes_namcot175_device, "nes_namcot175", "NES Cart Namcot 175 PCB")
+DEFINE_DEVICE_TYPE(NES_NAMCOT163, nes_namcot163_device, "nes_namcot163", "NES Cart Namcot 163 PCB")
-nes_namcot3433_device::nes_namcot3433_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0)
- {
+nes_namcot3433_device::nes_namcot3433_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0)
+{
}
nes_namcot3433_device::nes_namcot3433_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NAMCOT3433, "NES Cart Namcot 3433 & 3443 / DxROM PCB", tag, owner, clock, "nes_namcot3433", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_NAMCOT3433, tag, owner, clock), m_latch(0)
+{
}
nes_namcot3446_device::nes_namcot3446_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NAMCOT3446, "NES Cart Namcot 3446 PCB", tag, owner, clock, "nes_namcot3446", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_NAMCOT3446, tag, owner, clock), m_latch(0)
+{
}
nes_namcot3425_device::nes_namcot3425_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NAMCOT3425, "NES Cart Namcot 3425 PCB", tag, owner, clock, "nes_namcot3425", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_NAMCOT3425, tag, owner, clock), m_latch(0)
+{
}
-nes_namcot340_device::nes_namcot340_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+nes_namcot340_device::nes_namcot340_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
nes_namcot340_device::nes_namcot340_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NAMCOT340, "NES Cart Namcot 340 PCB", tag, owner, clock, "nes_namcot340", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_namcot340_device(mconfig, NES_NAMCOT340, tag, owner, clock)
+{
}
nes_namcot175_device::nes_namcot175_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_namcot340_device(mconfig, NES_NAMCOT175, "NES Cart Namcot 175 PCB", tag, owner, clock, "nes_namcot175", __FILE__), m_wram_protect(0)
- {
+ : nes_namcot340_device(mconfig, NES_NAMCOT175, tag, owner, clock), m_wram_protect(0)
+{
}
nes_namcot163_device::nes_namcot163_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_namcot340_device(mconfig, NES_NAMCOT163, "NES Cart Namcot 163 PCB", tag, owner, clock, "nes_namcot163", __FILE__), m_wram_protect(0), m_latch(0), m_chr_bank(0)
- {
+ : nes_namcot340_device(mconfig, NES_NAMCOT163, tag, owner, clock), m_wram_protect(0), m_latch(0), m_chr_bank(0)
+{
}
diff --git a/src/devices/bus/nes/namcot.h b/src/devices/bus/nes/namcot.h
index bb65a0c8953..a4ab64084e1 100644
--- a/src/devices/bus/nes/namcot.h
+++ b/src/devices/bus/nes/namcot.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_NAMCOT_H
-#define __NES_NAMCOT_H
+#ifndef MAME_BUS_NES_NAMCOT_H
+#define MAME_BUS_NES_NAMCOT_H
+
+#pragma once
#include "nxrom.h"
@@ -12,16 +14,19 @@ class nes_namcot3433_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_namcot3433_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_namcot3433_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(dxrom_write);
virtual DECLARE_WRITE8_MEMBER(write_h) override { dxrom_write(space, offset, data, mem_mask); }
virtual void pcb_reset() override;
+protected:
+ nes_namcot3433_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -35,12 +40,14 @@ public:
// construction/destruction
nes_namcot3446_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -54,12 +61,14 @@ public:
// construction/destruction
nes_namcot3425_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
uint8_t m_reg[4];
@@ -72,12 +81,8 @@ class nes_namcot340_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_namcot340_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_namcot340_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(n340_loread);
virtual DECLARE_WRITE8_MEMBER(n340_lowrite);
virtual DECLARE_WRITE8_MEMBER(n340_hiwrite);
@@ -88,10 +93,17 @@ public:
virtual void pcb_reset() override;
protected:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
+ nes_namcot340_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
uint16_t m_irq_count;
int m_irq_enable;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
// Namcot-163 chip contains 8K of internal ram, possibly battery backed up (not emulated yet)
@@ -129,8 +141,6 @@ public:
// construction/destruction
nes_namcot163_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
@@ -143,6 +153,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void set_mirror(uint8_t page, uint8_t data);
@@ -151,13 +165,12 @@ private:
};
-
// device type definition
-extern const device_type NES_NAMCOT3433;
-extern const device_type NES_NAMCOT3446;
-extern const device_type NES_NAMCOT3425;
-extern const device_type NES_NAMCOT175;
-extern const device_type NES_NAMCOT340;
-extern const device_type NES_NAMCOT163;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_NAMCOT3433, nes_namcot3433_device)
+DECLARE_DEVICE_TYPE(NES_NAMCOT3446, nes_namcot3446_device)
+DECLARE_DEVICE_TYPE(NES_NAMCOT3425, nes_namcot3425_device)
+DECLARE_DEVICE_TYPE(NES_NAMCOT340, nes_namcot340_device)
+DECLARE_DEVICE_TYPE(NES_NAMCOT175, nes_namcot175_device)
+DECLARE_DEVICE_TYPE(NES_NAMCOT163, nes_namcot163_device)
+
+#endif // MAME_BUS_NES_NAMCOT_H
diff --git a/src/devices/bus/nes/nanjing.cpp b/src/devices/bus/nes/nanjing.cpp
index 8acc871f81c..77a699f7a7c 100644
--- a/src/devices/bus/nes/nanjing.cpp
+++ b/src/devices/bus/nes/nanjing.cpp
@@ -30,15 +30,15 @@
// constructor
//-------------------------------------------------
-const device_type NES_NANJING = device_creator<nes_nanjing_device>;
+DEFINE_DEVICE_TYPE(NES_NANJING, nes_nanjing_device, "nes_nanjing", "NES Cart Nanjing PCB")
nes_nanjing_device::nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NANJING, "NES Cart Nanjing PCB", tag, owner, clock, "nes_nanjing", __FILE__),
- m_count(0),
- m_latch1(0),
- m_latch2(0)
- {
+ : nes_nrom_device(mconfig, NES_NANJING, tag, owner, clock)
+ , m_count(0)
+ , m_latch1(0)
+ , m_latch2(0)
+{
}
diff --git a/src/devices/bus/nes/nanjing.h b/src/devices/bus/nes/nanjing.h
index c7f886ba107..f7a7d508f5f 100644
--- a/src/devices/bus/nes/nanjing.h
+++ b/src/devices/bus/nes/nanjing.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_NANJING_H
-#define __NES_NANJING_H
+#ifndef MAME_BUS_NES_NANJING_H
+#define MAME_BUS_NES_NANJING_H
+
+#pragma once
#include "nxrom.h"
@@ -14,14 +16,16 @@ public:
// construction/destruction
nes_nanjing_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_count;
uint8_t m_reg[2];
@@ -29,10 +33,7 @@ private:
};
-
-
-
// device type definition
-extern const device_type NES_NANJING;
+DECLARE_DEVICE_TYPE(NES_NANJING, nes_nanjing_device)
-#endif
+#endif // MAME_BUS_NES_NANJING_H
diff --git a/src/devices/bus/nes/nes_carts.cpp b/src/devices/bus/nes/nes_carts.cpp
index 95cce71afaf..a2434621b4c 100644
--- a/src/devices/bus/nes/nes_carts.cpp
+++ b/src/devices/bus/nes/nes_carts.cpp
@@ -9,6 +9,61 @@
#include "emu.h"
#include "nes_carts.h"
+// official PCBs
+#include "nxrom.h"
+#include "mmc1.h"
+#include "mmc2.h"
+#include "mmc3.h"
+#include "mmc5.h"
+#include "bandai.h"
+#include "datach.h"
+#include "discrete.h"
+#include "disksys.h"
+#include "event.h"
+#include "irem.h"
+#include "jaleco.h"
+#include "karastudio.h"
+#include "konami.h"
+#include "namcot.h"
+#include "pt554.h"
+#include "sunsoft.h"
+#include "sunsoft_dcs.h"
+#include "taito.h"
+// unlicensed/bootleg/pirate PCBs
+#include "2a03pur.h"
+#include "act53.h"
+#include "aladdin.h"
+#include "ave.h"
+#include "benshieng.h"
+#include "camerica.h"
+#include "cne.h"
+#include "cony.h"
+#include "ggenie.h"
+#include "hes.h"
+#include "henggedianzi.h"
+#include "hosenkan.h"
+#include "jy.h"
+#include "kaiser.h"
+#include "legacy.h"
+#include "nanjing.h"
+#include "ntdec.h"
+#include "racermate.h"
+#include "rcm.h"
+#include "rexsoft.h"
+#include "sachen.h"
+#include "somari.h"
+#include "subor.h"
+#include "tengen.h"
+#include "txc.h"
+#include "waixing.h"
+#include "zemina.h"
+// misc unlicensed/bootleg/pirate PCBs
+#include "bootleg.h"
+#include "multigame.h"
+#include "pirate.h"
+#include "mmc3_clones.h"
+
+
SLOT_INTERFACE_START(nes_cart)
// HROM, NROM, RROM, SROM & STROM
SLOT_INTERFACE_INTERNAL("nrom", NES_NROM)
diff --git a/src/devices/bus/nes/nes_carts.h b/src/devices/bus/nes/nes_carts.h
index 85bc4b429fb..421a5b12386 100644
--- a/src/devices/bus/nes/nes_carts.h
+++ b/src/devices/bus/nes/nes_carts.h
@@ -6,69 +6,14 @@
**********************************************************************/
-#pragma once
-
-#ifndef __NES_CARTS_H__
-#define __NES_CARTS_H__
+#ifndef MAME_BUS_NES_NES_CARTS_H
+#define MAME_BUS_NES_NES_CARTS_H
-
-// official PCBs
-#include "nxrom.h"
-#include "mmc1.h"
-#include "mmc2.h"
-#include "mmc3.h"
-#include "mmc5.h"
-#include "bandai.h"
-#include "datach.h"
-#include "discrete.h"
-#include "disksys.h"
-#include "event.h"
-#include "irem.h"
-#include "jaleco.h"
-#include "karastudio.h"
-#include "konami.h"
-#include "namcot.h"
-#include "pt554.h"
-#include "sunsoft.h"
-#include "sunsoft_dcs.h"
-#include "taito.h"
-// unlicensed/bootleg/pirate PCBs
-#include "2a03pur.h"
-#include "act53.h"
-#include "aladdin.h"
-#include "ave.h"
-#include "benshieng.h"
-#include "camerica.h"
-#include "cne.h"
-#include "cony.h"
-#include "ggenie.h"
-#include "hes.h"
-#include "henggedianzi.h"
-#include "hosenkan.h"
-#include "jy.h"
-#include "kaiser.h"
-#include "legacy.h"
-#include "nanjing.h"
-#include "ntdec.h"
-#include "racermate.h"
-#include "rcm.h"
-#include "rexsoft.h"
-#include "sachen.h"
-#include "somari.h"
-#include "subor.h"
-#include "tengen.h"
-#include "txc.h"
-#include "waixing.h"
-#include "zemina.h"
-// misc unlicensed/bootleg/pirate PCBs
-#include "bootleg.h"
-#include "multigame.h"
-#include "pirate.h"
-#include "mmc3_clones.h"
+#pragma once
// supported devices
SLOT_INTERFACE_EXTERN(nes_cart);
SLOT_INTERFACE_EXTERN(disksys_only);
-#endif // __NES_CARTS_H__
+#endif // MAME_BUS_NES_NES_CARTS_H
diff --git a/src/devices/bus/nes/nes_slot.cpp b/src/devices/bus/nes/nes_slot.cpp
index 530287142e7..b8f99355faa 100644
--- a/src/devices/bus/nes/nes_slot.cpp
+++ b/src/devices/bus/nes/nes_slot.cpp
@@ -93,7 +93,7 @@
// GLOBAL VARIABLES
//**************************************************************************
-const device_type NES_CART_SLOT = device_creator<nes_cart_slot_device>;
+DEFINE_DEVICE_TYPE(NES_CART_SLOT, nes_cart_slot_device, "nes_cart_slot", "NES Cartridge Slot")
//**************************************************************************
@@ -105,31 +105,32 @@ const device_type NES_CART_SLOT = device_creator<nes_cart_slot_device>;
//-------------------------------------------------
device_nes_cart_interface::device_nes_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_prg(nullptr),
- m_vrom(nullptr),
- m_ciram(nullptr),
- m_prg_size(0),
- m_vrom_size(0), m_maincpu(nullptr),
- m_mapper_sram(nullptr),
- m_mapper_sram_size(0),
- m_ce_mask(0),
- m_ce_state(0),
- m_vrc_ls_prg_a(0),
- m_vrc_ls_prg_b(0),
- m_vrc_ls_chr(0),
- m_mirroring(PPU_MIRROR_NONE),
- m_pcb_ctrl_mirror(false),
- m_four_screen_vram(false),
- m_has_trainer(false),
- m_x1_005_alt_mirroring(false),
- m_bus_conflict(true),
- m_open_bus(0),
- m_prg_chunks(0),
- m_prg_mask(0xffff),
- m_chr_source(CHRRAM),
- m_vrom_chunks(0),
- m_vram_chunks(0)
+ : device_slot_card_interface(mconfig, device)
+ , m_prg(nullptr)
+ , m_vrom(nullptr)
+ , m_ciram(nullptr)
+ , m_prg_size(0)
+ , m_vrom_size(0)
+ , m_maincpu(nullptr)
+ , m_mapper_sram(nullptr)
+ , m_mapper_sram_size(0)
+ , m_ce_mask(0)
+ , m_ce_state(0)
+ , m_vrc_ls_prg_a(0)
+ , m_vrc_ls_prg_b(0)
+ , m_vrc_ls_chr(0)
+ , m_mirroring(PPU_MIRROR_NONE)
+ , m_pcb_ctrl_mirror(false)
+ , m_four_screen_vram(false)
+ , m_has_trainer(false)
+ , m_x1_005_alt_mirroring(false)
+ , m_bus_conflict(true)
+ , m_open_bus(0)
+ , m_prg_chunks(0)
+ , m_prg_mask(0xffff)
+ , m_chr_source(CHRRAM)
+ , m_vrom_chunks(0)
+ , m_vram_chunks(0)
{
}
@@ -742,13 +743,14 @@ void device_nes_cart_interface::nes_banks_restore()
//-------------------------------------------------
// nes_cart_slot_device - constructor
//-------------------------------------------------
-nes_cart_slot_device::nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, NES_CART_SLOT, "NES Cartridge Slot", tag, owner, clock, "nes_cart_slot", __FILE__),
- device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this),
- m_crc_hack(0), m_cart(nullptr),
- m_pcb_id(NO_BOARD),
- m_must_be_loaded(1)
+nes_cart_slot_device::nes_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, NES_CART_SLOT, tag, owner, clock)
+ , device_image_interface(mconfig, *this)
+ , device_slot_interface(mconfig, *this)
+ , m_crc_hack(0)
+ , m_cart(nullptr)
+ , m_pcb_id(NO_BOARD)
+ , m_must_be_loaded(1)
{
}
diff --git a/src/devices/bus/nes/nes_slot.h b/src/devices/bus/nes/nes_slot.h
index b8829fd4768..82876ce15a5 100644
--- a/src/devices/bus/nes/nes_slot.h
+++ b/src/devices/bus/nes/nes_slot.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_SLOT_H__
-#define __NES_SLOT_H__
+#ifndef MAME_BUS_NES_NES_SLOT_H
+#define MAME_BUS_NES_NES_SLOT_H
+
+#pragma once
#include "softlist_dev.h"
@@ -161,7 +163,6 @@ class device_nes_cart_interface : public device_slot_card_interface
{
public:
// construction/destruction
- device_nes_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~device_nes_cart_interface();
// reading and writing
@@ -230,6 +231,7 @@ public:
uint8_t account_bus_conflict(uint32_t offset, uint8_t data);
protected:
+ device_nes_cart_interface(const machine_config &mconfig, device_t &device);
// internal state
uint8_t *m_prg;
@@ -396,15 +398,14 @@ public:
void set_must_be_loaded(bool _must_be_loaded) { m_must_be_loaded = _must_be_loaded; }
- //private:
-
+//private:
device_nes_cart_interface* m_cart;
int m_pcb_id;
bool m_must_be_loaded;
};
// device type definition
-extern const device_type NES_CART_SLOT;
+DECLARE_DEVICE_TYPE(NES_CART_SLOT, nes_cart_slot_device)
/***************************************************************************
@@ -429,4 +430,4 @@ extern const device_type NES_CART_SLOT;
MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, true) \
MCFG_NES_CARTRIDGE_NOT_MANDATORY
-#endif
+#endif // MAME_BUS_NES_NES_SLOT_H
diff --git a/src/devices/bus/nes/ntdec.cpp b/src/devices/bus/nes/ntdec.cpp
index a2547a97185..5ea3458e8f3 100644
--- a/src/devices/bus/nes/ntdec.cpp
+++ b/src/devices/bus/nes/ntdec.cpp
@@ -34,18 +34,18 @@
// constructor
//-------------------------------------------------
-const device_type NES_NTDEC_ASDER = device_creator<nes_ntdec_asder_device>;
-const device_type NES_NTDEC_FH = device_creator<nes_ntdec_fh_device>;
+DEFINE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device, "nes_ntdec_asder", "NES Cart NTDEC Asder PCB")
+DEFINE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device, "nes_fh_asder", "NES Cart NTDEC Fighting Hero PCB")
nes_ntdec_asder_device::nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NTDEC_ASDER, "NES Cart NTDEC Asder PCB", tag, owner, clock, "nes_ntdec_asder", __FILE__),
- m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_NTDEC_ASDER, tag, owner, clock)
+ , m_latch(0)
+{
}
nes_ntdec_fh_device::nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NTDEC_FH, "NES Cart NTDEC Fighting Hero PCB", tag, owner, clock, "nes_ntdec_fh", __FILE__)
+ : nes_nrom_device(mconfig, NES_NTDEC_FH, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/ntdec.h b/src/devices/bus/nes/ntdec.h
index daa7ba8acdf..1e5e8ef6cbb 100644
--- a/src/devices/bus/nes/ntdec.h
+++ b/src/devices/bus/nes/ntdec.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_NTDEC_H
-#define __NES_NTDEC_H
+#ifndef MAME_BUS_NES_NTDEC_H
+#define MAME_BUS_NES_NTDEC_H
+
+#pragma once
#include "nxrom.h"
@@ -14,12 +16,14 @@ public:
// construction/destruction
nes_ntdec_asder_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -33,19 +37,18 @@ public:
// construction/destruction
nes_ntdec_fh_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
-};
-
-
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+};
// device type definition
-extern const device_type NES_NTDEC_ASDER;
-extern const device_type NES_NTDEC_FH;
+DECLARE_DEVICE_TYPE(NES_NTDEC_ASDER, nes_ntdec_asder_device)
+DECLARE_DEVICE_TYPE(NES_NTDEC_FH, nes_ntdec_fh_device)
-#endif
+#endif // MAME_BUS_NES_NTDEC_H
diff --git a/src/devices/bus/nes/nxrom.cpp b/src/devices/bus/nes/nxrom.cpp
index 6996fe50faa..e78fd6d1527 100644
--- a/src/devices/bus/nes/nxrom.cpp
+++ b/src/devices/bus/nes/nxrom.cpp
@@ -45,89 +45,87 @@
// constructor
//-------------------------------------------------
-const device_type NES_NROM = device_creator<nes_nrom_device>;
-const device_type NES_NROM368 = device_creator<nes_nrom368_device>;
-const device_type NES_FCBASIC = device_creator<nes_fcbasic_device>;
-const device_type NES_AXROM = device_creator<nes_axrom_device>;
-const device_type NES_BXROM = device_creator<nes_bxrom_device>;
-const device_type NES_CNROM = device_creator<nes_cnrom_device>;
-const device_type NES_CPROM = device_creator<nes_cprom_device>;
-const device_type NES_GXROM = device_creator<nes_gxrom_device>;
-const device_type NES_UXROM = device_creator<nes_uxrom_device>;
-const device_type NES_UXROM_CC = device_creator<nes_uxrom_cc_device>;
-const device_type NES_UN1ROM = device_creator<nes_un1rom_device>;
-const device_type NES_NOCHR = device_creator<nes_nochr_device>;
+DEFINE_DEVICE_TYPE(NES_NROM, nes_nrom_device, "nes_nrom", "NES Cart NROM PCB")
+DEFINE_DEVICE_TYPE(NES_NROM368, nes_nrom368_device, "nes_nrom368", "NES Cart NROM-368 PCB")
+DEFINE_DEVICE_TYPE(NES_FCBASIC, nes_fcbasic_device, "nes_fcbasic", "NES Cart Famicom BASIC PCB")
+DEFINE_DEVICE_TYPE(NES_AXROM, nes_axrom_device, "nes_axrom", "NES Cart AxROM PCB")
+DEFINE_DEVICE_TYPE(NES_BXROM, nes_bxrom_device, "nes_bxrom", "NES Cart BxROM PCB")
+DEFINE_DEVICE_TYPE(NES_CNROM, nes_cnrom_device, "nes_cnrom", "NES Cart CNROM PCB")
+DEFINE_DEVICE_TYPE(NES_CPROM, nes_cprom_device, "nes_cprom", "NES Cart CPROM PCB")
+DEFINE_DEVICE_TYPE(NES_GXROM, nes_gxrom_device, "nes_gxrom", "NES Cart GxROM PCB")
+DEFINE_DEVICE_TYPE(NES_UXROM, nes_uxrom_device, "nes_uxrom", "NES Cart UxROM PCB")
+DEFINE_DEVICE_TYPE(NES_UXROM_CC, nes_uxrom_cc_device, "nes_uxrom_cc", "NES Cart UNROM M5 (Crazy Climber) PCB")
+DEFINE_DEVICE_TYPE(NES_UN1ROM, nes_un1rom_device, "nes_un1rom", "NES Cart UN1ROM PCB")
+DEFINE_DEVICE_TYPE(NES_NOCHR, nes_nochr_device, "nes_nochr", "NES Cart NoCash NOCHR PCB")
-nes_nrom_device::nes_nrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : device_t(mconfig, type, name, tag, owner, clock, shortname, source),
- device_nes_cart_interface( mconfig, *this )
+nes_nrom_device::nes_nrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, type, tag, owner, clock), device_nes_cart_interface(mconfig, *this)
{
}
nes_nrom_device::nes_nrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NES_NROM, "NES Cart NROM PCB", tag, owner, clock, "nes_nrom", __FILE__),
- device_nes_cart_interface( mconfig, *this )
+ : nes_nrom_device(mconfig, NES_NROM, tag, owner, clock)
{
}
nes_nrom368_device::nes_nrom368_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NROM368, "NES Cart NROM-368 PCB", tag, owner, clock, "nes_nrom368", __FILE__)
+ : nes_nrom_device(mconfig, NES_NROM368, tag, owner, clock)
{
}
nes_fcbasic_device::nes_fcbasic_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FCBASIC, "NES Cart Famicom BASIC PCB", tag, owner, clock, "nes_fcbasic", __FILE__)
+ : nes_nrom_device(mconfig, NES_FCBASIC, tag, owner, clock)
{
}
nes_axrom_device::nes_axrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_AXROM, "NES Cart AxROM PCB", tag, owner, clock, "nes_axrom", __FILE__)
+ : nes_nrom_device(mconfig, NES_AXROM, tag, owner, clock)
{
}
nes_bxrom_device::nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_BXROM, "NES Cart BxROM PCB", tag, owner, clock, "nes_bxrom", __FILE__)
+ : nes_nrom_device(mconfig, NES_BXROM, tag, owner, clock)
{
}
-nes_cnrom_device::nes_cnrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_chr_open_bus(0)
- {
+nes_cnrom_device::nes_cnrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_chr_open_bus(0)
+{
}
nes_cnrom_device::nes_cnrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CNROM, "NES Cart CNROM PCB", tag, owner, clock, "nes_cnrom", __FILE__), m_chr_open_bus(0)
- {
+ : nes_cnrom_device(mconfig, NES_CNROM, tag, owner, clock)
+{
}
nes_cprom_device::nes_cprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CPROM, "NES Cart CPROM PCB", tag, owner, clock, "nes_cprom", __FILE__)
+ : nes_nrom_device(mconfig, NES_CPROM, tag, owner, clock)
{
}
nes_gxrom_device::nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GXROM, "NES Cart GxROM PCB", tag, owner, clock, "nes_gxrom", __FILE__)
+ : nes_nrom_device(mconfig, NES_GXROM, tag, owner, clock)
{
}
nes_uxrom_device::nes_uxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_UXROM, "NES Cart UxROM PCB", tag, owner, clock, "nes_uxrom", __FILE__)
+ : nes_nrom_device(mconfig, NES_UXROM, tag, owner, clock)
{
}
nes_uxrom_cc_device::nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_UXROM_CC, "NES Cart UNROM M5 PCB (Crazy Climber)", tag, owner, clock, "nes_uxrom_cc", __FILE__)
+ : nes_nrom_device(mconfig, NES_UXROM_CC, tag, owner, clock)
{
}
nes_un1rom_device::nes_un1rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_UN1ROM, "NES Cart UN1ROM PCB", tag, owner, clock, "nes_un1rom", __FILE__)
+ : nes_nrom_device(mconfig, NES_UN1ROM, tag, owner, clock)
{
}
nes_nochr_device::nes_nochr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_NOCHR, "NES Cart NoCash NOCHR PCB", tag, owner, clock, "nes_nochr", __FILE__)
+ : nes_nrom_device(mconfig, NES_NOCHR, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/nxrom.h b/src/devices/bus/nes/nxrom.h
index c4f112bb68e..721ed5b5e98 100644
--- a/src/devices/bus/nes/nxrom.h
+++ b/src/devices/bus/nes/nxrom.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_MMCX_H
-#define __NES_MMCX_H
+#ifndef MAME_BUS_NES_NXROM_H
+#define MAME_BUS_NES_NXROM_H
+
+#pragma once
#include "nes_slot.h"
#include "sound/samples.h"
@@ -9,18 +11,19 @@
// ======================> nes_nrom_device
-class nes_nrom_device : public device_t,
- public device_nes_cart_interface
+class nes_nrom_device : public device_t, public device_nes_cart_interface
{
public:
// construction/destruction
- nes_nrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_nrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- virtual void device_start() override { common_start(); }
-
virtual void pcb_reset() override;
+protected:
+ nes_nrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ virtual void device_start() override { common_start(); }
+
void common_start();
};
@@ -59,11 +62,13 @@ public:
// construction/destruction
nes_axrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -75,11 +80,13 @@ public:
// construction/destruction
nes_bxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -89,16 +96,19 @@ class nes_cnrom_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_cnrom_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_cnrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(chr_r) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ nes_cnrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_chr_open_bus;
};
@@ -112,11 +122,13 @@ public:
// construction/destruction
nes_cprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -128,11 +140,13 @@ public:
// construction/destruction
nes_gxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -144,11 +158,13 @@ public:
// construction/destruction
nes_uxrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -160,11 +176,13 @@ public:
// construction/destruction
nes_uxrom_cc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -176,11 +194,13 @@ public:
// construction/destruction
nes_un1rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -200,17 +220,17 @@ public:
// device type definition
-extern const device_type NES_NROM;
-extern const device_type NES_NROM368;
-extern const device_type NES_FCBASIC;
-extern const device_type NES_AXROM;
-extern const device_type NES_BXROM;
-extern const device_type NES_CNROM;
-extern const device_type NES_CPROM;
-extern const device_type NES_GXROM;
-extern const device_type NES_UXROM;
-extern const device_type NES_UXROM_CC;
-extern const device_type NES_UN1ROM;
-extern const device_type NES_NOCHR;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_NROM, nes_nrom_device)
+DECLARE_DEVICE_TYPE(NES_NROM368, nes_nrom368_device)
+DECLARE_DEVICE_TYPE(NES_FCBASIC, nes_fcbasic_device)
+DECLARE_DEVICE_TYPE(NES_AXROM, nes_axrom_device)
+DECLARE_DEVICE_TYPE(NES_BXROM, nes_bxrom_device)
+DECLARE_DEVICE_TYPE(NES_CNROM, nes_cnrom_device)
+DECLARE_DEVICE_TYPE(NES_CPROM, nes_cprom_device)
+DECLARE_DEVICE_TYPE(NES_GXROM, nes_gxrom_device)
+DECLARE_DEVICE_TYPE(NES_UXROM, nes_uxrom_device)
+DECLARE_DEVICE_TYPE(NES_UXROM_CC, nes_uxrom_cc_device)
+DECLARE_DEVICE_TYPE(NES_UN1ROM, nes_un1rom_device)
+DECLARE_DEVICE_TYPE(NES_NOCHR, nes_nochr_device)
+
+#endif // MAME_BUS_NES_NXROM_H
diff --git a/src/devices/bus/nes/pirate.cpp b/src/devices/bus/nes/pirate.cpp
index cded3deb09d..573b1d38ce7 100644
--- a/src/devices/bus/nes/pirate.cpp
+++ b/src/devices/bus/nes/pirate.cpp
@@ -18,7 +18,7 @@
#include "pirate.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#include "screen.h"
@@ -35,96 +35,96 @@
// constructor
//-------------------------------------------------
-const device_type NES_AGCI_50282 = device_creator<nes_agci_device>;
-const device_type NES_DREAMTECH01 = device_creator<nes_dreamtech_device>;
-const device_type NES_FUKUTAKE = device_creator<nes_fukutake_device>;
-const device_type NES_FUTUREMEDIA = device_creator<nes_futuremedia_device>;
-const device_type NES_MAGSERIES = device_creator<nes_magseries_device>;
-const device_type NES_DAOU306 = device_creator<nes_daou306_device>;
-const device_type NES_CC21 = device_creator<nes_cc21_device>;
-const device_type NES_XIAOZY = device_creator<nes_xiaozy_device>;
-const device_type NES_EDU2K = device_creator<nes_edu2k_device>;
-const device_type NES_T230 = device_creator<nes_t230_device>;
-const device_type NES_MK2 = device_creator<nes_mk2_device>;
-const device_type NES_WHERO = device_creator<nes_whero_device>;
-const device_type NES_43272 = device_creator<nes_43272_device>;
-const device_type NES_TF1201 = device_creator<nes_tf1201_device>;
-const device_type NES_CITYFIGHT = device_creator<nes_cityfight_device>;
+DEFINE_DEVICE_TYPE(NES_AGCI_50282, nes_agci_device, "nes_agci50282", "NES Cart AGCI 50282 PCB")
+DEFINE_DEVICE_TYPE(NES_DREAMTECH01, nes_dreamtech_device, "nes_dreamtech", "NES Cart Dreamtech01 PCB")
+DEFINE_DEVICE_TYPE(NES_FUKUTAKE, nes_fukutake_device, "nes_futuremedia", "NES Cart Fukutake Study Box PCB")
+DEFINE_DEVICE_TYPE(NES_FUTUREMEDIA, nes_futuremedia_device, "nes_fukutake", "NES Cart FutureMedia PCB")
+DEFINE_DEVICE_TYPE(NES_MAGSERIES, nes_magseries_device, "nes_magseries", "NES Cart Magical Series PCB")
+DEFINE_DEVICE_TYPE(NES_DAOU306, nes_daou306_device, "nes_daou306", "NES Cart Daou 306 PCB")
+DEFINE_DEVICE_TYPE(NES_CC21, nes_cc21_device, "nes_cc21", "NES Cart CC-21 PCB")
+DEFINE_DEVICE_TYPE(NES_XIAOZY, nes_xiaozy_device, "nes_xiaozy", "NES Cart Xiao Zhuan Yuan PCB")
+DEFINE_DEVICE_TYPE(NES_EDU2K, nes_edu2k_device, "nes_edu2k", "NES Cart Educational Computer 2000 PCB")
+DEFINE_DEVICE_TYPE(NES_T230, nes_t230_device, "nes_t230", "NES Cart T-230 PCB")
+DEFINE_DEVICE_TYPE(NES_MK2, nes_mk2_device, "nes_mk2", "NES Cart Mortal Kombat 2 PCB")
+DEFINE_DEVICE_TYPE(NES_WHERO, nes_whero_device, "nes_whero", "NES Cart World Heroes PCB")
+DEFINE_DEVICE_TYPE(NES_43272, nes_43272_device, "nes_43272", "NES Cart UNL-43272 PCB")
+DEFINE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device, "nes_tf1201", "NES Cart UNL-TF1201 PCB")
+DEFINE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device, "nes_cityfight", "NES Cart City Fighter PCB")
nes_agci_device::nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_AGCI_50282, "NES Cart AGCI 50282 PCB", tag, owner, clock, "nes_agci50282", __FILE__)
+ : nes_nrom_device(mconfig, NES_AGCI_50282, tag, owner, clock)
{
}
nes_dreamtech_device::nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_DREAMTECH01, "NES Cart Dreamtech01 PCB", tag, owner, clock, "nes_dreamtech", __FILE__)
+ : nes_nrom_device(mconfig, NES_DREAMTECH01, tag, owner, clock)
{
}
nes_fukutake_device::nes_fukutake_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FUKUTAKE, "NES Cart Fukutake Study Box PCB", tag, owner, clock, "nes_fukutake", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_FUKUTAKE, tag, owner, clock), m_latch(0)
+{
}
nes_futuremedia_device::nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_FUTUREMEDIA, "NES Cart FutureMedia PCB", tag, owner, clock, "nes_futuremedia", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
- {
+ : nes_nrom_device(mconfig, NES_FUTUREMEDIA, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
+{
}
nes_magseries_device::nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_MAGSERIES, "NES Cart Magical Series PCB", tag, owner, clock, "nes_magseries", __FILE__)
+ : nes_nrom_device(mconfig, NES_MAGSERIES, tag, owner, clock)
{
}
nes_daou306_device::nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_DAOU306, "NES Cart Daou 306 PCB", tag, owner, clock, "nes_daou306", __FILE__)
+ : nes_nrom_device(mconfig, NES_DAOU306, tag, owner, clock)
{
}
nes_cc21_device::nes_cc21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CC21, "NES Cart CC-21 PCB", tag, owner, clock, "nes_cc21", __FILE__)
+ : nes_nrom_device(mconfig, NES_CC21, tag, owner, clock)
{
}
nes_xiaozy_device::nes_xiaozy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_XIAOZY, "NES Cart Xiao Zhuan Yuan PCB", tag, owner, clock, "nes_xiaozy", __FILE__)
+ : nes_nrom_device(mconfig, NES_XIAOZY, tag, owner, clock)
{
}
nes_edu2k_device::nes_edu2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_EDU2K, "NES Cart Educational Computer 2000 PCB", tag, owner, clock, "nes_edu2k", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_EDU2K, tag, owner, clock)
+{
}
nes_t230_device::nes_t230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_T230, "NES Cart T-230 PCB", tag, owner, clock, "nes_t230", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), m_irq_enable_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_T230, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_enable(0), m_irq_enable_latch(0)
+{
}
nes_mk2_device::nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_MK2, "NES Cart Mortal Kombat 2 PCB", tag, owner, clock, "nes_mk2", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
- {
+ : nes_nrom_device(mconfig, NES_MK2, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_clear(0), m_irq_enable(0)
+{
}
nes_whero_device::nes_whero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WHERO, "NES Cart World Heroes PCB", tag, owner, clock, "nes_whero", __FILE__), m_reg(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_WHERO, tag, owner, clock), m_reg(0), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0)
+{
}
nes_43272_device::nes_43272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_43272, "NES Cart UNL-43272 PCB", tag, owner, clock, "nes_43272", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_43272, tag, owner, clock), m_latch(0)
+{
}
nes_tf1201_device::nes_tf1201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TF1201, "NES Cart UNL-TF1201 PCB", tag, owner, clock, "nes_tf1201", __FILE__), m_prg(0), m_swap(0), m_irq_count(0), m_irq_enable(0), m_irq_enable_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_TF1201, tag, owner, clock), m_prg(0), m_swap(0), m_irq_count(0), m_irq_enable(0), m_irq_enable_latch(0)
+{
}
nes_cityfight_device::nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_CITYFIGHT, "NES Cart City Fighter PCB", tag, owner, clock, "nes_cityfight", __FILE__), m_prg_reg(0), m_prg_mode(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_CITYFIGHT, tag, owner, clock), m_prg_reg(0), m_prg_mode(0), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr)
+{
}
@@ -530,7 +530,7 @@ READ8_MEMBER(nes_fukutake_device::read_m)
void nes_futuremedia_device::hblank_irq(int scanline, int vblank, int blanked)
{
- // if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ // if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
if (m_irq_enable && m_irq_count)
{
@@ -853,7 +853,7 @@ WRITE8_MEMBER(nes_t230_device::write_h)
// Same IRQ as MMC3
void nes_mk2_device::hblank_irq( int scanline, int vblank, int blanked )
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
int prior_count = m_irq_count;
if ((m_irq_count == 0) || m_irq_clear)
diff --git a/src/devices/bus/nes/pirate.h b/src/devices/bus/nes/pirate.h
index b17ce1ada9d..91424d32e25 100644
--- a/src/devices/bus/nes/pirate.h
+++ b/src/devices/bus/nes/pirate.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_PIR_H
-#define __NES_PIR_H
+#ifndef MAME_BUS_NES_PIRATE_H
+#define MAME_BUS_NES_PIRATE_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_agci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,11 +34,13 @@ public:
// construction/destruction
nes_dreamtech_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -46,8 +52,6 @@ public:
// construction/destruction
nes_fukutake_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
@@ -55,6 +59,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
uint8_t m_ram[0xb00];
@@ -69,13 +77,15 @@ public:
// construction/destruction
nes_futuremedia_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count, m_irq_count_latch;
uint8_t m_irq_clear;
@@ -91,11 +101,13 @@ public:
// construction/destruction
nes_magseries_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -107,12 +119,14 @@ public:
// construction/destruction
nes_daou306_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[16];
};
@@ -126,11 +140,13 @@ public:
// construction/destruction
nes_cc21_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -142,11 +158,13 @@ public:
// construction/destruction
nes_xiaozy_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -158,14 +176,16 @@ public:
// construction/destruction
nes_edu2k_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -179,13 +199,15 @@ public:
// construction/destruction
nes_t230_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count, m_irq_count_latch;
uint8_t m_irq_mode;
@@ -203,13 +225,15 @@ public:
// construction/destruction
nes_mk2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count, m_irq_count_latch;
uint8_t m_irq_clear;
@@ -225,13 +249,15 @@ public:
// construction/destruction
nes_whero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg;
uint8_t m_mmc_vrom_bank[8];
@@ -250,13 +276,15 @@ public:
// construction/destruction
nes_43272_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_latch;
};
@@ -270,13 +298,15 @@ public:
// construction/destruction
nes_tf1201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_prg();
uint8_t m_prg, m_swap;
@@ -295,20 +325,24 @@ public:
// construction/destruction
nes_cityfight_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
+ static constexpr device_timer_id TIMER_IRQ = 0;
+
void update_prg();
+
uint8_t m_prg_reg, m_prg_mode;
uint16_t m_irq_count;
int m_irq_enable;
- static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
uint8_t m_mmc_vrom_bank[8];
@@ -325,13 +359,15 @@ public:
// construction/destruction
nes_fujiya_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -339,23 +375,21 @@ private:
// device type definition
-extern const device_type NES_AGCI_50282;
-extern const device_type NES_DREAMTECH01;
-extern const device_type NES_FUKUTAKE;
-extern const device_type NES_FUTUREMEDIA;
-extern const device_type NES_MAGSERIES;
-extern const device_type NES_DAOU306;
-extern const device_type NES_SUBOR0;
-extern const device_type NES_SUBOR1;
-extern const device_type NES_CC21;
-extern const device_type NES_XIAOZY;
-extern const device_type NES_EDU2K;
-extern const device_type NES_T230;
-extern const device_type NES_MK2;
-extern const device_type NES_WHERO;
-extern const device_type NES_43272;
-extern const device_type NES_TF1201;
-extern const device_type NES_CITYFIGHT;
-extern const device_type NES_FUJIYA;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_AGCI_50282, nes_agci_device)
+DECLARE_DEVICE_TYPE(NES_DREAMTECH01, nes_dreamtech_device)
+DECLARE_DEVICE_TYPE(NES_FUKUTAKE, nes_fukutake_device)
+DECLARE_DEVICE_TYPE(NES_FUTUREMEDIA, nes_futuremedia_device)
+DECLARE_DEVICE_TYPE(NES_MAGSERIES, nes_magseries_device)
+DECLARE_DEVICE_TYPE(NES_DAOU306, nes_daou306_device)
+DECLARE_DEVICE_TYPE(NES_CC21, nes_cc21_device)
+DECLARE_DEVICE_TYPE(NES_XIAOZY, nes_xiaozy_device)
+DECLARE_DEVICE_TYPE(NES_EDU2K, nes_edu2k_device)
+DECLARE_DEVICE_TYPE(NES_T230, nes_t230_device)
+DECLARE_DEVICE_TYPE(NES_MK2, nes_mk2_device)
+DECLARE_DEVICE_TYPE(NES_WHERO, nes_whero_device)
+DECLARE_DEVICE_TYPE(NES_43272, nes_43272_device)
+DECLARE_DEVICE_TYPE(NES_TF1201, nes_tf1201_device)
+DECLARE_DEVICE_TYPE(NES_CITYFIGHT, nes_cityfight_device)
+//DECLARE_DEVICE_TYPE(NES_FUJIYA, nes_fujiya_device)
+
+#endif // MAME_BUS_NES_PIRATE_H
diff --git a/src/devices/bus/nes/pt554.cpp b/src/devices/bus/nes/pt554.cpp
index a12d3e63145..86a510866f4 100644
--- a/src/devices/bus/nes/pt554.cpp
+++ b/src/devices/bus/nes/pt554.cpp
@@ -32,12 +32,12 @@
// constructor
//-------------------------------------------------
-const device_type NES_BANDAI_PT554 = device_creator<nes_bandai_pt554_device>;
+DEFINE_DEVICE_TYPE(NES_BANDAI_PT554, nes_bandai_pt554_device, "nes_bandai_pt554", "NES Cart Bandai BT-554 PCB")
nes_bandai_pt554_device::nes_bandai_pt554_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_cnrom_device(mconfig, NES_BANDAI_PT554, "NES Cart Bandai PT-554 PCB", tag, owner, clock, "nes_bandai_pt554", __FILE__),
- m_samples(*this, "samples")
+ : nes_cnrom_device(mconfig, NES_BANDAI_PT554, tag, owner, clock)
+ , m_samples(*this, "samples")
{
}
diff --git a/src/devices/bus/nes/pt554.h b/src/devices/bus/nes/pt554.h
index 2dc1fe6f6f0..95947c26ef7 100644
--- a/src/devices/bus/nes/pt554.h
+++ b/src/devices/bus/nes/pt554.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_PT554_H
-#define __NES_PT554_H
+#ifndef MAME_BUS_NES_PT554_H
+#define MAME_BUS_NES_PT554_H
+
+#pragma once
#include "nxrom.h"
@@ -23,9 +25,7 @@ private:
};
-
-
// device type definition
-extern const device_type NES_BANDAI_PT554;
+DECLARE_DEVICE_TYPE(NES_BANDAI_PT554, nes_bandai_pt554_device)
-#endif
+#endif // MAME_BUS_NES_PT554_H
diff --git a/src/devices/bus/nes/racermate.cpp b/src/devices/bus/nes/racermate.cpp
index 680433e4ed4..5b578da0e09 100644
--- a/src/devices/bus/nes/racermate.cpp
+++ b/src/devices/bus/nes/racermate.cpp
@@ -32,13 +32,13 @@
// constructor
//-------------------------------------------------
-const device_type NES_RACERMATE = device_creator<nes_racermate_device>;
+DEFINE_DEVICE_TYPE(NES_RACERMATE, nes_racermate_device, "nes_racermate", "NES Cart Racermate PCB")
nes_racermate_device::nes_racermate_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_RACERMATE, "NES Cart Racermate PCB", tag, owner, clock, "nes_racermate", __FILE__),
- m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_RACERMATE, tag, owner, clock)
+ , m_latch(0)
+{
}
diff --git a/src/devices/bus/nes/racermate.h b/src/devices/bus/nes/racermate.h
index da7a5f5174b..5366ec1a6ea 100644
--- a/src/devices/bus/nes/racermate.h
+++ b/src/devices/bus/nes/racermate.h
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_RACERMATE_H
-#define __NES_RACERMATE_H
+#ifndef MAME_BUS_NES_RACERMATE_H
+#define MAME_BUS_NES_RACERMATE_H
#include "nxrom.h"
@@ -26,10 +26,7 @@ private:
};
-
-
-
// device type definition
-extern const device_type NES_RACERMATE;
+DECLARE_DEVICE_TYPE(NES_RACERMATE, nes_racermate_device)
-#endif
+#endif // MAME_BUS_NES_RACERMATE_H
diff --git a/src/devices/bus/nes/rcm.cpp b/src/devices/bus/nes/rcm.cpp
index aedda67cc46..f1800712765 100644
--- a/src/devices/bus/nes/rcm.cpp
+++ b/src/devices/bus/nes/rcm.cpp
@@ -39,36 +39,36 @@
// constructor
//-------------------------------------------------
-const device_type NES_GS2015 = device_creator<nes_gs2015_device>;
-const device_type NES_GS2004 = device_creator<nes_gs2004_device>;
-const device_type NES_GS2013 = device_creator<nes_gs2013_device>;
-const device_type NES_TF9IN1 = device_creator<nes_tf9_device>;
-const device_type NES_3DBLOCK = device_creator<nes_3dblock_device>;
+DEFINE_DEVICE_TYPE(NES_GS2015, nes_gs2015_device, "nes_g2015", "NES Cart RCM GS-2015 PCB")
+DEFINE_DEVICE_TYPE(NES_GS2004, nes_gs2004_device, "nes_g2004", "NES Cart RCM GS-2004 PCB")
+DEFINE_DEVICE_TYPE(NES_GS2013, nes_gs2013_device, "nes_g2013", "NES Cart RCM GS-2013 PCB")
+DEFINE_DEVICE_TYPE(NES_TF9IN1, nes_tf9_device, "nes_tetrisfam", "NES Cart RCM Tetris Family 9 in 1 PCB")
+DEFINE_DEVICE_TYPE(NES_3DBLOCK, nes_3dblock_device, "nes_3dblock", "NES Cart RCM 3D Block PCB")
nes_gs2015_device::nes_gs2015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GS2015, "NES Cart RCM GS-2015 PCB", tag, owner, clock, "nes_gs2015", __FILE__)
+ : nes_nrom_device(mconfig, NES_GS2015, tag, owner, clock)
{
}
nes_gs2004_device::nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GS2004, "NES Cart RCM GS-2004 PCB", tag, owner, clock, "nes_gs2004", __FILE__)
+ : nes_nrom_device(mconfig, NES_GS2004, tag, owner, clock)
{
}
nes_gs2013_device::nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_GS2013, "NES Cart RCM GS-2013 PCB", tag, owner, clock, "nes_gs2013", __FILE__)
+ : nes_nrom_device(mconfig, NES_GS2013, tag, owner, clock)
{
}
nes_tf9_device::nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TF9IN1, "NES Cart RCM Tetris Family 9 in 1 PCB", tag, owner, clock, "nes_tetrisfam", __FILE__)
+ : nes_nrom_device(mconfig, NES_TF9IN1, tag, owner, clock)
{
}
nes_3dblock_device::nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_3DBLOCK, "NES Cart RCM 3D Block PCB", tag, owner, clock, "nes_3dblock", __FILE__), m_irq_count(0)
- {
+ : nes_nrom_device(mconfig, NES_3DBLOCK, tag, owner, clock), m_irq_count(0)
+{
}
diff --git a/src/devices/bus/nes/rcm.h b/src/devices/bus/nes/rcm.h
index d7858cbdb53..f37a6074432 100644
--- a/src/devices/bus/nes/rcm.h
+++ b/src/devices/bus/nes/rcm.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_RCM_H
-#define __NES_RCM_H
+#ifndef MAME_BUS_NES_RCM_H
+#define MAME_BUS_NES_RCM_H
+
+#pragma once
#include "nxrom.h"
@@ -14,13 +16,15 @@ public:
// construction/destruction
nes_gs2015_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override { return read_m(space, offset, mem_mask); }
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -32,11 +36,13 @@ public:
// construction/destruction
nes_gs2004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -48,11 +54,13 @@ public:
// construction/destruction
nes_gs2013_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -64,11 +72,13 @@ public:
// construction/destruction
nes_tf9_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -80,26 +90,26 @@ public:
// construction/destruction
nes_3dblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
uint8_t m_irq_count;
};
-
-
// device type definition
-extern const device_type NES_GS2015;
-extern const device_type NES_GS2004;
-extern const device_type NES_GS2013;
-extern const device_type NES_TF9IN1;
-extern const device_type NES_3DBLOCK;
+DECLARE_DEVICE_TYPE(NES_GS2015, nes_gs2015_device)
+DECLARE_DEVICE_TYPE(NES_GS2004, nes_gs2004_device)
+DECLARE_DEVICE_TYPE(NES_GS2013, nes_gs2013_device)
+DECLARE_DEVICE_TYPE(NES_TF9IN1, nes_tf9_device)
+DECLARE_DEVICE_TYPE(NES_3DBLOCK, nes_3dblock_device)
-#endif
+#endif // MAME_BUS_NES_RCM_H
diff --git a/src/devices/bus/nes/rexsoft.cpp b/src/devices/bus/nes/rexsoft.cpp
index 9aaaed7721b..300bd07f96e 100644
--- a/src/devices/bus/nes/rexsoft.cpp
+++ b/src/devices/bus/nes/rexsoft.cpp
@@ -35,19 +35,19 @@
// constructor
//-------------------------------------------------
-const device_type NES_REX_DBZ5 = device_creator<nes_rex_dbz5_device>;
-const device_type NES_REX_SL1632 = device_creator<nes_rex_sl1632_device>;
+DEFINE_DEVICE_TYPE(NES_REX_DBZ5, nes_rex_dbz5_device, "nes_rex_dbz5", "NES Cart Rex Soft DragonBall Z V PCB")
+DEFINE_DEVICE_TYPE(NES_REX_SL1632, nes_rex_sl1632_device, "nes_rex_sl1632", "NES Cart Rex Soft SL-1632 PCB")
nes_rex_dbz5_device::nes_rex_dbz5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_REX_DBZ5, "NES Cart Rex Soft DragonBall Z V PCB", tag, owner, clock, "nes_rex_dbz5", __FILE__),
- m_extra(0)
- {
+ : nes_txrom_device(mconfig, NES_REX_DBZ5, tag, owner, clock)
+ , m_extra(0)
+{
}
nes_rex_sl1632_device::nes_rex_sl1632_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_REX_SL1632, "NES Cart Rex Soft SL-1632 PCB", tag, owner, clock, "nes_rex_sl1632", __FILE__), m_mode(0), m_mirror(0)
- {
+ : nes_txrom_device(mconfig, NES_REX_SL1632, tag, owner, clock), m_mode(0), m_mirror(0)
+{
}
diff --git a/src/devices/bus/nes/rexsoft.h b/src/devices/bus/nes/rexsoft.h
index 996b22baf13..61fe876633a 100644
--- a/src/devices/bus/nes/rexsoft.h
+++ b/src/devices/bus/nes/rexsoft.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_REXSOFT_H
-#define __NES_REXSOFT_H
+#ifndef MAME_BUS_NES_REXSOFT_H
+#define MAME_BUS_NES_REXSOFT_H
+
+#pragma once
#include "mmc3.h"
@@ -14,8 +16,6 @@ public:
// construction/destruction
nes_rex_dbz5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_READ8_MEMBER(read_m) override { return read_l(space, offset, mem_mask); }
virtual DECLARE_WRITE8_MEMBER(write_l) override;
@@ -23,6 +23,10 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_extra;
};
@@ -36,13 +40,14 @@ public:
// construction/destruction
nes_rex_sl1632_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
virtual void set_prg(int prg_base, int prg_mask) override;
virtual void set_chr(uint8_t chr, int chr_base, int chr_mask) override;
@@ -52,10 +57,8 @@ protected:
-
-
// device type definition
-extern const device_type NES_REX_DBZ5;
-extern const device_type NES_REX_SL1632;
+DECLARE_DEVICE_TYPE(NES_REX_DBZ5, nes_rex_dbz5_device)
+DECLARE_DEVICE_TYPE(NES_REX_SL1632, nes_rex_sl1632_device)
-#endif
+#endif // MAME_BUS_NES_REXSOFT_H
diff --git a/src/devices/bus/nes/sachen.cpp b/src/devices/bus/nes/sachen.cpp
index 317f2e7e78c..369c4cde885 100644
--- a/src/devices/bus/nes/sachen.cpp
+++ b/src/devices/bus/nes/sachen.cpp
@@ -44,99 +44,99 @@
// constructor
//-------------------------------------------------
-const device_type NES_SACHEN_SA009 = device_creator<nes_sachen_sa009_device>;
-const device_type NES_SACHEN_SA0036 = device_creator<nes_sachen_sa0036_device>;
-const device_type NES_SACHEN_SA0037 = device_creator<nes_sachen_sa0037_device>;
-const device_type NES_SACHEN_SA72007 = device_creator<nes_sachen_sa72007_device>;
-const device_type NES_SACHEN_SA72008 = device_creator<nes_sachen_sa72008_device>;
-const device_type NES_SACHEN_TCA01 = device_creator<nes_sachen_tca01_device>;
-const device_type NES_SACHEN_TCU01 = device_creator<nes_sachen_tcu01_device>;
-const device_type NES_SACHEN_TCU02 = device_creator<nes_sachen_tcu02_device>;
-const device_type NES_SACHEN_74X374 = device_creator<nes_sachen_74x374_device>;
-const device_type NES_SACHEN_74X374_ALT = device_creator<nes_sachen_74x374_alt_device>;
-const device_type NES_SACHEN_8259A = device_creator<nes_sachen_8259a_device>;
-const device_type NES_SACHEN_8259B = device_creator<nes_sachen_8259b_device>;
-const device_type NES_SACHEN_8259C = device_creator<nes_sachen_8259c_device>;
-const device_type NES_SACHEN_8259D = device_creator<nes_sachen_8259d_device>;
+DEFINE_DEVICE_TYPE(NES_SACHEN_SA009, nes_sachen_sa009_device, "nes_sa009", "NES Cart Sachen SA009 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_SA0036, nes_sachen_sa0036_device, "nes_sa0036", "NES Cart Sachen SA0036 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_SA0037, nes_sachen_sa0037_device, "nes_sa0037", "NES Cart Sachen SA0037 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_SA72007, nes_sachen_sa72007_device, "nes_sa72007", "NES Cart Sachen SA72007 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_SA72008, nes_sachen_sa72008_device, "nes_sa72008", "NES Cart Sachen SA72008 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_TCA01, nes_sachen_tca01_device, "nes_tca01", "NES Cart Sachen TCA-01 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_TCU01, nes_sachen_tcu01_device, "nes_tcu01", "NES Cart Sachen TCU-01 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_TCU02, nes_sachen_tcu02_device, "nes_tcu02", "NES Cart Sachen TCU-02 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_74X374, nes_sachen_74x374_device, "nes_s74x374", "NES Cart Sachen 74*374 PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_74X374_ALT, nes_sachen_74x374_alt_device, "nes_s74x374a", "NES Cart Sachen 74*374 Alt PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_8259A, nes_sachen_8259a_device, "nes_s8259a", "NES Cart Sachen 8259A PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_8259B, nes_sachen_8259b_device, "nes_s8259b", "NES Cart Sachen 8259B PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_8259C, nes_sachen_8259c_device, "nes_s8259c", "NES Cart Sachen 8259C PCB")
+DEFINE_DEVICE_TYPE(NES_SACHEN_8259D, nes_sachen_8259d_device, "nes_s8259d", "NES Cart Sachen 8259D PCB")
nes_sachen_sa009_device::nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_SA009, "NES Cart Sachen SA009 PCB", tag, owner, clock, "nes_sa009", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_SA009, tag, owner, clock)
{
}
nes_sachen_sa0036_device::nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_SA0036, "NES Cart Sachen sa0036 PCB", tag, owner, clock, "nes_sa0036", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_SA0036, tag, owner, clock)
{
}
nes_sachen_sa0037_device::nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_SA0037, "NES Cart Sachen sa0037 PCB", tag, owner, clock, "nes_sa0037", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_SA0037, tag, owner, clock)
{
}
nes_sachen_sa72007_device::nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_SA72007, "NES Cart Sachen SA72007 PCB", tag, owner, clock, "nes_sa72007", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_SA72007, tag, owner, clock)
{
}
nes_sachen_sa72008_device::nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_SA72008, "NES Cart Sachen SA72008 PCB", tag, owner, clock, "nes_sa72008", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_SA72008, tag, owner, clock)
{
}
nes_sachen_tca01_device::nes_sachen_tca01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_TCA01, "NES Cart Sachen TCA-01 PCB", tag, owner, clock, "nes_tca01", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_TCA01, tag, owner, clock)
{
}
nes_sachen_tcu01_device::nes_sachen_tcu01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_TCU01, "NES Cart Sachen TCU-01 PCB", tag, owner, clock, "nes_tcu01", __FILE__)
+ : nes_nrom_device(mconfig, NES_SACHEN_TCU01, tag, owner, clock)
{
}
nes_sachen_tcu02_device::nes_sachen_tcu02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_TCU02, "NES Cart Sachen TCU-02 PCB", tag, owner, clock, "nes_tcu02", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_SACHEN_TCU02, tag, owner, clock), m_latch(0)
+{
}
-nes_sachen_74x374_device::nes_sachen_74x374_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_latch(0), m_mmc_vrom_bank(0)
- {
+nes_sachen_74x374_device::nes_sachen_74x374_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_latch(0), m_mmc_vrom_bank(0)
+{
}
nes_sachen_74x374_device::nes_sachen_74x374_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SACHEN_74X374, "NES Cart Sachen 74*374 PCB", tag, owner, clock, "nes_s74x34", __FILE__), m_latch(0), m_mmc_vrom_bank(0)
- {
+ : nes_sachen_74x374_device(mconfig, NES_SACHEN_74X374, tag, owner, clock)
+{
}
nes_sachen_74x374_alt_device::nes_sachen_74x374_alt_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sachen_74x374_device(mconfig, NES_SACHEN_74X374_ALT, "NES Cart Sachen 74*374 Alt PCB", tag, owner, clock, "nes_s74x34a", __FILE__)
+ : nes_sachen_74x374_device(mconfig, NES_SACHEN_74X374_ALT, tag, owner, clock)
{
}
-nes_sachen_8259a_device::nes_sachen_8259a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_sachen_74x374_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_sachen_8259a_device::nes_sachen_8259a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_sachen_74x374_device(mconfig, type, tag, owner, clock)
{
}
nes_sachen_8259a_device::nes_sachen_8259a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sachen_74x374_device(mconfig, NES_SACHEN_8259A, "NES Cart Sachen 8259A PCB", tag, owner, clock, "nes_s8259a", __FILE__)
+ : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259A, tag, owner, clock)
{
}
nes_sachen_8259b_device::nes_sachen_8259b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259B, "NES Cart Sachen 8259B PCB", tag, owner, clock, "nes_s8259b", __FILE__)
+ : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259B, tag, owner, clock)
{
}
nes_sachen_8259c_device::nes_sachen_8259c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259C, "NES Cart Sachen 8259C PCB", tag, owner, clock, "nes_s8259c", __FILE__)
+ : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259C, tag, owner, clock)
{
}
nes_sachen_8259d_device::nes_sachen_8259d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259D, "NES Cart Sachen 8259D PCB", tag, owner, clock, "nes_s8259d", __FILE__)
+ : nes_sachen_8259a_device(mconfig, NES_SACHEN_8259D, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/sachen.h b/src/devices/bus/nes/sachen.h
index 2c309a55a06..cfec9363bdc 100644
--- a/src/devices/bus/nes/sachen.h
+++ b/src/devices/bus/nes/sachen.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_SACHEN_H
-#define __NES_SACHEN_H
+#ifndef MAME_BUS_NES_SACHEN_H
+#define MAME_BUS_NES_SACHEN_H
+
+#pragma once
#include "nxrom.h"
@@ -14,11 +16,13 @@ public:
// construction/destruction
nes_sachen_sa009_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -30,11 +34,13 @@ public:
// construction/destruction
nes_sachen_sa0036_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -46,11 +52,13 @@ public:
// construction/destruction
nes_sachen_sa0037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -62,11 +70,13 @@ public:
// construction/destruction
nes_sachen_sa72007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -78,11 +88,13 @@ public:
// construction/destruction
nes_sachen_sa72008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -94,11 +106,13 @@ public:
// construction/destruction
nes_sachen_tca01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -110,13 +124,15 @@ public:
// construction/destruction
nes_sachen_tcu01_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override { write_l(space, (offset + 0x100) & 0xfff, data, mem_mask); }
virtual DECLARE_WRITE8_MEMBER(write_h) override { write_l(space, (offset + 0x100) & 0xfff, data, mem_mask); }
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -128,13 +144,15 @@ public:
// construction/destruction
nes_sachen_tcu02_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
};
@@ -146,17 +164,19 @@ class nes_sachen_74x374_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_sachen_74x374_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_sachen_74x374_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
protected:
+ nes_sachen_74x374_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
void set_mirror(uint8_t nt);
uint8_t m_latch, m_mmc_vrom_bank;
};
@@ -182,17 +202,19 @@ class nes_sachen_8259a_device : public nes_sachen_74x374_device
{
public:
// construction/destruction
- nes_sachen_8259a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_sachen_8259a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override { write_l(space, (offset + 0x100) & 0xfff, data, mem_mask); }
virtual void pcb_reset() override;
protected:
+ nes_sachen_8259a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
virtual void chr_update();
uint8_t m_reg[8];
};
@@ -239,23 +261,20 @@ protected:
};
-
-
-
// device type definition
-extern const device_type NES_SACHEN_SA009;
-extern const device_type NES_SACHEN_SA0036;
-extern const device_type NES_SACHEN_SA0037;
-extern const device_type NES_SACHEN_SA72007;
-extern const device_type NES_SACHEN_SA72008;
-extern const device_type NES_SACHEN_TCA01;
-extern const device_type NES_SACHEN_TCU01;
-extern const device_type NES_SACHEN_TCU02;
-extern const device_type NES_SACHEN_74X374;
-extern const device_type NES_SACHEN_74X374_ALT;
-extern const device_type NES_SACHEN_8259A;
-extern const device_type NES_SACHEN_8259B;
-extern const device_type NES_SACHEN_8259C;
-extern const device_type NES_SACHEN_8259D;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_SACHEN_SA009, nes_sachen_sa009_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_SA0036, nes_sachen_sa0036_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_SA0037, nes_sachen_sa0037_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_SA72007, nes_sachen_sa72007_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_SA72008, nes_sachen_sa72008_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_TCA01, nes_sachen_tca01_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_TCU01, nes_sachen_tcu01_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_TCU02, nes_sachen_tcu02_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_74X374, nes_sachen_74x374_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_74X374_ALT, nes_sachen_74x374_alt_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_8259A, nes_sachen_8259a_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_8259B, nes_sachen_8259b_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_8259C, nes_sachen_8259c_device)
+DECLARE_DEVICE_TYPE(NES_SACHEN_8259D, nes_sachen_8259d_device)
+
+#endif // MAME_BUS_NES_SACHEN_H
diff --git a/src/devices/bus/nes/somari.cpp b/src/devices/bus/nes/somari.cpp
index b1f172567fe..b738ad671e8 100644
--- a/src/devices/bus/nes/somari.cpp
+++ b/src/devices/bus/nes/somari.cpp
@@ -36,17 +36,17 @@
// constructor
//-------------------------------------------------
-const device_type NES_SOMARI = device_creator<nes_somari_device>;
+DEFINE_DEVICE_TYPE(NES_SOMARI, nes_somari_device, "nes_somari", "NES Cart Team Somari PCB")
nes_somari_device::nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_SOMARI, "NES Cart Team Somari PCB", tag, owner, clock, "nes_somari", __FILE__),
- m_board_mode(0),
- m_mmc3_mirror_reg(0),
- m_count(0),
- m_mmc1_latch(0),
- m_vrc_mirror_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_SOMARI, tag, owner, clock)
+ , m_board_mode(0)
+ , m_mmc3_mirror_reg(0)
+ , m_count(0)
+ , m_mmc1_latch(0)
+ , m_vrc_mirror_reg(0)
+{
}
diff --git a/src/devices/bus/nes/somari.h b/src/devices/bus/nes/somari.h
index 6ccb8b73867..7b5d2920923 100644
--- a/src/devices/bus/nes/somari.h
+++ b/src/devices/bus/nes/somari.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_SOMARI_H
-#define __NES_SOMARI_H
+#ifndef MAME_BUS_NES_SOMARI_H
+#define MAME_BUS_NES_SOMARI_H
+
+#pragma once
#include "mmc3.h"
@@ -14,8 +16,6 @@ public:
// construction/destruction
nes_somari_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override { write_m(space, offset + 0x100, data, mem_mask); }
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(mmc1_w);
@@ -24,6 +24,11 @@ public:
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_prg();
void update_chr();
@@ -47,8 +52,7 @@ private:
};
-
// device type definition
-extern const device_type NES_SOMARI;
+DECLARE_DEVICE_TYPE(NES_SOMARI, nes_somari_device)
-#endif
+#endif // MAME_BUS_NES_SOMARI_H
diff --git a/src/devices/bus/nes/subor.cpp b/src/devices/bus/nes/subor.cpp
index 7d32104456a..c15e8761112 100644
--- a/src/devices/bus/nes/subor.cpp
+++ b/src/devices/bus/nes/subor.cpp
@@ -28,9 +28,9 @@
// DEVICE DEFINITIONS
//**************************************************************************
-const device_type NES_SUBOR0 = device_creator<nes_subor0_device>;
-const device_type NES_SUBOR1 = device_creator<nes_subor1_device>;
-const device_type NES_SUBOR2 = device_creator<nes_subor2_device>;
+DEFINE_DEVICE_TYPE(NES_SUBOR0, nes_subor0_device, "nes_subor0", "NES Cart Subor Type 0 PCB")
+DEFINE_DEVICE_TYPE(NES_SUBOR1, nes_subor1_device, "nes_subor1", "NES Cart Subor Type 1 PCB")
+DEFINE_DEVICE_TYPE(NES_SUBOR2, nes_subor2_device, "nes_subor2", "NES Cart Subor Type 2 PCB")
//**************************************************************************
// LIVE DEVICE
@@ -41,7 +41,7 @@ const device_type NES_SUBOR2 = device_creator<nes_subor2_device>;
//-------------------------------------------------
nes_subor0_device::nes_subor0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUBOR0, "NES Cart Subor Type 0 PCB", tag, owner, clock, "nes_subor0", __FILE__)
+ : nes_nrom_device(mconfig, NES_SUBOR0, tag, owner, clock)
{
}
@@ -50,7 +50,7 @@ nes_subor0_device::nes_subor0_device(const machine_config &mconfig, const char *
//-------------------------------------------------
nes_subor1_device::nes_subor1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUBOR1, "NES Cart Subor Type 1 PCB", tag, owner, clock, "nes_subor1", __FILE__)
+ : nes_nrom_device(mconfig, NES_SUBOR1, tag, owner, clock)
{
}
@@ -59,11 +59,11 @@ nes_subor1_device::nes_subor1_device(const machine_config &mconfig, const char *
//-------------------------------------------------
nes_subor2_device::nes_subor2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUBOR2, "NES Cart Subor Type 2 PCB", tag, owner, clock, "nes_subor2", __FILE__),
- m_switch_reg(0),
- m_bank_reg(0),
- m_chr_banking(0),
- m_page(0)
+ : nes_nrom_device(mconfig, NES_SUBOR2, tag, owner, clock)
+ , m_switch_reg(0)
+ , m_bank_reg(0)
+ , m_chr_banking(0)
+ , m_page(0)
{
}
diff --git a/src/devices/bus/nes/subor.h b/src/devices/bus/nes/subor.h
index 77839add137..93e542cf481 100644
--- a/src/devices/bus/nes/subor.h
+++ b/src/devices/bus/nes/subor.h
@@ -3,6 +3,8 @@
#ifndef MAME_BUS_NES_SUBOR_H
#define MAME_BUS_NES_SUBOR_H
+#pragma once
+
#include "nxrom.h"
//**************************************************************************
@@ -18,12 +20,14 @@ public:
// construction/destruction
nes_subor0_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
};
@@ -37,12 +41,14 @@ public:
// construction/destruction
nes_subor1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_reg[4];
};
@@ -56,8 +62,6 @@ public:
// construction/destruction
nes_subor2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(nt_r) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_READ8_MEMBER(read_l) override;
@@ -65,14 +69,18 @@ public:
virtual void ppu_latch(offs_t offset) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void update_banks();
uint8_t m_switch_reg, m_bank_reg, m_chr_banking, m_page;
};
// device type definition
-extern const device_type NES_SUBOR0;
-extern const device_type NES_SUBOR1;
-extern const device_type NES_SUBOR2;
+DECLARE_DEVICE_TYPE(NES_SUBOR0, nes_subor0_device)
+DECLARE_DEVICE_TYPE(NES_SUBOR1, nes_subor1_device)
+DECLARE_DEVICE_TYPE(NES_SUBOR2, nes_subor2_device)
-#endif /* MAME_BUS_NES_SUBOR_H */
+#endif // MAME_BUS_NES_SUBOR_H
diff --git a/src/devices/bus/nes/sunsoft.cpp b/src/devices/bus/nes/sunsoft.cpp
index 2394d67dad8..e35604256bd 100644
--- a/src/devices/bus/nes/sunsoft.cpp
+++ b/src/devices/bus/nes/sunsoft.cpp
@@ -42,52 +42,52 @@
// constructor
//-------------------------------------------------
-const device_type NES_SUNSOFT_1 = device_creator<nes_sunsoft_1_device>;
-const device_type NES_SUNSOFT_2 = device_creator<nes_sunsoft_2_device>;
-const device_type NES_SUNSOFT_3 = device_creator<nes_sunsoft_3_device>;
-const device_type NES_SUNSOFT_4 = device_creator<nes_sunsoft_4_device>;
-const device_type NES_SUNSOFT_FME7 = device_creator<nes_sunsoft_fme7_device>;
-const device_type NES_SUNSOFT_5 = device_creator<nes_sunsoft_5_device>;
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_1, nes_sunsoft_1_device, "nes_sun1", "NES Cart Sunsoft 1 PCB")
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_2, nes_sunsoft_2_device, "nes_sun2", "NES Cart Sunsoft 2 PCB")
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_3, nes_sunsoft_3_device, "nes_sun3", "NES Cart Sunsoft 3 PCB")
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_4, nes_sunsoft_4_device, "nes_sun4", "NES Cart Sunsoft 4 PCB")
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_FME7, nes_sunsoft_fme7_device, "nes_fme7", "NES Cart Sunsoft FME7 PCB")
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_5, nes_sunsoft_5_device, "nes_sun5", "NES Cart Sunsoft 5A/5B PCB")
nes_sunsoft_1_device::nes_sunsoft_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUNSOFT_1, "NES Cart Sunsoft 1 PCB", tag, owner, clock, "nes_sun1", __FILE__)
+ : nes_nrom_device(mconfig, NES_SUNSOFT_1, tag, owner, clock)
{
}
nes_sunsoft_2_device::nes_sunsoft_2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUNSOFT_2, "NES Cart Sunsoft 2 PCB", tag, owner, clock, "nes_sun2", __FILE__)
+ : nes_nrom_device(mconfig, NES_SUNSOFT_2, tag, owner, clock)
{
}
nes_sunsoft_3_device::nes_sunsoft_3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUNSOFT_3, "NES Cart Sunsoft 3 PCB", tag, owner, clock, "nes_sun3", __FILE__), m_irq_count(0), m_irq_enable(0), m_irq_toggle(0), irq_timer(nullptr)
- {
+ : nes_nrom_device(mconfig, NES_SUNSOFT_3, tag, owner, clock), m_irq_count(0), m_irq_enable(0), m_irq_toggle(0), irq_timer(nullptr)
+{
}
-nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_reg(0), m_latch1(0), m_latch2(0), m_wram_enable(0)
- {
+nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_reg(0), m_latch1(0), m_latch2(0), m_wram_enable(0)
+{
}
nes_sunsoft_4_device::nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUNSOFT_4, "NES Cart Sunsoft 4 PCB", tag, owner, clock, "nes_sun4", __FILE__), m_reg(0), m_latch1(0), m_latch2(0), m_wram_enable(0)
- {
+ : nes_sunsoft_4_device(mconfig, NES_SUNSOFT_4, tag, owner, clock)
+{
}
-nes_sunsoft_fme7_device::nes_sunsoft_fme7_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_wram_bank(0)
- {
+nes_sunsoft_fme7_device::nes_sunsoft_fme7_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_wram_bank(0)
+{
}
nes_sunsoft_fme7_device::nes_sunsoft_fme7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_SUNSOFT_FME7, "NES Cart Sunsoft FME7 PCB", tag, owner, clock, "nes_fme7", __FILE__), m_irq_count(0), m_irq_enable(0), irq_timer(nullptr), m_latch(0), m_wram_bank(0)
- {
+ : nes_sunsoft_fme7_device(mconfig, NES_SUNSOFT_FME7, tag, owner, clock)
+{
}
nes_sunsoft_5_device::nes_sunsoft_5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sunsoft_fme7_device(mconfig, NES_SUNSOFT_5, "NES Cart Sunsoft 5A/5B PCB", tag, owner, clock, "nes_sun5", __FILE__),
- m_ym2149(*this, "ay")
+ : nes_sunsoft_fme7_device(mconfig, NES_SUNSOFT_5, tag, owner, clock)
+ , m_ym2149(*this, "ay")
{
}
diff --git a/src/devices/bus/nes/sunsoft.h b/src/devices/bus/nes/sunsoft.h
index 9a0d7561b9c..0c4728627e4 100644
--- a/src/devices/bus/nes/sunsoft.h
+++ b/src/devices/bus/nes/sunsoft.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_SUNSOFT_H
-#define __NES_SUNSOFT_H
+#ifndef MAME_BUS_NES_SUNSOFT_H
+#define MAME_BUS_NES_SUNSOFT_H
+
+#pragma once
#include "nxrom.h"
#include "sound/ay8910.h"
@@ -15,11 +17,13 @@ public:
// construction/destruction
nes_sunsoft_1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -31,11 +35,13 @@ public:
// construction/destruction
nes_sunsoft_2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -47,13 +53,14 @@ public:
// construction/destruction
nes_sunsoft_3_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
uint16_t m_irq_count;
int m_irq_enable, m_irq_toggle;
@@ -69,11 +76,8 @@ class nes_sunsoft_4_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_sunsoft_4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(sun4_write);
@@ -82,7 +86,13 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_sunsoft_4_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
void sun4_mirror(int mirror, int mirr0, int mirr1);
+
int m_reg, m_latch1, m_latch2, m_wram_enable;
};
@@ -92,12 +102,8 @@ class nes_sunsoft_fme7_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_sunsoft_fme7_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_sunsoft_fme7_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual DECLARE_WRITE8_MEMBER(fme7_write);
@@ -105,6 +111,13 @@ public:
virtual void pcb_reset() override;
+protected:
+ nes_sunsoft_fme7_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
uint16_t m_irq_count;
int m_irq_enable;
@@ -133,15 +146,12 @@ private:
required_device<ay8910_device> m_ym2149;
};
-
-
-
// device type definition
-extern const device_type NES_SUNSOFT_1;
-extern const device_type NES_SUNSOFT_2;
-extern const device_type NES_SUNSOFT_3;
-extern const device_type NES_SUNSOFT_4;
-extern const device_type NES_SUNSOFT_FME7;
-extern const device_type NES_SUNSOFT_5;
-
-#endif
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_1, nes_sunsoft_1_device)
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_2, nes_sunsoft_2_device)
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_3, nes_sunsoft_3_device)
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_4, nes_sunsoft_4_device)
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_FME7, nes_sunsoft_fme7_device)
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_5, nes_sunsoft_4_device)
+
+#endif // MAME_BUS_NES_SUNSOFT_H
diff --git a/src/devices/bus/nes/sunsoft_dcs.cpp b/src/devices/bus/nes/sunsoft_dcs.cpp
index 829a2e10982..c88bdce67d8 100644
--- a/src/devices/bus/nes/sunsoft_dcs.cpp
+++ b/src/devices/bus/nes/sunsoft_dcs.cpp
@@ -35,8 +35,8 @@
//-------------------------------------------------
ntb_cart_interface::ntb_cart_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device),
- m_rom(nullptr)
+ : device_slot_card_interface(mconfig, device)
+ , m_rom(nullptr)
{
}
@@ -48,12 +48,13 @@ ntb_cart_interface::~ntb_cart_interface()
// sub-cart slot device
//-------------------------------------------------
-const device_type NES_NTB_SLOT = device_creator<nes_ntb_slot_device>;
+DEFINE_DEVICE_TYPE(NES_NTB_SLOT, nes_ntb_slot_device, "nes_ntb_slot", "NES NTB Cartridge Slot")
-nes_ntb_slot_device::nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
- device_t(mconfig, NES_NTB_SLOT, "NES NTB Cartridge Slot", tag, owner, clock, "nes_ntb_slot", __FILE__),
- device_image_interface(mconfig, *this),
- device_slot_interface(mconfig, *this), m_cart(nullptr)
+nes_ntb_slot_device::nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : device_t(mconfig, NES_NTB_SLOT, tag, owner, clock)
+ , device_image_interface(mconfig, *this)
+ , device_slot_interface(mconfig, *this)
+ , m_cart(nullptr)
{
}
@@ -120,11 +121,11 @@ ROM_START( ntb_rom )
ROM_REGION(0x4000, "ntbrom", ROMREGION_ERASEFF)
ROM_END
-const device_type NES_NTB_ROM = device_creator<nes_ntb_rom_device>;
+DEFINE_DEVICE_TYPE(NES_NTB_ROM, nes_ntb_rom_device, "nes_ntbrom", "NES NTB ROM")
nes_ntb_rom_device::nes_ntb_rom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : device_t(mconfig, NES_NTB_ROM, "NES NTB ROM", tag, owner, clock, "nes_ntbrom", __FILE__),
- ntb_cart_interface( mconfig, *this )
+ : device_t(mconfig, NES_NTB_ROM, tag, owner, clock)
+ , ntb_cart_interface(mconfig, *this)
{
}
@@ -153,13 +154,13 @@ uint8_t *nes_ntb_rom_device::get_cart_base()
//
//------------------------------------------------
-const device_type NES_SUNSOFT_DCS = device_creator<nes_sunsoft_dcs_device>;
+DEFINE_DEVICE_TYPE(NES_SUNSOFT_DCS, nes_sunsoft_dcs_device, "nes_dcs", "NES Cart Sunsoft DCS PCB")
nes_sunsoft_dcs_device::nes_sunsoft_dcs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_sunsoft_4_device(mconfig, NES_SUNSOFT_DCS, "NES Cart Sunsoft DCS PCB", tag, owner, clock, "nes_dcs", __FILE__), m_timer_on(0), m_exrom_enable(0),
- m_subslot(*this, "ntb_slot"), ntb_enable_timer(nullptr)
- {
+ : nes_sunsoft_4_device(mconfig, NES_SUNSOFT_DCS, tag, owner, clock), m_timer_on(0), m_exrom_enable(0)
+ , m_subslot(*this, "ntb_slot"), ntb_enable_timer(nullptr)
+{
}
diff --git a/src/devices/bus/nes/sunsoft_dcs.h b/src/devices/bus/nes/sunsoft_dcs.h
index 479f27aa39e..4b564a20f07 100644
--- a/src/devices/bus/nes/sunsoft_dcs.h
+++ b/src/devices/bus/nes/sunsoft_dcs.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_SUNSOFT_DCS_H
-#define __NES_SUNSOFT_DCS_H
+#ifndef MAME_BUS_NES_SUNSOFT_DCS_H
+#define MAME_BUS_NES_SUNSOFT_DCS_H
+
+#pragma once
#include "sunsoft.h"
#include "softlist_dev.h"
@@ -19,7 +21,6 @@ class ntb_cart_interface : public device_slot_card_interface
{
public:
// construction/destruction
- ntb_cart_interface(const machine_config &mconfig, device_t &device);
virtual ~ntb_cart_interface();
// reading and writing
@@ -28,16 +29,21 @@ public:
uint8_t *get_cart_base() { return m_rom; }
protected:
+ ntb_cart_interface(const machine_config &mconfig, device_t &device);
+
// internal state
uint8_t *m_rom;
};
// ======================> nes_ntb_slot_device
+class nes_sunsoft_dcs_device;
+
class nes_ntb_slot_device : public device_t,
public device_image_interface,
public device_slot_interface
{
+ friend class nes_sunsoft_dcs_device;
public:
// construction/destruction
nes_ntb_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
@@ -64,11 +70,12 @@ public:
virtual DECLARE_READ8_MEMBER(read);
+protected:
ntb_cart_interface* m_cart;
};
// device type definition
-extern const device_type NES_NTB_SLOT;
+DECLARE_DEVICE_TYPE(NES_NTB_SLOT, nes_ntb_slot_device)
#define MCFG_NTB_MINICART_ADD(_tag, _slot_intf) \
@@ -101,7 +108,7 @@ protected:
};
// device type definition
-extern const device_type NES_NTB_ROM;
+DECLARE_DEVICE_TYPE(NES_NTB_ROM, nes_ntb_rom_device)
@@ -121,10 +128,7 @@ public:
// construction/destruction
nes_sunsoft_dcs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual machine_config_constructor device_mconfig_additions() const override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_READ8_MEMBER(read_h) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
@@ -132,18 +136,23 @@ public:
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
private:
+ static constexpr device_timer_id TIMER_PROTECT = 0;
+
int m_timer_on, m_exrom_enable;
required_device<nes_ntb_slot_device> m_subslot;
- static const device_timer_id TIMER_PROTECT = 0;
emu_timer *ntb_enable_timer;
attotime timer_freq;
};
-
// device type definition
-extern const device_type NES_SUNSOFT_DCS;
+DECLARE_DEVICE_TYPE(NES_SUNSOFT_DCS, nes_sunsoft_dcs_device)
-#endif
+#endif // MAME_BUS_NES_SUNSOFT_DCS_H
diff --git a/src/devices/bus/nes/taito.cpp b/src/devices/bus/nes/taito.cpp
index b417f6dcc3a..e0b6f836a1c 100644
--- a/src/devices/bus/nes/taito.cpp
+++ b/src/devices/bus/nes/taito.cpp
@@ -25,7 +25,7 @@
#include "taito.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#ifdef NES_PCB_DEBUG
@@ -41,35 +41,35 @@
// constructor
//-------------------------------------------------
-const device_type NES_TC0190FMC = device_creator<nes_tc0190fmc_device>;
-const device_type NES_TC0190FMC_PAL16R4 = device_creator<nes_tc0190fmc_pal16r4_device>;
-const device_type NES_X1_005 = device_creator<nes_x1_005_device>;
-const device_type NES_X1_017 = device_creator<nes_x1_017_device>;
+DEFINE_DEVICE_TYPE(NES_TC0190FMC, nes_tc0190fmc_device, "nes_tc0190fmc", "NES Cart Taito TC0190FMC PCB")
+DEFINE_DEVICE_TYPE(NES_TC0190FMC_PAL16R4, nes_tc0190fmc_pal16r4_device, "nes_tc0190pal", "NES Cart Taito TC0190FMC + PAL16R4 PCB")
+DEFINE_DEVICE_TYPE(NES_X1_005, nes_x1_005_device, "nes_x1_005", "NES Cart Taito X1-005 PCB")
+DEFINE_DEVICE_TYPE(NES_X1_017, nes_x1_017_device, "nes_x1_017", "NES Cart Taito X1-017 PCB")
-nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock)
{
}
nes_tc0190fmc_device::nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TC0190FMC, "NES Cart Taito TC0190FMC PCB", tag, owner, clock, "nes_tc0190fmc", __FILE__)
+ : nes_tc0190fmc_device(mconfig, NES_TC0190FMC, tag, owner, clock)
{
}
nes_tc0190fmc_pal16r4_device::nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_tc0190fmc_device(mconfig, NES_TC0190FMC_PAL16R4, "NES Cart Taito TC0190FMC + PAL16R4 PCB", tag, owner, clock, "nes_tc0190pal", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0)
- {
+ : nes_tc0190fmc_device(mconfig, NES_TC0190FMC_PAL16R4, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0)
+{
}
nes_x1_005_device::nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_X1_005, "NES Cart Taito X1-005 PCB", tag, owner, clock, "nes_x1_005", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_X1_005, tag, owner, clock), m_latch(0)
+{
}
nes_x1_017_device::nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_X1_017, "NES Cart Taito X1-017 PCB", tag, owner, clock, "nes_x1_017", __FILE__), m_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_X1_017, tag, owner, clock), m_latch(0)
+{
}
@@ -228,7 +228,7 @@ WRITE8_MEMBER(nes_tc0190fmc_device::tc0190fmc_write)
void nes_tc0190fmc_pal16r4_device::hblank_irq( int scanline, int vblank, int blanked )
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
int prior_count = m_irq_count;
if (m_irq_count == 0)
diff --git a/src/devices/bus/nes/taito.h b/src/devices/bus/nes/taito.h
index 8d33ecd4c5e..8f3ccb2a8ee 100644
--- a/src/devices/bus/nes/taito.h
+++ b/src/devices/bus/nes/taito.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_TAITO_H
-#define __NES_TAITO_H
+#ifndef MAME_BUS_NES_TAITO_H
+#define MAME_BUS_NES_TAITO_H
+
+#pragma once
#include "nxrom.h"
@@ -12,15 +14,18 @@ class nes_tc0190fmc_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_tc0190fmc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(tc0190fmc_write);
virtual DECLARE_WRITE8_MEMBER(write_h) override { tc0190fmc_write(space, offset, data, mem_mask); }
virtual void pcb_reset() override;
+
+protected:
+ nes_tc0190fmc_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -32,13 +37,15 @@ public:
// construction/destruction
nes_tc0190fmc_pal16r4_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint16_t m_irq_count, m_irq_count_latch;
int m_irq_enable;
@@ -53,13 +60,15 @@ public:
// construction/destruction
nes_x1_005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
uint8_t m_latch;
// Taito X1-005 chip contains 80 bytes of internal ram, possibly battery backed up
@@ -75,13 +84,15 @@ public:
// construction/destruction
nes_x1_017_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_m) override;
virtual DECLARE_WRITE8_MEMBER(write_m) override;
virtual void pcb_reset() override;
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+
private:
void set_chr();
uint8_t m_latch;
@@ -92,13 +103,11 @@ private:
};
-
-
// device type definition
-extern const device_type NES_TC0190FMC;
-extern const device_type NES_TC0190FMC_PAL16R4;
-extern const device_type NES_X1_005;
-extern const device_type NES_X1_017;
+DECLARE_DEVICE_TYPE(NES_TC0190FMC, nes_tc0190fmc_device)
+DECLARE_DEVICE_TYPE(NES_TC0190FMC_PAL16R4, nes_tc0190fmc_pal16r4_device)
+DECLARE_DEVICE_TYPE(NES_X1_005, nes_x1_005_device)
+DECLARE_DEVICE_TYPE(NES_X1_017, nes_x1_017_device)
-#endif
+#endif // MAME_BUS_NES_TAITO_H
diff --git a/src/devices/bus/nes/tengen.cpp b/src/devices/bus/nes/tengen.cpp
index 24c8843637f..7b171e77311 100644
--- a/src/devices/bus/nes/tengen.cpp
+++ b/src/devices/bus/nes/tengen.cpp
@@ -22,7 +22,7 @@
#include "tengen.h"
#include "cpu/m6502/m6502.h"
-#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access PPU_BOTTOM_VISIBLE_SCANLINE
+#include "video/ppu2c0x.h" // this has to be included so that IRQ functions can access ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE
#ifdef NES_PCB_DEBUG
@@ -38,28 +38,28 @@
// constructor
//-------------------------------------------------
-const device_type NES_TENGEN_800008 = device_creator<nes_tengen008_device>;
-const device_type NES_TENGEN_800032 = device_creator<nes_tengen032_device>;
-const device_type NES_TENGEN_800037 = device_creator<nes_tengen037_device>;
+DEFINE_DEVICE_TYPE(NES_TENGEN_800008, nes_tengen008_device, "nes_tengen008", "NES Cart Tengen 800008 PCB")
+DEFINE_DEVICE_TYPE(NES_TENGEN_800032, nes_tengen032_device, "nes_tengen032", "NES Cart Tengen 800032 PCB")
+DEFINE_DEVICE_TYPE(NES_TENGEN_800037, nes_tengen037_device, "nes_tengen037", "NES Cart Tengen 800037 PCB")
nes_tengen008_device::nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TENGEN_800008, "NES Cart Tengen 800008 PCB", tag, owner, clock, "nes_tengen008", __FILE__)
+ : nes_nrom_device(mconfig, NES_TENGEN_800008, tag, owner, clock)
{
}
-nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr)
- {
+nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr)
+{
}
nes_tengen032_device::nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TENGEN_800032, "NES Cart Tengen 800032 PCB", tag, owner, clock, "nes_tengen032", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_mode(0), m_irq_reset(0), m_irq_enable(0), m_latch(0), irq_timer(nullptr)
+ : nes_tengen032_device(mconfig, NES_TENGEN_800032, tag, owner, clock)
{
}
nes_tengen037_device::nes_tengen037_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_tengen032_device(mconfig, NES_TENGEN_800037, "NES Cart Tengen 800037 PCB", tag, owner, clock, "nes_tengen037", __FILE__)
+ : nes_tengen032_device(mconfig, NES_TENGEN_800037, tag, owner, clock)
{
}
@@ -195,7 +195,7 @@ void nes_tengen032_device::hblank_irq(int scanline, int vblank, int blanked)
{
if (!m_irq_mode) // we are in scanline mode!
{
- if (scanline < PPU_BOTTOM_VISIBLE_SCANLINE)
+ if (scanline < ppu2c0x_device::BOTTOM_VISIBLE_SCANLINE)
{
irq_clock(blanked);
}
diff --git a/src/devices/bus/nes/tengen.h b/src/devices/bus/nes/tengen.h
index 3fb9cba0c88..dce41f4fbb4 100644
--- a/src/devices/bus/nes/tengen.h
+++ b/src/devices/bus/nes/tengen.h
@@ -1,7 +1,7 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_TENGEN_H
-#define __NES_TENGEN_H
+#ifndef MAME_BUS_NES_TENGEN_H
+#define MAME_BUS_NES_TENGEN_H
#include "nxrom.h"
@@ -14,11 +14,13 @@ public:
// construction/destruction
nes_tengen008_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -28,20 +30,23 @@ class nes_tengen032_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_tengen032_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_tengen032_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
- virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
virtual DECLARE_WRITE8_MEMBER(tengen032_write);
virtual DECLARE_WRITE8_MEMBER(write_h) override { tengen032_write(space, offset, data, mem_mask); }
- virtual void chr_cb(int start, int bank, int source);
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
protected:
+ nes_tengen032_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+ virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
+
+ virtual void chr_cb(int start, int bank, int source);
+
void set_prg();
void set_chr();
void irq_clock(int blanked);
@@ -77,12 +82,9 @@ protected:
};
-
-
-
// device type definition
-extern const device_type NES_TENGEN_800008;
-extern const device_type NES_TENGEN_800032;
-extern const device_type NES_TENGEN_800037;
+DECLARE_DEVICE_TYPE(NES_TENGEN_800008, nes_tengen008_device)
+DECLARE_DEVICE_TYPE(NES_TENGEN_800032, nes_tengen032_device)
+DECLARE_DEVICE_TYPE(NES_TENGEN_800037, nes_tengen037_device)
-#endif
+#endif // MAME_BUS_NES_TENGEN_H
diff --git a/src/devices/bus/nes/txc.cpp b/src/devices/bus/nes/txc.cpp
index c6c4b6b9ad1..f3ab8efc5f9 100644
--- a/src/devices/bus/nes/txc.cpp
+++ b/src/devices/bus/nes/txc.cpp
@@ -37,40 +37,40 @@
// constructor
//-------------------------------------------------
-const device_type NES_TXC_22211 = device_creator<nes_txc_22211_device>;
-const device_type NES_TXC_DUMARACING = device_creator<nes_txc_dumarc_device>;
-const device_type NES_TXC_MJBLOCK = device_creator<nes_txc_mjblock_device>;
-const device_type NES_TXC_STRIKEW = device_creator<nes_txc_strikew_device>;
-const device_type NES_TXC_COMMANDOS = device_creator<nes_txc_commandos_device>;
+DEFINE_DEVICE_TYPE(NES_TXC_22211, nes_txc_22211_device, "nes_txc_22211", "NES Cart TXC 22211 PCB")
+DEFINE_DEVICE_TYPE(NES_TXC_DUMARACING, nes_txc_dumarc_device, "nes_txc_dumarc", "NES Cart TXC Du Ma Racing PCB")
+DEFINE_DEVICE_TYPE(NES_TXC_MJBLOCK, nes_txc_mjblock_device, "nes_txc_mjblock", "NES Cart TXC Mahjong Block PCB")
+DEFINE_DEVICE_TYPE(NES_TXC_STRIKEW, nes_txc_strikew_device, "nes_txc_strikew", "NES Cart TXC Strike Wolf PCB")
+DEFINE_DEVICE_TYPE(NES_TXC_COMMANDOS, nes_txc_commandos_device, "nes_txc_comm", "NES Cart TXC Cart Commandos PCB") // and others
-nes_txc_22211_device::nes_txc_22211_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_nrom_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_txc_22211_device::nes_txc_22211_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_nrom_device(mconfig, type, tag, owner, clock)
{
}
nes_txc_22211_device::nes_txc_22211_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TXC_22211, "NES Cart TXC 22211 PCB", tag, owner, clock, "nes_txc_22211", __FILE__)
+ : nes_nrom_device(mconfig, NES_TXC_22211, tag, owner, clock)
{
}
nes_txc_dumarc_device::nes_txc_dumarc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txc_22211_device(mconfig, NES_TXC_DUMARACING, "NES Cart TXC Du Ma Racing PCB", tag, owner, clock, "nes_dumarc", __FILE__)
+ : nes_txc_22211_device(mconfig, NES_TXC_DUMARACING, tag, owner, clock)
{
}
nes_txc_mjblock_device::nes_txc_mjblock_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txc_22211_device(mconfig, NES_TXC_MJBLOCK, "NES Cart TXC Mahjong Block PCB", tag, owner, clock, "nes_mjblock", __FILE__)
+ : nes_txc_22211_device(mconfig, NES_TXC_MJBLOCK, tag, owner, clock)
{
}
nes_txc_strikew_device::nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TXC_STRIKEW, "NES Cart Strike Wolf PCB", tag, owner, clock, "nes_txc_strikew", __FILE__)
+ : nes_nrom_device(mconfig, NES_TXC_STRIKEW, tag, owner, clock)
{
}
nes_txc_commandos_device::nes_txc_commandos_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_TXC_COMMANDOS, "NES Cart Commandos (and others) PCB", tag, owner, clock, "nes_txc_comm", __FILE__)
+ : nes_nrom_device(mconfig, NES_TXC_COMMANDOS, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/txc.h b/src/devices/bus/nes/txc.h
index b8c11dddd20..efc32b58368 100644
--- a/src/devices/bus/nes/txc.h
+++ b/src/devices/bus/nes/txc.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_TXC_H
-#define __NES_TXC_H
+#ifndef MAME_BUS_NES_TXC_H
+#define MAME_BUS_NES_TXC_H
+
+#pragma once
#include "nxrom.h"
@@ -12,11 +14,8 @@ class nes_txc_22211_device : public nes_nrom_device
{
public:
// construction/destruction
- nes_txc_22211_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_txc_22211_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
@@ -24,6 +23,11 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_txc_22211_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_reg[4];
};
@@ -62,11 +66,13 @@ public:
// construction/destruction
nes_txc_strikew_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -78,22 +84,22 @@ public:
// construction/destruction
nes_txc_commandos_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
-};
-
+protected:
+ // device-level overrides
+ virtual void device_start() override;
+};
// device type definition
-extern const device_type NES_TXC_22211;
-extern const device_type NES_TXC_DUMARACING;
-extern const device_type NES_TXC_MJBLOCK;
-extern const device_type NES_TXC_STRIKEW;
-extern const device_type NES_TXC_COMMANDOS;
+DECLARE_DEVICE_TYPE(NES_TXC_22211, nes_txc_22211_device)
+DECLARE_DEVICE_TYPE(NES_TXC_DUMARACING, nes_txc_dumarac_device)
+DECLARE_DEVICE_TYPE(NES_TXC_MJBLOCK, nes_txc_mjblock_device)
+DECLARE_DEVICE_TYPE(NES_TXC_STRIKEW, nes_txc_strikew_device)
+DECLARE_DEVICE_TYPE(NES_TXC_COMMANDOS, nes_txc_commandos_device)
-#endif
+#endif // MAME_BUS_NES_TXC_H
diff --git a/src/devices/bus/nes/waixing.cpp b/src/devices/bus/nes/waixing.cpp
index fd343d910e3..f4d9c338f48 100644
--- a/src/devices/bus/nes/waixing.cpp
+++ b/src/devices/bus/nes/waixing.cpp
@@ -33,141 +33,141 @@
// constructor
//-------------------------------------------------
-const device_type NES_WAIXING_A = device_creator<nes_waixing_a_device>;
-const device_type NES_WAIXING_A1 = device_creator<nes_waixing_a1_device>;
-const device_type NES_WAIXING_B = device_creator<nes_waixing_b_device>;
-const device_type NES_WAIXING_C = device_creator<nes_waixing_c_device>;
-const device_type NES_WAIXING_D = device_creator<nes_waixing_d_device>;
-const device_type NES_WAIXING_E = device_creator<nes_waixing_e_device>;
-const device_type NES_WAIXING_F = device_creator<nes_waixing_f_device>;
-const device_type NES_WAIXING_G = device_creator<nes_waixing_g_device>;
-const device_type NES_WAIXING_H = device_creator<nes_waixing_h_device>;
-const device_type NES_WAIXING_H1 = device_creator<nes_waixing_h1_device>;
-const device_type NES_WAIXING_I = device_creator<nes_waixing_i_device>;
-const device_type NES_WAIXING_J = device_creator<nes_waixing_j_device>;
-const device_type NES_WAIXING_SH2 = device_creator<nes_waixing_sh2_device>;
-const device_type NES_WAIXING_SEC = device_creator<nes_waixing_sec_device>;
-const device_type NES_WAIXING_SGZ = device_creator<nes_waixing_sgz_device>;
-const device_type NES_WAIXING_SGZLZ = device_creator<nes_waixing_sgzlz_device>;
-const device_type NES_WAIXING_FFV = device_creator<nes_waixing_ffv_device>;
-const device_type NES_WAIXING_WXZS = device_creator<nes_waixing_wxzs_device>;
-const device_type NES_WAIXING_DQ8 = device_creator<nes_waixing_dq8_device>;
-const device_type NES_WAIXING_WXZS2 = device_creator<nes_waixing_wxzs2_device>;
-const device_type NES_WAIXING_FS304 = device_creator<nes_waixing_fs304_device>;
-
-
-nes_waixing_a_device::nes_waixing_a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source)
+DEFINE_DEVICE_TYPE(NES_WAIXING_A, nes_waixing_a_device, "nes_waixing_a", "NES Cart Waixing Type A PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_A1, nes_waixing_a1_device, "nes_waixing_a1", "NES Cart Waixing Type A (Alt) PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_B, nes_waixing_b_device, "nes_waixing_b", "NES Cart Waixing Type B PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_C, nes_waixing_c_device, "nes_waixing_c", "NES Cart Waixing Type C PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_D, nes_waixing_d_device, "nes_waixing_d", "NES Cart Waixing Type D PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_E, nes_waixing_e_device, "nes_waixing_e", "NES Cart Waixing Type E PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_F, nes_waixing_f_device, "nes_waixing_f", "NES Cart Waixing Type F PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_G, nes_waixing_g_device, "nes_waixing_g", "NES Cart Waixing Type G PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_H, nes_waixing_h_device, "nes_waixing_h", "NES Cart Waixing Type H PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_H1, nes_waixing_h1_device, "nes_waixing_h1", "NES Cart Waixing Type H (Alt) PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_I, nes_waixing_i_device, "nes_waixing_i", "NES Cart Waixing Type I PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_J, nes_waixing_j_device, "nes_waixing_j", "NES Cart Waixing Type J PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_SH2, nes_waixing_sh2_device, "nes_waixing_sh2", "NES Cart Waixing SH2 PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_SEC, nes_waixing_sec_device, "nes_waixing_sec", "NES Cart Waixing Security Chip PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_SGZ, nes_waixing_sgz_device, "nes_waixing_sgz", "NES Cart Waixing San Guo Zhi PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_SGZLZ, nes_waixing_sgzlz_device, "nes_waixing_sgzlz", "NES Cart Waixing San Guo Zhong Lie Zhuan PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_FFV, nes_waixing_ffv_device, "nes_waixing_ffv", "NES Cart Waixing Final Fantasy V PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_WXZS, nes_waixing_wxzs_device, "nes_waixing_wxzs", "NES Cart Waixing Wai Xing Zhan Shi PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_DQ8, nes_waixing_dq8_device, "nes_waixing_dq8", "NES Cart Waixing Dragon Quest VIII PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_WXZS2, nes_waixing_wxzs2_device, "nes_waixing_wxzs2", "NES Cart Waixing Wai Xing Zhan Shi 2 PCB")
+DEFINE_DEVICE_TYPE(NES_WAIXING_FS304, nes_waixing_fs304_device, "nes_waixing_fs304", "NES Cart Waixing FS-304 PCB")
+
+
+nes_waixing_a_device::nes_waixing_a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_txrom_device(mconfig, type, tag, owner, clock)
{
}
nes_waixing_a_device::nes_waixing_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_WAIXING_A, "NES Cart Waixing Type A PCB", tag, owner, clock, "nes_waixing_a", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_A, tag, owner, clock)
{
}
nes_waixing_a1_device::nes_waixing_a1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_A1, "NES Cart Waixing Type A (Alt) PCB", tag, owner, clock, "nes_waixing_a1", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_A1, tag, owner, clock)
{
}
nes_waixing_b_device::nes_waixing_b_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_B, "NES Cart Waixing Type B PCB", tag, owner, clock, "nes_waixing_b", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_B, tag, owner, clock)
{
}
nes_waixing_c_device::nes_waixing_c_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_C, "NES Cart Waixing Type C PCB", tag, owner, clock, "nes_waixing_c", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_C, tag, owner, clock)
{
}
nes_waixing_d_device::nes_waixing_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_D, "NES Cart Waixing Type D PCB", tag, owner, clock, "nes_waixing_d", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_D, tag, owner, clock)
{
}
nes_waixing_e_device::nes_waixing_e_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_E, "NES Cart Waixing Type E PCB", tag, owner, clock, "nes_waixing_e", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_E, tag, owner, clock)
{
}
nes_waixing_f_device::nes_waixing_f_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_F, "NES Cart Waixing Type F PCB", tag, owner, clock, "nes_waixing_f", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_F, tag, owner, clock)
{
}
nes_waixing_g_device::nes_waixing_g_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_G, "NES Cart Waixing Type G PCB", tag, owner, clock, "nes_waixing_g", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_G, tag, owner, clock)
{
}
-nes_waixing_h_device::nes_waixing_h_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source)
- : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source)
+nes_waixing_h_device::nes_waixing_h_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
+ : nes_txrom_device(mconfig, type, tag, owner, clock)
{
}
nes_waixing_h_device::nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_WAIXING_H, "NES Cart Waixing Type H PCB", tag, owner, clock, "nes_waixing_h", __FILE__)
+ : nes_waixing_h_device(mconfig, NES_WAIXING_H, tag, owner, clock)
{
}
nes_waixing_h1_device::nes_waixing_h1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_h_device(mconfig, NES_WAIXING_H1, "NES Cart Waixing Type H (Alt) PCB", tag, owner, clock, "nes_waixing_h1", __FILE__)
+ : nes_waixing_h_device(mconfig, NES_WAIXING_H1, tag, owner, clock)
{
}
nes_waixing_i_device::nes_waixing_i_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_I, "NES Cart Waixing Type I PCB", tag, owner, clock, "nes_waixing_i", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_I, tag, owner, clock)
{
}
nes_waixing_j_device::nes_waixing_j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_waixing_a_device(mconfig, NES_WAIXING_J, "NES Cart Waixing Type J PCB", tag, owner, clock, "nes_waixing_j", __FILE__)
+ : nes_waixing_a_device(mconfig, NES_WAIXING_J, tag, owner, clock)
{
}
nes_waixing_sh2_device::nes_waixing_sh2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_WAIXING_SH2, "NES Cart Waixing SH2 PCB", tag, owner, clock, "nes_waixing_sh2", __FILE__)
+ : nes_txrom_device(mconfig, NES_WAIXING_SH2, tag, owner, clock)
{
}
nes_waixing_sec_device::nes_waixing_sec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_txrom_device(mconfig, NES_WAIXING_SEC, "NES Cart Waixing Security Chip PCB", tag, owner, clock, "nes_waixing_sec", __FILE__), m_reg(0)
- {
+ : nes_txrom_device(mconfig, NES_WAIXING_SEC, tag, owner, clock), m_reg(0)
+{
}
nes_waixing_sgz_device::nes_waixing_sgz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_SGZ, "NES Cart Waixing San Guo Zhi PCB", tag, owner, clock, "nes_waixing_sgz", __FILE__), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0)
- {
+ : nes_nrom_device(mconfig, NES_WAIXING_SGZ, tag, owner, clock), m_irq_count(0), m_irq_count_latch(0), m_irq_enable(0), m_irq_enable_latch(0)
+{
}
nes_waixing_sgzlz_device::nes_waixing_sgzlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_SGZLZ, "NES Cart Waixing San Guo Zhong Lie Zhuan PCB", tag, owner, clock, "nes_waixing_sgzlz", __FILE__), m_reg{}
- {
+ : nes_nrom_device(mconfig, NES_WAIXING_SGZLZ, tag, owner, clock), m_reg{ 0, 0, 0, 0 }
+{
}
nes_waixing_ffv_device::nes_waixing_ffv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_FFV, "NES Cart Waixing Final Fantasy V PCB", tag, owner, clock, "nes_waixing_ffv", __FILE__)
+ : nes_nrom_device(mconfig, NES_WAIXING_FFV, tag, owner, clock)
{
}
nes_waixing_wxzs_device::nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_WXZS, "NES Cart Waixing Wai Xing Zhan Shi PCB", tag, owner, clock, "nes_waixing_wxzs", __FILE__)
+ : nes_nrom_device(mconfig, NES_WAIXING_WXZS, tag, owner, clock)
{
}
nes_waixing_dq8_device::nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_DQ8, "NES Cart Waixing Dragon Quest VIII PCB", tag, owner, clock, "nes_waixing_dq8", __FILE__)
+ : nes_nrom_device(mconfig, NES_WAIXING_DQ8, tag, owner, clock)
{
}
nes_waixing_wxzs2_device::nes_waixing_wxzs2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_WXZS2, "NES Cart Waixing Wai Xing Zhan Shi 2 PCB", tag, owner, clock, "nes_waixing_wxzs2", __FILE__)
+ : nes_nrom_device(mconfig, NES_WAIXING_WXZS2, tag, owner, clock)
{
}
nes_waixing_fs304_device::nes_waixing_fs304_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_WAIXING_FS304, "NES Cart Waixing FS-304 PCB", tag, owner, clock, "nes_waixing_fs304", __FILE__)
+ : nes_nrom_device(mconfig, NES_WAIXING_FS304, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/waixing.h b/src/devices/bus/nes/waixing.h
index dd53d109e73..5488973a14c 100644
--- a/src/devices/bus/nes/waixing.h
+++ b/src/devices/bus/nes/waixing.h
@@ -1,7 +1,9 @@
// license:BSD-3-Clause
// copyright-holders:Fabio Priuli
-#ifndef __NES_WAIXING_H
-#define __NES_WAIXING_H
+#ifndef MAME_BUS_NES_WAIXING_H
+#define MAME_BUS_NES_WAIXING_H
+
+#pragma once
#include "mmc3.h"
@@ -12,11 +14,8 @@ class nes_waixing_a_device : public nes_txrom_device
{
public:
// construction/destruction
- nes_waixing_a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_waixing_a_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_READ8_MEMBER(read_l) override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual DECLARE_WRITE8_MEMBER(waixing_write);
@@ -26,7 +25,13 @@ public:
virtual void pcb_reset() override;
protected:
+ nes_waixing_a_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual void device_start() override;
+
void set_mirror(uint8_t nt);
+
uint8_t mapper_ram[0x400];
};
@@ -109,6 +114,7 @@ public:
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
+
private:
virtual void set_prg(int prg_base, int prg_mask) override;
};
@@ -139,14 +145,17 @@ class nes_waixing_h_device : public nes_txrom_device
{
public:
// construction/destruction
- nes_waixing_h_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source);
nes_waixing_h_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void chr_cb(int start, int bank, int source) override;
// This PCB does not have 1K of internal RAM, so it's not derived from nes_waixing_a_device!!
+
+protected:
+ nes_waixing_h_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+
+ // device-level overrides
+ virtual DECLARE_WRITE8_MEMBER(write_h) override;
};
@@ -185,13 +194,14 @@ public:
// construction/destruction
nes_waixing_j_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
virtual void set_prg(int prg_base, int prg_mask) override;
uint8_t m_reg[4];
};
@@ -225,8 +235,6 @@ public:
// construction/destruction
nes_waixing_sec_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void prg_cb(int start, int bank) override;
virtual void chr_cb(int start, int bank, int source) override;
@@ -234,6 +242,9 @@ public:
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_reg;
};
@@ -246,14 +257,15 @@ public:
// construction/destruction
nes_waixing_sgz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void hblank_irq(int scanline, int vblank, int blanked) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
uint16_t m_irq_count, m_irq_count_latch;
int m_irq_enable, m_irq_enable_latch;
@@ -269,13 +281,14 @@ public:
// construction/destruction
nes_waixing_sgzlz_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_reg[4];
};
@@ -288,13 +301,14 @@ public:
// construction/destruction
nes_waixing_ffv_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_reg[2];
};
@@ -307,11 +321,13 @@ public:
// construction/destruction
nes_waixing_wxzs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -323,11 +339,13 @@ public:
// construction/destruction
nes_waixing_dq8_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -339,11 +357,13 @@ public:
// construction/destruction
nes_waixing_wxzs2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_h) override;
virtual void pcb_reset() override;
+
+protected:
+ // device-level overrides
+ virtual void device_start() override;
};
@@ -355,42 +375,39 @@ public:
// construction/destruction
nes_waixing_fs304_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- // device-level overrides
- virtual void device_start() override;
virtual DECLARE_WRITE8_MEMBER(write_l) override;
virtual void pcb_reset() override;
protected:
+ // device-level overrides
+ virtual void device_start() override;
+
uint8_t m_reg[4];
};
-
-
-
// device type definition
-extern const device_type NES_WAIXING_A;
-extern const device_type NES_WAIXING_A1;
-extern const device_type NES_WAIXING_B;
-extern const device_type NES_WAIXING_C;
-extern const device_type NES_WAIXING_D;
-extern const device_type NES_WAIXING_E;
-extern const device_type NES_WAIXING_F;
-extern const device_type NES_WAIXING_G;
-extern const device_type NES_WAIXING_H;
-extern const device_type NES_WAIXING_H1;
-extern const device_type NES_WAIXING_I;
-extern const device_type NES_WAIXING_J;
-extern const device_type NES_WAIXING_SH2;
-extern const device_type NES_WAIXING_SEC;
-extern const device_type NES_WAIXING_SGZ;
-extern const device_type NES_WAIXING_SGZLZ;
-extern const device_type NES_WAIXING_FFV;
-extern const device_type NES_WAIXING_WXZS;
-extern const device_type NES_WAIXING_DQ8;
-extern const device_type NES_WAIXING_WXZS2;
-extern const device_type NES_WAIXING_FS304;
-
-
-#endif
+DECLARE_DEVICE_TYPE(NES_WAIXING_A, nes_waixing_a_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_A1, nes_waixing_a1_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_B, nes_waixing_b_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_C, nes_waixing_c_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_D, nes_waixing_d_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_E, nes_waixing_e_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_F, nes_waixing_f_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_G, nes_waixing_g_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_H, nes_waixing_h_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_H1, nes_waixing_h1_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_I, nes_waixing_i_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_J, nes_waixing_j_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_SH2, nes_waixing_sh2_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_SEC, nes_waixing_sec_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_SGZ, nes_waixing_sgz_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_SGZLZ, nes_waixing_sgzlz_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_FFV, nes_waixing_ffv_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_WXZS, nes_waixing_wxzs_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_DQ8, nes_waixing_dq8_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_WXZS2, nes_waixing_wxzs2_device)
+DECLARE_DEVICE_TYPE(NES_WAIXING_FS304, nes_waixing_fs304_device)
+
+#endif // MAME_BUS_NES_WAIXING_H
diff --git a/src/devices/bus/nes/zemina.cpp b/src/devices/bus/nes/zemina.cpp
index 2328b7485a8..bb4b3b61bc0 100644
--- a/src/devices/bus/nes/zemina.cpp
+++ b/src/devices/bus/nes/zemina.cpp
@@ -21,7 +21,7 @@
// DEVICE DEFINITIONS
//**************************************************************************
-const device_type NES_ZEMINA = device_creator<nes_zemina_device>;
+DEFINE_DEVICE_TYPE(NES_ZEMINA, nes_zemina_device, "nes_zemina", "NES Cart Zemina PCB")
//**************************************************************************
// LIVE DEVICE
@@ -32,7 +32,7 @@ const device_type NES_ZEMINA = device_creator<nes_zemina_device>;
//-------------------------------------------------
nes_zemina_device::nes_zemina_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : nes_nrom_device(mconfig, NES_ZEMINA, "NES Cart Zemina PCB", tag, owner, clock, "nes_zemina", __FILE__)
+ : nes_nrom_device(mconfig, NES_ZEMINA, tag, owner, clock)
{
}
diff --git a/src/devices/bus/nes/zemina.h b/src/devices/bus/nes/zemina.h
index d52f2db803c..87d170d053d 100644
--- a/src/devices/bus/nes/zemina.h
+++ b/src/devices/bus/nes/zemina.h
@@ -26,6 +26,6 @@ public:
};
// device type definition
-extern const device_type NES_ZEMINA;
+DECLARE_DEVICE_TYPE(NES_ZEMINA, nes_zemina_device)
-#endif /* MAME_BUS_NES_ZEMINA_H */
+#endif // MAME_BUS_NES_ZEMINA_H