From 2d9acebbaafc0e97271b30660fd05a9747a7c463 Mon Sep 17 00:00:00 2001 From: profezzorn Date: Sun, 23 Jun 2024 03:08:54 -0500 Subject: [PATCH] pqoi variable evaluation bugfix --- display/rgb565frame.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/display/rgb565frame.h b/display/rgb565frame.h index 25c9870c6..e115615e1 100644 --- a/display/rgb565frame.h +++ b/display/rgb565frame.h @@ -98,7 +98,14 @@ class PQOILayer : public BufferedFileReader, public LayerControl { } else if (variable == 'R') { p = random(100); } - int N = (label >> 16) - '0' * 10 + (label >> 24) - '0'; + int N = (label >> 16) - '0' * 0x101; + N = (N & 0xFF) * 10 + (N >> 8); + PVLOG_VERBOSE << " VAR=" << ((char)variable ) << " = " << p + << " OP=" << ((char)((label >> 8) & 0xff)) + << " N=" << N + << " N1=" << ((char)((label >> 16) & 0xff)) + << " N2=" << ((char)((label >> 24) & 0xff)) + << "\n"; switch ((label >> 8) & 0xff) { case '<': return p < N; case '>': return p > N; @@ -312,6 +319,7 @@ class PQOILayer : public BufferedFileReader, public LayerControl { // Returns true when done. bool Apply(OutputBuffer* output_buffer, uint16_t* &out) { + SCOPED_PROFILER(); TRACE2(RGB565_DATA, "Apply", TELL()); if (!play_) return true; if (!transparent_) {