From 54c5ef60df14935efaa2900207130cfc1f3ceae7 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 18 Mar 2025 11:02:55 -0400 Subject: [PATCH] mikmod: Decouple the info scrolling from volume setting This way volume setting will always follow UP/DN conventions but scrolling is reversed as needed. Change-Id: I3fc72c29d78fab46bdf19947a88c02e039bfad51 --- apps/plugins/mikmod/mikmod.c | 37 ++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/apps/plugins/mikmod/mikmod.c b/apps/plugins/mikmod/mikmod.c index 99d5aca148..d80a69a8a6 100644 --- a/apps/plugins/mikmod/mikmod.c +++ b/apps/plugins/mikmod/mikmod.c @@ -715,6 +715,23 @@ static void mm_errorhandler(void) quit = true; } +static void do_vscroll(int up) +{ + if (up) { + if ( textlines-vscroll >= MAX_LINES ) + { + vscroll++; + screenupdated = false; + } + } else { + if ( vscroll > 0 ) + { + vscroll--; + screenupdated = false; + } + } +} + static int playfile(char* filename) { int button; @@ -793,11 +810,11 @@ static int playfile(char* filename) case ACTION_WPS_VOLUP: if ( display != DISPLAY_INFO ) { - if ( textlines-vscroll >= MAX_LINES ) - { - vscroll++; - screenupdated = false; - } +#ifdef HAVE_SCROLLWHEEL + do_vscroll(1); +#else + do_vscroll(0); +#endif break; } @@ -807,11 +824,11 @@ static int playfile(char* filename) case ACTION_WPS_VOLDOWN: if ( display != DISPLAY_INFO ) { - if ( vscroll > 0 ) - { - vscroll--; - screenupdated = false; - } +#ifdef HAVE_SCROLLWHEEL + do_vscroll(0); +#else + do_vscroll(1); +#endif break; }