diff options
Diffstat (limited to 'src/devices/video/mc6845.cpp')
-rw-r--r-- | src/devices/video/mc6845.cpp | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/src/devices/video/mc6845.cpp b/src/devices/video/mc6845.cpp index 13c1c8a6155..82ec8408130 100644 --- a/src/devices/video/mc6845.cpp +++ b/src/devices/video/mc6845.cpp @@ -129,13 +129,13 @@ void mc6845_device::call_on_update_address(int strobe) } -void mc6845_device::write_address(uint8_t data) +void mc6845_device::address_w(uint8_t data) { m_register_address_latch = data & 0x1f; } -uint8_t mc6845_device::read_status() +uint8_t mc6845_device::status_r() { uint8_t ret = 0; @@ -178,7 +178,7 @@ void mc6845_device::transparent_update() } -uint8_t mc6845_device::read_register() +uint8_t mc6845_device::register_r() { uint8_t ret = 0; @@ -200,7 +200,7 @@ uint8_t mc6845_device::read_register() } -void mc6845_device::write_register(uint8_t data) +void mc6845_device::register_w(uint8_t data) { LOG("%s:M6845 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data); @@ -253,13 +253,13 @@ void mc6845_device::write_register(uint8_t data) } -WRITE8_MEMBER( mos8563_device::address_w ) +void mos8563_device::address_w(uint8_t data) { m_register_address_latch = data & 0x3f; } -READ8_MEMBER( mos8563_device::status_r ) +uint8_t mos8563_device::status_r() { uint8_t ret = m_revision; @@ -279,7 +279,7 @@ READ8_MEMBER( mos8563_device::status_r ) } -READ8_MEMBER( mos8563_device::register_r ) +uint8_t mos8563_device::register_r() { uint8_t ret = 0xff; @@ -329,7 +329,7 @@ READ8_MEMBER( mos8563_device::register_r ) } -WRITE8_MEMBER( mos8563_device::register_w ) +void mos8563_device::register_w(uint8_t data) { LOG("%s:MOS8563 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data); @@ -392,13 +392,13 @@ WRITE8_MEMBER( mos8563_device::register_w ) recompute_parameters(false); } -WRITE8_MEMBER( hd6345_device::address_w ) +void hd6345_device::address_w(uint8_t data) { m_register_address_latch = data & 0x3f; } -READ8_MEMBER( hd6345_device::register_r ) +uint8_t hd6345_device::register_r() { uint8_t ret = 0xff; @@ -416,7 +416,7 @@ READ8_MEMBER( hd6345_device::register_r ) return ret; } -WRITE8_MEMBER( hd6345_device::register_w ) +void hd6345_device::register_w(uint8_t data) { LOG("%s:HD6345 reg 0x%02x = 0x%02x\n", machine().describe_context(), m_register_address_latch, data); @@ -582,7 +582,7 @@ void mc6845_device::recompute_parameters(bool postload) m_hsync_off_pos = hsync_off_pos; m_vsync_on_pos = vsync_on_pos; m_vsync_off_pos = vsync_off_pos; - if (!postload) // set m_line_counter to 0 on normal operation, but not on postload + if ( (!m_reconfigure_cb.isnull()) && (!postload) ) m_line_counter = 0; } } @@ -659,6 +659,28 @@ void mc6845_device::update_upd_adr_timer() } +bool mc6845_device::match_line() +{ + /* Check if we've reached the end of active display */ + if ( m_line_counter == m_vert_disp ) + { + m_line_enable_ff = false; + m_current_disp_addr = m_disp_start_addr; + } + + /* Check if VSYNC should be enabled */ + if ( m_line_counter == m_vert_sync_pos ) + { + m_vsync_width_counter = 0; + m_vsync_ff = 1; + + return true; + } + + return false; +} + + void mc6845_device::handle_line_timer() { bool new_vsync = m_vsync; @@ -698,21 +720,8 @@ void mc6845_device::handle_line_timer() m_line_counter = ( m_line_counter + 1 ) & 0x7F; m_line_address = ( m_line_address + m_horiz_disp ) & 0x3fff; - /* Check if we've reached the end of active display */ - if ( m_line_counter == m_vert_disp ) - { - m_line_enable_ff = false; - m_current_disp_addr = m_disp_start_addr; - } - - /* Check if VSYNC should be enabled */ - if ( m_line_counter == m_vert_sync_pos ) - { - m_vsync_width_counter = 0; - m_vsync_ff = 1; - + if (match_line()) new_vsync = true; - } } else { @@ -731,6 +740,13 @@ void mc6845_device::handle_line_timer() m_line_counter = 0; m_line_address = m_disp_start_addr; m_line_enable_ff = true; + + if (m_supports_vert_sync_width) + { + if (match_line()) + new_vsync = true; + } + /* also update the cursor state now */ update_cursor_state(); @@ -1438,7 +1454,8 @@ device_memory_interface::space_config_vector mos8563_device::memory_space_config // default address maps void mos8563_device::mos8563_videoram_map(address_map &map) { - map(0x0000, 0xffff).ram(); + if (!has_configured_map(0)) + map(0x0000, 0xffff).ram(); } @@ -1505,7 +1522,7 @@ mos8563_device::mos8563_device(const machine_config &mconfig, device_type type, : mc6845_device(mconfig, type, tag, owner, clock), device_memory_interface(mconfig, *this), device_palette_interface(mconfig, *this), - m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(), address_map_constructor(FUNC(mos8563_device::mos8563_videoram_map), this)) + m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 16, 0, address_map_constructor(FUNC(mos8563_device::mos8563_videoram_map), this)) { set_clock_scale(1.0/8); } |