From 062b2ae8d3ef626d807d3babae8255687c8f0aa0 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 10 Oct 2018 22:15:38 -0400 Subject: [PATCH] Corrects calculation of [NTSC, 192 line] current row. --- Components/9918/9918.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Components/9918/9918.cpp b/Components/9918/9918.cpp index 445b1ff49..77d37d3a1 100644 --- a/Components/9918/9918.cpp +++ b/Components/9918/9918.cpp @@ -523,9 +523,9 @@ void TMS9918::set_register(int address, uint8_t value) { } uint8_t TMS9918::get_current_line() { - int source_row = (column_ < mode_timing_.line_interrupt_position) ? (row_ + mode_timing_.pixel_lines - 1)%mode_timing_.pixel_lines : row_; + int source_row = (column_ < mode_timing_.line_interrupt_position) ? (row_ + mode_timing_.total_lines - 1)%mode_timing_.total_lines : row_; // This assumes NTSC 192-line. TODO: other modes. - if(source_row >= 0xdb) source_row -= 5; + if(source_row >= 0xdb) source_row -= 6; return static_cast(source_row); }