From 0aae1bd1eff10663646f9e1fa69a410db3898f73 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 10 Dec 2016 21:35:41 -0500 Subject: [PATCH] Fixed calculation of termination cycle. --- Machines/Electron/Video.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Machines/Electron/Video.cpp b/Machines/Electron/Video.cpp index df1b87223..cddca159a 100644 --- a/Machines/Electron/Video.cpp +++ b/Machines/Electron/Video.cpp @@ -31,7 +31,8 @@ namespace { VideoOutput::VideoOutput(uint8_t *memory) : ram_(memory), - current_pixel_line_(-1) + current_pixel_line_(-1), + output_position_(0) { memset(palette_, 0xf, sizeof(palette_)); @@ -318,7 +319,7 @@ void VideoOutput::run_for_cycles(int number_of_cycles) // determine how far we're going from left to right unsigned int this_cycle = output_position_&127; - unsigned int final_cycle = output_position_&127; + unsigned int final_cycle = final_position&127; if(final_line > line) { final_cycle = 128;