summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2017-03-03 14:14:00 +0100
committer Olivier Galibert <galibert@pobox.com>2017-03-03 14:14:00 +0100
commit694b8be9ec3c8b317daeed7e8689683707e5595a (patch)
treef868d34194deb57274114c5ff25fea27176b9d9e
parent446108bfe9fd10abe5484b77d70229a4c89cb670 (diff)
segacrp2_device: Device cleanup [O. Galibert]
-rw-r--r--src/mame/machine/segacrp2_device.cpp25
-rw-r--r--src/mame/machine/segacrp2_device.h3
2 files changed, 13 insertions, 15 deletions
diff --git a/src/mame/machine/segacrp2_device.cpp b/src/mame/machine/segacrp2_device.cpp
index be21a1919ef..63b0dd4b8a5 100644
--- a/src/mame/machine/segacrp2_device.cpp
+++ b/src/mame/machine/segacrp2_device.cpp
@@ -84,9 +84,6 @@ static void decode(uint8_t *rom, uint8_t *decrypted,
}
}
-
-const device_type SEGACRP2_Z80 = device_creator<segacrp2_z80_device>;
-
const device_type SEGA_315_5179 = device_creator<sega_315_5179_device>;
const device_type SEGA_315_5178 = device_creator<sega_315_5178_device>;
const device_type SEGA_315_5177 = device_creator<sega_315_5177_device>; // also seen as 317-5000
@@ -100,7 +97,7 @@ const device_type SEGA_317_0007 = device_creator<sega_317_0007_device>;
-segacrp2_z80_device::segacrp2_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : z80_device(mconfig, SEGACRP2_Z80, "Z80 SegaCrypt2", tag, owner, clock, "z80_sega2", __FILE__) {}
+segacrp2_z80_device::segacrp2_z80_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) : z80_device(mconfig, type, name, tag, owner, clock, shortname, __FILE__) {}
void segacrp2_z80_device::device_start() { z80_device::device_start(); decrypt(); }
void segacrp2_z80_device::device_reset() { z80_device::device_reset(); }
void segacrp2_z80_device::decrypt() { }
@@ -112,7 +109,8 @@ void segacrp2_z80_device::set_decrypted_tag(device_t &device, const char* decryp
}
-sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_315_5177_device::sega_315_5177_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5177, "Sega 315-5177", tag, owner, clock, "sega_315_5177", __FILE__) {}
+
void sega_315_5177_device::decrypt()
{
// 315-5177
@@ -169,7 +167,8 @@ void sega_315_5177_device::decrypt()
}
-sega_315_5176_device::sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_315_5176_device::sega_315_5176_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5176, "Sega 315-5176", tag, owner, clock, "sega_315_5176", __FILE__) {}
+
void sega_315_5176_device::decrypt()
{
// 315-5176
@@ -177,7 +176,7 @@ void sega_315_5176_device::decrypt()
}
-sega_315_5162_device::sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_315_5162_device::sega_315_5162_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5162, "Sega 315-5162", tag, owner, clock, "sega_315_5162", __FILE__) {}
void sega_315_5162_device::decrypt()
{
// 315-5162
@@ -213,7 +212,7 @@ void sega_315_5162_device::decrypt()
-sega_315_5178_device::sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_315_5178_device::sega_315_5178_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5178, "Sega 315-5178", tag, owner, clock, "sega_315_5178", __FILE__) {}
void sega_315_5178_device::decrypt()
{ // 315-5178
static const uint8_t xor_table[128] =
@@ -261,7 +260,7 @@ void sega_315_5178_device::decrypt()
-sega_315_5179_device::sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_315_5179_device::sega_315_5179_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_315_5179, "Sega 315-5179", tag, owner, clock, "sega_315_5179", __FILE__) {}
void sega_315_5179_device::decrypt()
{ // 315-5179
static const uint8_t xor_table[128] =
@@ -343,7 +342,7 @@ void _sega_decode_317(uint8_t *rom, uint8_t *decrypted, int shift)
}
-sega_317_0004_device::sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_317_0004_device::sega_317_0004_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0004, "Sega 317-0004", tag, owner, clock, "sega_317_0004", __FILE__) {}
void sega_317_0004_device::decrypt()
{ // 317-0004
_sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 0);
@@ -351,20 +350,20 @@ void sega_317_0004_device::decrypt()
-sega_317_0005_device::sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_317_0005_device::sega_317_0005_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0005, "Sega 317-0005", tag, owner, clock, "sega_317_0005", __FILE__) {}
void sega_317_0005_device::decrypt()
{ // 317-0005
_sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 1);
}
-sega_317_0006_device::sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_317_0006_device::sega_317_0006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0006, "Sega 317-0006", tag, owner, clock, "sega_317_0006", __FILE__) {}
void sega_317_0006_device::decrypt()
{ // 317-0006
_sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 2);
}
-sega_317_0007_device::sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, tag, owner, clock) {}
+sega_317_0007_device::sega_317_0007_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : segacrp2_z80_device(mconfig, SEGA_317_0007, "Sega 317-0007", tag, owner, clock, "sega_317_0007", __FILE__) {}
void sega_317_0007_device::decrypt()
{ // 317-0006
_sega_decode_317(memregion(tag())->base(), (uint8_t*)memshare(m_decrypted_tag)->ptr(), 3);
diff --git a/src/mame/machine/segacrp2_device.h b/src/mame/machine/segacrp2_device.h
index ddbe1cfb8d5..37fbf2fc606 100644
--- a/src/mame/machine/segacrp2_device.h
+++ b/src/mame/machine/segacrp2_device.h
@@ -16,7 +16,7 @@
class segacrp2_z80_device : public z80_device
{
public:
- segacrp2_z80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t);
+ segacrp2_z80_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);
static void set_decrypted_tag(device_t &device, const char* decrypted_tag);
const char* m_decrypted_tag;
@@ -105,7 +105,6 @@ protected:
};
-extern const device_type SEGACRP2_Z80;
extern const device_type SEGA_315_5179;
extern const device_type SEGA_315_5178;
extern const device_type SEGA_315_5177;