summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/bufsprite.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/bufsprite.h')
-rw-r--r--src/devices/video/bufsprite.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/devices/video/bufsprite.h b/src/devices/video/bufsprite.h
index d967b51c4b2..57b6ee0315f 100644
--- a/src/devices/video/bufsprite.h
+++ b/src/devices/video/bufsprite.h
@@ -42,13 +42,14 @@ public:
Type *live() const { return m_spriteram; }
Type *buffer() { return &m_buffered[0]; }
uint32_t bytes() const { return m_spriteram.bytes(); }
+ uint32_t length() const { return bytes() / sizeof(Type); }
// operations
Type *copy(uint32_t srcoffset = 0, uint32_t srclength = 0x7fffffff)
{
assert(m_spriteram != nullptr);
if (m_spriteram != nullptr)
- memcpy(&m_buffered[0], m_spriteram + srcoffset, (std::min<size_t>)(srclength, m_spriteram.bytes() / sizeof(Type) - srcoffset) * sizeof(Type));
+ memcpy(&m_buffered[0], m_spriteram + srcoffset, (std::min<size_t>)(srclength, length() - srcoffset) * sizeof(Type));
return &m_buffered[0];
}
@@ -56,8 +57,8 @@ public:
void write(address_space &space, offs_t offset, Type data, Type mem_mask = ~Type(0)) { copy(); }
// VBLANK handlers
- DECLARE_WRITE_LINE_MEMBER(vblank_copy_rising) { if (state) copy(); }
- DECLARE_WRITE_LINE_MEMBER(vblank_copy_falling) { if (!state) copy(); }
+ void vblank_copy_rising(int state) { if (state) copy(); }
+ void vblank_copy_falling(int state) { if (!state) copy(); }
protected:
// construction
@@ -69,7 +70,7 @@ protected:
uint32_t clock);
// first-time setup
- virtual void device_start() override;
+ virtual void device_start() override ATTR_COLD;
private:
// internal state