diff options
author | AJR <ajrhacker@users.noreply.github.com> | 2021-01-15 13:03:38 -0500 |
---|---|---|
committer | AJR <ajrhacker@users.noreply.github.com> | 2021-01-15 13:03:38 -0500 |
commit | 8ebaec9f823577aae8772f4fa6d3a89407e368db (patch) | |
tree | 7a618ca47ef48e6679606ddce955480d5a49af4b | |
parent | 315f0466771723905cc8717fbc09f134f24f3eb0 (diff) |
c64/dela_ep256: Use required_device_array
-rw-r--r-- | src/devices/bus/c64/dela_ep256.cpp | 19 | ||||
-rw-r--r-- | src/devices/bus/c64/dela_ep256.h | 2 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/devices/bus/c64/dela_ep256.cpp b/src/devices/bus/c64/dela_ep256.cpp index 8642d7c5f55..d5052f914b2 100644 --- a/src/devices/bus/c64/dela_ep256.cpp +++ b/src/devices/bus/c64/dela_ep256.cpp @@ -24,14 +24,8 @@ DEFINE_DEVICE_TYPE(C64_DELA_EP256, c64_dela_ep256_cartridge_device, "c64_dela_ep void c64_dela_ep256_cartridge_device::device_add_mconfig(machine_config &config) { - GENERIC_SOCKET(config, "rom1", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom2", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom3", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom4", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom5", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom6", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom7", generic_linear_slot, nullptr, "bin,rom"); - GENERIC_SOCKET(config, "rom8", generic_linear_slot, nullptr, "bin,rom"); + for (auto &rom : m_eproms) + GENERIC_SOCKET(config, rom, generic_linear_slot, nullptr, "bin,rom"); } @@ -46,14 +40,9 @@ void c64_dela_ep256_cartridge_device::device_add_mconfig(machine_config &config) c64_dela_ep256_cartridge_device::c64_dela_ep256_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, C64_DELA_EP256, tag, owner, clock), - device_c64_expansion_card_interface(mconfig, *this) + device_c64_expansion_card_interface(mconfig, *this), + m_eproms(*this, "rom%u", 1U) { - for (int i = 0; i < 8; i++) - { - char str[6]; - sprintf(str, "rom%i", i + 1); - m_eproms[i] = subdevice<generic_slot_device>(str); - } } diff --git a/src/devices/bus/c64/dela_ep256.h b/src/devices/bus/c64/dela_ep256.h index 61501df0790..bb6806f4d8e 100644 --- a/src/devices/bus/c64/dela_ep256.h +++ b/src/devices/bus/c64/dela_ep256.h @@ -44,7 +44,7 @@ protected: virtual void c64_cd_w(offs_t offset, uint8_t data, int sphi2, int ba, int roml, int romh, int io1, int io2) override; private: - generic_slot_device *m_eproms[8]; + required_device_array<generic_slot_device, 8> m_eproms; uint8_t m_bank, m_socket; int m_reset; |