summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/devfind.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-04-04 16:40:41 +1000
committer Vas Crabb <vas@vastheman.com>2023-04-04 16:40:41 +1000
commitb3e50dfa6a2035bda05ac52219968b0887fa8501 (patch)
treed8f38d5785ae1436e0f617a73ac25ac4be3b4467 /src/emu/devfind.h
parentaf05e9456881b8ed9b04b055f812991b5ad6aaeb (diff)
Small fixes and cleanup:
* emu/devfind.h: Allow range-based for loops on memory share finders. * emu/emucore.h: Choose correct emu_fatalerror constructor when format string is an rvalue. * osborne/osborne1.cpp: Allocate main RAM as a flat share, and use a view to switch in atttribute RAM. * Reduced scope of some variables and edited some copy/pasted comments.
Diffstat (limited to 'src/emu/devfind.h')
-rw-r--r--src/emu/devfind.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/emu/devfind.h b/src/emu/devfind.h
index c8884d9582f..6e8b078bc56 100644
--- a/src/emu/devfind.h
+++ b/src/emu/devfind.h
@@ -1186,6 +1186,33 @@ public:
/// been found.
size_t bytes() const { return m_bytes; }
+ /// \brief Get iterator to first element
+ ///
+ /// Returns an iterator to the first element of the memory share.
+ /// \return Iterator to first element.
+ PointerType *begin() const { return this->m_target; }
+
+ /// \brief Get iterator beyond last element
+ ///
+ /// Returns an iterator one past the last element of the memory
+ /// share.
+ /// \return Iterator one past last element.
+ PointerType *end() const { return this->m_target + length(); }
+
+ /// \brief Get constant iterator to first element
+ ///
+ /// Returns a constant iterator to the first element of the memory
+ /// share.
+ /// \return Constant iterator to first element.
+ PointerType const *cbegin() const { return this->m_target; }
+
+ /// \brief Get constant iterator beyond last element
+ ///
+ /// Returns a constant iterator one past the last element of the
+ /// memory share.
+ /// \return Constant iterator one past last element.
+ PointerType const *cend() const { return this->m_target + length(); }
+
private:
/// \brief Find memory share base pointer
///
@@ -1312,6 +1339,34 @@ public:
/// \return Memory share width in bytes.
u8 bytewidth() const { return m_target->bytewidth(); }
+ /// \brief Get iterator to first element
+ ///
+ /// Returns an iterator to the first element of the memory share.
+ /// Must not be called before creation is attempted.
+ /// \return Iterator to first element.
+ PointerType *begin() const { return target(); }
+
+ /// \brief Get iterator beyond last element
+ ///
+ /// Returns an iterator one past the last element of the memory
+ /// share. Must not be called before creation is attempted.
+ /// \return Iterator one past last element.
+ PointerType *end() const { return target() + length(); }
+
+ /// \brief Get constant iterator to first element
+ ///
+ /// Returns a constant iterator to the first element of the memory
+ /// share. Must not be called before creation is attempted.
+ /// \return Constant iterator to first element.
+ PointerType const *cbegin() const { return target(); }
+
+ /// \brief Get constant iterator beyond last element
+ ///
+ /// Returns a constant iterator one past the last element of the
+ /// memory share. Must not be called before creation is attempted.
+ /// \return Constant iterator one past last element.
+ PointerType const *cend() const { return target() + length(); }
+
protected:
virtual bool findit(validity_checker *valid) override;
virtual void end_configuration() override;