diff options
Diffstat (limited to 'src/mame/video/truco.cpp')
-rw-r--r-- | src/mame/video/truco.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/src/mame/video/truco.cpp b/src/mame/video/truco.cpp index bc1f936356b..986a4d29b04 100644 --- a/src/mame/video/truco.cpp +++ b/src/mame/video/truco.cpp @@ -11,19 +11,18 @@ #include "emu.h" #include "includes/truco.h" -PALETTE_INIT_MEMBER(truco_state, truco) +void truco_state::truco_palette(palette_device &palette) const { - int i; - - for (i = 0;i < palette.entries();i++) + for (int i = 0; i < palette.entries(); i++) { - int r = ( i & 0x8 ) ? 0xff : 0x00; - int g = ( i & 0x4 ) ? 0xff : 0x00; - int b = ( i & 0x2 ) ? 0xff : 0x00; + int r = (i & 0x8) ? 0xff : 0x00; + int g = (i & 0x4) ? 0xff : 0x00; + int b = (i & 0x2) ? 0xff : 0x00; - int dim = ( i & 0x1 ); + int const dim = (i & 0x1); - if ( dim ) { + if (dim) + { r >>= 1; g >>= 1; b >>= 1; @@ -35,25 +34,18 @@ PALETTE_INIT_MEMBER(truco_state, truco) uint32_t truco_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *videoram = m_videoram; - uint8_t *vid = videoram; - int x, y; + uint8_t const *videoram = m_videoram; - for( y = 0; y < 192; y++ ) + for (int y = 0; y < 192; y++) { - for( x = 0; x < 256; x++ ) + for (int x = 0; x < 256; x++) { - int pixel; - - if ( x & 1 ) - pixel = vid[x>>1] & 0x0f; - else - pixel = ( vid[x>>1] >> 4 ) & 0x0f; + int const pixel = (videoram[x >> 1] >> ((x & 1) ? 0 : 4)) & 0x0f; bitmap.pix16(y, x) = pixel; } - vid += 0x80; + videoram += 0x80; } return 0; } |