From 3db26d3fb0fe9eecb6c4f2c6829406f14a2d8cde Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sat, 8 Jan 2022 04:30:15 -0500 Subject: [PATCH] Logic fix for Qt TAS piano roll ensure line is visible. --- src/drivers/Qt/TasEditor/TasEditorWindow.cpp | 11 ++++++++++- src/drivers/Qt/fceuWrapper.cpp | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp index 97818590..b6ee48fc 100644 --- a/src/drivers/Qt/TasEditor/TasEditorWindow.cpp +++ b/src/drivers/Qt/TasEditor/TasEditorWindow.cpp @@ -4505,9 +4505,18 @@ void QPianoRoll::ensureTheLineIsVisible( int lineNum ) { if ( !lineIsVisible( lineNum ) ) { + //int lineEnd = lineOffset + viewLines - 2; //printf("Seeking Frame %i\n", lineNum ); - lineOffset = lineNum; + if ( lineNum < lineOffset ) + { + lineOffset = lineNum; + } + else + { + //printf("Seeking View Frame %i\n", lineNum ); + lineOffset = lineOffset - viewLines + 2; + } if ( lineOffset < 0 ) { diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index 83953074..a30046bb 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -1188,9 +1188,9 @@ FCEUD_Update(uint8 *XBuf, static void DoFun(int frameskip, int periodic_saves) { - uint8 *gfx; - int32 *sound; - int32 ssize; + uint8 *gfx = 0; + int32 *sound = 0; + int32 ssize = 0; static int fskipc = 0; //static int opause = 0;