Skip to content

Commit 4ea1185

Browse files
committed
Fix error with active line
1 parent 576bb6b commit 4ea1185

2 files changed

Lines changed: 3 additions & 7 deletions

File tree

src/huc6270.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,6 @@ void HuC6270::WriteRegister(u16 address, u8 value)
304304
void HuC6270::EndOfLine()
305305
{
306306
m_hpos = 0;
307-
m_line_buffer_index = 0;
308307
m_vpos++;
309308

310309
if (m_vpos == m_huc6260->GetTotalLines())
@@ -313,8 +312,7 @@ void HuC6270::EndOfLine()
313312
m_burst_mode = ((m_latched_cr & 0x00C0) == 0);
314313
}
315314

316-
//m_active_line = (m_raster_line < HUC6270_LINES_ACTIVE);
317-
m_active_line = ((m_vpos >= 14) && (m_vpos < 256));
315+
m_active_line = (m_v_state == HuC6270_VERTICAL_STATE_VDW) && (m_vpos >= 14) && (m_vpos < 256);
318316
}
319317

320318
void HuC6270::LineEvents()
@@ -520,6 +518,7 @@ void HuC6270::NextHorizontalState()
520518
case HuC6270_HORIZONTAL_STATE_HDS:
521519
HUC6270_DEBUG(" HDS start\t");
522520
m_clocks_to_next_h_state = (m_latched_hds + 1) << 3;
521+
m_line_buffer_index = 0;
523522
break;
524523
case HuC6270_HORIZONTAL_STATE_HDW:
525524
HUC6270_DEBUG(" HDW start\t");

src/huc6270_inline.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ INLINE u32 HuC6270::Clock()
3333

3434
u32 pixel = 0x10000;
3535

36-
//bool active_line = ((m_vpos >= 14) && (m_vpos < 256));
37-
38-
if (m_active_line && (m_v_state == HuC6270_VERTICAL_STATE_VDW) && (m_h_state == HuC6270_HORIZONTAL_STATE_HDW))
39-
//if (active_line && (m_v_state == HuC6270_VERTICAL_STATE_VDW) && (m_h_state == HuC6270_HORIZONTAL_STATE_HDW))
36+
if (m_active_line && (m_h_state == HuC6270_HORIZONTAL_STATE_HDW))
4037
{
4138
if (m_line_buffer_index < 512)
4239
{

0 commit comments

Comments
 (0)