diff options
author | Vas Crabb <vas@vastheman.com> | 2016-08-25 21:34:42 +1000 |
---|---|---|
committer | Vas Crabb <vas@vastheman.com> | 2016-08-25 21:34:42 +1000 |
commit | 1c98b515c5a10728d3d679ac7215440e55158f38 (patch) | |
tree | 0083c3d073488fa7d40e14c7fb4624bb19bff41a /src/mame/machine/fd1094.cpp | |
parent | cf8060d762ffddd8dbb923e5db9d2e6f7eed49e0 (diff) |
* Doxyfy a significant chunk of devfind.h
* Eliminate a lot of boilerplate code from devfind.h
* Keep instantiation of templates in one place to improve build time
* Remove some dangerous accessors
Diffstat (limited to 'src/mame/machine/fd1094.cpp')
-rw-r--r-- | src/mame/machine/fd1094.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/mame/machine/fd1094.cpp b/src/mame/machine/fd1094.cpp index 4a37174d306..aed3905fcf5 100644 --- a/src/mame/machine/fd1094.cpp +++ b/src/mame/machine/fd1094.cpp @@ -553,13 +553,14 @@ UINT16 *fd1094_decryption_cache::decrypted_opcodes(UINT8 state) fd1094_device::fd1094_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : m68000_device(mconfig, tag, owner, clock, "fd1094", __FILE__), - m_decrypted_opcodes_bank(*this, "^fd1094_decrypted_opcodes"), - m_state(0x00), - m_irqmode(false), - m_cache(*this), - m_srcbase(*this, DEVICE_SELF), - m_key(*this, "key") + : m68000_device(mconfig, tag, owner, clock, "fd1094", __FILE__) + , m_decrypted_opcodes_bank(*this, "^fd1094_decrypted_opcodes") + , m_state(0x00) + , m_irqmode(false) + , m_cache(*this) + , m_srcbase(nullptr) + , m_rom(*this, DEVICE_SELF) + , m_key(*this, "key") { // override the name after the m68000 initializes m_name.assign("FD1094"); @@ -633,18 +634,22 @@ void fd1094_device::change_state(int newstate) void fd1094_device::device_start() { + m_srcbase = m_rom; + UINT32 size = m_rom.bytes(); + // if no ROM region, see if there's a memory share with our name - if (!m_srcbase.found()) + if (!m_rom.found()) { - memory_share *share = memshare(DEVICE_SELF); - if (share != nullptr) - m_srcbase.set_target(reinterpret_cast<UINT16 *>(share->ptr()), share->bytes() / 2); - else + memory_share *const share = memshare(DEVICE_SELF); + if (!share) throw emu_fatalerror("FD1094 found no data to decrypt!"); + + m_srcbase = reinterpret_cast<UINT16 *>(share->ptr()); + size = share->bytes(); } // determine length and configure our cache - m_cache.configure(0x000000, m_srcbase.bytes(), 0x000000); + m_cache.configure(0x000000, size, 0x000000); change_state(STATE_RESET); // start the base device |