diff options
author | Phlosioneer <mattmdrr2@gmail.com> | 2019-04-07 20:20:22 -0400 |
---|---|---|
committer | Phlosioneer <mattmdrr2@gmail.com> | 2019-04-07 20:20:22 -0400 |
commit | 50350cc2e1c26082f9d852e97e1698f7254d4145 (patch) | |
tree | 3217b352dae2be8da75ad08a8d94ddc7f81a5017 /src/menu_helpers.c | |
parent | 1360b3a477f1107785900cd0c4e73ebf018f058c (diff) | |
parent | a4ea0ac816f799b76ac4bec1b66c569d6b684e64 (diff) |
Merge branch 'master' into contest-ai-cleanup
Diffstat (limited to 'src/menu_helpers.c')
-rw-r--r-- | src/menu_helpers.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/menu_helpers.c b/src/menu_helpers.c index b5745d812..801e2546b 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -344,17 +344,17 @@ void sub_812220C(struct ItemSlot *slots, u8 count, u8 *arg2, u8 *usedSlotsCount, *arg2 = (*usedSlotsCount); } -void sub_812225C(u16 *arg0, u16 *arg1, u8 arg2, u8 arg3) +void sub_812225C(u16 *scrollOffset, u16 *cursorPos, u8 maxShownItems, u8 numItems) { - if ((*arg0) != 0 && (*arg0) + arg2 > arg3) - (*arg0) = arg3 - arg2; + if (*scrollOffset != 0 && *scrollOffset + maxShownItems > numItems) + *scrollOffset = numItems - maxShownItems; - if ((*arg0) + (*arg1) >= arg3) + if (*scrollOffset + *cursorPos >= numItems) { - if (arg3 == 0) - (*arg1) = 0; + if (numItems == 0) + *cursorPos = 0; else - (*arg1) = arg3 - 1; + *cursorPos = numItems - 1; } } |