diff options
Diffstat (limited to 'src/devices/bus/neogeo')
29 files changed, 169 insertions, 169 deletions
diff --git a/src/devices/bus/neogeo/boot_cthd.cpp b/src/devices/bus/neogeo/boot_cthd.cpp index 70c4d891ad5..2f6659fddbe 100644 --- a/src/devices/bus/neogeo/boot_cthd.cpp +++ b/src/devices/bus/neogeo/boot_cthd.cpp @@ -48,10 +48,9 @@ void neogeo_cthd2k3_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_cthd2k3_cart_device::device_add_mconfig(machine_config &config) -{ - NG_CTHD_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_cthd2k3_cart_device::device_add_mconfig) + MCFG_CTHD_PROT_ADD("cthd_prot") +MACHINE_CONFIG_END /************************************************* @@ -123,9 +122,8 @@ void neogeo_matrimbl_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) } -void neogeo_matrimbl_cart_device::device_add_mconfig(machine_config &config) -{ - NG_KOF2002_PROT(config, m_kof2k2_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_CTHD_PROT(config, m_prot); -} + MACHINE_CONFIG_START(neogeo_matrimbl_cart_device::device_add_mconfig) + MCFG_KOF2002_PROT_ADD("kof2k2_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_CTHD_PROT_ADD("cthd_prot") +MACHINE_CONFIG_END diff --git a/src/devices/bus/neogeo/boot_kof10th.cpp b/src/devices/bus/neogeo/boot_kof10th.cpp index d1dd9c925f5..1fa9aeb1d84 100644 --- a/src/devices/bus/neogeo/boot_kof10th.cpp +++ b/src/devices/bus/neogeo/boot_kof10th.cpp @@ -48,10 +48,9 @@ void neogeo_kof10th_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_kof10th_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_kof10th_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") +MACHINE_CONFIG_END void neogeo_kof10th_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) diff --git a/src/devices/bus/neogeo/boot_kof2k2.cpp b/src/devices/bus/neogeo/boot_kof2k2.cpp index 8bbf3ab0962..611ff47a382 100644 --- a/src/devices/bus/neogeo/boot_kof2k2.cpp +++ b/src/devices/bus/neogeo/boot_kof2k2.cpp @@ -12,27 +12,24 @@ #include "boot_kof2k2.h" -void neogeo_kof2002b_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); - NG_KOF2002_PROT(config, m_kof2k2_prot); -} - -void neogeo_kf2k2mp_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); -} - -void neogeo_kf2k2mp2_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); -} +MACHINE_CONFIG_START(neogeo_kof2002b_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2002_PROT_ADD("kof2k2_prot") +MACHINE_CONFIG_END + +MACHINE_CONFIG_START(neogeo_kf2k2mp_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") +MACHINE_CONFIG_END + +MACHINE_CONFIG_START(neogeo_kf2k2mp2_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") +MACHINE_CONFIG_END /************************************************* kof2002b diff --git a/src/devices/bus/neogeo/boot_kof2k3.cpp b/src/devices/bus/neogeo/boot_kof2k3.cpp index 172a0ad56db..2c0f4f375a3 100644 --- a/src/devices/bus/neogeo/boot_kof2k3.cpp +++ b/src/devices/bus/neogeo/boot_kof2k3.cpp @@ -12,29 +12,26 @@ #include "boot_kof2k3.h" -void neogeo_kf2k3bl_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); - NG_KOF2K3BL_PROT(config, m_kof2k3bl_prot); -} - -void neogeo_kf2k3pl_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); - NG_KOF2K3BL_PROT(config, m_kof2k3bl_prot); -} - -void neogeo_kf2k3upl_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); - NG_KOF2K3BL_PROT(config, m_kof2k3bl_prot); -} +MACHINE_CONFIG_START(neogeo_kf2k3bl_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2K3BL_PROT_ADD("kof2k3bl_prot") +MACHINE_CONFIG_END + +MACHINE_CONFIG_START(neogeo_kf2k3pl_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2K3BL_PROT_ADD("kof2k3bl_prot") +MACHINE_CONFIG_END + +MACHINE_CONFIG_START(neogeo_kf2k3upl_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2K3BL_PROT_ADD("kof2k3bl_prot") +MACHINE_CONFIG_END /************************************************* kf2k3bl diff --git a/src/devices/bus/neogeo/boot_misc.cpp b/src/devices/bus/neogeo/boot_misc.cpp index b544fa93976..f22a0236ebf 100644 --- a/src/devices/bus/neogeo/boot_misc.cpp +++ b/src/devices/bus/neogeo/boot_misc.cpp @@ -48,10 +48,9 @@ void neogeo_bootleg_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_bootleg_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_bootleg_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") +MACHINE_CONFIG_END /************************************************* @@ -208,11 +207,10 @@ void neogeo_mslug3b6_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) m_cmc_prot->cmc42_gfx_decrypt(spr_region, spr_region_size, MSLUG3_GFX_KEY); } -void neogeo_mslug3b6_cart_device::device_add_mconfig(machine_config &config) -{ - NG_CMC_PROT(config, m_cmc_prot); - NEOBOOT_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_mslug3b6_cart_device::device_add_mconfig) + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") +MACHINE_CONFIG_END /************************************************* @@ -236,12 +234,11 @@ void neogeo_ms5plus_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) m_prot->sx_decrypt(fix_region, fix_region_size, 1); } -void neogeo_ms5plus_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); -} +MACHINE_CONFIG_START(neogeo_ms5plus_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") +MACHINE_CONFIG_END /************************************************* diff --git a/src/devices/bus/neogeo/boot_svc.cpp b/src/devices/bus/neogeo/boot_svc.cpp index aac306be5ce..dac4a8aedad 100644 --- a/src/devices/bus/neogeo/boot_svc.cpp +++ b/src/devices/bus/neogeo/boot_svc.cpp @@ -30,11 +30,10 @@ void neogeo_svcboot_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) m_prot->svcboot_cx_decrypt(spr_region, spr_region_size); } -void neogeo_svcboot_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_PVC_PROT(config, m_pvc_prot); -} +MACHINE_CONFIG_START(neogeo_svcboot_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_PVC_PROT_ADD("pvc_prot") +MACHINE_CONFIG_END /************************************************* @@ -97,8 +96,7 @@ void neogeo_svcsplus_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) } -void neogeo_svcsplus_cart_device::device_add_mconfig(machine_config &config) -{ - NEOBOOT_PROT(config, m_prot); - NG_PVC_PROT(config, m_pvc_prot); -} +MACHINE_CONFIG_START(neogeo_svcsplus_cart_device::device_add_mconfig) + MCFG_NEOBOOT_PROT_ADD("bootleg_prot") + MCFG_PVC_PROT_ADD("pvc_prot") +MACHINE_CONFIG_END diff --git a/src/devices/bus/neogeo/cmc.cpp b/src/devices/bus/neogeo/cmc.cpp index d1fb1b699f8..841244c478e 100644 --- a/src/devices/bus/neogeo/cmc.cpp +++ b/src/devices/bus/neogeo/cmc.cpp @@ -44,10 +44,9 @@ void neogeo_cmc_cart_device::device_reset() } -void neogeo_cmc_cart_device::device_add_mconfig(machine_config &config) -{ - NG_CMC_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_cmc_cart_device::device_add_mconfig) + MCFG_CMC_PROT_ADD("cmc_prot") +MACHINE_CONFIG_END /************************************************* @@ -252,23 +251,19 @@ void neogeo_cmc_kof2000n_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) DEFINE_DEVICE_TYPE(NEOGEO_CMC_JOCKEYGP_CART, neogeo_cmc_jockeygp_cart_device, "neocart_jockeygp", "Neo Geo Jockey GP CMC50 Cart") neogeo_cmc_jockeygp_cart_device::neogeo_cmc_jockeygp_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - neogeo_cmc_cart_device(mconfig, NEOGEO_CMC_JOCKEYGP_CART, tag, owner, clock), - m_nvram(*this, "nvram") + neogeo_cmc_cart_device(mconfig, NEOGEO_CMC_JOCKEYGP_CART, tag, owner, clock) { } void neogeo_cmc_jockeygp_cart_device::device_start() { - m_ram = make_unique_clear<uint16_t[]>(0x2000/2); - m_nvram->set_base(m_ram.get(), 0x2000); - save_pointer(NAME(m_ram), 0x2000/2); + save_item(NAME(m_ram)); } -void neogeo_cmc_jockeygp_cart_device::device_add_mconfig(machine_config &config) +void neogeo_cmc_jockeygp_cart_device::device_reset() { - neogeo_cmc_cart_device::device_add_mconfig(config); - NVRAM(config, m_nvram); + memset(m_ram, 0, 0x2000); } void neogeo_cmc_jockeygp_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) diff --git a/src/devices/bus/neogeo/cmc.h b/src/devices/bus/neogeo/cmc.h index bba8251d2e5..88b1c27cd9f 100644 --- a/src/devices/bus/neogeo/cmc.h +++ b/src/devices/bus/neogeo/cmc.h @@ -8,7 +8,6 @@ #include "slot.h" #include "rom.h" #include "prot_cmc.h" -#include "machine/nvram.h" // ======================> neogeo_cmc_cart_device @@ -219,13 +218,10 @@ public: protected: virtual void device_start() override; - - virtual void device_add_mconfig(machine_config &config) override; + virtual void device_reset() override; private: - std::unique_ptr<uint16_t[]> m_ram; - - required_device<nvram_device> m_nvram; + uint16_t m_ram[0x1000]; }; DECLARE_DEVICE_TYPE(NEOGEO_CMC_JOCKEYGP_CART, neogeo_cmc_jockeygp_cart_device) diff --git a/src/devices/bus/neogeo/fatfury2.cpp b/src/devices/bus/neogeo/fatfury2.cpp index 66fcfdc98a1..b3c9dea575e 100644 --- a/src/devices/bus/neogeo/fatfury2.cpp +++ b/src/devices/bus/neogeo/fatfury2.cpp @@ -43,7 +43,6 @@ void neogeo_fatfury2_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_fatfury2_cart_device::device_add_mconfig(machine_config &config) -{ - NG_FATFURY2_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_fatfury2_cart_device::device_add_mconfig) + MCFG_FATFURY2_PROT_ADD("fatfury2_prot") +MACHINE_CONFIG_END diff --git a/src/devices/bus/neogeo/kof2k2.cpp b/src/devices/bus/neogeo/kof2k2.cpp index 8ff5f040d3a..e313c93034a 100644 --- a/src/devices/bus/neogeo/kof2k2.cpp +++ b/src/devices/bus/neogeo/kof2k2.cpp @@ -3,7 +3,7 @@ /*********************************************************************************************************** Neo Geo cart emulation - The King of Fighters 2002 cart type (CMC + PCM2 + Additional CPU encryption) + The King of Fighers 2002 cart type (CMC + PCM2 + Additional CPU encryption) ***********************************************************************************************************/ @@ -50,12 +50,11 @@ void neogeo_kof2k2type_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_kof2k2type_cart_device::device_add_mconfig(machine_config &config) -{ - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); - NG_KOF2002_PROT(config, m_kof2k2_prot); -} +MACHINE_CONFIG_START(neogeo_kof2k2type_cart_device::device_add_mconfig) + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_KOF2002_PROT_ADD("kof2002_prot") +MACHINE_CONFIG_END /************************************************* diff --git a/src/devices/bus/neogeo/kof98.cpp b/src/devices/bus/neogeo/kof98.cpp index 52f6b5fe523..bc53a930bac 100644 --- a/src/devices/bus/neogeo/kof98.cpp +++ b/src/devices/bus/neogeo/kof98.cpp @@ -43,10 +43,9 @@ void neogeo_kof98_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_kof98_cart_device::device_add_mconfig(machine_config &config) -{ - NG_KOF98_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_kof98_cart_device::device_add_mconfig) + MCFG_KOF98_PROT_ADD("kof98_prot") +MACHINE_CONFIG_END void neogeo_kof98_cart_device::decrypt_all(DECRYPT_ALL_PARAMS) { diff --git a/src/devices/bus/neogeo/mslugx.cpp b/src/devices/bus/neogeo/mslugx.cpp index 2917841cac3..521f5636a1b 100644 --- a/src/devices/bus/neogeo/mslugx.cpp +++ b/src/devices/bus/neogeo/mslugx.cpp @@ -43,7 +43,6 @@ void neogeo_mslugx_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_mslugx_cart_device::device_add_mconfig(machine_config &config) -{ - NG_MSLUGX_PROT(config, m_prot); -} +MACHINE_CONFIG_START(neogeo_mslugx_cart_device::device_add_mconfig) + MCFG_MSLUGX_PROT_ADD("mslugx_prot") +MACHINE_CONFIG_END diff --git a/src/devices/bus/neogeo/pcm2.cpp b/src/devices/bus/neogeo/pcm2.cpp index 521c796d59a..e098d796229 100644 --- a/src/devices/bus/neogeo/pcm2.cpp +++ b/src/devices/bus/neogeo/pcm2.cpp @@ -49,11 +49,10 @@ void neogeo_pcm2_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_pcm2_cart_device::device_add_mconfig(machine_config &config) -{ - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); -} +MACHINE_CONFIG_START(neogeo_pcm2_cart_device::device_add_mconfig) + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") +MACHINE_CONFIG_END /************************************************* diff --git a/src/devices/bus/neogeo/prot_cmc.h b/src/devices/bus/neogeo/prot_cmc.h index 2853c71aa8f..46a6a6c6766 100644 --- a/src/devices/bus/neogeo/prot_cmc.h +++ b/src/devices/bus/neogeo/prot_cmc.h @@ -9,6 +9,9 @@ DECLARE_DEVICE_TYPE(NG_CMC_PROT, cmc_prot_device) +#define MCFG_CMC_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_CMC_PROT, 0) + // cmc42 #define KOF99_GFX_KEY (0x00) #define GAROU_GFX_KEY (0x06) @@ -41,7 +44,7 @@ class cmc_prot_device : public device_t { public: // construction/destruction - cmc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + cmc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void decrypt(uint8_t *r0, uint8_t *r1, uint8_t c0, uint8_t c1, diff --git a/src/devices/bus/neogeo/prot_cthd.h b/src/devices/bus/neogeo/prot_cthd.h index 95ae38289b3..455674a56c8 100644 --- a/src/devices/bus/neogeo/prot_cthd.h +++ b/src/devices/bus/neogeo/prot_cthd.h @@ -8,11 +8,15 @@ DECLARE_DEVICE_TYPE(NG_CTHD_PROT, cthd_prot_device) +#define MCFG_CTHD_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_CTHD_PROT, 0) + + class cthd_prot_device : public device_t { public: // construction/destruction - cthd_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + cthd_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void fix_do(uint8_t* sprrom, uint32_t sprrom_size, int start, int end, int bit3shift, int bit2shift, int bit1shift, int bit0shift); void gfx_address_fix(uint8_t* sprrom, uint32_t sprrom_size, int start, int end); diff --git a/src/devices/bus/neogeo/prot_fatfury2.h b/src/devices/bus/neogeo/prot_fatfury2.h index bb33d1c10c1..8c75e7f5d46 100644 --- a/src/devices/bus/neogeo/prot_fatfury2.h +++ b/src/devices/bus/neogeo/prot_fatfury2.h @@ -8,12 +8,15 @@ DECLARE_DEVICE_TYPE(NG_FATFURY2_PROT, fatfury2_prot_device) +#define MCFG_FATFURY2_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_FATFURY2_PROT, 0) + class fatfury2_prot_device : public device_t { public: // construction/destruction - fatfury2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + fatfury2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER( protection_r ); DECLARE_WRITE16_MEMBER( protection_w ); diff --git a/src/devices/bus/neogeo/prot_kof2k2.h b/src/devices/bus/neogeo/prot_kof2k2.h index 324da5a8918..4eb764f006d 100644 --- a/src/devices/bus/neogeo/prot_kof2k2.h +++ b/src/devices/bus/neogeo/prot_kof2k2.h @@ -9,12 +9,15 @@ DECLARE_DEVICE_TYPE(NG_KOF2002_PROT, kof2002_prot_device) +#define MCFG_KOF2002_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_KOF2002_PROT, 0) + class kof2002_prot_device : public device_t { public: // construction/destruction - kof2002_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + kof2002_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void kof2002_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); void matrim_decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); diff --git a/src/devices/bus/neogeo/prot_kof2k3bl.h b/src/devices/bus/neogeo/prot_kof2k3bl.h index 52d87e87bfe..8520bd90716 100644 --- a/src/devices/bus/neogeo/prot_kof2k3bl.h +++ b/src/devices/bus/neogeo/prot_kof2k3bl.h @@ -8,12 +8,15 @@ DECLARE_DEVICE_TYPE(NG_KOF2K3BL_PROT, kof2k3bl_prot_device) +#define MCFG_KOF2K3BL_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_KOF2K3BL_PROT, 0) + class kof2k3bl_prot_device : public device_t { public: // construction/destruction - kof2k3bl_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + kof2k3bl_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ16_MEMBER(protection_r); DECLARE_WRITE16_MEMBER(kof2003_w); diff --git a/src/devices/bus/neogeo/prot_kof98.h b/src/devices/bus/neogeo/prot_kof98.h index 652e098898a..ff0783e29ad 100644 --- a/src/devices/bus/neogeo/prot_kof98.h +++ b/src/devices/bus/neogeo/prot_kof98.h @@ -9,12 +9,15 @@ DECLARE_DEVICE_TYPE(NG_KOF98_PROT, kof98_prot_device) +#define MCFG_KOF98_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_KOF98_PROT, 0) + class kof98_prot_device : public device_t { public: // construction/destruction - kof98_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + kof98_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void decrypt_68k(uint8_t* cpurom, uint32_t cpurom_size); DECLARE_WRITE16_MEMBER(protection_w); diff --git a/src/devices/bus/neogeo/prot_misc.h b/src/devices/bus/neogeo/prot_misc.h index e1525fc44f6..f2b0c1f06d6 100644 --- a/src/devices/bus/neogeo/prot_misc.h +++ b/src/devices/bus/neogeo/prot_misc.h @@ -8,12 +8,15 @@ DECLARE_DEVICE_TYPE(NEOBOOT_PROT, neoboot_prot_device) +#define MCFG_NEOBOOT_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NEOBOOT_PROT, 0) + class neoboot_prot_device : public device_t { public: // construction/destruction - neoboot_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + neoboot_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void cx_decrypt(uint8_t* sprrom, uint32_t sprrom_size); void sx_decrypt(uint8_t* fixed, uint32_t fixed_size, int value); diff --git a/src/devices/bus/neogeo/prot_mslugx.h b/src/devices/bus/neogeo/prot_mslugx.h index 106bce3ad84..91ab71e463d 100644 --- a/src/devices/bus/neogeo/prot_mslugx.h +++ b/src/devices/bus/neogeo/prot_mslugx.h @@ -9,12 +9,15 @@ DECLARE_DEVICE_TYPE(NG_MSLUGX_PROT, mslugx_prot_device) +#define MCFG_MSLUGX_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_MSLUGX_PROT, 0) + class mslugx_prot_device : public device_t { public: // construction/destruction - mslugx_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + mslugx_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_WRITE16_MEMBER( protection_w ); DECLARE_READ16_MEMBER( protection_r ); diff --git a/src/devices/bus/neogeo/prot_pcm2.h b/src/devices/bus/neogeo/prot_pcm2.h index 707e9ab94b4..666b38b4bee 100644 --- a/src/devices/bus/neogeo/prot_pcm2.h +++ b/src/devices/bus/neogeo/prot_pcm2.h @@ -9,12 +9,15 @@ DECLARE_DEVICE_TYPE(NG_PCM2_PROT, pcm2_prot_device) +#define MCFG_PCM2_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_PCM2_PROT, 0) + class pcm2_prot_device : public device_t { public: // construction/destruction - pcm2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + pcm2_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void decrypt(uint8_t* ymrom, uint32_t ymsize, int value); void swap(uint8_t* ymrom, uint32_t ymsize, int value); diff --git a/src/devices/bus/neogeo/prot_pvc.h b/src/devices/bus/neogeo/prot_pvc.h index d2855808331..4f7d73f4020 100644 --- a/src/devices/bus/neogeo/prot_pvc.h +++ b/src/devices/bus/neogeo/prot_pvc.h @@ -8,12 +8,15 @@ DECLARE_DEVICE_TYPE(NG_PVC_PROT, pvc_prot_device) +#define MCFG_PVC_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_PVC_PROT, 0) + class pvc_prot_device : public device_t { public: // construction/destruction - pvc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + pvc_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); void pvc_write_unpack_color(); void pvc_write_pack_color(); diff --git a/src/devices/bus/neogeo/prot_sma.h b/src/devices/bus/neogeo/prot_sma.h index c36af941132..f0ee9733bd0 100644 --- a/src/devices/bus/neogeo/prot_sma.h +++ b/src/devices/bus/neogeo/prot_sma.h @@ -9,12 +9,15 @@ DECLARE_DEVICE_TYPE(NG_SMA_PROT, sma_prot_device) +#define MCFG_SMA_PROT_ADD(_tag) \ + MCFG_DEVICE_ADD(_tag, NG_SMA_PROT, 0) + class sma_prot_device : public device_t { public: // construction/destruction - sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0); + sma_prot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); //DECLARE_WRITE16_MEMBER( kof99_bankswitch_w ); //DECLARE_WRITE16_MEMBER( garou_bankswitch_w ); diff --git a/src/devices/bus/neogeo/pvc.cpp b/src/devices/bus/neogeo/pvc.cpp index 26987ab33dc..bb9d0098159 100644 --- a/src/devices/bus/neogeo/pvc.cpp +++ b/src/devices/bus/neogeo/pvc.cpp @@ -50,12 +50,11 @@ void neogeo_pvc_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_pvc_cart_device::device_add_mconfig(machine_config &config) -{ - NG_CMC_PROT(config, m_cmc_prot); - NG_PCM2_PROT(config, m_pcm2_prot); - NG_PVC_PROT(config, m_pvc_prot); -} +MACHINE_CONFIG_START(neogeo_pvc_cart_device::device_add_mconfig) + MCFG_CMC_PROT_ADD("cmc_prot") + MCFG_PCM2_PROT_ADD("pcm2_prot") + MCFG_PVC_PROT_ADD("pvc_prot") +MACHINE_CONFIG_END /************************************************* diff --git a/src/devices/bus/neogeo/rom.cpp b/src/devices/bus/neogeo/rom.cpp index 0f54a808cef..10c61858386 100644 --- a/src/devices/bus/neogeo/rom.cpp +++ b/src/devices/bus/neogeo/rom.cpp @@ -73,19 +73,17 @@ WRITE16_MEMBER(neogeo_rom_device::banksel_w) DEFINE_DEVICE_TYPE(NEOGEO_VLINER_CART, neogeo_vliner_cart_device, "neocart_vliner", "Neo Geo V-Liner Cart") neogeo_vliner_cart_device::neogeo_vliner_cart_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - neogeo_rom_device(mconfig, NEOGEO_VLINER_CART, tag, owner, clock), - m_nvram(*this, "nvram") + neogeo_rom_device(mconfig, NEOGEO_VLINER_CART, tag, owner, clock) { } + void neogeo_vliner_cart_device::device_start() { - m_cart_ram = make_unique_clear<uint16_t[]>(0x2000/2); - m_nvram->set_base(m_cart_ram.get(), 0x2000); - save_pointer(NAME(m_cart_ram), 0x2000/2); + save_item(NAME(m_cart_ram)); } -void neogeo_vliner_cart_device::device_add_mconfig(machine_config &config) +void neogeo_vliner_cart_device::device_reset() { - NVRAM(config, m_nvram); + memset(m_cart_ram, 0, 0x2000); } diff --git a/src/devices/bus/neogeo/rom.h b/src/devices/bus/neogeo/rom.h index 1f62a890859..17efc4da4a7 100644 --- a/src/devices/bus/neogeo/rom.h +++ b/src/devices/bus/neogeo/rom.h @@ -6,7 +6,6 @@ #pragma once #include "slot.h" -#include "machine/nvram.h" // ======================> neogeo_rom_device @@ -51,13 +50,10 @@ public: protected: virtual void device_start() override; - - virtual void device_add_mconfig(machine_config &config) override; + virtual void device_reset() override; private: - std::unique_ptr<uint16_t[]> m_cart_ram; - - required_device<nvram_device> m_nvram; + uint16_t m_cart_ram[0x1000]; }; DECLARE_DEVICE_TYPE(NEOGEO_VLINER_CART, neogeo_vliner_cart_device) diff --git a/src/devices/bus/neogeo/slot.h b/src/devices/bus/neogeo/slot.h index b5be4c5e901..edeb2452a1d 100644 --- a/src/devices/bus/neogeo/slot.h +++ b/src/devices/bus/neogeo/slot.h @@ -190,15 +190,6 @@ class neogeo_cart_slot_device : public device_t, { public: // construction/destruction - template <typename T> - neogeo_cart_slot_device(machine_config const &mconfig, char const *tag, device_t *owner, T &&opts, char const *dflt) - : neogeo_cart_slot_device(mconfig, tag, owner, (uint16_t)0) - { - option_reset(); - opts(*this); - set_default_option(dflt); - set_fixed(false); - } neogeo_cart_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint16_t clock); virtual ~neogeo_cart_slot_device(); @@ -347,4 +338,15 @@ private: // device type definition DECLARE_DEVICE_TYPE(NEOGEO_CART_SLOT, neogeo_cart_slot_device) + +/*************************************************************************** + DEVICE CONFIGURATION MACROS + ***************************************************************************/ + + +#define MCFG_NEOGEO_CARTRIDGE_ADD(_tag,_slot_intf,_def_slot) \ + MCFG_DEVICE_ADD(_tag, NEOGEO_CART_SLOT, 0) \ + MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, false) + + #endif // MAME_BUS_NEOGEO_SLOT_H diff --git a/src/devices/bus/neogeo/sma.cpp b/src/devices/bus/neogeo/sma.cpp index ee031e4f44f..70b03aa0a28 100644 --- a/src/devices/bus/neogeo/sma.cpp +++ b/src/devices/bus/neogeo/sma.cpp @@ -55,11 +55,10 @@ void neogeo_sma_cart_device::device_reset() mapper specific handlers -------------------------------------------------*/ -void neogeo_sma_cart_device::device_add_mconfig(machine_config &config) -{ - NG_SMA_PROT(config, m_sma_prot); - NG_CMC_PROT(config, m_cmc_prot); -} +MACHINE_CONFIG_START(neogeo_sma_cart_device::device_add_mconfig) + MCFG_SMA_PROT_ADD("sma_prot") + MCFG_CMC_PROT_ADD("cmc_prot") +MACHINE_CONFIG_END /************************************************* |