From ad52ac1b72e8e22f75a2c65f4dc4479143f5fada Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 1 Mar 2025 17:24:31 +0100 Subject: [PATCH] documentation dungeon menu --- asm/code_8040094.s | 16 +- asm/code_8041AD0.s | 2 +- asm/code_8045A00.s | 6 +- asm/code_8046CE4.s | 4 +- asm/code_805D8C8.s | 266 ++++++------ asm/code_808417C.s | 2 +- include/code_803E46C.h | 2 +- include/constants/dungeon_action.h | 4 +- include/dungeon_map_access.h | 2 +- include/menu_input.h | 4 +- src/code_803D110.c | 2 +- src/code_803E46C.c | 14 +- src/code_803E724.c | 10 +- src/code_8041AD0.c | 12 +- src/code_804267C.c | 12 +- src/code_8042B34.c | 2 +- src/code_8048480.c | 12 +- src/code_805D8C8_1.c | 660 +++++++++++++++-------------- src/code_8066D04.c | 68 +-- src/code_8069E0C.c | 2 +- src/code_806CD90.c | 2 +- src/code_8073CF0.c | 2 +- src/code_8077274_1.c | 10 +- src/code_807CD9C.c | 16 +- src/code_807E5AC.c | 8 +- src/code_8085E98.c | 4 +- src/code_80861A8.c | 4 +- src/code_80869E4.c | 26 +- src/dungeon_action.c | 5 +- src/dungeon_ai_leader.c | 2 +- src/dungeon_cutscenes.c | 152 +++---- src/dungeon_engine.c | 2 +- src/dungeon_map_access.c | 2 +- src/dungeon_message.c | 42 +- src/dungeon_move.c | 4 +- src/dungeon_music.c | 10 +- src/dungeon_util_1.c | 10 +- src/menu_input.c | 4 +- src/move_actions.c | 4 +- src/status.c | 2 +- 40 files changed, 712 insertions(+), 701 deletions(-) diff --git a/asm/code_8040094.s b/asm/code_8040094.s index 48176725e..87d0a7190 100644 --- a/asm/code_8040094.s +++ b/asm/code_8040094.s @@ -1527,7 +1527,7 @@ _08040CEA: bl sub_800EEC8 bl sub_800EF64 movs r0, 0x58 - bl sub_803E46C + bl DungeonRunFrameActions mov r0, sp bl sub_800EA84 adds r4, r0, 0 @@ -1574,7 +1574,7 @@ _08040D68: _08040D6E: bl sub_803EA10 movs r0, 0x26 - bl sub_803E46C + bl DungeonRunFrameActions _08040D78: adds r0, r4, 0 bl sub_800E9A8 @@ -1876,7 +1876,7 @@ _08040FE6: cmp r5, 0x77 bgt _08041022 movs r0, 0x59 - bl sub_803E46C + bl DungeonRunFrameActions ldr r4, [r7, 0x40] ldr r1, [sp, 0x18] cmp r1, 0x9 @@ -2055,7 +2055,7 @@ sub_8041108: bl sub_800EEF8 bl sub_800EF64 movs r0, 0x5A - bl sub_803E46C + bl DungeonRunFrameActions adds r0, r6, 0 bl sub_800E52C adds r1, r7, 0 @@ -2227,7 +2227,7 @@ _0804128C: bl sub_800EBC8 adds r4, r0, 0 movs r0, 0x5B - bl sub_803E46C + bl DungeonRunFrameActions adds r0, r4, 0 adds r1, r6, 0 movs r2, 0x6 @@ -2235,7 +2235,7 @@ _0804128C: b _080412C2 _080412BC: movs r0, 0x28 - bl sub_803E46C + bl DungeonRunFrameActions _080412C2: adds r0, r4, 0 bl sub_800E9A8 @@ -2558,7 +2558,7 @@ sub_8041500: cmp r0, 0 beq _08041518 movs r0, 0x5C - bl sub_803E46C + bl DungeonRunFrameActions movs r0, 0x5D bl sub_8052740 _08041518: @@ -2745,7 +2745,7 @@ _0804166C: .4byte gDungeon _08041670: .4byte 0x000181f2 _08041674: movs r0, 0x42 - bl sub_803E46C + bl DungeonRunFrameActions adds r5, 0x1 _0804167C: cmp r5, 0x63 diff --git a/asm/code_8041AD0.s b/asm/code_8041AD0.s index d45d8b6bd..72277ff9c 100644 --- a/asm/code_8041AD0.s +++ b/asm/code_8041AD0.s @@ -144,7 +144,7 @@ _0804236E: cmp r5, r4 bgt _08042384 movs r0, 0x42 - bl sub_803E46C + bl DungeonRunFrameActions adds r0, r6, 0 bl sub_800E9A8 lsls r0, 24 diff --git a/asm/code_8045A00.s b/asm/code_8045A00.s index 86e17e07e..4c38e4fa3 100644 --- a/asm/code_8045A00.s +++ b/asm/code_8045A00.s @@ -1315,7 +1315,7 @@ _080467BE: movs r2, 0 bl sub_80462AC movs r0, 0x13 - bl sub_803E46C + bl DungeonRunFrameActions ldr r2, [sp, 0x10] adds r2, 0x55 str r2, [sp, 0x10] @@ -1351,7 +1351,7 @@ _08046822: movs r3, 0xFF bl sub_80462AC movs r0, 0x13 - bl sub_803E46C + bl DungeonRunFrameActions add sp, 0x18 pop {r3-r5} mov r8, r3 @@ -1837,7 +1837,7 @@ _08046C06: blt _08046BAA _08046C14: movs r0, 0x13 - bl sub_803E46C + bl DungeonRunFrameActions movs r0, 0xA7 lsls r0, 3 add r0, sp diff --git a/asm/code_8046CE4.s b/asm/code_8046CE4.s index 34c302ab3..6a0fc46dd 100644 --- a/asm/code_8046CE4.s +++ b/asm/code_8046CE4.s @@ -249,7 +249,7 @@ _08047370: cmp r4, 0 beq _0804737A movs r0, 0x12 - bl sub_803E46C + bl DungeonRunFrameActions _0804737A: subs r5, 0x1 cmp r5, 0 @@ -788,7 +788,7 @@ _080477B2: cmp r3, 0 beq _080477BE movs r0, 0x17 - bl sub_803E46C + bl DungeonRunFrameActions _080477BE: ldr r0, [sp, 0x34] add r8, r0 diff --git a/asm/code_805D8C8.s b/asm/code_805D8C8.s index df8cb4dc1..1fa80c864 100644 --- a/asm/code_805D8C8.s +++ b/asm/code_805D8C8.s @@ -326,7 +326,7 @@ _08063908: movs r1, 0 bl nullsub_34 movs r0, 0x1C - bl sub_803E46C + bl DungeonRunFrameActions bl sub_8062D88 ldr r1, _08063948 ldrh r1, [r1, 0x2] @@ -337,7 +337,7 @@ _08063908: cmp r0, 0 beq _0806394C _0806392C: - bl sub_8083D08 + bl PlayDungeonConfirmationSE movs r7, 0x1 mov r1, r8 cmp r1, 0 @@ -358,7 +358,7 @@ _0806394C: cmp r0, 0 beq _08063962 _0806395A: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r7, 0x1 b _080639AE _08063962: @@ -379,7 +379,7 @@ _08063978: cmp r0, r4 beq _080639AE movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE b _080639AE _08063986: movs r0, 0x10 @@ -403,7 +403,7 @@ _080639A4: cmp r1, r4 beq _080639AE movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE _080639AE: cmp r7, 0x1 beq _080639CA @@ -1086,7 +1086,7 @@ _08063EEC: mov r0, r8 bl AddMenuCursorSprite movs r0, 0x1E - bl sub_803E46C + bl DungeonRunFrameActions mov r0, r10 ldrh r1, [r0, 0x4] movs r0, 0x80 @@ -1108,7 +1108,7 @@ _08063EEC: cmp r4, r0 beq _08063F2A movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE _08063F2A: mov r0, r10 ldrh r1, [r0, 0x4] @@ -1131,7 +1131,7 @@ _08063F2A: cmp r4, r0 beq _08063F5C movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE _08063F5C: bl sub_8062D88 mov r2, r10 @@ -1146,7 +1146,7 @@ _08063F5C: cmp r0, 0 beq _08063F8C _08063F76: - bl sub_8083D08 + bl PlayDungeonConfirmationSE movs r4, 0 b _08063FB2 .align 2, 0 @@ -1171,14 +1171,14 @@ _08063F8C: cmp r0, 0 beq _08063EEC _08063FAC: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r4, 0x1 _08063FB2: ldr r5, _08063FD0 adds r0, r5, 0 bl AddMenuCursorSprite movs r0, 0x1E - bl sub_803E46C + bl DungeonRunFrameActions cmp r4, 0x1 bne _08063FDC movs r0, 0x1 @@ -1189,7 +1189,7 @@ _08063FB2: .align 2, 0 _08063FD0: .4byte gUnknown_202EE10 _08063FD4: - bl sub_8083D44 + bl PlayDungeonStartButtonSE movs r4, 0x2 b _08063FB2 _08063FDC: @@ -1225,17 +1225,17 @@ _0806401C: adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x1B - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r6, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08064040 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r4, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08064040: ldrh r1, [r6, 0x4] movs r0, 0x40 @@ -1243,10 +1243,10 @@ _08064040: cmp r0, 0 beq _08064058 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r4, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08064058: bl sub_8062D88 ldrh r1, [r6, 0x2] @@ -1269,7 +1269,7 @@ _0806406E: ldrsh r0, [r4, r2] cmp r0, 0x2 bne _08064090 - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08064094 .align 2, 0 _0806408C: .4byte gRealInputs @@ -1279,7 +1279,7 @@ _08064094: movs r4, 0 b _080640B2 _08064098: - bl sub_8083D30 + bl PlayDungeonCancelSE _0806409C: ldrh r1, [r6, 0x2] movs r0, 0x2 @@ -1290,14 +1290,14 @@ _0806409C: cmp r0, 0 beq _0806401C _080640AC: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r4, 0x1 _080640B2: ldr r6, _080640E4 adds r0, r6, 0 bl AddMenuCursorSprite movs r0, 0x1B - bl sub_803E46C + bl DungeonRunFrameActions movs r0, 0 movs r1, 0 bl sub_803EAF0 @@ -1758,13 +1758,13 @@ _080643F0: ldr r1, [sp, 0xC4] movs r2, 0x60 bl memcpy - bl sub_8083D44 + bl PlayDungeonStartButtonSE adds r0, r7, 0x4 mov r1, sp mov r2, r10 bl sub_806455C movs r0, 0x2D - bl sub_803E46C + bl DungeonRunFrameActions adds r0, r7, 0 bl sub_80645D4 strh r4, [r5, 0x8] @@ -1776,7 +1776,7 @@ _0806445C: adds r0, r5, 0 bl AddMenuCursorSprite movs r0, 0x2D - bl sub_803E46C + bl DungeonRunFrameActions mov r2, r8 ldrh r1, [r2, 0x4] movs r0, 0x80 @@ -1784,10 +1784,10 @@ _0806445C: cmp r0, 0 beq _08064482 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08064482: mov r0, r8 ldrh r1, [r0, 0x4] @@ -1796,10 +1796,10 @@ _08064482: cmp r0, 0 beq _0806449C movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _0806449C: mov r2, r8 ldrh r1, [r2, 0x2] @@ -1817,7 +1817,7 @@ _080644B2: ldrsh r0, [r5, r1] cmp r0, 0x1 bne _080644D0 - bl sub_8083D08 + bl PlayDungeonConfirmationSE ldr r0, [sp, 0xCC] bl sub_80645F8 movs r4, 0x2 @@ -1842,7 +1842,7 @@ _080644D0: ldrh r1, [r0] adds r0, r4, 0 bl SetMonsterActionFields - bl sub_8083D08 + bl PlayDungeonConfirmationSE strb r6, [r4, 0x4] strh r6, [r4, 0x8] strh r6, [r4, 0xA] @@ -1854,7 +1854,7 @@ _080644D0: .align 2, 0 _08064508: .4byte gUnknown_202EE44 _0806450C: - bl sub_8083D30 + bl PlayDungeonCancelSE _08064510: mov r0, r8 ldrh r1, [r0, 0x2] @@ -1867,13 +1867,13 @@ _08064510: cmp r0, 0 beq _0806445C _08064524: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r4, 0x1 _0806452A: ldr r0, _08064558 bl AddMenuCursorSprite movs r0, 0x2D - bl sub_803E46C + bl DungeonRunFrameActions cmp r4, 0x2 bne _0806453C b _080643F0 @@ -2119,7 +2119,7 @@ _08064724: cmp r0, 0 beq _08064738 _08064732: - bl sub_8083D30 + bl PlayDungeonCancelSE b _080647D8 _08064738: cmp r5, 0 @@ -2130,7 +2130,7 @@ _08064740: movs r1, 0 bl nullsub_34 movs r0, 0x16 - bl sub_803E46C + bl DungeonRunFrameActions ldr r0, _08064788 ldrh r1, [r0, 0x2] movs r0, 0x1 @@ -2141,7 +2141,7 @@ _08064740: cmp r0, 0 beq _08064724 _08064760: - bl sub_8083D08 + bl PlayDungeonConfirmationSE cmp r5, 0 beq _080647D8 movs r4, 0 @@ -2171,7 +2171,7 @@ _0806478C: cmp r0, 0 beq _080647A0 _0806479A: - bl sub_8083D30 + bl PlayDungeonCancelSE b _080647CC _080647A0: cmp r4, r8 @@ -2182,7 +2182,7 @@ _080647A8: movs r1, 0 bl nullsub_34 movs r0, 0x16 - bl sub_803E46C + bl DungeonRunFrameActions ldr r0, _080647D4 ldrh r1, [r0, 0x2] movs r0, 0x1 @@ -2193,7 +2193,7 @@ _080647A8: cmp r0, 0 beq _0806478C _080647C8: - bl sub_8083D08 + bl PlayDungeonConfirmationSE _080647CC: adds r4, r7, 0 cmp r4, r5 @@ -2215,8 +2215,8 @@ _080647D8: bx r0 thumb_func_end sub_80645F8 - thumb_func_start sub_80647F0 -sub_80647F0: + thumb_func_start ShowDungeonStairsMenu +ShowDungeonStairsMenu: push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2285,13 +2285,13 @@ _08064834: ldr r1, [sp, 0xC4] movs r2, 0x60 bl memcpy - bl sub_8083D44 + bl PlayDungeonStartButtonSE adds r0, r7, 0x4 mov r1, sp mov r2, r10 bl sub_80649A0 movs r0, 0x2E - bl sub_803E46C + bl DungeonRunFrameActions adds r0, r7, 0 bl sub_8064A18 strh r4, [r5, 0x8] @@ -2303,7 +2303,7 @@ _080648A0: adds r0, r5, 0 bl AddMenuCursorSprite movs r0, 0x2E - bl sub_803E46C + bl DungeonRunFrameActions mov r2, r8 ldrh r1, [r2, 0x4] movs r0, 0x80 @@ -2311,10 +2311,10 @@ _080648A0: cmp r0, 0 beq _080648C6 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _080648C6: mov r0, r8 ldrh r1, [r0, 0x4] @@ -2323,10 +2323,10 @@ _080648C6: cmp r0, 0 beq _080648E0 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _080648E0: mov r2, r8 ldrh r1, [r2, 0x2] @@ -2344,7 +2344,7 @@ _080648F6: ldrsh r0, [r5, r1] cmp r0, 0x1 bne _08064914 - bl sub_8083D08 + bl PlayDungeonConfirmationSE ldr r0, [sp, 0xCC] bl sub_8064A3C movs r4, 0x2 @@ -2369,7 +2369,7 @@ _08064914: ldrh r1, [r0] adds r0, r4, 0 bl SetMonsterActionFields - bl sub_8083D08 + bl PlayDungeonConfirmationSE strb r6, [r4, 0x4] strh r6, [r4, 0x8] strh r6, [r4, 0xA] @@ -2381,7 +2381,7 @@ _08064914: .align 2, 0 _0806494C: .4byte gUnknown_202EE44 _08064950: - bl sub_8083D30 + bl PlayDungeonCancelSE _08064954: mov r0, r8 ldrh r1, [r0, 0x2] @@ -2394,13 +2394,13 @@ _08064954: cmp r0, 0 beq _080648A0 _08064968: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r4, 0x1 _0806496E: ldr r0, _0806499C bl AddMenuCursorSprite movs r0, 0x2E - bl sub_803E46C + bl DungeonRunFrameActions cmp r4, 0x2 bne _08064980 b _08064834 @@ -2419,7 +2419,7 @@ _08064980: .align 2, 0 _08064998: .4byte gUnknown_202EE3A _0806499C: .4byte gUnknown_202EE10 - thumb_func_end sub_80647F0 + thumb_func_end ShowDungeonStairsMenu thumb_func_start sub_80649A0 sub_80649A0: @@ -2611,7 +2611,7 @@ _08064B14: cmp r0, 0 beq _08064B28 _08064B22: - bl sub_8083D30 + bl PlayDungeonCancelSE b _08064BC8 _08064B28: cmp r6, 0 @@ -2622,7 +2622,7 @@ _08064B30: movs r1, 0 bl nullsub_34 movs r0, 0x16 - bl sub_803E46C + bl DungeonRunFrameActions ldr r0, _08064B78 ldrh r1, [r0, 0x2] movs r0, 0x1 @@ -2633,7 +2633,7 @@ _08064B30: cmp r0, 0 beq _08064B14 _08064B50: - bl sub_8083D08 + bl PlayDungeonConfirmationSE cmp r6, 0 beq _08064BC8 movs r4, 0 @@ -2663,7 +2663,7 @@ _08064B7C: cmp r0, 0 beq _08064B90 _08064B8A: - bl sub_8083D30 + bl PlayDungeonCancelSE b _08064BBC _08064B90: cmp r4, r8 @@ -2674,7 +2674,7 @@ _08064B98: movs r1, 0 bl nullsub_34 movs r0, 0x16 - bl sub_803E46C + bl DungeonRunFrameActions ldr r0, _08064BC4 ldrh r1, [r0, 0x2] movs r0, 0x1 @@ -2685,7 +2685,7 @@ _08064B98: cmp r0, 0 beq _08064B7C _08064BB8: - bl sub_8083D08 + bl PlayDungeonConfirmationSE _08064BBC: adds r4, r7, 0 cmp r4, r6 @@ -2707,8 +2707,8 @@ _08064BC8: bx r0 thumb_func_end sub_8064A3C - thumb_func_start sub_8064BE0 -sub_8064BE0: + thumb_func_start ShowDungeonOthersMenu +ShowDungeonOthersMenu: push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -2743,17 +2743,17 @@ _08064C1A: adds r0, r6, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r7, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08064C3E movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r6, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08064C3E: ldrh r1, [r7, 0x4] movs r0, 0x40 @@ -2761,10 +2761,10 @@ _08064C3E: cmp r0, 0 beq _08064C56 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r6, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08064C56: ldrh r1, [r7, 0x2] movs r0, 0x1 @@ -2794,7 +2794,7 @@ _08064C6A: cmp r0, 0 bne _08064CA4 _08064C8C: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08064CC0 .align 2, 0 _08064C94: .4byte gDungeon @@ -2802,7 +2802,7 @@ _08064C98: .4byte gUnknown_202F2E0 _08064C9C: .4byte gUnknown_202EE10 _08064CA0: .4byte gRealInputs _08064CA4: - bl sub_8083D30 + bl PlayDungeonCancelSE b _08064CC0 _08064CAA: movs r0, 0x2 @@ -2814,14 +2814,14 @@ _08064CAA: cmp r0, 0 beq _08064C1A _08064CBA: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r5, 0x1 _08064CC0: ldr r4, _08064D68 adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions mov r0, r10 cmp r0, 0 bne _08064C14 @@ -2899,7 +2899,7 @@ _08064D4C: _08064D68: .4byte gUnknown_202EE10 _08064D6C: .4byte gUnknown_202F2E0 _08064D70: .4byte gDungeon - thumb_func_end sub_8064BE0 + thumb_func_end ShowDungeonOthersMenu thumb_func_start sub_8064D74 sub_8064D74: @@ -2918,17 +2918,17 @@ _08064D8A: adds r0, r6, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r7, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08064DAE movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r6, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08064DAE: ldrh r1, [r7, 0x4] movs r0, 0x40 @@ -2936,10 +2936,10 @@ _08064DAE: cmp r0, 0 beq _08064DC6 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r6, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08064DC6: ldrh r1, [r7, 0x2] movs r0, 0x1 @@ -2952,7 +2952,7 @@ _08064DC6: cmp r0, 0 beq _08064DE8 _08064DDA: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08064DFE .align 2, 0 _08064DE0: .4byte gUnknown_202EE10 @@ -2967,14 +2967,14 @@ _08064DE8: cmp r0, 0 beq _08064D8A _08064DF8: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r5, 0x1 _08064DFE: ldr r4, _08064E2C adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions cmp r5, 0 bne _08064E56 ldr r0, _08064E30 @@ -3041,17 +3041,17 @@ _08064E86: adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r6, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08064EAA movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r4, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08064EAA: ldrh r1, [r6, 0x4] movs r0, 0x40 @@ -3059,10 +3059,10 @@ _08064EAA: cmp r0, 0 beq _08064EC2 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r4, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08064EC2: ldrh r1, [r6, 0x4] movs r0, 0x20 @@ -3070,7 +3070,7 @@ _08064EC2: cmp r0, 0 beq _08064EE4 movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r1, 0x18 ldrsh r0, [r4, r1] bl sub_8065A8C @@ -3084,7 +3084,7 @@ _08064EE4: cmp r0, 0 beq _08064EFC movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r2, 0x18 ldrsh r0, [r4, r2] bl sub_8065B3C @@ -3100,14 +3100,14 @@ _08064EFC: cmp r0, 0 beq _08064F14 _08064F0E: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08064F30 _08064F14: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq _08064F24 - bl sub_8083D30 + bl PlayDungeonCancelSE movs r7, 0x1 b _08064F30 _08064F24: @@ -3121,7 +3121,7 @@ _08064F30: ldr r0, _08064F4C bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions cmp r5, 0 bne _08064E7E adds r0, r7, 0 @@ -3155,17 +3155,17 @@ _08064F6E: adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r6, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08064F92 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r4, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08064F92: ldrh r1, [r6, 0x4] movs r0, 0x40 @@ -3173,10 +3173,10 @@ _08064F92: cmp r0, 0 beq _08064FAA movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r4, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08064FAA: ldrh r1, [r6, 0x4] movs r0, 0x20 @@ -3184,7 +3184,7 @@ _08064FAA: cmp r0, 0 beq _08064FD0 movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r1, 0x18 ldrsh r0, [r4, r1] adds r0, 0x5 @@ -3199,7 +3199,7 @@ _08064FD0: cmp r0, 0 beq _08064FEA movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r2, 0x18 ldrsh r0, [r4, r2] adds r0, 0x5 @@ -3216,14 +3216,14 @@ _08064FEA: cmp r0, 0 beq _08065002 _08064FFC: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _0806501E _08065002: movs r0, 0x2 ands r0, r1 cmp r0, 0 beq _08065012 - bl sub_8083D30 + bl PlayDungeonCancelSE movs r7, 0x1 b _0806501E _08065012: @@ -3237,7 +3237,7 @@ _0806501E: ldr r0, _0806503C bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions cmp r5, 0 bne _08064F66 adds r0, r7, 0 @@ -3337,17 +3337,17 @@ _080650DC: adds r0, r5, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r6, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08065100 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08065100: ldrh r1, [r6, 0x4] movs r0, 0x40 @@ -3355,10 +3355,10 @@ _08065100: cmp r0, 0 beq _08065118 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08065118: ldrh r1, [r6, 0x2] movs r0, 0x1 @@ -3371,7 +3371,7 @@ _08065118: cmp r0, 0 beq _0806513C _0806512C: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08065152 .align 2, 0 _08065134: .4byte gUnknown_202EE10 @@ -3386,14 +3386,14 @@ _0806513C: cmp r0, 0 beq _080650DC _0806514C: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r7, 0x1 _08065152: ldr r4, _08065178 adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions mov r0, r9 cmp r0, 0 bne _080650D6 @@ -3441,7 +3441,7 @@ sub_806519C: bl sub_80319A4 _080651B6: movs r0, 0x47 - bl sub_803E46C + bl DungeonRunFrameActions bl sub_80319F8 cmp r0, 0 beq _080651B6 @@ -4703,17 +4703,17 @@ _08065C0A: adds r0, r5, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldrh r1, [r6, 0x4] movs r0, 0x80 ands r0, r1 cmp r0, 0 beq _08065C2E movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_80136E0 + bl MoveMenuCursorDownWrapAround _08065C2E: ldrh r1, [r6, 0x4] movs r0, 0x40 @@ -4721,10 +4721,10 @@ _08065C2E: cmp r0, 0 beq _08065C46 movs r0, 0x1 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r0, r5, 0 movs r1, 0x1 - bl sub_8013744 + bl MoveMenuCursorUpWrapAround _08065C46: ldrh r1, [r6, 0x2] movs r0, 0x1 @@ -4737,7 +4737,7 @@ _08065C46: cmp r0, 0 beq _08065C68 _08065C5A: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08065C7E .align 2, 0 _08065C60: .4byte gUnknown_202EE10 @@ -4752,14 +4752,14 @@ _08065C68: cmp r0, 0 beq _08065C0A _08065C78: - bl sub_8083D30 + bl PlayDungeonCancelSE movs r7, 0x1 _08065C7E: ldr r4, _08065C9C adds r0, r4, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions cmp r7, 0 bne _08065CA0 movs r1, 0x18 @@ -5057,7 +5057,7 @@ _08065EF4: adds r0, r5, 0 bl AddMenuCursorSprite movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions ldr r0, _08065F3C ldrh r1, [r0, 0x2] mov r0, r10 @@ -5071,7 +5071,7 @@ _08065EF4: beq _08065F40 _08065F16: movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE adds r6, 0x1 cmp r6, 0x7 bne _08065F64 @@ -5096,7 +5096,7 @@ _08065F40: beq _08065F68 _08065F52: movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE subs r6, 0x1 movs r0, 0x1 negs r0, r0 @@ -5117,7 +5117,7 @@ _08065F68: cmp r0, 0 beq _08065F80 _08065F7A: - bl sub_8083D08 + bl PlayDungeonConfirmationSE b _08065F94 _08065F80: movs r0, 0x2 @@ -5129,10 +5129,10 @@ _08065F80: cmp r0, 0 beq _08065EF4 _08065F90: - bl sub_8083D30 + bl PlayDungeonCancelSE _08065F94: movs r0, 0x24 - bl sub_803E46C + bl DungeonRunFrameActions cmp r7, 0 beq _08065FA0 b _08065E0C @@ -5280,7 +5280,7 @@ _080660BE: ldr r0, _08066130 bl AddMenuCursorSprite movs r0, 0x45 - bl sub_803E46C + bl DungeonRunFrameActions _080660CE: ldr r2, _08066140 ldrb r1, [r2] @@ -5322,7 +5322,7 @@ _080660F8: beq _08066150 _0806611A: movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r0, 0 mov r1, r10 cmp r1, 0 @@ -5356,14 +5356,14 @@ _08066150: cmp r0, 0 beq _08066174 _0806616E: - bl sub_8083D30 + bl PlayDungeonCancelSE b _0806618C _08066174: movs r0, 0xC ands r0, r1 cmp r0, 0 beq _0806608C - bl sub_8083D08 + bl PlayDungeonConfirmationSE movs r2, 0x1 mov r8, r2 _08066184: @@ -5530,7 +5530,7 @@ _080662BC: .4byte gUnknown_202F2FC _080662C0: .4byte gRealInputs _080662C4: movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r0, 0 bl sub_80073B8 movs r0, 0x10 @@ -5564,7 +5564,7 @@ _080662C4: movs r0, 0 bl sub_80073E0 movs r0, 0x45 - bl sub_803E46C + bl DungeonRunFrameActions ldr r5, _08066350 movs r4, 0x5 _08066320: @@ -5572,7 +5572,7 @@ _08066320: movs r0, 0 bl _call_via_r1 movs r0, 0x45 - bl sub_803E46C + bl DungeonRunFrameActions subs r4, 0x1 cmp r4, 0 bge _08066320 @@ -5632,7 +5632,7 @@ _08066398: .4byte gUnknown_202F2FC _0806639C: .4byte gRealInputs _080663A0: movs r0, 0 - bl sub_8083CE0 + bl PlayDungeonCursorSE movs r0, 0 bl sub_80073B8 movs r0, 0x10 @@ -5666,7 +5666,7 @@ _080663A0: movs r0, 0 bl sub_80073E0 movs r0, 0xD - bl sub_803E46C + bl DungeonRunFrameActions ldr r5, _0806642C movs r4, 0x5 _080663FC: @@ -5674,7 +5674,7 @@ _080663FC: movs r0, 0 bl _call_via_r1 movs r0, 0xD - bl sub_803E46C + bl DungeonRunFrameActions subs r4, 0x1 cmp r4, 0 bge _080663FC diff --git a/asm/code_808417C.s b/asm/code_808417C.s index a23fae6b2..296721a32 100644 --- a/asm/code_808417C.s +++ b/asm/code_808417C.s @@ -116,7 +116,7 @@ _080842C4: cmp r0, 0 beq _08084290 _080842DA: - bl sub_8083D08 + bl PlayDungeonConfirmationSE add sp, 0xC4 pop {r3} mov r8, r3 diff --git a/include/code_803E46C.h b/include/code_803E46C.h index 270af6573..9588788e4 100644 --- a/include/code_803E46C.h +++ b/include/code_803E46C.h @@ -1,6 +1,6 @@ #ifndef GUARD_CODE_803E46C_H #define GUARD_CODE_803E46C_H -void sub_803E46C(u32); +void DungeonRunFrameActions(u32); #endif diff --git a/include/constants/dungeon_action.h b/include/constants/dungeon_action.h index 7ffe68b7d..3a6febe5b 100644 --- a/include/constants/dungeon_action.h +++ b/include/constants/dungeon_action.h @@ -8,8 +8,8 @@ enum DungeonAction ACTION_WALK = 0x2, ACTION_UNK5 = 0x5, // Switching between Pokémon in the moves menu. - ACTION_NEXT = 0x6, - ACTION_PREVIOUS = 0x7, + ACTION_MOVES_MENU_NEXT_MON = 0x6, + ACTION_MOVES_MENU_PREV_MON = 0x7, ACTION_PLACE_ITEM = 0x8, // Some actions are different between the leader and AI-controlled Pokémon. ACTION_PICK_UP_PLAYER = 0x9, // Picking up an item underfoot. diff --git a/include/dungeon_map_access.h b/include/dungeon_map_access.h index 71532776d..36fc0440e 100644 --- a/include/dungeon_map_access.h +++ b/include/dungeon_map_access.h @@ -19,7 +19,7 @@ void sub_8049B8C(void); void sub_8049BB0(s32 x, s32 y); void sub_804A1F0(s32 a0, s32 a1); void sub_804A49C(s32 a0, s32 a1); -void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3); +void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3); void sub_804AA60(void); void sub_804AAAC(void); void sub_804AAD4(void); diff --git a/include/menu_input.h b/include/menu_input.h index 338b6f411..3b28cc41c 100644 --- a/include/menu_input.h +++ b/include/menu_input.h @@ -24,9 +24,9 @@ void AddMenuCursorSprite(MenuInputStruct *param_1); void sub_8013660(MenuInputStruct *param_1); void UpdateMenuCursorSpriteCoords(MenuInputStruct *param_1); void MoveMenuCursorDown(MenuInputStruct *param_1); -void sub_80136E0(MenuInputStruct *param_1, u8 param_2); +void MoveMenuCursorDownWrapAround(MenuInputStruct *param_1, u8 param_2); void MoveMenuCursorUp(MenuInputStruct *param_1); -void sub_8013744(MenuInputStruct *param_1, u8 param_2); +void MoveMenuCursorUpWrapAround(MenuInputStruct *param_1, u8 param_2); void sub_8013780(MenuInputStruct *param_1, s32 param_2); s32 sub_80137A8(MenuInputStruct *param_1); void sub_80137B0(MenuInputStruct *param_1, s32 param_2); diff --git a/src/code_803D110.c b/src/code_803D110.c index 6f40c9e93..8447fb3d1 100644 --- a/src/code_803D110.c +++ b/src/code_803D110.c @@ -317,7 +317,7 @@ void ShowDungeonNameBanner(void) } CloseFile(gDungeonNameBannerFontFile); - sub_803E46C(2); + DungeonRunFrameActions(2); } s32 sub_803DC14(const u8 *dungName, s32 strWidth, s32 a2) diff --git a/src/code_803E46C.c b/src/code_803E46C.c index 2bcefa896..6e3bd9f92 100644 --- a/src/code_803E46C.c +++ b/src/code_803E46C.c @@ -43,7 +43,7 @@ void sub_800F7D0(DungeonPos *); void sub_803E874(s32, s32); void sub_803EAF0(s32, s32); -void sub_803E46C(u32 a0) +void DungeonRunFrameActions(u32 a0) { if (gUnknown_203B40C != 0) sub_803E490(a0); @@ -150,7 +150,7 @@ void sub_803E668(u32 unused) void sub_803E708(s32 a0, u32 a1) { while (a0 != 0) { - sub_803E46C(a1); + DungeonRunFrameActions(a1); a0--; } } @@ -159,7 +159,7 @@ void sub_803E724(s32 r0) { do { - sub_803E46C(r0); + DungeonRunFrameActions(r0); } while (gRealInputs.held & 0xF0); } @@ -190,7 +190,7 @@ void sub_803E748(void) { if(gDungeonBrightness <= 0x1E) gDungeonBrightness++; sub_803E874(1, index2); - sub_803E46C(5); + DungeonRunFrameActions(5); } gUnknown_203B40D = 0; gDungeonBrightness = 0x1F; @@ -206,7 +206,7 @@ void sub_803E7C8(void) gUnknown_203B40D = 1; gDungeonBrightness = 0; - sub_803E46C(5); + DungeonRunFrameActions(5); for(index1 = 0; index1 < 0x2C; index1++) { @@ -221,7 +221,7 @@ void sub_803E7C8(void) gDungeon->unk181e8.unk18217 = index2; } } - sub_803E46C(5); + DungeonRunFrameActions(5); } gUnknown_203B40D = 0; } @@ -234,7 +234,7 @@ void sub_803E830(void) for(index = 0; index < 0x20; index++) { sub_803E874(0, 0); - sub_803E46C(5); + DungeonRunFrameActions(5); if(gDungeonBrightness > 0) gDungeonBrightness--; } diff --git a/src/code_803E724.c b/src/code_803E724.c index 85dcfaddc..d7244585e 100644 --- a/src/code_803E724.c +++ b/src/code_803E724.c @@ -55,7 +55,7 @@ extern u8 gUnknown_20274A5; extern s32 gUnknown_202EDCC; extern void sub_8040A84(); -extern void sub_8083D44(void); +extern void PlayDungeonStartButtonSE(void); extern void sub_8040A84(void); extern void sub_80400D4(void); extern void sub_8041888(u8 param_1); @@ -320,7 +320,7 @@ void sub_803EAF0(u32 a0, u8 *a1) break; case 8: if (gUnknown_203B40C != 0) { - sub_8083D44(); + PlayDungeonStartButtonSE(); sub_8052210(0); } CreateConfirmNameMenu(2, a1); @@ -328,13 +328,13 @@ void sub_803EAF0(u32 a0, u8 *a1) case 9: if (gUnknown_203B40C != 0) { sub_8052210(0); - sub_8083D44(); + PlayDungeonStartButtonSE(); } ResetUnusedInputStruct(); ShowWindows(&gUnknown_80F63D0, FALSE, TRUE); break; case 10: - sub_8083D44(); + PlayDungeonStartButtonSE(); break; case 150: // Dummy case put here to match, any value >= 150 works break; @@ -394,7 +394,7 @@ void sub_803ED30(s32 a0, Entity *mon, u8 a2, s32 a3) for (i = 0; i < 20; i++) { if (gUnknown_202EDE8.unk0 == 0) break; - sub_803E46C(0x29); + DungeonRunFrameActions(0x29); } var = sub_803EF90(a0, a2); diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index 6e87e719c..44d003ce3 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -86,7 +86,7 @@ s32 sub_80416E0(PixelPos *pos, u32 param_2, bool8 param_3) if (param_3) { counter = 0; while ((counter < 100 && (sub_800E9A8(ret)))) { - sub_803E46C(0x42); + DungeonRunFrameActions(0x42); counter++; } ret = -1; @@ -99,7 +99,7 @@ u32 sub_8041764(unkStruct_80416E0 *param_1, bool8 param_2) sub_800EE5C(param_1->unk0); sub_800EF64(); if(param_2) - sub_803E46C(0x42); + DungeonRunFrameActions(0x42); return sub_800E890(param_1); } @@ -112,11 +112,11 @@ void sub_804178C(u8 param_1) gDungeon->unk181e8.unk18204 = 0; if (sub_800E9FC(param_1) != 0) { while ((counter < 1000 && (sub_800E9FC(param_1) != 0))) { - sub_803E46C(0x4a); + DungeonRunFrameActions(0x4a); counter++; } - sub_803E46C(0x4a); - sub_803E46C(0x4a); + DungeonRunFrameActions(0x4a); + DungeonRunFrameActions(0x4a); } if ((counter == 1000) || (param_1 != 0)) { sub_800DBBC(); @@ -136,7 +136,7 @@ void sub_804178C(u8 param_1) gDungeonBrightness = 0x1f; } sub_803EA10(); - sub_803E46C(0x4a); + DungeonRunFrameActions(0x4a); if(gDungeonBrightness == 0x1f) break; }; gUnknown_2026E4E = 0x808; diff --git a/src/code_804267C.c b/src/code_804267C.c index aa73cb1e6..aa9b45b2d 100644 --- a/src/code_804267C.c +++ b/src/code_804267C.c @@ -60,7 +60,7 @@ void sub_8042390(Entity *entity, Item *item) sub_8005700(asStack_24,&entity->axObj); uVar6 = sub_800E49C(id,&local_14,asStack_24,0,sVar1); for (counter = 0; counter < 1000; counter++) { - sub_803E46C(0x42); + DungeonRunFrameActions(0x42); if (!sub_800E9A8(uVar6)) { break; } @@ -88,7 +88,7 @@ void sub_804245C(Entity *entity, Item *item) sub_8005700(asStack_24,&entity->axObj); uVar6 = sub_800E49C(id,&local_14,asStack_24,1,sVar1); for (counter = 0; counter < 1000; counter++) { - sub_803E46C(0x42); + DungeonRunFrameActions(0x42); if (!sub_800E9A8(uVar6)) { break; } @@ -128,7 +128,7 @@ s32 sub_8042520(Entity *a0) for (i = 0; i < 6; i++) { sub_800E8AC(uVar4, &pos, 0, iVar8, 0); - sub_803E46C(66); + DungeonRunFrameActions(66); pos.x += gAdjacentTileOffsets[dir].x * 4; pos.y += gAdjacentTileOffsets[dir].y * 4; iVar8 = (pos.y - gDungeon->unk181e8.cameraPixelPos.y) / 2; @@ -179,7 +179,7 @@ void sub_80426C8(u32 a0, u32 a1) sub_8042B34(a0, a1, 0x80); while (sub_8042CC0()) - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); sub_8042D7C(); sub_8040238(); @@ -192,7 +192,7 @@ void sub_8042730(Entity *a0, void *unused) sub_806CDD4(a0, 8, 8); for (i = 0; i < 100; i++) { - sub_803E46C(0x51); + DungeonRunFrameActions(0x51); if ((a0->axObj.axdata.sub1.unk10 & 3) != 0 || a0->axObj.unk43_animId2 != 8) break; } @@ -406,7 +406,7 @@ void sub_8042A84(s16 param_1, Entity *entity, u32 param_3) sub_803E708(param_3,0x42); do { if (entity->unk1C.raw > IntToF248_2(199.999).raw) break; - sub_803E46C(0x42); + DungeonRunFrameActions(0x42); entity->unk1C.raw += + r6; r6 += IntToF248_2(1).raw; iVar3 = (entity->pixelPos.y - entity->unk1C.raw) / 256; diff --git a/src/code_8042B34.c b/src/code_8042B34.c index fcee722dd..879cf7917 100644 --- a/src/code_8042B34.c +++ b/src/code_8042B34.c @@ -85,7 +85,7 @@ void sub_8042B34(s32 a0, s32 a1, s32 a2) sUnknown_203B414->unk8 = (a1 + 1) * 4; sub_800EE5C(gUnknown_80F6624[a0][0].unk0); sub_800EF64(); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); sUnknown_203B414->unk4 = a2; for (i = 0; i < sUnknown_203B414->unk8; i++) { s32 rnd; diff --git a/src/code_8048480.c b/src/code_8048480.c index 954771ce3..4d23c6d38 100644 --- a/src/code_8048480.c +++ b/src/code_8048480.c @@ -73,10 +73,10 @@ extern void sub_80637E8(ActionContainer *); extern void sub_8063BB4(ActionContainer *); extern void sub_8063CF0(ActionContainer *, u32); extern void sub_8063A70(ActionContainer *, u32); -extern u8 sub_8062F90(Entity *, u32, u32, u32, u32); +extern u8 ShowDungeonMovesMenu(Entity *, u32, u32, u32, u32); extern void sub_8044DF0(Entity *, u32, u32); extern void sub_803EAF0(u32, u32); -extern void sub_8044C10(bool8); +extern void SetLeaderActionToNothing(bool8); Entity *DrawFieldGiveItemMenu(u32, u32); extern void sub_8044E24(Entity *, u32, u32); extern void sub_804245C(Entity *, Item *); @@ -938,13 +938,13 @@ bool8 sub_8048B9C(Entity *entity, Item *item) else if (entityActionPtr->action == ACTION_UNK20) { sub_803EAF0(0,0); sub_8063BB4(entityActionPtr); - sub_8044C10(TRUE); + SetLeaderActionToNothing(TRUE); ret = TRUE; } else if (entityActionPtr->action == ACTION_UNK21) { sub_803EAF0(0,0); sub_8063CF0(entityActionPtr,0); - sub_8044C10(TRUE); + SetLeaderActionToNothing(TRUE); } else if ((entityActionPtr->action == ACTION_SET_MOVE) || (entityActionPtr->action == ACTION_UNSET_MOVE)) { sub_803EAF0(0,0); @@ -957,7 +957,7 @@ bool8 sub_8048B9C(Entity *entity, Item *item) LOOP_MIDDLE: ClearMonsterActionFields(entityActionPtr); - if (sub_8062F90(entity2,1,0,0,1) != 0) { + if (ShowDungeonMovesMenu(entity2,1,0,0,1) != 0) { if (ret) { ASM_MATCH_TRICK(ret); if (DisplayDungeonYesNoMessage(0,*gUnknown_80FECA0,1) == 1) { @@ -969,7 +969,7 @@ bool8 sub_8048B9C(Entity *entity, Item *item) } else { - sub_8044C10(TRUE); + SetLeaderActionToNothing(TRUE); break; } } diff --git a/src/code_805D8C8_1.c b/src/code_805D8C8_1.c index 9cd1975a4..d64df7197 100644 --- a/src/code_805D8C8_1.c +++ b/src/code_805D8C8_1.c @@ -62,9 +62,9 @@ extern bool8 sub_8048A68(Entity *param_1,Item *item); extern bool8 sub_8048950(Entity *param_1,Item *item); extern bool8 sub_8048B9C(Entity *param_1,Item *item); extern Item *sub_8044D90(Entity *, s32, u32); -extern void sub_8083D44(void); -extern void sub_8083D30(void); -extern void sub_8083D08(void); +extern void PlayDungeonStartButtonSE(void); +extern void PlayDungeonCancelSE(void); +extern void PlayDungeonConfirmationSE(void); extern void sub_806A6E8(Entity *); extern bool8 sub_8047084(s32 itemFlag); extern void HandleTrap(Entity *pokemon, DungeonPos *pos, int param_3, char param_4); @@ -73,18 +73,18 @@ bool8 sub_807EF48(void); void sub_806A2BC(Entity *a0, u8 a1); bool8 sub_805E874(void); bool8 sub_80701A4(Entity *a0); -void sub_80647F0(Entity *a0); +void ShowDungeonStairsMenu(Entity *a0); void sub_805E738(Entity *a0); void sub_803E708(s32 a0, s32 a1); void sub_8040A78(void); void sub_805E804(void); -void sub_8064BE0(void); +void ShowDungeonOthersMenu(void); void sub_8075680(u32); void sub_8094C88(void); void sub_8040A84(void); void sub_8047158(void); void sub_806A914(u8 a0, u8 a1, u8 a2); -void sub_8044C10(u8 a0); +void SetLeaderActionToNothing(u8 a0); u16 GetLeaderActionId(void); void sub_80978C8(s16 a0); static void TryCreateModeArrows(Entity *leader); @@ -94,15 +94,15 @@ void sub_803E724(s32 a0); void HandleTalkFieldAction(Entity *); bool8 sub_8044B28(void); bool8 IsNotAttacking(Entity *param_1, bool8 param_2); -void ShowFieldMenu(u8 a0, bool8 a1); +void ShowMainMenu(bool8 fromBPress, bool8 a1); bool8 sub_805EF60(Entity *a0, EntityInfo *a1); s32 GetTeamMemberEntityIndex(Entity *pokemon); bool8 sub_8070F80(Entity * pokemon, s32 direction); -void DrawFieldMenu(u8 a0); -bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1); +void PrintOnMainMenu(bool8 printAll); +bool8 ShowDungeonItemsMenu(Entity * a0, struct UnkMenuBitsStruct *a1); bool8 sub_805FD3C(struct UnkMenuBitsStruct *a0); void sub_8060D24(UNUSED ActionContainer *a0); -bool8 sub_8060E38(Entity *a0); +bool8 ShowDungeonTeamMenu(Entity *a0); void sub_8062D8C(ActionContainer *a0); void sub_80637E8(ActionContainer *a0); void sub_8063B54(ActionContainer *a0); @@ -113,10 +113,10 @@ void sub_8063A70(ActionContainer *a0, bool8 a1); void sub_8063CF0(ActionContainer *a0, bool8 a1); void sub_8067768(ActionContainer *a0); void ShowTacticsMenu(ActionContainer *a0); -void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3); +void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3); extern bool8 sub_8071A8C(Entity *pokemon); extern void sub_80643AC(Entity *pokemon); -extern bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4); +extern bool8 ShowDungeonMovesMenu(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4); extern u8 gUnknown_202EE00; extern Entity *gLeaderPointer; @@ -172,9 +172,9 @@ void DungeonHandlePlayerInput(void) if (gDungeon->unk1 != 0) { gDungeon->unk1 = 0; if (!ShouldMonsterRunAwayAndShowEffect(GetLeader(), TRUE)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); sub_805E804(); - sub_80647F0(GetLeader()); + ShowDungeonStairsMenu(GetLeader()); ResetRepeatTimers(); ResetUnusedInputStruct(); if (GetLeaderActionId() != 0) { @@ -436,7 +436,7 @@ void DungeonHandlePlayerInput(void) SetBGOBJEnableFlags(0x1E); sub_803E708(0xA, 0x2F); while (1) { - sub_803E46C(0x2F); + DungeonRunFrameActions(0x2F); if (gRealInputs.pressed & SELECT_BUTTON) break; if (gRealInputs.pressed & B_BUTTON) @@ -452,8 +452,8 @@ void DungeonHandlePlayerInput(void) gUnknown_202EE00 = 1; sub_8040A84(); SetBGOBJEnableFlags(0); - sub_803E46C(0x2F); - sub_803E46C(0x2F); + DungeonRunFrameActions(0x2F); + DungeonRunFrameActions(0x2F); } if (gDungeon->unk644.unk29 != 0 && !sInDiagonalMode) { @@ -550,7 +550,7 @@ void DungeonHandlePlayerInput(void) } } - sub_803E46C(0xF); + DungeonRunFrameActions(0xF); } if (unkPtr->unk1821A != 0) { @@ -567,16 +567,16 @@ void DungeonHandlePlayerInput(void) gDungeon->unk644.unk29 = 0; if (leaderInfo->action.action != 0) { if (!IsNotAttacking(leader, FALSE)) { - sub_803E46C(0xF); + DungeonRunFrameActions(0xF); } break; } - sub_803E46C(0xF); + DungeonRunFrameActions(0xF); } else { - sub_803E46C(0xF); + DungeonRunFrameActions(0xF); sub_8047158(); - ShowFieldMenu((r6.a0_16 == 0) ? 1 : 0, r6.a0_24); + ShowMainMenu((r6.a0_16 == 0), r6.a0_24); ResetRepeatTimers(); ResetUnusedInputStruct(); sInRotateMode = FALSE; @@ -595,7 +595,7 @@ void DungeonHandlePlayerInput(void) } break; } - sub_803E46C(0xF); + DungeonRunFrameActions(0xF); if (gDungeon->unk4 != 0) break; } @@ -728,7 +728,7 @@ static void TryCreateModeArrows(Entity *leader) if (sInRotateMode && unkPtr->unk1821C != unkPtr->unk1821B) { unkPtr->unk1821C = unkPtr->unk1821B; - sub_804A728(&leader->pos, unkPtr->unk1821B, 0, sInRotateMode); + ChangeDungeonCameraPos(&leader->pos, unkPtr->unk1821B, 0, sInRotateMode); } } @@ -770,7 +770,7 @@ void sub_805E804(void) gDungeon->unk644.unk29 |= gDungeon->unk644.unk28; gDungeon->unk644.unk28 = 0; while (gDungeon->unk644.unk29 != 0 && gRealInputs.held & R_BUTTON) { - sub_803E46C(0x54); + DungeonRunFrameActions(0x54); } } @@ -1087,7 +1087,7 @@ extern void sub_803F508(Entity *); extern void sub_8041AD0(Entity *pokemon); extern void sub_8041AE0(Entity *pokemon); extern void sub_807EC28(bool8); -extern void sub_8083CE0(u8 param_1); +extern void PlayDungeonCursorSE(u8 param_1); extern MenuInputStruct gUnknown_202EE10; @@ -1170,116 +1170,125 @@ static UNUSED EWRAM_DATA u8 sUnused3[4] = {0}; static EWRAM_DATA s32 sTeamMenuChosenId = 0; static UNUSED EWRAM_DATA u8 sUnused4[4] = {0}; -void ShowFieldMenu(u8 a0_, bool8 a1) +enum +{ + MAIN_MENU_MOVES, + MAIN_MENU_ITEMS, + MAIN_MENU_TEAM, + MAIN_MENU_OTHERS, + MAIN_MENU_GROUND, +}; + +void ShowMainMenu(bool8 fromBPress, bool8 a1) { Item *item; s32 r10; - u8 a0 = a0_; // Needed to match. - s32 var_28; + bool8 printAll = fromBPress; + s32 chosenOption; s32 var_24; struct UnkMenuBitsStruct var_30; struct UnkMenuBitsStruct var_34; r10 = gDungeon->unk5C0; - var_28 = 0; + chosenOption = 0; var_24 = (gDungeon->unk5C0 > - 1); gDungeon->unk5C0 = -1; if (r10 >= 0) { - var_28 = r10; + chosenOption = r10; } if (a1) { PlayFanfareSE(0x137, 0x100); } else { - sub_8083D44(); + PlayDungeonStartButtonSE(); } while (1) { if (r10 < 0) { - sub_8044C10(1); + SetLeaderActionToNothing(1); sTeamMenuChosenId = -1; - DrawFieldMenu(a0); + PrintOnMainMenu(printAll); sub_806A2BC(GetLeader(), 0); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1D); + DungeonRunFrameActions(0x1D); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON || gUnknown_202EE10.unk28.a_button)) { if (gUnknown_202749A[gUnknown_202EE10.menuIndex + 1] == 7) { - sub_8083D08(); - var_28 = gUnknown_202EE10.menuIndex; + PlayDungeonConfirmationSE(); + chosenOption = gUnknown_202EE10.menuIndex; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); - var_28 = -1; + PlayDungeonCancelSE(); + chosenOption = -1; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1D); - a0 = 1; + DungeonRunFrameActions(0x1D); + printAll = TRUE; } - r10 = var_28; - if (var_28 == 1) { + r10 = chosenOption; + if (chosenOption == MAIN_MENU_ITEMS) { u16 action; - sub_8044C10(1); + SetLeaderActionToNothing(1); var_34.a0_8 = 0; var_34.a0_16 = 1; var_34.a0_24 = 0; var_34.a0_32 = 0; - if (sub_805FD74(GetLeader(), &var_34)) { + if (ShowDungeonItemsMenu(GetLeader(), &var_34)) { r10 = -1; } - if (sub_805FD3C(&var_34) && sub_805FD74(GetLeader(), &var_34)) { - sub_8044C10(1); + if (sub_805FD3C(&var_34) && ShowDungeonItemsMenu(GetLeader(), &var_34)) { + SetLeaderActionToNothing(1); } action = GetLeaderActionId(); if (action == 12) { sub_8044D90(GetLeader(), 0, 12)->flags |= ITEM_FLAG_UNPAID; sub_8060D24(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (action == 53) { item = sub_8044D90(GetLeader(), 0, 13); if (!sub_8048A68(GetLeader(), item)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); } } else if (action == 16) { item = sub_8044D90(GetLeader(), 0, 14); if (!sub_8048950(GetLeader(), item)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); } } else if (action == 44) { item = sub_8044D90(GetLeader(), 0, 15); if (!sub_8048B9C(GetLeader(), item)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); } } else if (action == 60) { HandleSetItemAction(GetLeader(), TRUE); - sub_8044C10(1); + SetLeaderActionToNothing(1); sub_803E708(0x50, 0x4D); sub_8052210(0); break; } else if (action == 61) { HandleUnsetItemAction(GetLeader(), TRUE); - sub_8044C10(1); + SetLeaderActionToNothing(1); sub_803E708(0x50, 0x4D); sub_8052210(0); break; @@ -1288,31 +1297,31 @@ void ShowFieldMenu(u8 a0_, bool8 a1) if (GetLeaderActionId() != 0) break; } - else if (var_28 == 2) { - sub_8044C10(1); - if (sub_8060E38(GetLeader())) { + else if (chosenOption == MAIN_MENU_TEAM) { + SetLeaderActionToNothing(1); + if (ShowDungeonTeamMenu(GetLeader())) { r10 = -1; } if (GetLeaderActionId() == 0x1B) { sub_8061A38(GetLeaderActionContainer(), FALSE); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 0x1C) { sub_806752C(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 0x34) { sub_8067768(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 0x1A) { ShowTacticsMenu(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 0x30) { sub_8061A38(GetLeaderActionContainer(), TRUE); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 0x19) { s32 i, count; @@ -1337,17 +1346,17 @@ void ShowFieldMenu(u8 a0_, bool8 a1) if (GetLeaderActionId() != 0) break; } - else if (var_28 == 0) { - s32 i, r7, r8, r9, r4; - Entity *r6; + else if (chosenOption == MAIN_MENU_MOVES) { + s32 i, currMonId, teamMonsCount, r9; + Entity *currEntity; - r7 = 0; - sub_8044C10(1); + currMonId = 0; + SetLeaderActionToNothing(1); for (i = 0; i < MAX_TEAM_MEMBERS; i++) { Entity *teamMon = gDungeon->teamPokemon[i]; if (EntityIsValid(teamMon)) { if (GetEntInfo(teamMon)->isTeamLeader) { - r7 = i; + currMonId = i; break; } } @@ -1355,78 +1364,78 @@ void ShowFieldMenu(u8 a0_, bool8 a1) while (1) { - sub_8044C10(0); - LOOP_START_NO_CALL: // Actions 6 and 7 don't call sub_8044C10 - r6 = NULL; + SetLeaderActionToNothing(0); + LOOP_START_NO_CALL: // Actions 6 and 7 don't call SetLeaderActionToNothing + currEntity = NULL; r9 = 0; - r8 = 0; + teamMonsCount = 0; for (i = 0; i < MAX_TEAM_MEMBERS; i++) { Entity *teamMon = gDungeon->teamPokemon[i]; if (sub_8071A8C(teamMon)) { - if (i == r7) { - r9 = r8; - r6 = teamMon; + if (i == currMonId) { + r9 = teamMonsCount; + currEntity = teamMon; } - r8++; + teamMonsCount++; } } - if (r6 == NULL) { - r6 = GetLeader(); + if (currEntity == NULL) { + currEntity = GetLeader(); } - sub_806A2BC(r6, 0); - sub_804A728(&r6->pos, 0, 1, 1); - GetLeaderInfo()->action.actionParameters[0].actionUseIndex = r7; - sub_8044C10(0); - if (sub_8062F90(r6, 0, 1, r9, r8)) { + sub_806A2BC(currEntity, 0); + ChangeDungeonCameraPos(&currEntity->pos, 0, 1, 1); + GetLeaderInfo()->action.actionParameters[0].actionUseIndex = currMonId; + SetLeaderActionToNothing(FALSE); + if (ShowDungeonMovesMenu(currEntity, 0, 1, r9, teamMonsCount)) { r10 = -1; } - if (GetLeaderActionId() == 6) { - r4 = r7; + if (GetLeaderActionId() == ACTION_MOVES_MENU_NEXT_MON) { + s32 prevMonId = currMonId; for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - if (++r7 >= MAX_TEAM_MEMBERS) { - r7 = 0; + if (++currMonId >= MAX_TEAM_MEMBERS) { + currMonId = 0; } - r6 = gDungeon->teamPokemon[r7]; - if (sub_8071A8C(r6)) + currEntity = gDungeon->teamPokemon[currMonId]; + if (sub_8071A8C(currEntity)) break; } - GetLeaderInfo()->action.actionParameters[0].actionUseIndex = r7; - if (r4 != r7) { - sub_8083CE0(0); + GetLeaderInfo()->action.actionParameters[0].actionUseIndex = currMonId; + if (prevMonId != currMonId) { + PlayDungeonCursorSE(0); } goto LOOP_START_NO_CALL; } - else if (GetLeaderActionId() == 7) { - r4 = r7; + else if (GetLeaderActionId() == ACTION_MOVES_MENU_PREV_MON) { + s32 prevMonId = currMonId; for (i = 0; i < MAX_TEAM_MEMBERS; i++) { - if (--r7 < 0) { - r7 = MAX_TEAM_MEMBERS - 1; + if (--currMonId < 0) { + currMonId = MAX_TEAM_MEMBERS - 1; } - r6 = gDungeon->teamPokemon[r7]; - if (sub_8071A8C(r6)) + currEntity = gDungeon->teamPokemon[currMonId]; + if (sub_8071A8C(currEntity)) break; } - GetLeaderInfo()->action.actionParameters[0].actionUseIndex = r7; - if (r4 != r7) { - sub_8083CE0(0); + GetLeaderInfo()->action.actionParameters[0].actionUseIndex = currMonId; + if (prevMonId != currMonId) { + PlayDungeonCursorSE(0); } goto LOOP_START_NO_CALL; } - else if (GetLeaderActionId() == 0x1D) { + else if (GetLeaderActionId() == ACTION_UNK1D) { sub_80637E8(GetLeaderActionContainer()); } - else if (GetLeaderActionId() == 0x1E || GetLeaderActionId() == 0x33) { + else if (GetLeaderActionId() == ACTION_SET_MOVE || GetLeaderActionId() == ACTION_UNSET_MOVE) { sub_8063A70(GetLeaderActionContainer(), FALSE); } - else if (GetLeaderActionId() == 0x1F) { + else if (GetLeaderActionId() == ACTION_UNK1F) { sub_8063B54(GetLeaderActionContainer()); } - else if (GetLeaderActionId() == 0x20) { + else if (GetLeaderActionId() == ACTION_UNK20) { sub_8063BB4(GetLeaderActionContainer()); } - else if (GetLeaderActionId() == 0x21) { + else if (GetLeaderActionId() == ACTION_UNK21) { sub_8063CF0(GetLeaderActionContainer(), FALSE); } else { @@ -1434,11 +1443,11 @@ void ShowFieldMenu(u8 a0_, bool8 a1) } } sub_806A2BC(GetLeader(), 0); - sub_804A728(&GetLeader()->pos, 0, 1, 1); + ChangeDungeonCameraPos(&GetLeader()->pos, 0, 1, 1); if (GetLeaderActionId() != 0) break; } - else if (var_28 == 4) { + else if (chosenOption == MAIN_MENU_GROUND) { Entity *leader = GetLeader(); const Tile *tile = GetTile(leader->pos.x, leader->pos.y); Entity *tileObject = tile->object; @@ -1446,48 +1455,48 @@ void ShowFieldMenu(u8 a0_, bool8 a1) if (GetEntityType(tileObject) == ENTITY_ITEM) { u16 action; - sub_8044C10(1); + SetLeaderActionToNothing(1); var_30.a0_8 = 0; var_30.a0_16 = 1; var_30.a0_24 = 1; var_30.a0_32 = 1; - if (sub_805FD74(GetLeader(), &var_30)) { + if (ShowDungeonItemsMenu(GetLeader(), &var_30)) { // This actually doesn't do anything, it's just there to make the code match as the compiler does a `lsl r0, r0, #0x10, mov r0, r4` ASM_MATCH_TRICK(leader); } - if (sub_805FD3C(&var_30) && sub_805FD74(GetLeader(), &var_30)) { - sub_8044C10(1); + if (sub_805FD3C(&var_30) && ShowDungeonItemsMenu(GetLeader(), &var_30)) { + SetLeaderActionToNothing(1); } action = GetLeaderActionId(); if (action == 0xC) { sub_8044D90(GetLeader(), 0, 0x10)->flags |= ITEM_FLAG_UNPAID; sub_8060D24(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (action == 0x35) { item = sub_8044D90(GetLeader(), 0, 0x11); if (!sub_8048A68(GetLeader(), item)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); } } else if (action == 0x10) { item = sub_8044D90(GetLeader(), 0, 0x12); if (!sub_8048950(GetLeader(), item)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); } } else if (action == 0x2C) { item = sub_8044D90(GetLeader(), 0, 0x13); if (!sub_8048B9C(GetLeader(), item)) { - sub_8044C10(1); + SetLeaderActionToNothing(1); } } if (GetLeaderActionId() != 0) break; } else if (GetEntityType(tileObject) == ENTITY_TRAP) { - sub_8044C10(1); + SetLeaderActionToNothing(1); sub_80643AC(GetLeader()); if (GetLeaderActionId() != 0) break; @@ -1496,8 +1505,8 @@ void ShowFieldMenu(u8 a0_, bool8 a1) else { if (tile->terrainType & TERRAIN_TYPE_STAIRS) { - sub_8044C10(1); - sub_80647F0(GetLeader()); + SetLeaderActionToNothing(1); + ShowDungeonStairsMenu(GetLeader()); if (GetLeaderActionId() != 0) break; } @@ -1508,8 +1517,8 @@ void ShowFieldMenu(u8 a0_, bool8 a1) } r10 = -1; } - else if (var_28 == 3) { - sub_8064BE0(); + else if (chosenOption == MAIN_MENU_OTHERS) { + ShowDungeonOthersMenu(); if (gDungeon->unk4) break; if (GetLeaderActionId() != 0) @@ -1517,7 +1526,8 @@ void ShowFieldMenu(u8 a0_, bool8 a1) r10 = -1; } - if (var_28 < 0) + // B button + if (chosenOption < 0) break; if (var_24 == 0) { @@ -1552,7 +1562,7 @@ void GetWeatherName(u8 *dst, u8 weatherId); extern s32 gFormatArgs[]; -void DrawFieldMenu(u8 a0) +void PrintOnMainMenu(bool8 printAll) { s32 i, x, y, yLoop; @@ -1568,7 +1578,7 @@ void DrawFieldMenu(u8 a0) gUnknown_202EE10.unk14.x = 0; sub_801317C(&gUnknown_202EE10.unk28); sub_80137B0(&gUnknown_202EE10, 0x38); - if (a0) { + if (printAll) { sub_803EAF0(7, NULL); } else { @@ -1608,7 +1618,7 @@ void DrawFieldMenu(u8 a0) PrintStringOnWindow(8, y, gFieldMenuGroundPtr, 0, 0); sub_80073E0(0); - if (a0) { + if (printAll) { u32 hours, minutes, seconds; EntityInfo *leaderInfo = GetEntInfo(GetLeader()); const u8 *dungeonName = GetCurrentDungeonName(); @@ -1657,12 +1667,12 @@ bool8 sub_805FBE8(u8 *a0) sub_803EAF0(8, a0); do { - sub_803E46C(0xE); + DungeonRunFrameActions(0xE); DrawDialogueBoxString(); r4 = sub_8016080(); } while (r4 == 0); CleanConfirmNameMenu(); - sub_803E46C(0xE); + DungeonRunFrameActions(0xE); sub_803EAF0(0, NULL); if (r4 == 3 && *a0 != 0) return TRUE; @@ -1676,7 +1686,7 @@ extern s32 gUnknown_202EE6C; extern const u8 gUnknown_8106B50[]; extern void sub_803ECB4(Windows *a0, u8 a1); -static void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, Windows *a4, WindowHeader *a5); +static void PrintOnDungeonItemsMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, Windows *a4, WindowHeader *a5); void sub_805FC30(Windows *a0, s32 a1) { @@ -1761,7 +1771,7 @@ s32 sub_8060800(WindowHeader *a0, s32 a1); void sub_8060CE8(ActionContainer *a0); Entity *DrawFieldGiveItemMenu(s32 *teamId, s32 a1); -bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) +bool8 ShowDungeonItemsMenu(Entity * a0, struct UnkMenuBitsStruct *a1) { s32 i, i_r6; s32 r8; @@ -1839,7 +1849,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) } } } - CreateFieldItemMenu(r8, a0, var_2C, var_30, &var_FC, &var_3C); + PrintOnDungeonItemsMenu(r8, a0, var_2C, var_30, &var_FC, &var_3C); id = sUnknown_202F248[gUnknown_202EE10.unk1E]; if (id >= MAX_TEAM_MEMBERS) { @@ -1849,15 +1859,15 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) r4 = a0; } sub_806A2BC(r4, 0); - sub_804A728(&r4->pos, 0, 1, 1); + ChangeDungeonCameraPos(&r4->pos, 0, 1, 1); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x14); + DungeonRunFrameActions(0x14); if (!var_30) { if (sUnknown_202F258 > 1) { if ((gRealInputs.pressed & DPAD_LEFT) || gUnknown_202EE10.unk28.dpad_left) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); if (--r8 < 0) { r8 = sUnknown_202F258 - 1; } @@ -1865,7 +1875,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) break; } if ((gRealInputs.pressed & DPAD_RIGHT) || gUnknown_202EE10.unk28.dpad_right) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); if (++r8 == sUnknown_202F258) { r8 = 0; } @@ -1874,12 +1884,12 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) } } if (gRealInputs.repeated & DPAD_DOWN && sub_8060860(r8)) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP && sub_8060860(r8)) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.pressed & SELECT_BUTTON && sUnknown_202F248[r8] <= 1) { s32 r3; @@ -1912,19 +1922,19 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) break; } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { - sub_8083D08(); + PlayDungeonConfirmationSE(); sub_8060890(&a0->pos); r9 = 1; break; } if (gRealInputs.pressed & START_BUTTON) { - sub_8083D44(); + PlayDungeonStartButtonSE(); sub_8060890(&a0->pos); r9 = 3; break; } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); r9 = 2; break; } @@ -1936,7 +1946,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x14); + DungeonRunFrameActions(0x14); if (sUnknown_202F248[gUnknown_202EE10.unk1E] <= 1 && !(gTeamInventoryRef->teamItems[0].flags & ITEM_FLAG_EXISTS)) { r9 = 2; } @@ -1970,32 +1980,32 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) sub_805FC30(&var_FC, 0x16); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x14); + DungeonRunFrameActions(0x14); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (sub_8044F3C(gUnknown_202EE10.menuIndex)) { - sub_8083D08(); + PlayDungeonConfirmationSE(); sub_8060CE8(&a0Info->action); r9 = 0; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); r9 = 1; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x14); + DungeonRunFrameActions(0x14); gDungeon->unk181e8.unk18212 = 0; if (r9 != 1 || var_30 != 0) { if (a0Info->action.action == 0x37 || a0Info->action.action == 0x38 || a0Info->action.action == 0x3E) { @@ -2015,7 +2025,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) break; } sub_803EAF0(0, NULL); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else { sub_803EAF0(0, 0); @@ -2036,7 +2046,7 @@ bool8 sub_805FD74(Entity * a0, struct UnkMenuBitsStruct *a1) extern const struct Window gUnknown_8106B6C; extern const struct unkStruct_8090F58 gUnknown_8106B60; -static void CreateFieldItemMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, Windows *windows, WindowHeader *a5) +static void PrintOnDungeonItemsMenu(s32 a0, Entity *a1, bool8 a2, bool8 a3, Windows *windows, WindowHeader *a5) { s32 i, x, y; s32 r10; @@ -2457,7 +2467,7 @@ void sub_8060D24(UNUSED ActionContainer *a0) sub_801B3C0(item); do { - sub_803E46C(0x16); + DungeonRunFrameActions(0x16); } while (sub_801B410() == 0); sub_801B450(); @@ -2505,30 +2515,33 @@ struct UnkFieldTeamMenuStruct u8 unk14[MAX_TEAM_MEMBERS]; }; -void DrawFieldTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *a1, bool8 a2); +void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *a1, bool8 a2); void sub_806145C(struct UnkFieldTeamMenuStruct *a0); void sub_80615B4(ActionContainer *a0, struct UnkFieldTeamMenuStruct *a1); extern u8 gUnknown_202EE39; -bool8 sub_8060E38(Entity *a0) +bool8 ShowDungeonTeamMenu(Entity *a0) { s32 i; bool32 r10, ret; - struct UnkFieldTeamMenuStruct sp; - Windows var_84 = {0}; - - var_84.id[0].type = WINDOW_TYPE_WITH_HEADER; - var_84.id[0].pos.x = 2; - var_84.id[0].pos.y = 2; - var_84.id[0].width = 0xE; - var_84.id[0].height = 0x10; - var_84.id[0].unk10 = 0x10; - var_84.id[0].unk14 = &gUnknown_202F270; - var_84.id[1].type = WINDOW_TYPE_NORMAL; - var_84.id[2].type = WINDOW_TYPE_NORMAL; - var_84.id[3].type = WINDOW_TYPE_NORMAL; + Windows windows = { + .id = { + [0] = { + .type = WINDOW_TYPE_WITH_HEADER, + .pos = {2, 2}, + .width = 14, + .height = 16, + .unk10 = 16, + .unk12 = 0, + .unk14 = &gUnknown_202F270, + }, + [1] = WINDOW_DUMMY, + [2] = WINDOW_DUMMY, + [3] = WINDOW_DUMMY, + } + }; for (i = 0; i < MAX_TEAM_MEMBERS; i++) { Entity *teamMon = gDungeon->teamPokemon[i]; @@ -2538,8 +2551,8 @@ bool8 sub_8060E38(Entity *a0) } if (!gDungeon->unk644.unk17) { - var_84.id[0].type = WINDOW_TYPE_NORMAL; - var_84.id[0].pos.y++; + windows.id[0].type = WINDOW_TYPE_NORMAL; + windows.id[0].pos.y++; } while (1) { @@ -2547,44 +2560,44 @@ bool8 sub_8060E38(Entity *a0) bool32 r4; ret = FALSE; - DrawFieldTeamMenu(&sp, &var_84, TRUE); + PrintOnDungeonTeamMenu(&sp, &windows, TRUE); r10 = FALSE; while (1) { s32 id = sp.unk4[gUnknown_202EE10.menuIndex]; if (id >= 0) { Entity *teamMon = gDungeon->teamPokemon[id]; sub_806A2BC(teamMon, 0); - sub_804A728(&teamMon->pos, 0, 1, 1); + ChangeDungeonCameraPos(&teamMon->pos, 0, 1, 1); } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.pressed & START_BUTTON) { if (sp.unk14[gUnknown_202EE10.menuIndex] != 0) { - sub_8083D44(); + PlayDungeonStartButtonSE(); r10 = TRUE; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (sp.unk14[gUnknown_202EE10.menuIndex] != 0) { - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); ret = TRUE; break; } @@ -2594,11 +2607,11 @@ bool8 sub_8060E38(Entity *a0) if (id >= 0) { Entity *teamMon = gDungeon->teamPokemon[id]; sub_806A2BC(teamMon, 0); - sub_804A728(&teamMon->pos, 0, 1, 1); + ChangeDungeonCameraPos(&teamMon->pos, 0, 1, 1); } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); sub_804AA60(); if (ret) { break; @@ -2615,35 +2628,35 @@ bool8 sub_8060E38(Entity *a0) break; } - sub_805FC30(&var_84, 0x12); + sub_805FC30(&windows, 0x12); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (sub_8044F3C(gUnknown_202EE10.menuIndex)) { sub_80615B4(&GetEntInfo(a0)->action, &sp); - sub_8083D08(); + PlayDungeonConfirmationSE(); r4 = FALSE; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); r4 = TRUE; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); if (r4 != TRUE) { ret = FALSE; break; @@ -2675,7 +2688,7 @@ extern const u8 gUnknown_8106BF4[]; extern void sub_8070968(u8 *buffer, EntityInfo *entityInfo, s32 colorNum); -void DrawFieldTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *windows, bool8 a2) +void PrintOnDungeonTeamMenu(struct UnkFieldTeamMenuStruct *a0, Windows *windows, bool8 a2) { s32 r0; DungeonPos pos; @@ -2935,41 +2948,41 @@ void ShowTacticsMenu(ActionContainer *a0) if (scrollFirstId != 0) { sub_8062230(); } - sub_803E46C(0x3D); + DungeonRunFrameActions(0x3D); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 7) { if (tacticIds[8] != TACTIC_UNUSED) { for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(0x3D); + DungeonRunFrameActions(0x3D); } scrollFirstId++; } menuIndex = 7; break; } - sub_80136E0(&gUnknown_202EE10, 0); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, 0); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 0) { if (scrollFirstId != 0) { for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(0x3D); + DungeonRunFrameActions(0x3D); } scrollFirstId--; } menuIndex = 0; break; } - sub_8013744(&gUnknown_202EE10, 0); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, 0); } if (gRealInputs.pressed & START_BUTTON) { u32 tacticId = tacticIds[gUnknown_202EE10.menuIndex]; menuIndex = gUnknown_202EE10.menuIndex; - sub_8083D44(); + PlayDungeonStartButtonSE(); sub_8062748(tacticId); loopBreak = FALSE; break; @@ -2980,7 +2993,7 @@ void ShowTacticsMenu(ActionContainer *a0) u32 tacticId = tacticIds[gUnknown_202EE10.menuIndex]; menuIndex = gUnknown_202EE10.menuIndex; sub_8062D68(); - sub_8083D08(); + PlayDungeonConfirmationSE(); gUnknown_202EE6C = 0; sub_8044F5C(0x2F, 0); sub_8044F5C(0xC, 0); @@ -2991,30 +3004,30 @@ void ShowTacticsMenu(ActionContainer *a0) while (1) { changed = FALSE; AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x3D); + DungeonRunFrameActions(0x3D); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (sub_8044F3C(gUnknown_202EE10.menuIndex)) { changed = TRUE; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); changed = FALSE; break; } } if (changed) { - sub_8083D08(); + PlayDungeonConfirmationSE(); if (gUnknown_202EE10.menuIndex == 0) { PlaySoundEffect(0x133); monInfo->tactic = tacticId; @@ -3035,7 +3048,7 @@ void ShowTacticsMenu(ActionContainer *a0) break; } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); loopBreak = TRUE; break; } @@ -3044,7 +3057,7 @@ void ShowTacticsMenu(ActionContainer *a0) if (addCursor) { AddMenuCursorSprite(&gUnknown_202EE10); } - sub_803E46C(0x3D); + DungeonRunFrameActions(0x3D); if (loopBreak) break; } @@ -3256,10 +3269,10 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) } } - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); if (gUnknown_202F270.f0 > 1 && !sub_80048C8()) { if ((gRealInputs.pressed & DPAD_RIGHT) || gUnknown_202EE10.unk28.dpad_right) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); var_3C++; if (spArr[var_3C] == 0) { var_3C = 0; @@ -3267,7 +3280,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } if ((gRealInputs.pressed & DPAD_LEFT) || gUnknown_202EE10.unk28.dpad_left) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); var_3C--; if (var_3C == -1) { var_3C = 5; @@ -3281,12 +3294,12 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) if (var_2C) { if (unkVar == 2 && r5) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); if (unkInfoTabStruct.unkC[8] != 0) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk56++; } @@ -3294,13 +3307,13 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); if (gUnknown_202EE10.menuIndex == 7) { if (unkInfoTabStruct.unkC[8] != 0) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk56++; } @@ -3308,7 +3321,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } else { - sub_80136E0(&gUnknown_202EE10, 0); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, 0); } } @@ -3317,7 +3330,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk56--; } @@ -3325,13 +3338,13 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 0) { if (unkMonStruct.unk56 != 0) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk56--; } @@ -3339,7 +3352,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } else { - sub_8013744(&gUnknown_202EE10, 0); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, 0); } } } @@ -3349,7 +3362,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk40++; } @@ -3357,13 +3370,13 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 7) { if (unkInfoTabStruct.unk0[8] != 0) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk40++; } @@ -3371,7 +3384,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } else { - sub_80136E0(&gUnknown_202EE10, 0); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, 0); } } @@ -3380,7 +3393,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk40--; } @@ -3388,13 +3401,13 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 0) { if (unkMonStruct.unk40 != 0) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(28); + DungeonRunFrameActions(28); } unkMonStruct.unk40--; } @@ -3402,7 +3415,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) break; } else { - sub_8013744(&gUnknown_202EE10, 0); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, 0); } } } @@ -3415,7 +3428,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) s32 var = unkInfoTabStruct.unkC[gUnknown_202EE10.menuIndex]; r8 = gUnknown_202EE10.menuIndex; - sub_8083D44(); + PlayDungeonStartButtonSE(); sub_806285C(var); var_28 = 0; loopBreak = FALSE; @@ -3425,7 +3438,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) s32 var = unkInfoTabStruct.unk0[gUnknown_202EE10.menuIndex]; r8 = gUnknown_202EE10.menuIndex; - sub_8083D44(); + PlayDungeonStartButtonSE(); sub_806262C(var); var_28 = 0; loopBreak = FALSE; @@ -3440,30 +3453,30 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) r8 = gUnknown_202EE10.menuIndex; sub_8062D68(); gUnknown_202EE6C = 0; - sub_8083D08(); + PlayDungeonConfirmationSE(); sub_8044F5C(0xC, 0); sub_805FC30(&windows, 0x16); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { - sub_8083D08(); + PlayDungeonConfirmationSE(); sub_806285C(var); var_28 = 0; loopBreak = FALSE; break; } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); loopBreak = FALSE; break; } @@ -3476,7 +3489,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) r8 = gUnknown_202EE10.menuIndex; sub_8062D68(); gUnknown_202EE6C = var_2C; - sub_8083D08(); + PlayDungeonConfirmationSE(); sub_8044F5C(0x28, 0); sub_8044F5C(0xC, 0); if (CheckVariousStatuses2(entity, TRUE)) { @@ -3485,26 +3498,26 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) sub_805FC30(&windows, 0x16); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (sub_8044F3C(gUnknown_202EE10.menuIndex)) { - sub_8083D08(); + PlayDungeonConfirmationSE(); aPress = TRUE; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); loopBreak = FALSE; aPress = FALSE; break; @@ -3525,13 +3538,13 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) } } else { - sub_8083D08(); + PlayDungeonConfirmationSE(); loopBreak = TRUE; } break; } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); loopBreak = TRUE; break; } @@ -3541,7 +3554,7 @@ void sub_8061A38(ActionContainer *a0, bool8 a1) if (var_30 != 0 || var_2C != 0) { AddMenuCursorSprite(&gUnknown_202EE10); } - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); } if (loopBreak) { @@ -3643,17 +3656,16 @@ void sub_80625A4(s32 count, struct subStruct_203B240 **strings) sub_8062500(); } nullsub_34(&menuSub, 0); - sub_803E46C(0x16); + DungeonRunFrameActions(0x16); if ((gRealInputs.pressed & A_BUTTON) || menuSub.a_button) { - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } if ((gRealInputs.pressed & B_BUTTON) || menuSub.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); break; } } - } } @@ -3706,15 +3718,15 @@ void sub_806262C(u8 iqSkillId) sub_8062500(); } nullsub_34(&menuSub, 0); - sub_803E46C(0x16); + DungeonRunFrameActions(0x16); if ((gRealInputs.pressed & A_BUTTON) || menuSub.a_button) { bPress = FALSE; - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } if ((gRealInputs.pressed & B_BUTTON) || menuSub.b_button) { bPress = TRUE; - sub_8083D30(); + PlayDungeonCancelSE(); break; } } @@ -3759,15 +3771,15 @@ void sub_8062748(u8 tacticId) sub_8062500(); } nullsub_34(&menuSub, 0); - sub_803E46C(62); + DungeonRunFrameActions(62); if ((gRealInputs.pressed & A_BUTTON) || menuSub.a_button) { bPress = FALSE; - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } if ((gRealInputs.pressed & B_BUTTON) || menuSub.b_button) { bPress = TRUE; - sub_8083D30(); + PlayDungeonCancelSE(); break; } } @@ -3818,13 +3830,13 @@ void sub_806285C(s32 a0) while (1) { nullsub_34(&menuSub, 0); - sub_803E46C(22); + DungeonRunFrameActions(22); if ((gRealInputs.pressed & A_BUTTON) || menuSub.a_button) { - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } if ((gRealInputs.pressed & B_BUTTON) || menuSub.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); break; } } @@ -3854,7 +3866,7 @@ Entity *DrawFieldGiveItemMenu(s32 *teamId, s32 a1) windows.id[2] = gUnknown_8106C18; } - DrawFieldTeamMenu(&unkStruct, &windows, FALSE); + PrintOnDungeonTeamMenu(&unkStruct, &windows, FALSE); sub_80073B8(1); PrintStringOnWindow(4, 3, gWhichTextPtr2, 1, '\0'); sub_80073E0(1); @@ -3876,36 +3888,36 @@ Entity *DrawFieldGiveItemMenu(s32 *teamId, s32 a1) } prevId = currId; sub_806A2BC(entity, 0); - sub_804A728(&entity->pos, 0, 1, 1); + ChangeDungeonCameraPos(&entity->pos, 0, 1, 1); } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (unkStruct.unk14[gUnknown_202EE10.menuIndex] != 0) { - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); bPress = TRUE; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); sub_804AA60(); sub_806A2BC(GetLeader(), 0); sub_803EAF0(0, 0); @@ -4039,9 +4051,9 @@ void sub_8062D8C(ActionContainer *a0) } sub_806A2BC(entityNew, 0); - sub_804A728(&entityNew->pos, 0, 1, 1); - sub_8044C10(1); - if (sub_8062F90(entityNew, 0, 1, countUntilId, count)) { + ChangeDungeonCameraPos(&entityNew->pos, 0, 1, 1); + SetLeaderActionToNothing(1); + if (ShowDungeonMovesMenu(entityNew, 0, 1, countUntilId, count)) { return; } @@ -4059,9 +4071,9 @@ void sub_8062D8C(ActionContainer *a0) a0->actionParameters[0].actionUseIndex = id; if (idBefore != id) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); } - sub_8044C10(1); + SetLeaderActionToNothing(1); } // Everything is the same as in the above if except for add/sub difference. else if (GetLeaderActionId() == 7) { @@ -4078,33 +4090,33 @@ void sub_8062D8C(ActionContainer *a0) a0->actionParameters[0].actionUseIndex = id; if (idBefore != id) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); } - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 29) { sub_80637E8(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 30) { sub_803EAF0(0, NULL); sub_8063A70(GetLeaderActionContainer(), TRUE); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 51) { sub_803EAF0(0, NULL); sub_8063A70(GetLeaderActionContainer(), FALSE); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 31) { sub_803EAF0(0, NULL); sub_8063B54(GetLeaderActionContainer()); - sub_8044C10(1); + SetLeaderActionToNothing(1); } else if (GetLeaderActionId() == 33) { sub_803EAF0(0, NULL); sub_8063CF0(GetLeaderActionContainer(), TRUE); - sub_8044C10(1); + SetLeaderActionToNothing(1); } if (GetLeaderActionId() != 0) @@ -4112,7 +4124,7 @@ void sub_8062D8C(ActionContainer *a0) } sub_806A2BC(entityOrg, 0); - sub_804A728(&entityOrg->pos, 0, 1, 1); + ChangeDungeonCameraPos(&entityOrg->pos, 0, 1, 1); } extern s32 gUnknown_202F2D8; @@ -4123,7 +4135,7 @@ void sub_8063698(Entity *entity, u8 a1, u8 a2); void sub_80637BC(ActionContainer *a0, s32 a1, s32 a2); void sub_80637A4(ActionContainer *a0, s32 a1); -bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) +bool8 ShowDungeonMovesMenu(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) { s32 i; bool8 ret; @@ -4147,7 +4159,7 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) [3] = WINDOW_DUMMY, } }; - u8 unk[0x60]; + u8 unk[4]; bool8 r10; s32 r5; bool8 bPress; @@ -4169,7 +4181,7 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) sub_80633E4(entity, entInfo, a1, &windows, &header, unk, a3, a4); while (1) { AddMenuCursorSprite_(&gUnknown_202EE10, unk); - sub_803E46C(0x1E); + DungeonRunFrameActions(0x1E); if (gRealInputs.repeated & DPAD_DOWN) { bool8 rHeld = (gRealInputs.held & R_BUTTON) != 0; s32 id = gUnknown_202EE10.menuIndex; @@ -4177,10 +4189,10 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) if (rHeld) { gUnknown_202F2D8 = unk_SetMoveToLastInLinkedSequence4(entInfo->moves.moves, id); if (id != gUnknown_202F2D8) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); } else { - sub_8083D30(); + PlayDungeonCancelSE(); } r10 = TRUE; break; @@ -4188,7 +4200,7 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) else { sub_8013780(&gUnknown_202EE10, unk_FindMoveEnabledForAIAfter4(entInfo->moves.moves, id)); if (id != gUnknown_202EE10.menuIndex) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); } } } @@ -4199,10 +4211,10 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) if (rHeld) { gUnknown_202F2D8 = unk_SetMoveToFirstInLinkedSequence4(entInfo->moves.moves, id); if (id != gUnknown_202F2D8) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); } else { - sub_8083D30(); + PlayDungeonCancelSE(); } r10 = TRUE; break; @@ -4210,7 +4222,7 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) else { sub_8013780(&gUnknown_202EE10, sub_8092DB8(entInfo->moves.moves, id)); if (id != gUnknown_202EE10.menuIndex) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); } } } @@ -4231,26 +4243,26 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) r5 = 3; } } - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } if (gRealInputs.pressed & START_BUTTON) { r5 = 1; - sub_8083D44(); + PlayDungeonStartButtonSE(); break; } if (gRealInputs.pressed & SELECT_BUTTON) { r5 = 2; - sub_8083D44(); + PlayDungeonStartButtonSE(); break; } // Fixme: r0/r1 regswap... { - u32 pressed = B_BUTTON; - pressed &= gRealInputs.pressed; - if ((pressed) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + u32 bPressed = B_BUTTON; + bPressed &= gRealInputs.pressed; + if ((bPressed) || gUnknown_202EE10.unk28.b_button) { + PlayDungeonCancelSE(); ret = TRUE; break; } @@ -4258,7 +4270,7 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1E); + DungeonRunFrameActions(0x1E); if (leaderInfo->action.action == 6 || leaderInfo->action.action == 7) { unkBool = FALSE; break; @@ -4323,36 +4335,36 @@ bool8 sub_8062F90(Entity * entity, u8 a1, u8 a2, s32 a3, s32 a4) sub_805FC30(&windows, 0x16); while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, TRUE); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, TRUE); } if ((gRealInputs.pressed & sub_8062D88()) || gUnknown_202EE10.unk28.a_button) { if (sub_8044F3C(gUnknown_202EE10.menuIndex)) { sub_80637A4(&leaderInfo->action, GetTeamMemberEntityIndex(entity)); if (leaderInfo->action.action != 20 && leaderInfo->action.action != 21) { - sub_8083D08(); + PlayDungeonConfirmationSE(); } bPress = FALSE; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); bPress = TRUE; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x1B); + DungeonRunFrameActions(0x1B); if (bPress != TRUE) { ret = 0; break; diff --git a/src/code_8066D04.c b/src/code_8066D04.c index 1b653f171..d1e358666 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -899,7 +899,7 @@ void sub_8067904(Entity *entity, u16 moveId) extern void sub_80684C4(void); void sub_8045064(void); -extern void sub_8083CE0(u8 param_1); +extern void PlayDungeonCursorSE(u8 param_1); extern void sub_8068344(void); bool8 sub_8044F3C(s32 param_1); void sub_8068310(s32 a0, PokemonStruct1 **a1); @@ -907,8 +907,8 @@ void sub_8067F00(u8 a0, PokemonStruct1 **a1, s32 a2, s32 a3, s32 a4); extern void sub_803ECB4(Windows *a0, u8 a1); u32 sub_8014140(s32 a0, const void *a1); void sub_8083D1C(void); -void sub_8083D08(void); -void sub_8083D30(void); +void PlayDungeonConfirmationSE(void); +void PlayDungeonCancelSE(void); void sub_806806C(PokemonStruct1 *a0); void sub_805FC30(Windows *a0, s32 a1); extern void sub_803EAF0(u32, u8 *); @@ -1011,13 +1011,13 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) } r4 = sub_8014140(0, gUnknown_8106DA4); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); if (r4 == 2 && r5) { if (a2 - gUnknown_202F30C > 8) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); } gUnknown_202F30C++; } @@ -1026,13 +1026,13 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) break; } if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 7) { if (a2 - gUnknown_202F30C > 8) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); } gUnknown_202F30C++; } @@ -1040,7 +1040,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) r10 = 7; break; } - sub_80136E0(&gUnknown_202EE10, 0); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, 0); } if (r4 == 1 && r7 != 0) { @@ -1048,7 +1048,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); } gUnknown_202F30C--; } @@ -1057,13 +1057,13 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) break; } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); + PlayDungeonCursorSE(1); if (gUnknown_202EE10.menuIndex == 0) { if (gUnknown_202F30C != 0) { s32 i; for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); } gUnknown_202F30C--; } @@ -1071,7 +1071,7 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) r10 = 0; break; } - sub_8013744(&gUnknown_202EE10, 0); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, 0); } if (sub_80048C8()) { @@ -1084,19 +1084,19 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) break; } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { - sub_8083D08(); + PlayDungeonConfirmationSE(); r7 = 1; break; } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); r7 = 2; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); if (r7 == 0) { continue; } @@ -1146,34 +1146,34 @@ void sub_8067A80(u8 a0, s32 a1, s32 a2, PokemonStruct1 **a3) while (1) { AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); if (gRealInputs.repeated & DPAD_DOWN) { - sub_8083CE0(1); - sub_80136E0(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorDownWrapAround(&gUnknown_202EE10, 1); } if (gRealInputs.repeated & DPAD_UP) { - sub_8083CE0(1); - sub_8013744(&gUnknown_202EE10, 1); + PlayDungeonCursorSE(1); + MoveMenuCursorUpWrapAround(&gUnknown_202EE10, 1); } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { if (sub_8044F3C(gUnknown_202EE10.menuIndex)) { - sub_8083D08(); + PlayDungeonConfirmationSE(); r7 = 1; break; } - sub_8083D30(); + PlayDungeonCancelSE(); } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); r7 = 0; break; } } AddMenuCursorSprite(&gUnknown_202EE10); - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); if (r7 != 0) { if (gUnknown_202EE10.menuIndex == 0) { a3[arrId]->unk0 |= 0x8000; @@ -1312,16 +1312,16 @@ void sub_806806C(PokemonStruct1 *a0) } r5 = sub_8014140(0, gUnknown_8106DA4); - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); if ((gRealInputs.pressed & DPAD_RIGHT) || gUnknown_202EE10.unk28.dpad_right) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); if (++r7 == 4) { r7 = 0; } break; } if ((gRealInputs.pressed & DPAD_LEFT) || gUnknown_202EE10.unk28.dpad_left) { - sub_8083CE0(0); + PlayDungeonCursorSE(0); if (--r7 == -1) { r7 = 3; } @@ -1332,10 +1332,10 @@ void sub_806806C(PokemonStruct1 *a0) if (((gRealInputs.repeated & DPAD_DOWN) || r5 == 2) && var_C8.unk0[8] != 0) { s32 i; - sub_8083CE0(0); + PlayDungeonCursorSE(0); for (i = 0; i < 6; i++) { gIwramTextFunc1(0); - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); } unkStruct.unk40++; break; @@ -1343,10 +1343,10 @@ void sub_806806C(PokemonStruct1 *a0) if (((gRealInputs.repeated & DPAD_UP) || r5 == 1) && unkStruct.unk40 != 0) { s32 i; - sub_8083CE0(0); + PlayDungeonCursorSE(0); for (i = 0; i < 6; i++) { gIwramTextFunc2(0); - sub_803E46C(0x1C); + DungeonRunFrameActions(0x1C); } unkStruct.unk40--; break; @@ -1358,18 +1358,18 @@ void sub_806806C(PokemonStruct1 *a0) } if ((gRealInputs.pressed & A_BUTTON) || gUnknown_202EE10.unk28.a_button) { - sub_8083D08(); + PlayDungeonConfirmationSE(); loopBreak = TRUE; break; } if ((gRealInputs.pressed & B_BUTTON) || gUnknown_202EE10.unk28.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); loopBreak = TRUE; break; } } - sub_803E46C(0x37); + DungeonRunFrameActions(0x37); if (loopBreak) { break; } diff --git a/src/code_8069E0C.c b/src/code_8069E0C.c index 7181cc058..baea43318 100644 --- a/src/code_8069E0C.c +++ b/src/code_8069E0C.c @@ -310,7 +310,7 @@ void sub_806A2BC(Entity *pokemon, u8 param_2) if (param_2 != '\0') { sub_804178C(1); while (gDungeon->unk12 < 0x3c) { - sub_803E46C(0x34); + DungeonRunFrameActions(0x34); } } sub_803E708(4,0x44); diff --git a/src/code_806CD90.c b/src/code_806CD90.c index b992b90b4..0810e0ac0 100644 --- a/src/code_806CD90.c +++ b/src/code_806CD90.c @@ -209,7 +209,7 @@ void sub_806CF18(Entity *entity) entityInfo = GetEntInfo(entity); for (i = 0; i < 100; i++) { - sub_803E46C(33); + DungeonRunFrameActions(33); if (!sub_808DA44(entityInfo->apparentID, entity->axObj.unk43_animId2)) break; diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 6a06e5be5..fa2eb2d7d 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -912,7 +912,7 @@ bool8 UseAttack(Entity *a0) if (gDungeon->unk644.unk28 == 0 && r9) { sub_80526D0(0x35); for (loop = 0; loop < 24 / gUnknown_202F378; loop++) { - sub_803E46C(7); + DungeonRunFrameActions(7); for (i = 0; i < DUNGEON_MAX_POKEMON; i++) { Entity *mon = gDungeon->activePokemon[i]; if (EntityIsValid(mon)) { diff --git a/src/code_8077274_1.c b/src/code_8077274_1.c index 24550b07c..522521b4e 100644 --- a/src/code_8077274_1.c +++ b/src/code_8077274_1.c @@ -370,7 +370,7 @@ void BlindTarget(Entity *pokemon, Entity *target) entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gBlinkerTurnRange, TRUE) + 1; sub_8041E0C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB7F4); - sub_803E46C(0x31); + DungeonRunFrameActions(0x31); sub_8049ED4(); sub_8040A84(); } @@ -423,7 +423,7 @@ void RestoreVisionTarget(Entity *pokemon, Entity *target) entityInfo->blinkerClassStatus.turns = CalculateStatusTurns(target,gEyedropsTurnRange, FALSE) + 1; sub_8041E3C(target); TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FB880); - sub_803E46C(0x31); + DungeonRunFrameActions(0x31); sub_8049ED4(); sub_8040A84(); } @@ -691,7 +691,7 @@ void SetChargeStatusTarget(Entity *pokemon, Entity *target, u8 newStatus, Move * if (bVar2) { break; } - sub_803E46C(0x53); + DungeonRunFrameActions(0x53); } } } @@ -1506,7 +1506,7 @@ void SendEyesightEndMessage(Entity * pokemon,Entity * target) entityInfo->blinkerClassStatus.status = STATUS_NONE; EntityUpdateStatusSprites(target); if (entityInfo->isTeamLeader) { - sub_803E46C(0x31); + DungeonRunFrameActions(0x31); sub_8049ED4(); sub_8040A84(); } @@ -1734,7 +1734,7 @@ void sub_807AB38(Entity *entity, bool8 forcedMonsterHouse) if (newMonster->unk1C.raw < IntToF248_2(1).raw) { break; } - sub_803E46C(0x57); + DungeonRunFrameActions(0x57); } newMonster->unk1C = IntToF248_2(0); } diff --git a/src/code_807CD9C.c b/src/code_807CD9C.c index 1edaa4117..0596c8e4f 100644 --- a/src/code_807CD9C.c +++ b/src/code_807CD9C.c @@ -129,7 +129,7 @@ void BlowAwayTarget(Entity *pokemon, Entity *target, u32 direction) { IncreaseEntityPixelPos(target,pos32.x,pos32.y); if (sub_8045888(target) != 0) { - sub_803E46C(0x19); + DungeonRunFrameActions(0x19); } } tile = GetTile(pos.x, pos.y); @@ -230,7 +230,7 @@ void sub_807D068(Entity *pokemon, DungeonPos *pos) pokemon->unk1C.raw = sin_4096(iVar8) * 0xc; sub_804535C(pokemon, &local_34); if (sub_8045888(pokemon)) { - sub_803E46C(0x1a); + DungeonRunFrameActions(0x1a); } iVar8 = iVar8 + 0xaa; } @@ -239,7 +239,7 @@ _0807D11E: local_34.y = posY; pokemon->unk1C = IntToF248(0); sub_804535C(pokemon,&local_34); - sub_803E46C(0x1a); + DungeonRunFrameActions(0x1a); } void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) @@ -283,7 +283,7 @@ void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) info->action.direction = direction & DIRECTION_MASK; sub_806CE68(target,direction); } - sub_803E46C(0x22); + DungeonRunFrameActions(0x22); target->unk1C.raw += 0x800; } } @@ -329,12 +329,12 @@ void WarpTarget(Entity *pokemon, Entity *target, u32 param_3, DungeonPos *pos) info->action.direction = direction & DIRECTION_MASK; sub_806CE68(target,direction); } - sub_803E46C(0x22); + DungeonRunFrameActions(0x22); target->unk1C.raw -= 0x400; } while (0 < target->unk1C.raw); } target->unk1C = IntToF248_2(0); - sub_803E46C(0x22); + DungeonRunFrameActions(0x22); if (flag) { TryDisplayDungeonLoggableMessage3(pokemon,target,*gUnknown_80FCB14); // But it dropped back at the same spot! } @@ -523,7 +523,7 @@ void HandleTrawlOrbAction(Entity *user, Entity *target) } } - sub_803E46C(0x13); + DungeonRunFrameActions(0x13); unkAngle += 0x22; if (!(animFrame & 3)) { var++; @@ -587,7 +587,7 @@ void HandlePounceOrbAction(Entity *pokemon, Entity *target, u8 r2) { sub_804535C(target, 0); if(!sub_8045888(target)) continue; - sub_803E46C(0x3A); + DungeonRunFrameActions(0x3A); } sub_806A5B8(target); diff --git a/src/code_807E5AC.c b/src/code_807E5AC.c index d3fd624f9..070d34a92 100644 --- a/src/code_807E5AC.c +++ b/src/code_807E5AC.c @@ -83,7 +83,7 @@ void sub_807E698(bool8 arg0) u8 savedByte; sub_8042818(GetApparentWeather(NULL), arg0); - sub_803E46C(0x25); + DungeonRunFrameActions(0x25); sub_804178C(1); savedByte = gUnknown_203B40D; gUnknown_203B40D = 1; @@ -91,7 +91,7 @@ void sub_807E698(bool8 arg0) for (i = 0; i < 64; i++) { bool8 r7 = FALSE; - sub_803E46C(0x25); + DungeonRunFrameActions(0x25); for (j = 0; j < COLOR_RAMP_COUNT; j++) { if (abs(gDungeon->colorRamp[j].r - fileData[weatherArrId + j].r) < 10) { gDungeon->colorRamp[j].r = fileData[weatherArrId + j].r; @@ -755,7 +755,7 @@ void sub_807F43C(Entity *target, Entity *attacker) sub_804535C(attacker, &var_54); if (sub_8045888(attacker)) { attacker->unk1C.raw = sin_4096(var_2C) << 5; - sub_803E46C(0x3B); + DungeonRunFrameActions(0x3B); if (!(i & 3)) { attackerDirection &= DIRECTION_MASK; sub_806CDD4(attacker, 6, attackerDirection); @@ -769,7 +769,7 @@ void sub_807F43C(Entity *target, Entity *attacker) var_54.y = pixelPosY; attacker->unk1C.raw = 0; sub_804535C(attacker, &var_54); - sub_803E46C(0x3B); + DungeonRunFrameActions(0x3B); GetEntInfo(attacker)->action.direction = attackerDirection & DIRECTION_MASK; tileEntity = GetTile(attackerPos.x, attackerPos.y)->monster; diff --git a/src/code_8085E98.c b/src/code_8085E98.c index 1a1d2db91..ec0886d27 100644 --- a/src/code_8085E98.c +++ b/src/code_8085E98.c @@ -46,7 +46,7 @@ u32 sub_8085EC8(s16 param_1,u32 param_2,u32 param_3,DungeonPos *param_4, sub_800EE5C(param_1_s32); sub_800EF64(); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); local_40.unk0 = param_1; local_40.unk4 = param_2; local_40.dir = param_3; @@ -69,7 +69,7 @@ void sub_8085F44(s32 param_1) { while (sub_800E9A8(param_1)) { sub_800E90C(&gDungeon->unk181e8.cameraPixelPos); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } diff --git a/src/code_80861A8.c b/src/code_80861A8.c index 69fc275d7..076532e8c 100644 --- a/src/code_80861A8.c +++ b/src/code_80861A8.c @@ -20,7 +20,7 @@ static void sub_80861EC(Entity *); void sub_800EE5C(s32); void sub_800EF64(); -void sub_803E46C(s32); +void DungeonRunFrameActions(s32); s32 sub_800E700(s32); void sub_800569C(DungeonPos *, axdata *, u8); void sub_8085F44(s32); @@ -90,7 +90,7 @@ s32 sub_80861F8(s32 param_1,Entity *param_2,bool32 param_3) sub_800EE5C(param_1Copy2); sub_800EF64(); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); info = GetEntInfo(param_2); pos.x = 0; pos.y = 0; diff --git a/src/code_80869E4.c b/src/code_80869E4.c index 80578f4d5..a64cc5c99 100644 --- a/src/code_80869E4.c +++ b/src/code_80869E4.c @@ -147,7 +147,7 @@ void sub_8086448(void) YPos += 0x100; sub_803F878(XPos, YPos); sub_80855E4(sub_8086410); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_80855E4(sub_80863F8); @@ -173,7 +173,7 @@ static void sub_8086494(void) for (i = 0; i < 144; i++) { sub_80855E4(sub_8086424); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_8086310); @@ -193,7 +193,7 @@ void sub_8086500(void) YPos = GetCameraYPos(); sub_803F878(XPos, YPos); sub_80855E4(sub_8086434); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_8086404); @@ -213,7 +213,7 @@ void sub_808654C(void) YPos = GetCameraYPos(); sub_803F878(XPos, YPos); sub_80855E4(sub_8086434); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_8086404); @@ -232,7 +232,7 @@ void sub_8086598(void) YPos = GetCameraYPos(); sub_803F878(XPos, YPos - 0x100); sub_80855E4(sub_8086410); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_80863F8); @@ -252,7 +252,7 @@ void sub_80865E8(void) sub_803F878(XPos, YPos + 0x200); sub_80855E4(sub_8086424); sub_80855E4(sub_8086424); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_80863F8); @@ -272,7 +272,7 @@ void sub_808663C(void) sub_803F878(XPos, YPos + 0x200); sub_80855E4(sub_8086424); sub_80855E4(sub_8086424); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_80863F8); @@ -286,7 +286,7 @@ void sub_8086690(void) for (i = 0; i < 48; i++) { sub_80855E4(sub_8086434); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_80855E4(sub_8086404); @@ -308,7 +308,7 @@ UNUSED static void sub_80866FC(void) for (i = 0; i >= -250; i -= 10) { SetDungeonBGColorRGB(i, i, i, 1, 0); - sub_803E46C(70); + DungeonRunFrameActions(70); } } @@ -323,7 +323,7 @@ void sub_8086738(void) for (i = 0; i < 250; i += 10) { SetDungeonBGColorRGB(i, i, i, 1, 0); - sub_803E46C(70); + DungeonRunFrameActions(70); } } @@ -333,7 +333,7 @@ void sub_8086764(void) for (i = 250; i >= 0; i -= 5) { SetDungeonBGColorRGB(i, i, i, 1, 0); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_8085EB0(); @@ -348,7 +348,7 @@ void sub_8086794(void) for (i = 0; i < 200; i++) { SetDungeonBGColorRGB(0, 0, 0, 1, 0); BgColorCallNullsub4(); - sub_803E46C(70); + DungeonRunFrameActions(70); if ((i & 3) == 0) { gDungeonBrightness++; @@ -357,7 +357,7 @@ void sub_8086794(void) } } - sub_803E46C(70); + DungeonRunFrameActions(70); gDungeon->unk7 = 0; } diff --git a/src/dungeon_action.c b/src/dungeon_action.c index 840fa7caf..7b148347b 100644 --- a/src/dungeon_action.c +++ b/src/dungeon_action.c @@ -217,14 +217,13 @@ u8 *sub_8044BA8(u16 param_1, u8 id) } } -void sub_8044C10(u8 param_1) +void SetLeaderActionToNothing(bool8 clearActionFields) { EntityInfo * entityInfo = GetLeaderInfo(); entityInfo->action.action = ACTION_NOTHING; - if(param_1) - { + if (clearActionFields) { entityInfo->action.actionParameters[0].actionUseIndex = 0; entityInfo->action.actionParameters[1].actionUseIndex = 0; entityInfo->action.itemTargetPosition.x = -1; diff --git a/src/dungeon_ai_leader.c b/src/dungeon_ai_leader.c index ab9b35d93..9dd5ea6b2 100644 --- a/src/dungeon_ai_leader.c +++ b/src/dungeon_ai_leader.c @@ -169,7 +169,7 @@ bool8 sub_8072CF4(Entity *entity) sub_8052740(10); } sub_806A1E8(entity); - sub_803E46C(10); + DungeonRunFrameActions(10); } if (((ACTION_PASS_TURN < info->action.action) && (info->action.action != 4)) && (info->action.action != ACTION_WALK)) { info->attacking = TRUE; diff --git a/src/dungeon_cutscenes.c b/src/dungeon_cutscenes.c index 010fe490c..b2ec057b7 100644 --- a/src/dungeon_cutscenes.c +++ b/src/dungeon_cutscenes.c @@ -806,7 +806,7 @@ void sub_8087144(void) GetEntInfo(iVar4)->unk15F = 1; while( TRUE ) { if (!sub_8085B80(auStack_4c)) break; - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } GetEntInfo(iVar2)->unk15F = 0; GetEntInfo(iVar3)->unk15F = 0; @@ -909,7 +909,7 @@ void ZapdosPreFightDialogue(void) sub_8085B4C(&auStack_78,puStack_34,pEStack_34,1); GetEntInfo(partnerEntity)->unk15F = 1; while(sub_8085B80(&auStack_78)) { - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } GetEntInfo(partnerEntity)->unk15F = 0; @@ -927,7 +927,7 @@ void ZapdosPreFightDialogue(void) pEStack_2c[0] = partnerEntity; sub_8085B4C(&auStack_48,puStack_4c,pEStack_2c,1); while (sub_8085B80(&auStack_48)) { - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_80869E4(partnerEntity,2,1,DIRECTION_NORTHEAST); @@ -1012,7 +1012,7 @@ void ZapdosDropInEffect(Entity *zapdosEntity) for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) { GetEntInfo(zapdosEntity)->unk174 = IntToF248_2(iVar1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(0x1e,0x46); } @@ -1026,20 +1026,20 @@ void ZapdosScreenFlash(s32 numFlashes) for(index = 250; index > 199; index -= 10) { SetDungeonBGColorRGB(index,index,index / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } if (1 < numFlashes) { for(index = 250; index > 199; index -= 10) { SetDungeonBGColorRGB(index,index,index / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } for(index = 250; index >= 0; index -= 10) { SetDungeonBGColorRGB(index,index,index / 4,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_8085EB0(); } @@ -1261,7 +1261,7 @@ void MoltresDropInEffect(Entity * moltresEntity) for(iVar1 = 200; iVar1 >= 0; iVar1 -= 5) { GetEntInfo(moltresEntity)->unk174 = IntToF248_2(iVar1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } @@ -1296,13 +1296,13 @@ void MoltresScreenFlash2(s32 xArg, s32 yArg) for (i = 250; i >= 20; i -= 10) { SetDungeonBGColorRGB(i, 0, 0, 1, 1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(0xA, 0x46); for (i = 250; i >= 0; i -= 10) { SetDungeonBGColorRGB(i, 0, 0, 1, 1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(0xA, 0x46); @@ -1319,14 +1319,14 @@ void MoltresScreenFlash3(void) for(iVar1 = 250; iVar1 > 9; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(0x1e,0x46); PlaySoundEffect(0x1ed); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(0x1e,0x46); sub_8085EB0(); @@ -1339,7 +1339,7 @@ void MoltresScreenDarken(void) for(iVar1 = 0; iVar1 >= -80; iVar1 -= 8) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,0,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } @@ -1555,7 +1555,7 @@ void sub_8088484(Entity *param_1) { GetEntInfo(param_1)->unk174 = IntToF248_2(iVar1); SetDungeonBGColorRGB(iVar1,iVar1,iVar1 / 2,1,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } @@ -1567,19 +1567,19 @@ void ArticunoScreenFlash(void) for(iVar1 = 250; iVar1 > 0x95; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1 / 2,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(4,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(0,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(4,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1 / 2,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(4,0x46); sub_8085EB0(); @@ -1592,7 +1592,7 @@ void sub_8088574(void) for(iVar1 = 0; iVar1 <= 80; iVar1 += 8) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,0,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } } @@ -1884,7 +1884,7 @@ void SceneGroudonMovement(Entity * groudonEntity) if ((iVar1 - 10U < 0xc) || (iVar1 > 0x1f)) { IncreaseEntityPixelPos(groudonEntity,0,0x100); } - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_80856C8(groudonEntity,groudonEntity->pos.x,groudonEntity->pos.y + 1); sub_80861D4(groudonEntity,0xf,DIRECTION_SOUTH); @@ -1901,21 +1901,21 @@ void GroudonScreenFlash(void) for(iVar1 = 250; iVar1 > 0x95; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1 / 2,iVar1 / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1 / 2,0,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1 / 2,iVar1 / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -1928,21 +1928,21 @@ void GroudonScreenFlash2(void) for(iVar1 = 250; iVar1 > 0x95; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1 / 2,iVar1 / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1 / 2,0,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1 / 2,iVar1 / 2,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -2160,7 +2160,7 @@ void sub_80891F0(void) for(iVar1 = 0; iVar1 < 0x30; iVar1++) { sub_80855E4(sub_808919C); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_80855E4(sub_80891D0); } @@ -2215,7 +2215,7 @@ void sub_8089294(void) for(iVar1 = 0; iVar1 <= 0x77; iVar1++) { sub_80855E4(sub_8089224); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_80855E4(sub_80891D0); } @@ -2377,7 +2377,7 @@ void RayquazaDropInEffect(Entity *rayquazaEntity) } if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(rayquazaEntity)->unk174 = iVar2; - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } GetEntInfo(rayquazaEntity)->unk174 = IntToF248_2(0); } @@ -2390,19 +2390,19 @@ void RayquazaScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1 / 2, iVar1, iVar1 / 2, 1, 1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1 / 2, iVar1, 0, 1, 1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1 / 2, iVar1, iVar1 / 2, 1, 1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); sub_8085EB0(); @@ -2650,7 +2650,7 @@ void MewtwoDropInEffect(Entity *mewtwoEntity) } if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(mewtwoEntity)->unk174 = iVar2; - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } GetEntInfo(mewtwoEntity)->unk174 = IntToF248_2(0); } @@ -2663,19 +2663,19 @@ void MewtwoScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,0,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -2792,19 +2792,19 @@ void EnteiScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1, iVar1 / 2, iVar1 / 2, 1, 1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1, 0, 0, 1, 1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1, iVar1 / 2, iVar1 / 2, 1, 1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); sub_8085EB0(); @@ -2947,19 +2947,19 @@ void RaikouScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); sub_8085EB0(); @@ -3109,7 +3109,7 @@ void sub_808A528(Entity * param_1) } if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(param_1)->unk174 = iVar2; - sub_803E46C(70); + DungeonRunFrameActions(70); } GetEntInfo(param_1)->unk174 = IntToF248_2(0); } @@ -3122,19 +3122,19 @@ void SuicuneScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); sub_8085EB0(); @@ -3287,7 +3287,7 @@ void HoOhDropInEffect(Entity * param_1) } if (F248LessThanInt(iVar2, 0)) break; GetEntInfo(param_1)->unk174 = iVar2; - sub_803E46C(70); + DungeonRunFrameActions(70); } GetEntInfo(param_1)->unk174 = IntToF248_2(0); } @@ -3300,19 +3300,19 @@ void HoOhScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); sub_8085EB0(); @@ -3442,13 +3442,13 @@ void LatiosScreenFlash(void) for(iVar1 = 250; iVar1 > 149; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(70); + DungeonRunFrameActions(70); } sub_803E708(10,70); sub_8085EB0(); @@ -4073,21 +4073,21 @@ void JirachiWishGrantFlash(void) for(iVar1 = 0xFA; iVar1 > 0x95; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 0xFA; iVar1 > 0xC7; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 0xFA; iVar1 >= 0; iVar1 -= 10) { SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -4130,7 +4130,7 @@ void JirachiDropInEffect(Entity *jirachiEntity) } if (F248LessThanInt(iVar1, 0)) break; GetEntInfo(jirachiEntity)->unk174 = iVar1; - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } GetEntInfo(jirachiEntity)->unk174 = IntToF248_2(0); } @@ -4312,17 +4312,17 @@ void LugiaScreenFlash(void) PlaySoundEffect(0x1f6); for(iVar1 = 250; iVar1 > 149; iVar1 -= 10){ SetDungeonBGColorRGB(0,0,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10){ SetDungeonBGColorRGB(0,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10){ SetDungeonBGColorRGB(0,0,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -4336,24 +4336,24 @@ void LugiaScreenFlash2(void) for(iVar1 = 0; iVar1 < 200; iVar1 += 100){ SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } for(iVar1 = 200; iVar1 >= 0; iVar1 -= 100){ SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(4,0x46); for(iVar1 = 0; iVar1 < 200; iVar1 += 100){ SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } for(iVar1 = 200; iVar1 >= 0; iVar1 -= 100){ SetDungeonBGColorRGB(iVar1,iVar1,iVar1,1,0); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); @@ -4365,7 +4365,7 @@ void sub_808C0CC(void) gDungeonBrightness = 0x1f; SetDungeonBGColorRGB(0,0,0,1,1); BgColorCallNullsub4(); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); gDungeon->unk7 = 0; LugiaScreenFlash(); } @@ -4465,17 +4465,17 @@ void KyogreScreenFlash(void) PlaySoundEffect(0x1f8); for(iVar1 = 250; iVar1 > 149; iVar1 -= 10){ SetDungeonBGColorRGB(0,0,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10){ SetDungeonBGColorRGB(0,iVar1,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10){ SetDungeonBGColorRGB(0,0,iVar1,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -4486,7 +4486,7 @@ void sub_808C360(void) gDungeonBrightness = 0x1f; SetDungeonBGColorRGB(0,0,0,1,1); BgColorCallNullsub4(); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); gDungeon->unk7 = 0; KyogreScreenFlash(); } @@ -4552,17 +4552,17 @@ void DeoxysScreenFlash(void) PlaySoundEffect(0x2c1); for(iVar1 = 250; iVar1 > 149; iVar1 -= 10){ SetDungeonBGColorRGB(iVar1,0,0,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 > 199; iVar1 -= 10){ SetDungeonBGColorRGB(iVar1,iVar1,0,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); for(iVar1 = 250; iVar1 >= 0; iVar1 -= 10){ SetDungeonBGColorRGB(iVar1,0,0,1,1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_803E708(10,0x46); sub_8085EB0(); @@ -4573,7 +4573,7 @@ void sub_808C550(void) gDungeonBrightness = 0x1f; SetDungeonBGColorRGB(0,0,0,1,1); BgColorCallNullsub4(); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); gDungeon->unk7 = 0; DeoxysScreenFlash(); } @@ -4678,7 +4678,7 @@ void CelebiJoinDialogue(void) DungeonStopBGM(); PlaySoundEffect(0xcc); while (IsFanfareSEPlaying_2(0xcc) != 0) { - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } DungeonStartNewBGM(MUS_FRIEND_AREA_HEALING_FOREST); PlaySoundEffect(0x1c7); @@ -4751,11 +4751,11 @@ void sub_808C8E0(Entity *entity) sub_806CDD4(entity, 0, DIRECTION_SOUTH); for(iVar1 = 0; iVar1 < 16; iVar1++){ GetEntInfo(entity)->unk174 = IntToF248_2(iVar1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } for(iVar1 = 16; iVar1 < 200; iVar1 += 4){ GetEntInfo(entity)->unk174 = IntToF248_2(iVar1); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_8086A3C(entity); } @@ -4858,7 +4858,7 @@ void MedichamRescueDialogue(void) for(counter = 0x17; counter >= 0; counter--) { IncreaseEntityPixelPos(medichamEntity, 0, 0x100); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_806CE68(medichamEntity, DIRECTION_SOUTH); sub_803E708(0x20, 0x46); @@ -4947,7 +4947,7 @@ void SmeargleRescueDialogue(void) for(counter = 0x17; counter >= 0; counter--) { IncreaseEntityPixelPos(smeargleEntity, 0, 0x100); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } sub_806CE68(smeargleEntity, DIRECTION_SOUTH); sub_803E708(0x20, 0x46); diff --git a/src/dungeon_engine.c b/src/dungeon_engine.c index 686853216..8ab386c0f 100644 --- a/src/dungeon_engine.c +++ b/src/dungeon_engine.c @@ -125,7 +125,7 @@ static bool8 xxx_dungeon_80442D0(bool8 param_1) if ((UseAttack(0) == 0) && ((gDungeon->unk644.unk28 != 0 || (gDungeon->unk644.unk2F != 0)))) { - sub_803E46C(0xc); + DungeonRunFrameActions(0xc); } GetEntInfo(entity)->speedStageChanged = FALSE; if (sub_8044B28()) return FALSE; diff --git a/src/dungeon_map_access.c b/src/dungeon_map_access.c index 858fd80a5..fd28b0daf 100644 --- a/src/dungeon_map_access.c +++ b/src/dungeon_map_access.c @@ -761,7 +761,7 @@ void sub_804A49C(s32 a0, s32 a1) sub_80098F8(3); } -void sub_804A728(DungeonPos *pos, s32 a1, u8 a2, u8 a3) +void ChangeDungeonCameraPos(DungeonPos *pos, s32 a1, u8 a2, u8 a3) { DungeonPos spArray[6]; u16 *src; diff --git a/src/dungeon_message.c b/src/dungeon_message.c index ccbaccb88..388de1883 100644 --- a/src/dungeon_message.c +++ b/src/dungeon_message.c @@ -36,11 +36,11 @@ extern void sub_803EAF0(s32, s32); extern void sub_8040238(void); extern void sub_8083E28(void); extern u32 sub_8014140(s32 a0, const void *a1); -extern void sub_8083D30(void); -extern void sub_8083D08(void); +extern void PlayDungeonCancelSE(void); +extern void PlayDungeonConfirmationSE(void); extern void sub_8007334(s32 a0); extern void sub_80087EC(s32 a0, s32 a1, s32 a2, s32 a3, s32 a4); -extern void sub_8083CE0(u8 param_1); +extern void PlayDungeonCursorSE(u8 param_1); extern u32 gUnknown_202EDD0; extern u8 gUnknown_203B40C; @@ -93,7 +93,7 @@ void sub_8052210(bool8 a0) if (a0 && gUnknown_202EDD0 == 3) { sub_803EAF0(0, 0); - sub_803E46C(11); + DungeonRunFrameActions(11); } } @@ -196,7 +196,7 @@ static void DisplayMessageAddToLog(Entity *pokemon, const u8 *str, bool8 r2) if (val != gDungeon->unk1BDD4.unk1C062) { break; } - sub_803E46C(0); + DungeonRunFrameActions(0); } if (*str == '\0') @@ -305,7 +305,7 @@ void sub_80526D0(s32 r0) { struct UnkStructDungeon1BDD4 *strPtr = &gDungeon->unk1BDD4; while (strPtr->unk1C06C != 0 || gDungeon->unk1BDD4.unk1C060 != gDungeon->unk1BDD4.unk1C062) { - sub_803E46C(r0); + DungeonRunFrameActions(r0); } } @@ -322,7 +322,7 @@ void sub_8052740(s32 a0) break; if (gRealInputs.pressed & JOY_EXCL_DPAD) break; - sub_803E46C(a0); + DungeonRunFrameActions(a0); } } @@ -333,7 +333,7 @@ void sub_8052740(s32 a0) \ do { \ DrawDialogueBoxString(); \ - sub_803E46C(9); \ + DungeonRunFrameActions(9); \ unkPrintRet = sub_80144A4(chosenMenuIndex);\ } while (unkPrintRet != 0); \ } @@ -772,7 +772,7 @@ void sub_8052FB8(const u8 *str) break; } DrawDialogueBoxString(); - sub_803E46C(9); + DungeonRunFrameActions(9); } while (r8 >= 0) { @@ -780,12 +780,12 @@ void sub_8052FB8(const u8 *str) SetBGPaletteBufferColorRGB(240 + j, &gFontPalette[j], r8 / 2, NULL); } DrawDialogueBoxString(); - sub_803E46C(9); + DungeonRunFrameActions(9); r8--; } ShowWindows(NULL, TRUE, TRUE); - sub_803E46C(9); + DungeonRunFrameActions(9); sub_8040238(); for (j = 0; j < 8; j++) { SetBGPaletteBufferColorArray(240 + j, &gFontPalette[j]); @@ -866,7 +866,7 @@ bool32 DisplayMessageLog(void) sub_801317C(&menuInput); sub_803EAF0(9, 0); do { - sub_803E46C(13); + DungeonRunFrameActions(13); unkRet = sub_8008D8C(0); } while (unkRet); @@ -888,7 +888,7 @@ bool32 DisplayMessageLog(void) scroll = TRUE; if (!scroll) { - sub_803E46C(0xD); + DungeonRunFrameActions(0xD); } if (sMessageLogFlags & FLAG_CAN_SCROLL_UP) { @@ -900,11 +900,11 @@ bool32 DisplayMessageLog(void) if (!sub_80048C8()) { if (gRealInputs.pressed & B_BUTTON || menuInput.b_button) { - sub_8083D30(); + PlayDungeonCancelSE(); break; } else if (gRealInputs.pressed & A_BUTTON) { - sub_8083D08(); + PlayDungeonConfirmationSE(); break; } } @@ -972,7 +972,7 @@ static bool8 TryScrollLogUp(s32 a0) return FALSE; } - sub_8083CE0(0); + PlayDungeonCursorSE(0); sub_80073B8(0); msgLogString = &gDungeon->messageLogStrings[arrId]; if (msgLogString->unk0) { @@ -983,11 +983,11 @@ static bool8 TryScrollLogUp(s32 a0) PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); } sub_80073E0(0); - sub_803E46C(0xD); + DungeonRunFrameActions(0xD); for (i = 0; i < 7; i++) { gIwramTextFunc2(0); - sub_803E46C(0xD); + DungeonRunFrameActions(0xD); } sMessageLogCursor--; @@ -1022,7 +1022,7 @@ static bool8 TryScrollLogDown(s32 a0) return FALSE; } - sub_8083CE0(0); + PlayDungeonCursorSE(0); sub_80073B8(0); msgLogString = &gDungeon->messageLogStrings[arrId]; if (msgLogString->unk0) { @@ -1033,11 +1033,11 @@ static bool8 TryScrollLogDown(s32 a0) PrintStringOnWindow(8, y + 3, msgLogString->str, 0, 0xD); } sub_80073E0(0); - sub_803E46C(0xD); + DungeonRunFrameActions(0xD); for (i = 0; i < 7; i++) { gIwramTextFunc1(0); - sub_803E46C(0xD); + DungeonRunFrameActions(0xD); } sMessageLogCursor++; diff --git a/src/dungeon_move.c b/src/dungeon_move.c index 95881ee7a..e73cad7f3 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -2285,7 +2285,7 @@ s32 sub_8056564(Entity *entity, DungeonPos *pos, Move *move, s32 r4) sub_800EF10(sub_80412E0(move->id, GetApparentWeather(entity), 1)); sub_800EF64(); - sub_803E46C(0x5E); + DungeonRunFrameActions(0x5E); someRetVal = sub_800E710(entInfo->apparentID, sub_80412E0(move->id, GetApparentWeather(entity), 1)); if (someRetVal != -1) { sub_800569C(&unkSp1.unk8, &entity->axObj.axdata, someRetVal); @@ -2438,7 +2438,7 @@ void sub_80566F8(Entity *attacker, Move *move, s32 a2, bool8 a3, s32 itemId, s32 r2 /= 2; sub_800E3AC(var_34, &var_64, r2 + var_38); } - sub_803E46C(0x30); + DungeonRunFrameActions(0x30); pos32.x += var_28; pos32.y += var_24; r9 += var_2C; diff --git a/src/dungeon_music.c b/src/dungeon_music.c index e0c12616f..60289929f 100644 --- a/src/dungeon_music.c +++ b/src/dungeon_music.c @@ -138,14 +138,14 @@ bool8 sub_8083C88(u8 param_1) } } -void sub_8083CE0(u8 param_1) +void PlayDungeonCursorSE(bool8 checkMenuEntriesCount) { - if ((param_1 == 0) || (1 < gUnknown_202EE10.unk1A)) { + if ((!checkMenuEntriesCount) || (gUnknown_202EE10.unk1A > 1)) { PlayFanfareSE(0x12d,MAX_VOLUME); } } -void sub_8083D08(void) +void PlayDungeonConfirmationSE(void) { PlayFanfareSE(0x12E, MAX_VOLUME); } @@ -155,12 +155,12 @@ void sub_8083D1C(void) PlayFanfareSE(0x133, MAX_VOLUME); } -void sub_8083D30(void) +void PlayDungeonCancelSE(void) { PlayFanfareSE(0x12F, MAX_VOLUME); } -void sub_8083D44(void) +void PlayDungeonStartButtonSE(void) { PlayFanfareSE(0x130, MAX_VOLUME); } diff --git a/src/dungeon_util_1.c b/src/dungeon_util_1.c index fa1d66152..117a9c7ce 100644 --- a/src/dungeon_util_1.c +++ b/src/dungeon_util_1.c @@ -181,7 +181,7 @@ void sub_80856E0(Entity * pokemon, s32 direction) for(counter = 0; counter < 5; counter++) { entityInfo->unk174 = F248_Add(entityInfo->unk174, IntToF248(2)); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } entityInfo->action.direction = direction & DIRECTION_MASK; sub_806CE68(pokemon, direction); @@ -189,10 +189,10 @@ void sub_80856E0(Entity * pokemon, s32 direction) for(counter = 0; counter < 5; counter++) { entityInfo->unk174 = F248_Sub(entityInfo->unk174, IntToF248(2)); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } entityInfo->unk174.raw = 0; // weird one that doesn't match with struct assignment - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } void sub_8085764(void) @@ -265,12 +265,12 @@ void ShiftCameraToPosition(PixelPos *posStruct, s32 cameraSteps) XPos += XIncrement; YPos += YIncrement; sub_803F878(XPos,YPos); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); cameraSteps--; } while (cameraSteps != 0); } sub_803F878(posStruct->x,posStruct->y); - sub_803E46C(0x46); + DungeonRunFrameActions(0x46); } void SetFacingDirection(Entity *pokemon, s32 direction) diff --git a/src/menu_input.c b/src/menu_input.c index bb6408f41..a0b0ea261 100644 --- a/src/menu_input.c +++ b/src/menu_input.c @@ -722,7 +722,7 @@ void MoveMenuCursorDown(MenuInputStruct *param_1) } } -void sub_80136E0(MenuInputStruct *param_1, u8 param_2) +void MoveMenuCursorDownWrapAround(MenuInputStruct *param_1, u8 param_2) { param_1->unk24 = 0; @@ -754,7 +754,7 @@ void MoveMenuCursorUp(MenuInputStruct *param_1) } } -void sub_8013744(MenuInputStruct *param_1, u8 param_2) +void MoveMenuCursorUpWrapAround(MenuInputStruct *param_1, u8 param_2) { param_1->unk24 = 0; diff --git a/src/move_actions.c b/src/move_actions.c index a50f494ed..1a797a308 100644 --- a/src/move_actions.c +++ b/src/move_actions.c @@ -2616,7 +2616,7 @@ _0805A8C2: for(counter = 0; counter < 0xC; counter++) { IncreaseEntityPixelPos(target,pos2.x,pos2.y); - sub_803E46C(0x2c); + DungeonRunFrameActions(0x2c); } } tile = GetTileMut(pos1.x,pos1.y); @@ -2639,7 +2639,7 @@ _0805A9FE: for(counter = 0; counter < 0xC; counter++) { IncreaseEntityPixelPos(target, -pos2.x,-pos2.y); - sub_803E46C(0x2c); + DungeonRunFrameActions(0x2c); } } goto _0805AA5E; diff --git a/src/status.c b/src/status.c index f6ca6db60..db00cb46e 100644 --- a/src/status.c +++ b/src/status.c @@ -984,7 +984,7 @@ void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3) if ((((EntityIsValid(entity)) && (target != entity)) && (u8)(GetEntInfo(entity)->curseClassStatus.status - 2U) < 2)) { EndCurseClassStatus(pokemon,entity,STATUS_NONE); - sub_803E46C(0x2a); + DungeonRunFrameActions(0x2a); } } sub_8041D38(target);