papermario/src/code_13CAF0.c

53 lines
1.3 KiB
C
Raw Normal View History

2020-10-15 05:20:51 +02:00
#include "common.h"
2020-11-12 06:44:10 +01:00
s32 pause_items_comparator(s16* a, s16* b) {
if (*a > *b) {
return 1;
} else {
return -1;
}
}
2020-10-15 05:20:51 +02:00
2020-11-12 06:44:10 +01:00
s32 pause_items_get_pos_x(s32 page, s32 itemIndex) {
return (itemIndex % ITEM_MENU_PAGE(page)->numCols) * 98;
}
2020-10-15 05:20:51 +02:00
2020-11-12 06:44:10 +01:00
s32 pause_items_get_pos_y(s32 page, s32 itemIndex) {
return ((page + 1) * 11) + (ITEM_MENU_PAGE(page)->listStart * 16) + ((itemIndex / ITEM_MENU_PAGE(page)->numCols) * 16);
}
2020-10-15 05:20:51 +02:00
2020-11-12 06:44:10 +01:00
s32 pause_items_get_column(s32 page, s32 itemIdx) {
return itemIdx % ITEM_MENU_PAGE(page)->numCols;
}
2020-10-15 05:20:51 +02:00
2020-11-12 06:44:10 +01:00
s32 pause_items_get_row(s32 page, s32 itemIdx) {
return ITEM_MENU_PAGE(page)->listStart + (itemIdx / ITEM_MENU_PAGE(page)->numCols);
}
2020-10-15 05:20:51 +02:00
2020-11-12 06:44:10 +01:00
s32 pause_items_is_visible(s32 y) {
if (y < gItemMenuCurrentScrollPos - 32) {
return FALSE;
}
return y < gItemMenuCurrentScrollPos + 128;
}
2020-10-15 05:20:51 +02:00
2020-11-12 06:44:10 +01:00
s32 pause_items_scroll_offset_y(s32 beforeY) {
return beforeY - gItemMenuCurrentScrollPos;
}
2020-10-15 05:20:51 +02:00
s32 pause_items_scroll_offset_x(s32 beforeX) {
return beforeX;
}
INCLUDE_ASM(s32, "code_13CAF0", pause_items_draw_contents);
INCLUDE_ASM(s32, "code_13CAF0", pause_items_load_items);
INCLUDE_ASM(s32, "code_13CAF0", pause_items_init);
INCLUDE_ASM(s32, "code_13CAF0", pause_items_handle_input);
INCLUDE_ASM(s32, "code_13CAF0", pause_items_update);
INCLUDE_ASM(s32, "code_13CAF0", pause_items_cleanup);