summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/epos.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2020-09-27 14:00:42 +1000
committer Vas Crabb <vas@vastheman.com>2020-09-27 14:00:42 +1000
commita1d35e5abf431e03e06d55b96379a3b14753ed4d (patch)
tree506ffe906e707f50eca2306da80b1657644e0507 /src/mame/video/epos.cpp
parentd294948a3bb8c6e8fdbc96841ceae30ec6687870 (diff)
Cleaned up bitmap API.
Made const-qualified pixel accessors (pix, pixt, raw_pixptr) return const-qualified references/pointers to pixesl, and added non-const versions. This makes bitmap more like standard library containers where const protects the content as well as the dimensions. Made the templated pixt accessor protected - having it public makes it too easy to inadvertently get a pointer to the wrong location. Removed the pix(8|16|32|64) accessors from the specific bitmaps. You could only use the "correct" one anyway, and having the "incorrect" ones available prevented explicit instantiations of the class template because the static assertions would fail. You can still see the pixel type in the bitmap class names, and you can't assign the result of &pix(y, x) to the wrong kind of pointer without a cast. Added fill member functions to the specific bitmap template, and added a explicit instantiations. This allows the bitmap size check to be skipped on most bitmap fills, although the clipping check is still there. Also fixed a couple of places that were trying to fill an indexed 16-bit bitmap with rgb_t::black() exposed by this (replaced with zero to get the same net effect). The explicit template instantiations in the .cpp file mean the compiler can inline the function if necessary, but don't need to generate a local out-of-line body if it chooses not to. Extended the size of the fill value parameter in the base bitmap class to 64 bits so it works correctly for 64-bit bitmaps. Fixed places where IE15 and VGM visualiser weren't accounting for row bytes potentially being larger than width. Fixed an off-by-one in an HP-DIO card where it was treating the Topcat cursor right edge as exclusive. Updated everything to work with the API changes, reduced the scope of many variables, added more const, and replaced a few fill/copy loops with stuff from <algorithm>.
Diffstat (limited to 'src/mame/video/epos.cpp')
-rw-r--r--src/mame/video/epos.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mame/video/epos.cpp b/src/mame/video/epos.cpp
index 91a0b77299f..886582a9a3e 100644
--- a/src/mame/video/epos.cpp
+++ b/src/mame/video/epos.cpp
@@ -89,13 +89,13 @@ uint32_t epos_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap,
if (flip_screen())
{
- bitmap.pix32(240 - y, 270 - x + 1) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f));
- bitmap.pix32(240 - y, 270 - x + 0) = m_palette->pen((m_palette_bank << 4) | (data >> 4));
+ bitmap.pix(240 - y, 270 - x + 1) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f));
+ bitmap.pix(240 - y, 270 - x + 0) = m_palette->pen((m_palette_bank << 4) | (data >> 4));
}
else
{
- bitmap.pix32(y, x + 0) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f));
- bitmap.pix32(y, x + 1) = m_palette->pen((m_palette_bank << 4) | (data >> 4));
+ bitmap.pix(y, x + 0) = m_palette->pen((m_palette_bank << 4) | (data & 0x0f));
+ bitmap.pix(y, x + 1) = m_palette->pen((m_palette_bank << 4) | (data >> 4));
}
}