upd7220: correct hsync width and invert the vsync wait time.

This commit is contained in:
cracyc 2024-11-28 19:28:28 -06:00
parent ca1cc36f91
commit f7b3108465

View File

@ -351,7 +351,7 @@ inline void upd7220_device::update_vsync_timer(int state)
// page 6-68, route vsync so that top is start of back porch, end is at sync time
// (at bottom of MAME vpos() mechanism)
// - pc9801:lemmings and pc9801:spindiz2 cares
int next_y = state ? (m_vbp + m_al + m_vfp) * vert_mult : 0;
int next_y = state ? 0 : (m_vbp + m_al + m_vfp) * vert_mult;
attotime duration = screen().time_until_pos(next_y, 0);
@ -365,10 +365,11 @@ inline void upd7220_device::update_vsync_timer(int state)
inline void upd7220_device::update_hsync_timer(int state)
{
const int horiz_mult = (m_mode & UPD7220_MODE_DISPLAY_MASK) == UPD7220_MODE_DISPLAY_GRAPHICS ? 16 : 8;
int y = screen().vpos();
int next_x = state ? m_hs : 0;
int next_y = state ? y : ((y + 1) % m_al);
int next_x = state ? m_hs * horiz_mult : 0;
int next_y = state ? y : ((y + 1) % (m_vs + m_vbp + m_al + m_vfp - 1));
attotime duration = screen().time_until_pos(next_y, next_x);