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
This commit is contained in:
Solomon Peachy 2025-03-18 11:02:55 -04:00
parent 1dc8a5a8ce
commit 54c5ef60df

View file

@ -715,6 +715,23 @@ static void mm_errorhandler(void)
quit = true; 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) static int playfile(char* filename)
{ {
int button; int button;
@ -793,11 +810,11 @@ static int playfile(char* filename)
case ACTION_WPS_VOLUP: case ACTION_WPS_VOLUP:
if ( display != DISPLAY_INFO ) if ( display != DISPLAY_INFO )
{ {
if ( textlines-vscroll >= MAX_LINES ) #ifdef HAVE_SCROLLWHEEL
{ do_vscroll(1);
vscroll++; #else
screenupdated = false; do_vscroll(0);
} #endif
break; break;
} }
@ -807,11 +824,11 @@ static int playfile(char* filename)
case ACTION_WPS_VOLDOWN: case ACTION_WPS_VOLDOWN:
if ( display != DISPLAY_INFO ) if ( display != DISPLAY_INFO )
{ {
if ( vscroll > 0 ) #ifdef HAVE_SCROLLWHEEL
{ do_vscroll(0);
vscroll--; #else
screenupdated = false; do_vscroll(1);
} #endif
break; break;
} }