amusco.cpp: Generate blink state in a way more likely to represent hardware; remove kludged-in MC6845 accessor (nw)
This commit is contained in:
parent
5322568267
commit
bb2e57ba2c
@ -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 )
|
READ_LINE_MEMBER( mc6845_device::hsync_r )
|
||||||
{
|
{
|
||||||
return m_hsync;
|
return m_hsync;
|
||||||
|
@ -140,7 +140,6 @@ public:
|
|||||||
|
|
||||||
// read cursor line state
|
// read cursor line state
|
||||||
DECLARE_READ_LINE_MEMBER( cursor_r );
|
DECLARE_READ_LINE_MEMBER( cursor_r );
|
||||||
DECLARE_READ_LINE_MEMBER( cursor_state_r );
|
|
||||||
|
|
||||||
// read horizontal sync line state
|
// read horizontal sync line state
|
||||||
DECLARE_READ_LINE_MEMBER( hsync_r );
|
DECLARE_READ_LINE_MEMBER( hsync_r );
|
||||||
|
@ -142,6 +142,7 @@ public:
|
|||||||
required_device<ticket_dispenser_device> m_hopper;
|
required_device<ticket_dispenser_device> m_hopper;
|
||||||
uint8_t m_mc6845_address;
|
uint8_t m_mc6845_address;
|
||||||
uint16_t m_video_update_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 code = m_videoram[tile_index * 2] | (m_videoram[tile_index * 2 + 1] << 8);
|
||||||
int color = (code & 0x7000) >> 12;
|
int color = (code & 0x7000) >> 12;
|
||||||
|
|
||||||
// 6845 cursor is only used for its blink state
|
if (BIT(code, 15) && !m_blink_state)
|
||||||
if (BIT(code, 15) && !m_crtc->cursor_state_r())
|
|
||||||
code = 0;
|
code = 0;
|
||||||
|
|
||||||
SET_TILE_INFO_MEMBER(
|
SET_TILE_INFO_MEMBER(
|
||||||
@ -175,6 +175,7 @@ TILE_GET_INFO_MEMBER(amusco_state::get_bg_tile_info)
|
|||||||
void amusco_state::video_start()
|
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_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()
|
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)
|
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);
|
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);
|
m_bg_tilemap->draw(*m_screen, bitmap, rowrect, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user