From b7f12265ab5e296e03fd2ac04bd7ae9f9fc1ee66 Mon Sep 17 00:00:00 2001 From: hap Date: Sat, 22 Aug 2020 19:03:28 +0200 Subject: [PATCH] i8244: reduce partial screen update calls --- src/devices/video/i8244.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/devices/video/i8244.cpp b/src/devices/video/i8244.cpp index f2aaa56be48..6721f43ed2d 100644 --- a/src/devices/video/i8244.cpp +++ b/src/devices/video/i8244.cpp @@ -369,7 +369,7 @@ void i8244_device::write(offs_t offset, uint8_t data) return; // update screen before accessing video registers - if (offset < 0xa4 || offset >= 0xc0) + if (offset >= 0x80 && offset < 0xa4) screen().update_now(); // color registers d4-d7 are not connected @@ -518,13 +518,13 @@ uint32_t i8244_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap int w = ( m_vdc.s.control & 0x80 ) ? width : 2; /* Draw horizontal part of the grid */ - for ( int j = 1, y = 0; y < 9; y++, j <<= 1 ) + for ( int y = 0; y < 9; y++ ) { if ( y_grid_offset + y * height <= scanline && scanline < y_grid_offset + y * height + 3 ) { for ( int i = 0; i < 9; i++ ) { - if ( ( m_vdc.s.hgrid[0][i] & j ) || ( m_vdc.s.hgrid[1][i] & ( j >> 8 ) ) ) + if ( BIT(m_vdc.s.hgrid[1][i] << 8 | m_vdc.s.hgrid[0][i], y) ) { for ( int k = 0; k < width + 2; k++ ) {