From 9848f84b9ec2d5950cb5dc4600b7651486ff986a Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 11 Mar 2019 03:12:15 -0400 Subject: Use constants for Oam .shape and .size fields Also some general formatting fixes for constants. --- src/menu_helpers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/menu_helpers.c') diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 3fb5ca40d..b5745d812 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -37,10 +37,10 @@ static const struct OamData sOamData_859F4E8 = .objMode = 0, .mosaic = 0, .bpp = 0, - .shape = 0, + .shape = SPRITE_SHAPE(16x16), .x = 0, .matrixNum = 0, - .size = 1, + .size = SPRITE_SIZE(16x16), .tileNum = 0, .priority = 0, .paletteNum = 0, -- cgit v1.2.3 From fe12f2f4b360e68937e49af8672c8b1b1441223c Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 6 Apr 2019 12:41:55 -0500 Subject: Document and cleanup some decoration code --- src/menu_helpers.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/menu_helpers.c') 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; } } -- cgit v1.2.3