diff options
author | scnorton <scnorton@biociphers.org> | 2017-06-28 10:51:18 -0400 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2017-06-28 10:51:18 -0400 |
commit | c6255560d7577edf6058171ba61331c7c6f78dfc (patch) | |
tree | 0e8de969a7950ea6825c18e087de865473697e35 | |
parent | 7018449024766d1b24d3de4271f998d285e19cd0 (diff) |
through sub_810C540
-rwxr-xr-x | asm/pokeblock.s | 116 | ||||
-rwxr-xr-x | src/pokeblock.c | 30 |
2 files changed, 30 insertions, 116 deletions
diff --git a/asm/pokeblock.s b/asm/pokeblock.s index 86e799586..5d04f40eb 100755 --- a/asm/pokeblock.s +++ b/asm/pokeblock.s @@ -6,122 +6,6 @@ .text - thumb_func_start sub_810C4C4 -sub_810C4C4: @ 810C4C4 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, _0810C4F8 @ =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0810C4F0 - bl sub_810C2B0 - ldr r0, _0810C4FC @ =gScriptItemId - ldrh r0, [r0] - lsls r0, 3 - ldr r1, _0810C500 @ =gSaveBlock1 + 0x7F8 - adds r0, r1 - ldr r1, _0810C504 @ =sub_810B96C - bl sub_8136130 - adds r0, r4, 0 - bl DestroyTask -_0810C4F0: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0810C4F8: .4byte gPaletteFade -_0810C4FC: .4byte gScriptItemId -_0810C500: .4byte gSaveBlock1 + 0x7F8 -_0810C504: .4byte sub_810B96C - thumb_func_end sub_810C4C4 - - thumb_func_start sub_810C508 -sub_810C508: @ 810C508 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, _0810C538 @ =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, _0810C53C @ =sub_810C4C4 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0810C538: .4byte gTasks -_0810C53C: .4byte sub_810C4C4 - thumb_func_end sub_810C508 - - thumb_func_start sub_810C540 -sub_810C540: @ 810C540 - push {r4,r5,lr} - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, _0810C5A0 @ =gWindowConfig_81E6E50 - bl BasicInitMenuWindow - bl HandleDestroyMenuCursors - movs r0, 0x7 - movs r1, 0x4 - movs r2, 0xD - movs r3, 0xB - bl MenuZeroFillWindowRect - ldr r0, _0810C5A4 @ =gStringVar1 - ldr r4, _0810C5A8 @ =gPokeblockNames - ldr r3, _0810C5AC @ =gSaveBlock1 - ldr r2, _0810C5B0 @ =gUnknown_02039248 - ldrb r1, [r2] - ldrb r2, [r2, 0x1] - adds r1, r2 - lsls r1, 3 - adds r1, r3 - movs r2, 0xFF - lsls r2, 3 - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r4 - ldr r1, [r1] - bl StringCopy - ldr r4, _0810C5B4 @ =gStringVar4 - ldr r1, _0810C5B8 @ =gContestStatsText_ThrowAwayPrompt - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r2, _0810C5BC @ =sub_810C5EC - adds r0, r5, 0 - adds r1, r4, 0 - movs r3, 0 - bl DisplayItemMessageOnField - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_0810C5A0: .4byte gWindowConfig_81E6E50 -_0810C5A4: .4byte gStringVar1 -_0810C5A8: .4byte gPokeblockNames -_0810C5AC: .4byte gSaveBlock1 -_0810C5B0: .4byte gUnknown_02039248 -_0810C5B4: .4byte gStringVar4 -_0810C5B8: .4byte gContestStatsText_ThrowAwayPrompt -_0810C5BC: .4byte sub_810C5EC - thumb_func_end sub_810C540 - thumb_func_start sub_810C5C0 sub_810C5C0: @ 810C5C0 push {r4,lr} diff --git a/src/pokeblock.c b/src/pokeblock.c index 8ea8de838..a8de73549 100755 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -807,3 +807,33 @@ void sub_810C40C(u8 taskId) sub_810C748(taskId); } } + +void sub_8136130(struct Pokeblock *, MainCallback); + +void sub_810C4C4(u8 taskId) +{ + if (!gPaletteFade.active) + { + sub_810C2B0(); + sub_8136130(&gSaveBlock1.pokeblocks[gScriptItemId], sub_810B96C); + DestroyTask(taskId); + } +} + +void sub_810C508(u8 taskId) +{ + BeginNormalPaletteFade(-1, 0, 0, 16, 0); + gTasks[taskId].func = sub_810C4C4; +} + +void sub_810C5EC(u8); + +void sub_810C540(u8 taskId) +{ + BasicInitMenuWindow(&gWindowConfig_81E6E50); + HandleDestroyMenuCursors(); + MenuZeroFillWindowRect(7, 4, 13, 11); + StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1.pokeblocks[gUnknown_02039248[0] + gUnknown_02039248[1]].color]); + StringExpandPlaceholders(gStringVar4, gContestStatsText_ThrowAwayPrompt); + DisplayItemMessageOnField(taskId, gStringVar4, sub_810C5EC, 0); +} |