From bb2e57ba2cb2a5467e1ec343abff6f6bc12671b9 Mon Sep 17 00:00:00 2001 From: AJR Date: Sat, 18 Mar 2017 23:22:37 -0400 Subject: [PATCH] amusco.cpp: Generate blink state in a way more likely to represent hardware; remove kludged-in MC6845 accessor (nw) --- src/devices/video/mc6845.cpp | 6 ------ src/devices/video/mc6845.h | 1 - src/mame/drivers/amusco.cpp | 13 ++++++++++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index add19de1f2b..9adfe40ca59 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -443,12 +443,6 @@ READ_LINE_MEMBER( mc6845_device::cursor_r ) } -READ_LINE_MEMBER( mc6845_device::cursor_state_r ) -{ - return m_cursor_state; -} - - READ_LINE_MEMBER( mc6845_device::hsync_r ) { return m_hsync; diff --git a/src/devices/video/mc6845.h b/src/devices/video/mc6845.h index 52fbad4711a..e9f25ab354a 100644 --- a/src/devices/video/mc6845.h +++ b/src/devices/video/mc6845.h @@ -140,7 +140,6 @@ public: // read cursor line state DECLARE_READ_LINE_MEMBER( cursor_r ); - DECLARE_READ_LINE_MEMBER( cursor_state_r ); // read horizontal sync line state DECLARE_READ_LINE_MEMBER( hsync_r ); diff --git a/src/mame/drivers/amusco.cpp b/src/mame/drivers/amusco.cpp index 0204669d39e..ac67cb8cb7b 100644 --- a/src/mame/drivers/amusco.cpp +++ b/src/mame/drivers/amusco.cpp @@ -142,6 +142,7 @@ public: required_device m_hopper; uint8_t m_mc6845_address; uint16_t m_video_update_address; + bool m_blink_state; }; @@ -160,8 +161,7 @@ TILE_GET_INFO_MEMBER(amusco_state::get_bg_tile_info) int code = m_videoram[tile_index * 2] | (m_videoram[tile_index * 2 + 1] << 8); int color = (code & 0x7000) >> 12; - // 6845 cursor is only used for its blink state - if (BIT(code, 15) && !m_crtc->cursor_state_r()) + if (BIT(code, 15) && !m_blink_state) code = 0; SET_TILE_INFO_MEMBER( @@ -175,6 +175,7 @@ TILE_GET_INFO_MEMBER(amusco_state::get_bg_tile_info) void amusco_state::video_start() { m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(amusco_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 10, 74, 24); + m_blink_state = false; } void amusco_state::machine_start() @@ -453,8 +454,14 @@ MC6845_ON_UPDATE_ADDR_CHANGED(amusco_state::crtc_addr) MC6845_UPDATE_ROW(amusco_state::update_row) { + // Latch blink state at start of first line, where cursor is always positioned + if (y == 0 && ma == 0 && m_blink_state != (cursor_x == 0)) + { + m_blink_state = (cursor_x == 0); + m_bg_tilemap->mark_all_dirty(); + } + const rectangle rowrect(0, 8 * x_count - 1, y, y); - m_bg_tilemap->mark_all_dirty(); m_bg_tilemap->draw(*m_screen, bitmap, rowrect, 0, 0); }