diff options
author | PikalaxALT <PikalaxALT@gmail.com> | 2020-03-15 13:24:40 -0400 |
---|---|---|
committer | PikalaxALT <PikalaxALT@gmail.com> | 2020-03-15 13:24:40 -0400 |
commit | 8908b7d47a6f4879a37c6d5794a347e1c3c422f4 (patch) | |
tree | 17c67e0005be0615f69f9e33f0d2792f5822ef7e | |
parent | 39ef2a31a4dd12e8638ccf520952bd8f1eb1f36e (diff) |
finish pokemon_storage_system_6
-rw-r--r-- | asm/pokemon_storage_system.s | 101 | ||||
-rw-r--r-- | src/pokemon_storage_system_6.c | 51 |
2 files changed, 51 insertions, 101 deletions
diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index c8facfa67..c991cd1eb 100644 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -5,107 +5,6 @@ .text - thumb_func_start sub_8094F90 -sub_8094F90: @ 8094F90 - movs r0, 0 - bx lr - thumb_func_end sub_8094F90 - - thumb_func_start sub_8094F94 -sub_8094F94: @ 8094F94 - push {r4,r5,lr} - movs r5, 0x2 - negs r5, r5 - ldr r4, _08094FD0 @ =gMain - ldrh r1, [r4, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _08094FEA - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _08094FB6 - movs r0, 0x5 - bl PlaySE - adds r5, 0x1 -_08094FB6: - ldrh r1, [r4, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _08094FD4 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl Menu_MoveCursor - b _08094FF2 - .align 2, 0 -_08094FD0: .4byte gMain -_08094FD4: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08094FF2 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl Menu_MoveCursor - b _08094FF2 -_08094FEA: - bl Menu_GetCursorPos - lsls r0, 24 - lsrs r5, r0, 24 -_08094FF2: - movs r0, 0x2 - negs r0, r0 - cmp r5, r0 - beq _08094FFE - bl sub_8095024 -_08094FFE: - cmp r5, 0 - blt _08095010 - ldr r0, _0809501C @ =sPSSData - ldr r0, [r0] - lsls r1, r5, 3 - ldr r2, _08095020 @ =0x00000c74 - adds r0, r2 - adds r0, r1 - ldr r5, [r0] -_08095010: - lsls r0, r5, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_0809501C: .4byte sPSSData -_08095020: .4byte 0x00000c74 - thumb_func_end sub_8094F94 - - thumb_func_start sub_8095024 -sub_8095024: @ 8095024 - push {r4,r5,lr} - ldr r5, _08095048 @ =sPSSData - ldr r0, [r5] - ldr r4, _0809504C @ =0x00000cac - adds r0, r4 - ldrb r0, [r0] - movs r1, 0x1 - bl ClearStdWindowAndFrameToTransparent - ldr r0, [r5] - adds r0, r4 - ldrb r0, [r0] - bl RemoveWindow - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08095048: .4byte sPSSData -_0809504C: .4byte 0x00000cac - thumb_func_end sub_8095024 - @ file boundary? thumb_func_start sub_8095050 diff --git a/src/pokemon_storage_system_6.c b/src/pokemon_storage_system_6.c index 4c5bc4189..a92fe6891 100644 --- a/src/pokemon_storage_system_6.c +++ b/src/pokemon_storage_system_6.c @@ -4,6 +4,7 @@ #include "new_menu_helpers.h" #include "pokemon_storage_system_internal.h" #include "strings.h" +#include "constants/songs.h" void InitMenu(void) { @@ -94,3 +95,53 @@ void AddMenu(void) ScheduleBgCopyTilemapToVram(0); sPSSData->field_CAE = 0; } + +bool8 sub_8094F90(void) +{ + // Some debug flag? + return FALSE; +} + +s16 sub_8094F94(void) +{ + s32 textId = -2; + + do + { + if (JOY_NEW(A_BUTTON)) + { + textId = Menu_GetCursorPos(); + break; + } + else if (JOY_NEW(B_BUTTON)) + { + PlaySE(SE_SELECT); + textId = -1; + } + + if (JOY_NEW(DPAD_UP)) + { + PlaySE(SE_SELECT); + Menu_MoveCursor(-1); + } + else if (JOY_NEW(DPAD_DOWN)) + { + PlaySE(SE_SELECT); + Menu_MoveCursor(1); + } + } while (0); + + if (textId != -2) + sub_8095024(); + + if (textId >= 0) + textId = sPSSData->menuItems[textId].textId; + + return textId; +} + +void sub_8095024(void) +{ + ClearStdWindowAndFrameToTransparent(sPSSData->field_CB0, TRUE); + RemoveWindow(sPSSData->field_CB0); +} |