+ /* move cursor instead of scrolling when already at start/end of list */
+ if (dy == -1 * SCROLL_LINE && first_entry == 0)
+ dy = -1;
+ else if (dy == +1 * SCROLL_LINE &&
+ first_entry + num_page_entries == max_info_info)
+ dy = 1;
+
+ /* handle scrolling screen one line or page */
+ if (y + dy < 0 ||
+ y + dy > num_page_entries - 1)
+ {
+ boolean redraw = FALSE;
+
+ if (ABS(dy) == SCROLL_PAGE)
+ step = num_page_entries - 1;
+
+ if (dy < 0 && first_entry > 0)
+ {
+ /* scroll page/line up */
+
+ first_entry -= step;
+ if (first_entry < 0)
+ first_entry = 0;
+
+ redraw = TRUE;
+ }
+ else if (dy > 0 && first_entry + num_page_entries < max_info_info)
+ {
+ /* scroll page/line down */
+
+ first_entry += step;
+ if (first_entry + num_page_entries > max_info_info)
+ first_entry = MAX(0, max_info_info - num_page_entries);
+
+ redraw = TRUE;
+ }
+
+ if (redraw)
+ {
+ choice += first_entry - first_entry_store[info_mode];
+
+ if (choice < first_entry)
+ {
+ choice = first_entry;
+
+ if (info_info[choice].type & TYPE_SKIP_ENTRY)
+ choice++;
+ }
+ else if (choice > first_entry + num_page_entries - 1)
+ {
+ choice = first_entry + num_page_entries - 1;
+
+ if (info_info[choice].type & TYPE_SKIP_ENTRY)
+ choice--;
+ }
+ else if (info_info[choice].type & TYPE_SKIP_ENTRY)
+ {
+ choice += SIGN(dy);
+
+ if (choice < first_entry ||
+ choice > first_entry + num_page_entries - 1)
+ first_entry += SIGN(dy);
+ }
+
+ first_entry_store[info_mode] = first_entry;
+ choice_store[info_mode] = choice;
+
+ drawInfoInfoList(info_info, first_entry, NUM_MENU_ENTRIES_ON_SCREEN);
+
+ DrawCursorAndText_Info(choice - first_entry, choice, TRUE);
+
+ AdjustScrollbar(SCREEN_CTRL_ID_SCROLL_VERTICAL, max_info_info,
+ NUM_MENU_ENTRIES_ON_SCREEN, first_entry);
+ }
+
+ return;
+ }
+