From 24b9cd721ff1f5c7f2fdd674299d0d2d9f396be2 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 3 Sep 2018 22:55:55 +0200 Subject: [PATCH] More Battle Factory --- asm/battle_frontier_2.s | 1682 +--------------------------------- asm/battle_tower.s | 4 +- asm/contest_link_80F57C4.s | 2 +- asm/easy_chat.s | 2 +- asm/party_menu.s | 8 +- asm/pokenav.s | 32 +- asm/rom_8011DC0.s | 84 +- asm/slot_machine.s | 2 +- asm/trade.s | 4 +- asm/trainer_card.s | 68 +- asm/use_pokeblock.s | 2 +- include/global.h | 8 +- include/menu.h | 2 +- src/battle_factory.c | 569 +++++++++++- src/berry_fix_program.c | 10 +- src/hall_of_fame.c | 26 +- src/link.c | 10 +- src/mail.c | 4 +- src/main_menu.c | 44 +- src/menu.c | 6 +- src/naming_screen.c | 6 +- src/pokemon_storage_system.c | 4 +- src/starter_choose.c | 4 +- 23 files changed, 717 insertions(+), 1866 deletions(-) diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index 4ad564400..4e0c3126f 100644 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -7,1658 +7,6 @@ - thumb_func_start sub_819B124 -sub_819B124: @ 819B124 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - ldrh r0, [r0, 0x8] - subs r0, 0x2 - lsls r0, 16 - asrs r0, 16 - adds r6, r1, 0 - cmp r0, 0xB - bls _0819B144 - b _0819B36E -_0819B144: - lsls r0, 2 - ldr r1, =_0819B158 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0819B158: - .4byte _0819B188 - .4byte _0819B1EC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B1BC - .4byte _0819B36E - .4byte _0819B36E - .4byte _0819B300 - .4byte _0819B35C -_0819B188: - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B1A2 - ldr r2, =0x00000299 - adds r0, r1, r2 - movs r7, 0xA8 - lsls r7, 2 - adds r1, r7 - movs r2, 0 - bl sub_819F2B4 -_0819B1A2: - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0x9 - b _0819B36C - .pool -_0819B1BC: - ldr r4, =gUnknown_0300127C - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0819B1CE - b _0819B36E -_0819B1CE: - bl sub_819B844 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - b _0819B344 - .pool -_0819B1EC: - ldr r2, =gMain - ldrh r1, [r2, 0x2E] - movs r7, 0x1 - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B27C - movs r0, 0x5 - bl PlaySE - bl sub_819BC04 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - bne _0819B228 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldr r2, =0x000002a2 - adds r0, r2 - b _0819B2AC - .pool -_0819B228: - cmp r0, 0x2 - bne _0819B248 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xA - strh r1, [r0, 0x8] - ldr r1, =Task_HandleSelectionScreenYesNo - str r1, [r0] - b _0819B36E - .pool -_0819B248: - cmp r1, 0x3 - bne _0819B260 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0xB - strh r1, [r0, 0x8] - b _0819B2BA - .pool -_0819B260: - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - movs r1, 0x6 - strh r1, [r0, 0x8] - ldr r1, =Task_FromSelectScreenToSummaryScreen - str r1, [r0] - b _0819B36E - .pool -_0819B27C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0819B2D0 - movs r0, 0x5 - bl PlaySE - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldr r1, =0x000002a2 - adds r0, r1 -_0819B2AC: - strb r7, [r0] - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x8] -_0819B2BA: - ldr r1, =sub_819B378 - str r1, [r0] - b _0819B36E - .pool -_0819B2D0: - ldrh r1, [r2, 0x30] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0819B2EA - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - bl UpdateMenuCursorPosition - b _0819B36E -_0819B2EA: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0819B36E - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - bl UpdateMenuCursorPosition - b _0819B36E -_0819B300: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0 - bne _0819B36E - ldr r4, =gUnknown_0300127C - ldr r2, [r4] - ldrb r0, [r2, 0x6] - cmp r0, 0x1 - bne _0819B338 - ldr r1, =gPlttBufferFaded - movs r7, 0xA9 - lsls r7, 2 - adds r0, r2, r7 - ldrh r0, [r0] - movs r2, 0xE4 - lsls r2, 1 - adds r1, r2 - strh r0, [r1] - ldr r0, =gPlttBufferUnfaded - subs r7, 0xBC - adds r1, r0, r7 - ldrh r1, [r1] - adds r0, r2 - strh r1, [r0] -_0819B338: - ldr r0, [r4] - strb r3, [r0, 0x6] - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r0, r6 -_0819B344: - movs r1, 0x3 - strh r1, [r0, 0x8] - b _0819B36E - .pool -_0819B35C: - bl sub_819B844 - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - movs r0, 0xC -_0819B36C: - strh r0, [r1, 0x8] -_0819B36E: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B124 - - thumb_func_start sub_819B378 -sub_819B378: @ 819B378 - push {r4-r7,lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r5, =gUnknown_0300127C - ldr r3, [r5] - movs r7, 0xA8 - lsls r7, 2 - adds r0, r3, r7 - ldrb r0, [r0] - cmp r0, 0x1 - beq _0819B476 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r4, r0, r1 - movs r0, 0x8 - ldrsh r1, [r4, r0] - cmp r1, 0x1 - beq _0819B3DC - cmp r1, 0x1 - bgt _0819B3B4 - cmp r1, 0 - beq _0819B3BA - b _0819B476 - .pool -_0819B3B4: - cmp r1, 0xB - beq _0819B440 - b _0819B476 -_0819B3BA: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0819B476 - movs r0, 0x1 - movs r1, 0x1 - strh r1, [r4, 0x8] - ldr r2, =0x000002a2 - adds r1, r3, r2 - strb r0, [r1] - b _0819B476 - .pool -_0819B3DC: - ldr r2, =gMain - ldrh r0, [r2, 0x2E] - ands r1, r0 - cmp r1, 0 - beq _0819B40C - movs r0, 0x5 - bl PlaySE - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0 - strb r1, [r0] - movs r0, 0x2 - strh r0, [r4, 0x8] - ldr r0, =sub_819B124 - str r0, [r4] - b _0819B476 - .pool -_0819B40C: - ldrh r1, [r2, 0x30] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0819B422 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 - negs r0, r0 - b _0819B432 -_0819B422: - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - movs r0, 0x1 -_0819B432: - bl UpdateBallCursorPosition - bl sub_819BCF8 - bl sub_819B9E8 - b _0819B476 -_0819B440: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r6, 0x1 - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _0819B476 - movs r0, 0x5 - bl PlaySE - ldr r1, [r5] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r1, r7 - movs r2, 0 - bl sub_819F3F8 - bl sub_819BA64 - ldr r0, [r5] - ldr r1, =0x000002a2 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - strh r6, [r4, 0x8] -_0819B476: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B378 - - thumb_func_start sub_819B484 -sub_819B484: @ 819B484 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - movs r6, 0 - add r0, sp, 0xC - strb r6, [r0] - ldr r0, =0x000040ce - bl VarGet - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r7, =gSaveBlock2Ptr - ldr r2, [r7] - ldr r0, =0x00000ca9 - adds r4, r2, r0 - ldrb r0, [r4] - lsls r0, 30 - lsrs r0, 30 - adds r5, r0, 0 - lsls r0, r5, 1 - lsls r1, r6, 2 - adds r0, r1 - ldr r1, =0x00000de2 - adds r2, r1 - adds r2, r0 - ldrh r0, [r2] - movs r1, 0x7 - bl __udivsi3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x18] - ldr r1, =gFacilityTrainerMons - ldr r0, =gBattleFrontierMons - str r0, [r1] - ldrb r1, [r4] - movs r0, 0x3 - ands r0, r1 - movs r2, 0x32 - str r2, [sp, 0x14] - cmp r0, 0 - beq _0819B4EA - movs r3, 0x64 - str r3, [sp, 0x14] -_0819B4EA: - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_81A6F70 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x1C] - ldr r1, [r7] - ldrb r0, [r1, 0xA] - mov r9, r0 - ldrb r0, [r1, 0xB] - lsls r0, 8 - mov r2, r9 - orrs r2, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r2, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r2, r0 - mov r9, r2 - movs r3, 0 - mov r8, r3 -_0819B518: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r8 - lsls r0, r2, 1 - add r0, r8 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r5, [r1] - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - ldr r2, [sp, 0x10] - add r2, r8 - movs r3, 0x6C - adds r0, r2, 0 - muls r0, r3 - adds r1, r0 - strh r5, [r1, 0xC] - mov r10, r2 - ldr r0, [sp, 0x1C] - cmp r8, r0 - bcs _0819B570 - ldr r0, [sp, 0x18] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _0819B572 - .pool -_0819B570: - ldr r0, [sp, 0x18] -_0819B572: - movs r1, 0 - bl sub_81A6CA8 - lsls r0, 24 - lsrs r6, r0, 24 - movs r1, 0x6C - mov r4, r10 - muls r4, r1 - adds r4, 0xC - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, =gFacilityTrainerMons - ldr r2, [r1] - lsls r5, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - str r6, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r9 - str r2, [sp, 0x8] - ldr r2, [sp, 0x14] - bl CreateMonWithEVSpreadPersonalityOTID - movs r1, 0 - add r0, sp, 0xC - strb r1, [r0] - movs r6, 0 - adds r7, r5, 0 - movs r3, 0x1 - add r8, r3 - ldr r3, =gUnknown_0300127C -_0819B5B8: - ldr r0, [r3] - adds r0, r4 - adds r0, 0x8 - ldr r5, =gFacilityTrainerMons - ldr r1, [r5] - adds r1, r7, r1 - lsls r2, r6, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r6, 0 - str r3, [sp, 0x20] - bl sub_81A7024 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r3, [sp, 0x20] - cmp r6, 0x3 - bls _0819B5B8 - movs r0, 0x6C - mov r4, r10 - muls r4, r0 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r1, [r5] - adds r1, r7, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r3, r8 - lsls r0, r3, 24 - lsrs r0, 24 - mov r8, r0 - cmp r0, 0x5 - bhi _0819B620 - b _0819B518 -_0819B620: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B484 - - thumb_func_start sub_819B63C -sub_819B63C: @ 819B63C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x14 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x10] - add r0, sp, 0xC - movs r1, 0 - strb r1, [r0] - ldr r2, =gFacilityTrainerMons - ldr r0, =gSlateportBattleTentMons - str r0, [r2] - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r3, [r1, 0xA] - ldrb r0, [r1, 0xB] - lsls r0, 8 - orrs r3, r0 - ldrb r0, [r1, 0xC] - lsls r0, 16 - orrs r3, r0 - ldrb r0, [r1, 0xD] - lsls r0, 24 - orrs r3, r0 - mov r10, r3 - movs r7, 0 - mov r9, r7 -_0819B678: - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - mov r2, r9 - lsls r0, r2, 1 - add r0, r9 - lsls r0, 2 - adds r1, r0 - movs r3, 0xE7 - lsls r3, 4 - adds r1, r3 - ldrh r1, [r1] - mov r8, r1 - ldr r7, =gUnknown_0300127C - ldr r0, [r7] - ldr r6, [sp, 0x10] - add r6, r9 - movs r1, 0x6C - adds r4, r6, 0 - muls r4, r1 - adds r1, r0, r4 - mov r2, r8 - strh r2, [r1, 0xC] - adds r4, 0xC - adds r0, r4 - adds r0, 0x8 - ldr r3, =gFacilityTrainerMons - ldr r2, [r3] - mov r7, r8 - lsls r5, r7, 4 - adds r2, r5, r2 - ldrh r1, [r2] - ldrb r3, [r2, 0xC] - movs r7, 0 - str r7, [sp] - ldrb r2, [r2, 0xB] - str r2, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r2, 0x1E - bl CreateMonWithEVSpreadPersonalityOTID - add r0, sp, 0xC - movs r3, 0 - strb r3, [r0] - movs r0, 0x1 - add r9, r0 -_0819B6D4: - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gFacilityTrainerMons - ldr r2, [r3] - mov r3, r8 - lsls r1, r3, 4 - adds r1, r2 - lsls r2, r7, 1 - adds r1, 0x2 - adds r1, r2 - ldrh r1, [r1] - adds r2, r7, 0 - bl sub_81A7024 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0x3 - bls _0819B6D4 - movs r7, 0x6C - adds r4, r6, 0 - muls r4, r7 - adds r4, 0xC - ldr r1, =gUnknown_0300127C - ldr r0, [r1] - adds r0, r4 - adds r0, 0x8 - movs r1, 0x20 - add r2, sp, 0xC - bl SetMonData - ldr r2, =gUnknown_0300127C - ldr r0, [r2] - adds r0, r4 - adds r0, 0x8 - ldr r3, =gFacilityTrainerMons - ldr r1, [r3] - adds r1, r5, r1 - ldrb r2, [r1, 0xA] - lsls r2, 1 - ldr r1, =gBattleFrontierHeldItems - adds r2, r1 - movs r1, 0xC - bl SetMonData - mov r7, r9 - lsls r0, r7, 24 - lsrs r0, 24 - mov r9, r0 - cmp r0, 0x5 - bls _0819B678 - add sp, 0x14 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B63C - - thumb_func_start sub_819B764 -sub_819B764: @ 819B764 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r7, 0 - ldr r0, =gUnknown_0300127C - mov r10, r0 - ldr r1, =gSaveBlock2Ptr - mov r8, r1 -_0819B778: - movs r2, 0 - adds r0, r7, 0x1 - mov r9, r0 -_0819B77E: - mov r1, r10 - ldr r0, [r1] - movs r1, 0x6C - adds r6, r2, 0 - muls r6, r1 - adds r1, r0, r6 - ldrb r0, [r1, 0x10] - cmp r0, r9 - bne _0819B81C - movs r0, 0x64 - adds r5, r7, 0 - muls r5, r0 - ldr r2, =gPlayerParty - adds r5, r2 - adds r1, 0x14 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - mov r0, r8 - ldr r1, [r0] - lsls r4, r7, 1 - adds r4, r7 - lsls r4, 2 - adds r1, r4 - mov r2, r10 - ldr r0, [r2] - adds r0, r6 - ldrh r0, [r0, 0xC] - movs r2, 0xE7 - lsls r2, 4 - adds r1, r2 - strh r0, [r1] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r2, r8 - ldr r1, [r2] - ldr r2, =0x00000e74 - adds r1, r2 - adds r1, r4 - str r0, [r1] - adds r0, r5, 0 - movs r1, 0x2E - movs r2, 0 - bl GetBoxMonData - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e79 - adds r1, r2 - strb r0, [r1] - adds r0, r5, 0 - movs r1, 0x28 - movs r2, 0 - bl GetBoxMonData - mov r2, r8 - ldr r1, [r2] - adds r1, r4 - ldr r2, =0x00000e78 - adds r1, r2 - strb r0, [r1] - b _0819B826 - .pool -_0819B81C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _0819B77E -_0819B826: - mov r1, r9 - lsls r0, r1, 24 - lsrs r7, r0, 24 - cmp r7, 0x2 - bls _0819B778 - bl CalculatePlayerPartyCount - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_819B764 - - thumb_func_start sub_819B844 -sub_819B844: @ 819B844 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - ldrb r0, [r1, 0x6] - cmp r0, 0 - bne _0819B852 - strb r0, [r1] -_0819B852: - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r0, [r2, 0x2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - ldrb r0, [r2] - lsls r0, 4 - adds r0, 0x70 - strh r0, [r1, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BAFC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B844 - - thumb_func_start sub_819B8D4 -sub_819B8D4: @ 819B8D4 - push {r4,r5,lr} - ldr r5, =gUnknown_0300127C - ldr r1, [r5] - movs r0, 0 - strb r0, [r1, 0x7] - ldr r4, =gSprites - ldr r2, [r5] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xB0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r3, 0x70 - strh r3, [r0, 0x22] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - movs r1, 0xD0 - strh r1, [r0, 0x20] - ldrb r1, [r2, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r3, [r0, 0x22] - ldrb r0, [r2, 0x1] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r3, [r1] - movs r2, 0x5 - negs r2, r2 - adds r0, r2, 0 - ands r0, r3 - strb r0, [r1] - ldr r0, [r5] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x3E - ldrb r1, [r0] - ands r2, r1 - strb r2, [r0] - bl sub_819BBA8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B8D4 - - thumb_func_start sub_819B958 -sub_819B958: @ 819B958 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gSprites - ldr r3, =gUnknown_0300127C - ldr r0, [r3] - ldrb r1, [r0, 0x1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - ldrb r1, [r0, 0x2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x2 - bl CopyWindowToVram - adds r0, r4, 0 - bl ClearWindowTilemap - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B958 - - thumb_func_start sub_819B9B4 -sub_819B9B4: @ 819B9B4 - push {lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gText_RentalPkmn2 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9B4 - - thumb_func_start sub_819B9E8 -sub_819B9E8: @ 819B9E8 - push {r4,r5,lr} - sub sp, 0xC - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gStringVar4 - movs r1, 0xB - muls r1, r0 - ldr r0, =gSpeciesNames - adds r1, r0 - adds r0, r4, 0 - bl StringCopy - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x56 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_08610479 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0x1 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819B9E8 - - thumb_func_start sub_819BA64 -sub_819BA64: @ 819BA64 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x1 - bne _0819BA88 - ldr r2, =gText_SelectFirstPkmn - b _0819BA9C - .pool -_0819BA88: - cmp r0, 0x2 - bne _0819BA94 - ldr r2, =gText_SelectSecondPkmn - b _0819BA9C - .pool -_0819BA94: - ldr r2, =gText_TheseThreePkmnOkay - cmp r0, 0x3 - bne _0819BA9C - ldr r2, =gText_SelectThirdPkmn -_0819BA9C: - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BA64 - - thumb_func_start sub_819BAC8 -sub_819BAC8: @ 819BAC8 - push {lr} - sub sp, 0xC - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r2, =gText_CantSelectSamePkmn - movs r0, 0x5 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r3, 0x2 - bl PrintTextOnWindow - movs r0, 0x2 - movs r1, 0x2 - bl CopyWindowToVram - add sp, 0xC - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAC8 - - thumb_func_start sub_819BAFC -sub_819BAFC: @ 819BAFC - push {r4-r6,lr} - sub sp, 0xC - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r5, [r0, 0x10] - movs r0, 0x3 - bl PutWindowTilemap - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r4, =gUnknown_08610476 - str r4, [sp] - movs r6, 0 - str r6, [sp, 0x4] - ldr r0, =gText_Summary - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - cmp r5, 0 - beq _0819BB60 - str r4, [sp] - str r6, [sp, 0x4] - ldr r0, =gText_Deselect - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - b _0819BB74 - .pool -_0819BB60: - str r4, [sp] - str r5, [sp, 0x4] - ldr r0, =gText_Rent - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print -_0819BB74: - ldr r0, =gUnknown_08610476 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r0, =gText_Others2 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x21 - bl box_print - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BAFC - - thumb_func_start sub_819BBA8 -sub_819BBA8: @ 819BBA8 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0x4 - bl PutWindowTilemap - movs r0, 0x4 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r5, =gUnknown_08610476 - str r5, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gText_Yes2 - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x1 - bl box_print - str r5, [sp] - str r4, [sp, 0x4] - ldr r0, =gText_No2 - str r0, [sp, 0x8] - movs r0, 0x4 - movs r1, 0x1 - movs r2, 0x7 - movs r3, 0x11 - bl box_print - movs r0, 0x4 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BBA8 - - thumb_func_start sub_819BC04 -sub_819BC04: @ 819BC04 - push {lr} - ldr r2, =gUnknown_030062E8 - ldr r1, =gUnknown_0861041C - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [r2] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BC04 - - thumb_func_start sub_819BC30 -sub_819BC30: @ 819BC30 - push {r4,lr} - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r2, [r0, 0x3] - movs r1, 0x6C - muls r1, r2 - adds r0, r1 - ldrb r1, [r0, 0x10] - ldrh r0, [r0, 0xC] - cmp r1, 0 - bne _0819BC60 - bl sub_819C634 - cmp r0, 0 - bne _0819BC60 - bl sub_819BAC8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x3 - b _0819BC96 - .pool -_0819BC60: - ldr r4, =gUnknown_0300127C - ldr r1, [r4] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - bl HandleMonSelectionChange - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BC94 - movs r0, 0x1 - b _0819BC96 - .pool -_0819BC94: - movs r0, 0x2 -_0819BC96: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_819BC30 - - thumb_func_start sub_819BC9C -sub_819BC9C: @ 819BC9C - push {lr} - bl sub_819C568 - bl HandleMonSelectionChange - bl sub_819BA64 - movs r0, 0x3 - bl sub_819B958 - ldr r0, =gUnknown_0300127C - ldr r0, [r0] - ldrb r0, [r0, 0x5] - cmp r0, 0x3 - bhi _0819BCC4 - movs r0, 0x1 - b _0819BCC6 - .pool -_0819BCC4: - movs r0, 0x2 -_0819BCC6: - pop {r1} - bx r1 - thumb_func_end sub_819BC9C - - thumb_func_start sub_819BCCC -sub_819BCCC: @ 819BCCC - movs r0, 0 - bx lr - thumb_func_end sub_819BCCC - - thumb_func_start sub_819BCD0 -sub_819BCD0: @ 819BCD0 - push {lr} - ldr r0, =gUnknown_0300127C - ldr r1, [r0] - movs r2, 0xA6 - lsls r2, 2 - adds r0, r1, r2 - ldr r0, [r0] - adds r2, 0x8 - adds r1, r2 - movs r2, 0 - bl sub_819F3F8 - movs r0, 0x3 - bl sub_819B958 - movs r0, 0x1 - pop {r1} - bx r1 - .pool - thumb_func_end sub_819BCD0 - - thumb_func_start sub_819BCF8 -sub_819BCF8: @ 819BCF8 - push {r4,r5,lr} - sub sp, 0x2C - ldr r5, =gUnknown_0300127C - ldr r0, [r5] - ldrb r4, [r0, 0x3] - cmp r4, 0x5 - bhi _0819BD64 - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0x5 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x6C - muls r0, r4 - ldr r1, [r5] - adds r0, r1 - adds r0, 0x14 - movs r1, 0xB - movs r2, 0 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl SpeciesToNationalPokedexNum - lsls r0, 16 - lsrs r0, 16 - add r1, sp, 0xC - bl CopyMonCategoryText - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x76 - bl GetStringRightAlignXOffset - adds r3, r0, 0 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x1 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x5 - movs r1, 0x1 - add r2, sp, 0xC - bl PrintTextOnWindow - movs r0, 0x5 - movs r1, 0x2 - bl CopyWindowToVram -_0819BD64: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BCF8 - - thumb_func_start sub_819BD70 -sub_819BD70: @ 819BD70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x10 - ldr r6, =gUnknown_0300127C - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r8 - movs r3, 0x1 - bl CreateMonPicSprite_HandleDeoxys - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - movs r3, 0 - strb r0, [r1] - ldr r4, =gSprites - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x28 - strb r3, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x29 - strb r3, [r0] - ldr r0, [r6] - movs r1, 0xA8 - lsls r1, 2 - adds r0, r1 - strb r3, [r0] - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BD70 - - thumb_func_start sub_819BE20 -sub_819BE20: @ 819BE20 - ldr r1, =gUnknown_0300127C - ldr r1, [r1] - movs r2, 0xA8 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_819BE20 - - thumb_func_start sub_819BE34 -sub_819BE34: @ 819BE34 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x10 - ldr r0, =gUnknown_08610638 - movs r1, 0x78 - movs r2, 0x40 - movs r3, 0x1 - bl CreateSprite - ldr r6, =gUnknown_0300127C - ldr r1, [r6] - ldr r2, =0x00000299 - mov r10, r2 - add r1, r10 - movs r7, 0 - strb r0, [r1] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - movs r1, 0x2 - bl StartSpriteAffineAnim - ldr r2, [r6] - ldrb r1, [r2, 0x3] - movs r0, 0x6C - adds r4, r1, 0 - muls r4, r0 - adds r4, r2 - adds r4, 0x14 - adds r0, r4, 0 - movs r1, 0xB - movs r2, 0 - bl GetMonData - adds r5, r0, 0 - lsls r5, 16 - lsrs r5, 16 - adds r0, r4, 0 - movs r1, 0 - movs r2, 0 - bl GetMonData - mov r9, r0 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - bl GetMonData - adds r1, r0, 0 - movs r0, 0x58 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - ldr r0, =0x0000ffff - str r0, [sp, 0xC] - adds r0, r5, 0 - mov r2, r9 - movs r3, 0x1 - bl CreateMonPicSprite_HandleDeoxys - ldr r1, [r6] - movs r2, 0xA6 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x28 - strb r7, [r0] - ldr r0, [r6] - adds r0, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x29 - strb r7, [r0] - ldr r0, [r6] - add r0, r10 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - add sp, 0x10 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_819BE34 thumb_func_start sub_819BF2C sub_819BF2C: @ 819BF2C @@ -6974,7 +5322,7 @@ _0819EB8A: movs r0, 0x1 movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x1 movs r1, 0x3 bl CopyWindowToVram @@ -7032,7 +5380,7 @@ sub_819EC20: @ 819EC20 movs r1, 0x1 movs r2, 0xF movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 str r5, [sp] str r4, [sp, 0x4] ldr r0, =gText_Swap @@ -7041,7 +5389,7 @@ sub_819EC20: @ 819EC20 movs r1, 0x1 movs r2, 0xF movs r3, 0x11 - bl box_print + bl AddTextPrinterParameterized3 str r5, [sp] str r4, [sp, 0x4] ldr r0, =gText_Rechoose @@ -7050,7 +5398,7 @@ sub_819EC20: @ 819EC20 movs r1, 0x1 movs r2, 0xF movs r3, 0x21 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x3 movs r1, 0x3 bl CopyWindowToVram @@ -7080,7 +5428,7 @@ sub_819EC94: @ 819EC94 movs r1, 0x1 movs r2, 0x7 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 str r5, [sp] str r4, [sp, 0x4] ldr r0, =gText_No3 @@ -7089,7 +5437,7 @@ sub_819EC94: @ 819EC94 movs r1, 0x1 movs r2, 0x7 movs r3, 0x11 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x4 movs r1, 0x3 bl CopyWindowToVram @@ -7126,7 +5474,7 @@ sub_819ECF0: @ 819ECF0 adds r0, r4, 0 movs r1, 0 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r4-r6} pop {r0} @@ -7321,7 +5669,7 @@ _0819EE8E: movs r0, 0x7 movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x7 movs r1, 0x3 bl CopyWindowToVram @@ -7398,7 +5746,7 @@ _0819EF46: movs r0, 0x1 movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x1 movs r1, 0x3 bl CopyWindowToVram @@ -21389,7 +19737,7 @@ _081A6602: lsls r2, r6, 24 lsrs r2, 24 adds r0, r4, r5 - bl sub_81A7024 + bl SetMonMoveAvoidReturn adds r6, 0x1 cmp r6, 0x3 ble _081A6602 @@ -21555,7 +19903,7 @@ _081A674E: lsls r2, r6, 24 lsrs r2, 24 adds r0, r4, r5 - bl sub_81A7024 + bl SetMonMoveAvoidReturn adds r6, 0x1 cmp r6, 0x3 ble _081A674E @@ -22445,7 +20793,7 @@ _081A6E6E: lsls r2, r4, 24 lsrs r2, 24 adds r0, r5, r6 - bl sub_81A7024 + bl SetMonMoveAvoidReturn adds r4, 0x1 cmp r4, 0x3 ble _081A6E6E @@ -22638,8 +20986,8 @@ _081A701E: bx r1 thumb_func_end GetAiScriptsInBattleFactory - thumb_func_start sub_81A7024 -sub_81A7024: @ 81A7024 + thumb_func_start SetMonMoveAvoidReturn +SetMonMoveAvoidReturn: @ 81A7024 push {lr} lsls r1, 16 lsls r2, 24 @@ -22652,7 +21000,7 @@ _081A7034: bl SetMonMoveSlot pop {r0} bx r0 - thumb_func_end sub_81A7024 + thumb_func_end SetMonMoveAvoidReturn thumb_func_start sub_81A703C sub_81A703C: @ 81A703C diff --git a/asm/battle_tower.s b/asm/battle_tower.s index f24069307..2312b63bd 100644 --- a/asm/battle_tower.s +++ b/asm/battle_tower.s @@ -2544,7 +2544,7 @@ _08163718: adds r0, r6, r2 adds r2, r3, 0 str r3, [sp, 0x1C] - bl sub_81A7024 + bl SetMonMoveAvoidReturn ldr r3, [sp, 0x1C] adds r0, r3, 0x1 lsls r0, 24 @@ -2662,7 +2662,7 @@ _08163818: ldr r2, =gEnemyParty adds r0, r6, r2 adds r2, r7, 0 - bl sub_81A7024 + bl SetMonMoveAvoidReturn ldr r1, =gFacilityTrainerMons ldr r0, [r1] adds r0, r5, r0 diff --git a/asm/contest_link_80F57C4.s b/asm/contest_link_80F57C4.s index 9eefa154f..3e35ab7f1 100644 --- a/asm/contest_link_80F57C4.s +++ b/asm/contest_link_80F57C4.s @@ -2237,7 +2237,7 @@ _080F6BD0: adds r0, r4, 0 movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r4, 0 movs r1, 0x7 bl GetWindowAttribute diff --git a/asm/easy_chat.s b/asm/easy_chat.s index 768311639..ffe8e171b 100644 --- a/asm/easy_chat.s +++ b/asm/easy_chat.s @@ -4693,7 +4693,7 @@ sub_811D058: @ 811D058 str r4, [sp, 0x4] str r2, [sp, 0x8] mov r2, r9 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0x10 pop {r3-r5} mov r8, r3 diff --git a/asm/party_menu.s b/asm/party_menu.s index 2d1faadab..67fc563fb 100644 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -4502,7 +4502,7 @@ _081B24C0: adds r0, r5, 0 movs r1, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 b _081B2540 .pool _081B2514: @@ -4525,7 +4525,7 @@ _081B2514: adds r0, r5, 0 movs r1, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 _081B2540: adds r0, r5, 0 bl PutWindowTilemap @@ -5108,7 +5108,7 @@ sub_81B2A3C: @ 81B2A3C str r1, [sp, 0x8] movs r1, 0 adds r2, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r4,r5} pop {r0} @@ -5804,7 +5804,7 @@ _081B2FF2: ldr r1, [r1] str r1, [sp, 0x8] movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 _081B3018: add sp, 0xC pop {r3} diff --git a/asm/pokenav.s b/asm/pokenav.s index b8165ec80..e69a9ef8c 100644 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -1471,7 +1471,7 @@ sub_81C7BA4: @ 81C7BA4 movs r1, 0x1 movs r2, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r4,r5} pop {r0} @@ -3707,7 +3707,7 @@ sub_81C8CB4: @ 81C8CB4 str r2, [sp, 0x4] str r6, [sp, 0x8] movs r2, 0x8 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r4, 0 movs r1, 0x1 bl sub_81C8C64 @@ -3835,7 +3835,7 @@ sub_81C8DBC: @ 81C8DBC movs r1, 0x7 movs r2, 0x2 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 ldrh r0, [r6, 0x8] lsls r4, 1 ldrb r1, [r6, 0x4] @@ -7078,7 +7078,7 @@ sub_81CA714: @ 81CA714 str r6, [sp, 0x8] movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r4-r6} pop {r0} @@ -7116,7 +7116,7 @@ sub_81CA770: @ 81CA770 str r6, [sp, 0x8] movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r4-r6} pop {r0} @@ -20108,7 +20108,7 @@ sub_81D0E84: @ 81D0E84 movs r1, 0x1 movs r2, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 ldrb r0, [r5, 0xA] movs r1, 0x2 bl CopyWindowToVram @@ -20155,7 +20155,7 @@ _081D0F2E: str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x80 lsls r0, 21 adds r5, r0 @@ -20195,7 +20195,7 @@ _081D0F7C: str r1, [sp, 0x8] movs r1, 0x1 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x80 lsls r0, 21 adds r6, r0 @@ -24413,7 +24413,7 @@ _081D36CA: movs r1, 0x1 movs r2, 0 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 lsls r0, r7, 1 mov r4, sp adds r4, r0 @@ -24436,7 +24436,7 @@ _081D3704: movs r1, 0x1 movs r2, 0x38 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0 ldrsh r1, [r4, r0] adds r0, r1, 0 @@ -24467,7 +24467,7 @@ _081D373A: mov r0, r8 movs r1, 0x1 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r7, 0x1 lsls r0, 16 lsrs r7, r0, 16 @@ -24585,7 +24585,7 @@ _081D3808: movs r1, 0x1 movs r2, 0 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r4, 0x38 lsls r4, 24 lsrs r4, 24 @@ -24599,7 +24599,7 @@ _081D3808: movs r1, 0x1 adds r2, r4, 0 adds r3, r5, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r6, 0x1 lsls r0, 16 lsrs r6, r0, 16 @@ -28979,7 +28979,7 @@ PrintOnTrainerHillRecordsWindow: @ 81D5C8C movs r0, 0 movs r1, 0x1 movs r3, 0x2 - bl box_print + bl AddTextPrinterParameterized3 movs r7, 0x12 movs r0, 0 mov r8, r0 @@ -29002,7 +29002,7 @@ _081D5CD6: movs r0, 0 movs r1, 0x1 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r7, 0xF ldr r0, =gSaveBlock1Ptr ldr r1, =0x00003718 @@ -29068,7 +29068,7 @@ _081D5CD6: str r0, [sp, 0x8] movs r0, 0 movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 adds r7, 0x11 movs r1, 0x1 add r8, r1 diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 01f29e0a5..d96e3c294 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -12955,7 +12955,7 @@ _0801C1D0: movs r1, 0x3 movs r2, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 ldr r4, [r7] movs r1, 0xDA lsls r1, 1 @@ -12996,7 +12996,7 @@ _0801C22E: adds r0, r5, 0 movs r1, 0x3 movs r3, 0x11 - bl box_print + bl AddTextPrinterParameterized3 ldr r2, [r7] ldr r0, [r2, 0x4] mov r9, r6 @@ -13023,7 +13023,7 @@ _0801C266: movs r1, 0x1 movs r2, 0xA6 movs r3, 0x11 - bl box_print + bl AddTextPrinterParameterized3 b _0801C498 .pool _0801C2A0: @@ -13064,7 +13064,7 @@ _0801C2A2: lsrs r0, r2, 24 movs r1, 0x3 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r4, 0x1 lsls r4, 24 lsrs r0, r4, 24 @@ -13104,7 +13104,7 @@ _0801C304: adds r0, r5, 0 movs r1, 0x3 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 ldr r2, [r7] ldrb r1, [r2, 0x8] movs r0, 0x3 @@ -13137,7 +13137,7 @@ _0801C304: adds r0, r5, 0 movs r1, 0x3 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 mov r9, r6 b _0801C498 .pool @@ -13202,7 +13202,7 @@ _0801C3CE: ldr r0, [sp, 0x10] movs r1, 0x3 ldr r3, [sp, 0x14] - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [r7] adds r0, r1, r5 ldr r2, =0x00000306 @@ -13240,7 +13240,7 @@ _0801C3CE: ldr r0, [sp, 0x10] movs r1, 0x3 ldr r3, [sp, 0x14] - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [r7] adds r1, r4 adds r1, 0x2A @@ -14515,7 +14515,7 @@ _0801CEEC: str r4, [sp, 0x8] movs r1, 0x3 movs r3, 0x6 - bl box_print + bl AddTextPrinterParameterized3 _0801CF1C: ldr r6, =gUnknown_02022C78 ldr r4, [r6] @@ -14550,7 +14550,7 @@ _0801CF1C: str r4, [sp, 0x8] movs r1, 0x3 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r5, 0x1 lsls r0, 24 lsrs r5, r0, 24 @@ -20926,7 +20926,7 @@ _08020154: movs r0, 0x1 movs r1, 0x2 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0x34 pop {r3-r5} mov r8, r3 @@ -21004,7 +21004,7 @@ _08020206: movs r0, 0x2 movs r1, 0 lsrs r2, r5, 24 - bl box_print + bl AddTextPrinterParameterized3 adds r4, 0x4 adds r7, 0x1 adds r0, r6, 0 @@ -21043,7 +21043,7 @@ _08020248: movs r4, 0x80 lsls r4, 19 lsrs r2, r4, 24 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r7, 0x1 str r0, [sp, 0x48] adds r6, 0xC @@ -21094,7 +21094,7 @@ _080202AC: movs r0, 0x2 movs r1, 0 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r2, r7, 0 add r0, sp, 0xC str r0, [sp] @@ -21106,7 +21106,7 @@ _080202AC: movs r0, 0x2 movs r1, 0 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 _08020300: ldr r7, [sp, 0x48] mov r4, r10 @@ -21299,7 +21299,7 @@ sub_8020420: @ 8020420 movs r1, 0x2 movs r2, 0 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0x10 pop {r4,r5} pop {r0} @@ -23909,7 +23909,7 @@ sub_80219C8: @ 80219C8 movs r1, 0x2 adds r2, r4, 0 movs r3, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r3} mov r8, r3 @@ -24217,7 +24217,7 @@ _08021C5E: ldr r1, =gStringVar4 str r1, [sp, 0x8] movs r1, 0x2 - bl box_print + bl AddTextPrinterParameterized3 ldr r3, [sp, 0x18] ldr r2, [sp, 0xC] ldrb r2, [r2, 0x8] @@ -24260,7 +24260,7 @@ _08021CC8: str r2, [sp, 0x8] movs r1, 0x2 movs r2, 0x4 - bl box_print + bl AddTextPrinterParameterized3 lsls r0, r5, 24 lsrs r5, r0, 24 ldr r3, [sp, 0xC] @@ -24324,7 +24324,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 movs r2, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 ldr r4, =gText_SpaceSec movs r0, 0x2 adds r1, r4, 0 @@ -24345,7 +24345,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x9F lsls r0, 1 add r0, r8 @@ -24386,7 +24386,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 ldr r4, =gText_SpaceMin movs r0, 0x2 adds r1, r4, 0 @@ -24406,7 +24406,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x9E lsls r0, 1 add r0, r8 @@ -24437,7 +24437,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r7, 0 adds r0, 0xE lsls r0, 24 @@ -24452,7 +24452,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 movs r2, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 ldr r4, =gText_TimesPerSec movs r0, 0x2 adds r1, r4, 0 @@ -24474,7 +24474,7 @@ sub_8021D34: @ 8021D34 movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 mov r4, r8 ldrb r2, [r4, 0x16] ldrh r0, [r4, 0x16] @@ -24555,7 +24555,7 @@ _08021F0A: movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 b _08021FDE .pool _08021FC4: @@ -24570,7 +24570,7 @@ _08021FC4: movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 _08021FDE: adds r0, r7, 0 adds r0, 0xE @@ -24591,7 +24591,7 @@ _08021FDE: movs r1, 0x2 movs r2, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 ldr r0, =gStringVar1 ldr r4, [sp, 0x10] ldrh r1, [r4, 0x8] @@ -24620,7 +24620,7 @@ _08021FDE: movs r1, 0x2 adds r2, r6, 0 adds r3, r7, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0x1C pop {r3-r5} mov r8, r3 @@ -24942,7 +24942,7 @@ _080222D0: movs r1, 0x1 adds r2, r7, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 ldr r0, =gText_PressingSpeedRankings mov r10, r0 movs r0, 0x1 @@ -24962,7 +24962,7 @@ _080222D0: movs r1, 0x1 adds r2, r7, 0 movs r3, 0x11 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x29 mov r10, r0 _08022336: @@ -24985,7 +24985,7 @@ _08022336: movs r1, 0x1 movs r2, 0 mov r3, r10 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x1 ldr r1, =gText_TimesPerSec movs r2, 0x1 @@ -25005,7 +25005,7 @@ _08022336: movs r1, 0x1 adds r2, r7, 0 mov r3, r10 - bl box_print + bl AddTextPrinterParameterized3 movs r2, 0 mov r0, r9 lsls r4, r0, 1 @@ -25078,7 +25078,7 @@ _080223CA: movs r1, 0x1 adds r2, r7, 0 mov r3, r10 - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [sp, 0x10] lsls r0, r1, 24 lsrs r0, 24 @@ -39391,7 +39391,7 @@ _0802955A: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 mov r2, r10 ldr r0, [r2] add r0, r9 @@ -39677,7 +39677,7 @@ _080297CC: movs r1, 0x1 movs r2, 0x1C adds r3, r6, 0 - bl box_print + bl AddTextPrinterParameterized3 add r0, sp, 0xC mov r1, r9 movs r2, 0 @@ -39908,7 +39908,7 @@ _080299F2: str r6, [sp, 0x8] movs r1, 0x1 movs r2, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r7, 0 mov r8, r5 mov r0, r9 @@ -39971,7 +39971,7 @@ _08029A36: mov r1, r10 str r1, [sp, 0x8] movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 b _08029B10 .pool _08029AE0: @@ -47951,7 +47951,7 @@ sub_802DB8C: @ 802DB8C movs r1, 0 movs r2, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add r0, sp, 0xC str r0, [sp] str r4, [sp, 0x4] @@ -47961,7 +47961,7 @@ sub_802DB8C: @ 802DB8C movs r1, 0 movs r2, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0x10 pop {r4} pop {r0} @@ -48390,7 +48390,7 @@ sub_802DED8: @ 802DED8 movs r1, 0x1 adds r2, r4, 0 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 ldr r0, [r6] adds r0, 0x1C add r0, r8 diff --git a/asm/slot_machine.s b/asm/slot_machine.s index fe8acf6d6..e6828cb70 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -4527,7 +4527,7 @@ sub_812DD78: @ 812DD78 movs r1, 0x1 movs r2, 0x2 movs r3, 0x5 - bl box_print + bl AddTextPrinterParameterized3 movs r0, 0x1 movs r1, 0x3 bl CopyWindowToVram diff --git a/asm/trade.s b/asm/trade.s index 224995de5..30a22ff75 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -4588,7 +4588,7 @@ _080798BC: str r0, [sp, 0x8] adds r0, r5, 0 movs r3, 0x4 - bl box_print + bl AddTextPrinterParameterized3 add r6, sp, 0x28 adds r0, r6, 0 ldr r1, [sp, 0x60] @@ -4847,7 +4847,7 @@ sub_8079B84: @ 8079B84 adds r0, r4, 0 movs r1, 0 movs r3, 0x4 - bl box_print + bl AddTextPrinterParameterized3 adds r0, r4, 0 bl PutWindowTilemap adds r0, r4, 0 diff --git a/asm/trainer_card.s b/asm/trainer_card.s index 6d1be17cb..8ebcfbacc 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -1747,7 +1747,7 @@ sub_80C3574: @ 80C3574 movs r1, 0x1 movs r2, 0x14 movs r3, 0x1C - bl box_print + bl AddTextPrinterParameterized3 b _080C35FA .pool _080C35E0: @@ -1762,7 +1762,7 @@ _080C35E0: movs r1, 0x1 movs r2, 0x10 movs r3, 0x21 - bl box_print + bl AddTextPrinterParameterized3 _080C35FA: add sp, 0x2C pop {r4,r5} @@ -1818,7 +1818,7 @@ _080C365C: str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0x2C pop {r4} pop {r0} @@ -1848,7 +1848,7 @@ sub_80C3684: @ 80C3684 movs r1, 0x1 movs r2, 0x14 movs r3, 0x38 - bl box_print + bl AddTextPrinterParameterized3 b _080C36DE .pool _080C36C4: @@ -1863,7 +1863,7 @@ _080C36C4: movs r1, 0x1 movs r2, 0x10 movs r3, 0x39 - bl box_print + bl AddTextPrinterParameterized3 _080C36DE: ldr r0, =gStringVar1 ldr r4, =gUnknown_02039CE8 @@ -1910,7 +1910,7 @@ _080C3740: str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r4,r5} pop {r0} @@ -1964,7 +1964,7 @@ sub_80C378C: @ 80C378C movs r1, 0x1 movs r2, 0x14 movs r3, 0x48 - bl box_print + bl AddTextPrinterParameterized3 b _080C37F6 .pool _080C37DC: @@ -1979,7 +1979,7 @@ _080C37DC: movs r1, 0x1 movs r2, 0x10 movs r3, 0x49 - bl box_print + bl AddTextPrinterParameterized3 _080C37F6: ldr r5, =gStringVar4 ldr r4, =gUnknown_02039CE8 @@ -2025,7 +2025,7 @@ _080C3854: str r0, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 _080C386E: add sp, 0xC pop {r4,r5} @@ -2060,7 +2060,7 @@ sub_80C3880: @ 80C3880 movs r1, 0x1 movs r2, 0x14 movs r3, 0x58 - bl box_print + bl AddTextPrinterParameterized3 b _080C38E2 .pool _080C38C8: @@ -2075,7 +2075,7 @@ _080C38C8: movs r1, 0x1 movs r2, 0x10 movs r3, 0x59 - bl box_print + bl AddTextPrinterParameterized3 _080C38E2: ldr r0, =gUnknown_02039CE8 ldr r1, [r0] @@ -2159,7 +2159,7 @@ _080C395C: movs r0, 0x1 movs r1, 0x1 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 adds r7, 0x12 lsls r2, r7, 24 lsrs r2, 24 @@ -2177,7 +2177,7 @@ _080C395C: movs r0, 0x1 movs r1, 0x1 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 add r7, r10 mov r0, r9 adds r1, r6, 0 @@ -2194,7 +2194,7 @@ _080C395C: movs r0, 0x1 movs r1, 0x1 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r3-r5} mov r8, r3 @@ -2235,7 +2235,7 @@ sub_80C3A18: @ 80C3A18 movs r0, 0x1 movs r1, 0x1 movs r2, 0x8 - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [r7] adds r1, 0x19 movs r0, 0x1 @@ -2256,7 +2256,7 @@ sub_80C3A18: @ 80C3A18 str r1, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 ldr r0, =gUnknown_0856FB4A mov r8, r0 ldr r1, [r7] @@ -2271,7 +2271,7 @@ sub_80C3A18: @ 80C3A18 movs r0, 0x1 movs r1, 0x1 movs r2, 0x8 - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [r7] adds r1, 0x33 movs r0, 0x1 @@ -2292,7 +2292,7 @@ sub_80C3A18: @ 80C3A18 str r1, [sp, 0x8] movs r0, 0x1 movs r1, 0x1 - bl box_print + bl AddTextPrinterParameterized3 _080C3ACE: add sp, 0xC pop {r3} @@ -2363,7 +2363,7 @@ sub_80C3B50: @ 80C3B50 movs r1, 0x1 movs r2, 0x88 movs r3, 0x9 - bl box_print + bl AddTextPrinterParameterized3 b _080C3BB6 .pool _080C3B8C: @@ -2385,7 +2385,7 @@ _080C3B8C: movs r0, 0x1 movs r1, 0x1 movs r3, 0x9 - bl box_print + bl AddTextPrinterParameterized3 _080C3BB6: add sp, 0xC pop {r4} @@ -2470,7 +2470,7 @@ sub_80C3C34: @ 80C3C34 movs r0, 0x1 movs r1, 0x1 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 ldr r1, =gUnknown_0856FB57 ldr r0, [r6] adds r0, r5 @@ -2492,7 +2492,7 @@ sub_80C3C34: @ 80C3C34 movs r0, 0x1 movs r1, 0x1 adds r3, r4, 0 - bl box_print + bl AddTextPrinterParameterized3 add sp, 0xC pop {r3-r5} mov r8, r3 @@ -6361,7 +6361,7 @@ _080C5DC2: str r4, [sp, 0x8] movs r1, 0x1 movs r3, 0x5 - bl box_print + bl AddTextPrinterParameterized3 ldr r4, =gText_BattleRecord movs r0, 0x1 adds r1, r4, 0 @@ -6376,7 +6376,7 @@ _080C5DC2: movs r0, 0x1 movs r1, 0x1 movs r3, 0x5 - bl box_print + bl AddTextPrinterParameterized3 str r6, [sp] mov r0, r8 str r0, [sp, 0x4] @@ -6386,7 +6386,7 @@ _080C5DC2: movs r1, 0x8 movs r2, 0x5 movs r3, 0x4 - bl box_print + bl AddTextPrinterParameterized3 ldr r4, =gStringVar4 ldr r5, =gUnknown_02039CEC ldr r0, [r5] @@ -6408,7 +6408,7 @@ _080C5DC2: movs r0, 0x2 movs r1, 0x8 movs r3, 0x10 - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [r5] ldrh r0, [r1, 0x8] subs r0, 0x5 @@ -6476,7 +6476,7 @@ sub_80C5ED0: @ 80C5ED0 movs r1, 0x1 movs r2, 0x2 movs r3, 0 - bl box_print + bl AddTextPrinterParameterized3 b _080C5F3A .pool _080C5F18: @@ -6495,7 +6495,7 @@ _080C5F18: movs r1, 0x1 movs r2, 0x2 movs r3, 0 - bl box_print + bl AddTextPrinterParameterized3 _080C5F3A: movs r0, 0x3 movs r1, 0x3 @@ -7983,7 +7983,7 @@ _080C6BB8: movs r0, 0x1 movs r1, 0x7 movs r2, 0x4 - bl box_print + bl AddTextPrinterParameterized3 b _080C6C0E .pool _080C6BF0: @@ -8000,7 +8000,7 @@ _080C6BF0: movs r0, 0x1 movs r1, 0x7 movs r2, 0x4 - bl box_print + bl AddTextPrinterParameterized3 _080C6C0E: adds r0, r4, 0x1 lsls r0, 24 @@ -8024,7 +8024,7 @@ _080C6C0E: movs r1, 0x1 movs r2, 0x4 movs r3, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r4, 0 _080C6C40: adds r0, r4, 0 @@ -8084,7 +8084,7 @@ _080C6C94: movs r0, 0x1 movs r1, 0x7 movs r2, 0x4 - bl box_print + bl AddTextPrinterParameterized3 ldr r5, =gUnknown_02039CF4 ldr r1, [r5] ldrb r3, [r1, 0x10] @@ -8104,7 +8104,7 @@ _080C6C94: movs r0, 0x1 movs r1, 0x7 movs r2, 0x4 - bl box_print + bl AddTextPrinterParameterized3 ldr r1, [r5] ldr r2, [r1, 0x4] ldrb r0, [r1, 0x10] @@ -8148,7 +8148,7 @@ _080C6C94: movs r1, 0x1 movs r2, 0x4 movs r3, 0 - bl box_print + bl AddTextPrinterParameterized3 movs r4, 0 _080C6D4A: adds r0, r4, 0 diff --git a/asm/use_pokeblock.s b/asm/use_pokeblock.s index 4cee3c4d9..f4a2bdbb2 100644 --- a/asm/use_pokeblock.s +++ b/asm/use_pokeblock.s @@ -2572,7 +2572,7 @@ sub_8167BA0: @ 8167BA0 movs r1, 0x1 movs r2, 0x2 movs r3, 0x1 - bl box_print + bl AddTextPrinterParameterized3 _08167C46: mov r2, r8 cmp r2, 0 diff --git a/include/global.h b/include/global.h index 6977d4059..b35008550 100644 --- a/include/global.h +++ b/include/global.h @@ -344,7 +344,9 @@ struct FrontierMonData struct Struct_field_E70 { u16 monId; - u8 unk2[9]; + u32 personality; + u8 ivs; + u8 abilityBit; }; struct BattleDomeTrainer @@ -413,9 +415,7 @@ struct BattleFrontier /*0xDD8*/ u16 field_DD8; /*0xDDA*/ u16 field_DDA[2]; /*0xDDE*/ u16 field_DDE[2]; - /*0xDE2*/ u16 field_DE2[2]; - /*0xDE6*/ u16 field_DE6; - /*0xDE8*/ u16 field_DE8; + /*0xDE2*/ u16 field_DE2[2][2]; /*0xDEA*/ u16 field_DEA[2]; /*0xDEE*/ u16 field_DEE; /*0xDF0*/ u16 field_DF0; diff --git a/include/menu.h b/include/menu.h index a13fe73ec..145a7d5de 100644 --- a/include/menu.h +++ b/include/menu.h @@ -37,7 +37,7 @@ u8 GetPlayerTextSpeed(void); void sub_81978B0(u16 arg0); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextSubPrinter *, u16)); -void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); +void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); void sub_8198070(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); diff --git a/src/battle_factory.c b/src/battle_factory.c index e1c955122..9cb773ea3 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -11,10 +11,15 @@ #include "malloc.h" #include "bg.h" #include "gpu_regs.h" +#include "string_util.h" +#include "international_string_util.h" #include "window.h" +#include "data2.h" #include "decompress.h" #include "pokemon_summary_screen.h" #include "sound.h" +#include "pokedex.h" +#include "trainer_pokemon_sprites.h" #include "constants/battle_frontier.h" #include "constants/songs.h" @@ -30,12 +35,18 @@ struct FactorySelecteableMon { - u16 unk0; + u16 monSetId; u16 spriteId; - u8 selectetedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon + u8 selectedId; // 0 - not selected, 1 - first pokemon, 2 - second pokemon, 3 - third pokemon struct Pokemon monData; }; +struct UnkFactoryStruct +{ + u8 field0; + u8 field1; +}; + struct FactorySelectMonsStruct { u8 menuCursorPos; @@ -50,7 +61,7 @@ struct FactorySelectMonsStruct u8 unk9; struct FactorySelecteableMon mons[SELECTABLE_MONS_COUNT]; u32 unk294; - u32 unk298; + struct UnkFactoryStruct unk298; u32 unk29C; u8 unk2A0; u8 unk2A1; @@ -63,31 +74,49 @@ struct FactorySelectMonsStruct }; extern struct FactorySelectMonsStruct *gUnknown_0300127C; +extern u8 (*gUnknown_030062E8)(void); extern u8 gUnknown_0203CF20; +extern const u16 gBattleFrontierHeldItems[]; +extern const struct FacilityMon gBattleFrontierMons[]; +extern const struct FacilityMon gSlateportBattleTentMons[]; +extern const struct BattleFrontierTrainer gBattleFrontierTrainers[]; + +extern void SetMonMoveAvoidReturn(struct Pokemon *mon, u16 move, u8 moveSlot); + // This file's functions. void sub_819A514(void); void sub_819C5D0(u16 mWin0H, u16 nWin0H, u16 mWin0V, u16 nWin0V); void sub_819A9AC(void); void sub_819AA18(void); void sub_819BE34(void); -void sub_819BA64(void); -void sub_819BCF8(void); +void PrintSelectMonString(void); +void PrintMonSpecies(void); +void PrintMonCategory(void); void sub_819B9E8(void); -void sub_819B9B4(void); -void sub_819B764(void); +void PrintRentalPkmnString(void); +void CopySelectedMonsToPlayerParty(void); void sub_819C4B4(void); void sub_819B8D4(void); void sub_819C568(void); -void sub_819BC9C(void); +void sub_819B844(void); +void PrintSelectableMenuOptions(void); +void PrintSelectableYesNo(void); void sub_819C69C(u8 taskId); -void sub_819B378(u8 taskId); -void sub_819B124(u8 taskId); -void sub_819B484(u8 arg0); -void sub_819B63C(u8 arg0); +void Task_HandleSelectionScreenChooseMons(u8 taskId); +void Task_HandleSelectionScreenMenu(u8 taskId); +void CreateFrontierFactorySelectableMons(u8 firstMonId); +void CreateTentFactorySelectableMons(u8 firstMonId); void SetBallSpritePaletteNum(u8 id); -void sub_819F444(u32 spriteId, u8 *arg1); -void sub_819B958(u8 arg0); +void sub_819F444(struct UnkFactoryStruct arg0, u8 *arg1); +void sub_819B958(u8 windowId); +void sub_819F2B4(u8 *arg0, u8 *arg1, u8 arg2); +void sub_819F3F8(struct UnkFactoryStruct arg0, u8 *arg1, u8 arg2); +u8 sub_819BC04(void); +u8 sub_819BC9C(void); +u8 sub_81A6F70(u8 battleMode, u8 lvlMode); +u8 sub_81A6CA8(u8 arg0, u8 arg1); +bool32 sub_819C634(u16 monSetId); // Ewram variables EWRAM_DATA u8 *gUnknown_0203CE2C = NULL; @@ -113,6 +142,20 @@ extern const u8 gFrontierFactorySelectMenu_Gfx[]; extern const u8 gFrontierFactorySelectMenu_Tilemap[]; extern const u16 gFrontierFactorySelectMenu_Pal[]; +// text +extern const u8 gText_RentalPkmn2[]; +extern const u8 gText_SelectFirstPkmn[]; +extern const u8 gText_SelectSecondPkmn[]; +extern const u8 gText_SelectThirdPkmn[]; +extern const u8 gText_TheseThreePkmnOkay[]; +extern const u8 gText_CantSelectSamePkmn[]; +extern const u8 gText_Summary[]; +extern const u8 gText_Deselect[]; +extern const u8 gText_Rent[]; +extern const u8 gText_Others2[]; +extern const u8 gText_Yes2[]; +extern const u8 gText_No2[]; + // code void sub_819A44C(struct Sprite *sprite) { @@ -267,22 +310,22 @@ void sub_819A514(void) gMain.state++; break; case 6: - sub_819BA64(); + PrintSelectMonString(); PutWindowTilemap(2); gMain.state++; break; case 7: - sub_819BCF8(); + PrintMonCategory(); PutWindowTilemap(5); gMain.state++; break; case 8: - sub_819B9E8(); + PrintMonSpecies(); PutWindowTilemap(1); gMain.state++; break; case 9: - sub_819B9B4(); + PrintRentalPkmnString(); PutWindowTilemap(0); gMain.state++; break; @@ -291,14 +334,14 @@ void sub_819A514(void) if (!gUnknown_0300127C->fromSummaryScreen) { gTasks[gUnknown_0300127C->unk2A1].data[0] = 0; - taskId = CreateTask(sub_819B378, 0); + taskId = CreateTask(Task_HandleSelectionScreenChooseMons, 0); gTasks[taskId].data[0] = 0; } else { gTasks[gUnknown_0300127C->unk2A1].data[0] = 1; gUnknown_0300127C->unk2A2 = 0; - taskId = CreateTask(sub_819B124, 0); + taskId = CreateTask(Task_HandleSelectionScreenMenu, 0); gTasks[taskId].data[0] = 13; } SetMainCallback2(sub_819A4C8); @@ -318,12 +361,12 @@ void sub_819A9AC(void) gUnknown_0300127C->selectingMonsState = 1; gUnknown_0300127C->fromSummaryScreen = FALSE; for (i = 0; i < SELECTABLE_MONS_COUNT; i++) - gUnknown_0300127C->mons[i].selectetedId = 0; + gUnknown_0300127C->mons[i].selectedId = 0; if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_TENT) - sub_819B484(0); + CreateFrontierFactorySelectableMons(0); else - sub_819B63C(0); + CreateTentFactorySelectableMons(0); } extern const struct SpriteTemplate gUnknown_086105F0; @@ -436,28 +479,28 @@ void HandleMonSelectionChange(void) { u8 i, paletteNum; u8 cursorPos = gUnknown_0300127C->cursorPos; - if (gUnknown_0300127C->mons[cursorPos].selectetedId) // Deselect a mon. + if (gUnknown_0300127C->mons[cursorPos].selectedId) // Deselect a mon. { paletteNum = IndexOfSpritePaletteTag(TAG_PAL_BALL_GREY); - if (gUnknown_0300127C->selectingMonsState == 3 && gUnknown_0300127C->mons[cursorPos].selectetedId == 1) + if (gUnknown_0300127C->selectingMonsState == 3 && gUnknown_0300127C->mons[cursorPos].selectedId == 1) { for (i = 0; i < SELECTABLE_MONS_COUNT; i++) { - if (gUnknown_0300127C->mons[i].selectetedId == 2) + if (gUnknown_0300127C->mons[i].selectedId == 2) break; } if (i == SELECTABLE_MONS_COUNT) return; else - gUnknown_0300127C->mons[i].selectetedId = 1; + gUnknown_0300127C->mons[i].selectedId = 1; } - gUnknown_0300127C->mons[cursorPos].selectetedId = 0; + gUnknown_0300127C->mons[cursorPos].selectedId = 0; gUnknown_0300127C->selectingMonsState--; } else // Select a mon. { paletteNum = IndexOfSpritePaletteTag(TAG_PAL_BALL_SELECTED); - gUnknown_0300127C->mons[cursorPos].selectetedId = gUnknown_0300127C->selectingMonsState; + gUnknown_0300127C->mons[cursorPos].selectedId = gUnknown_0300127C->selectingMonsState; gUnknown_0300127C->selectingMonsState++; } @@ -468,7 +511,7 @@ void SetBallSpritePaletteNum(u8 id) { u8 palNum; - if (gUnknown_0300127C->mons[id].selectetedId) + if (gUnknown_0300127C->mons[id].selectedId) palNum = IndexOfSpritePaletteTag(TAG_PAL_BALL_SELECTED); else palNum = IndexOfSpritePaletteTag(TAG_PAL_BALL_GREY); @@ -528,7 +571,7 @@ void Task_CloseSelectionScreen(u8 taskId) case 1: if (!UpdatePaletteFade()) { - sub_819B764(); + CopySelectedMonsToPlayerParty(); DestroyTask(gUnknown_0300127C->unk2A1); sub_819AB40(); FREE_AND_SET_NULL(gUnknown_0203CE2C); @@ -574,7 +617,7 @@ void Task_HandleSelectionScreenYesNo(u8 taskId) sub_819BC9C(); gUnknown_0300127C->unk2A2 = 1; gTasks[taskId].data[0] = 1; - gTasks[taskId].func = sub_819B378; + gTasks[taskId].func = Task_HandleSelectionScreenChooseMons; } } else if (gMain.newKeys & B_BUTTON) @@ -584,7 +627,7 @@ void Task_HandleSelectionScreenYesNo(u8 taskId) sub_819BC9C(); gUnknown_0300127C->unk2A2 = 1; gTasks[taskId].data[0] = 1; - gTasks[taskId].func = sub_819B378; + gTasks[taskId].func = Task_HandleSelectionScreenChooseMons; } else if (gMain.newAndRepeatedKeys & DPAD_UP) { @@ -600,3 +643,463 @@ void Task_HandleSelectionScreenYesNo(u8 taskId) } } } + +void Task_HandleSelectionScreenMenu(u8 taskId) +{ + switch (gTasks[taskId].data[0]) + { + case 2: + if (!gUnknown_0300127C->fromSummaryScreen) + sub_819F2B4(&gUnknown_0300127C->unk298.field1, &gUnknown_0300127C->unk2A0, 0); + gTasks[taskId].data[0] = 9; + break; + case 9: + if (gUnknown_0300127C->unk2A0 != 1) + { + sub_819B844(); + gUnknown_0300127C->fromSummaryScreen = FALSE; + gTasks[taskId].data[0] = 3; + } + break; + case 3: + if (gMain.newKeys & A_BUTTON) + { + u8 retVal; + PlaySE(SE_SELECT); + retVal = sub_819BC04(); + if (retVal == 1) + { + gUnknown_0300127C->unk2A2 = 1; + gTasks[taskId].data[0] = 1; + gTasks[taskId].func = Task_HandleSelectionScreenChooseMons; + } + else if (retVal == 2) + { + gTasks[taskId].data[0] = 10; + gTasks[taskId].func = Task_HandleSelectionScreenYesNo; + } + else if (retVal == 3) + { + gTasks[taskId].data[0] = 11; + gTasks[taskId].func = Task_HandleSelectionScreenChooseMons; + } + else + { + gTasks[taskId].data[0] = 6; + gTasks[taskId].func = Task_FromSelectScreenToSummaryScreen; + } + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + sub_819F3F8(gUnknown_0300127C->unk298, &gUnknown_0300127C->unk2A0, 0); + sub_819B958(3); + gUnknown_0300127C->unk2A2 = 1; + gTasks[taskId].data[0] = 1; + gTasks[taskId].func = Task_HandleSelectionScreenChooseMons; + } + else if (gMain.newAndRepeatedKeys & DPAD_UP) + { + PlaySE(SE_SELECT); + UpdateMenuCursorPosition(-1); + } + else if (gMain.newAndRepeatedKeys & DPAD_DOWN) + { + PlaySE(SE_SELECT); + UpdateMenuCursorPosition(1); + } + break; + case 12: + if (!gPaletteFade.active) + { + if (gUnknown_0300127C->fromSummaryScreen == TRUE) + { + gPlttBufferFaded[228] = gUnknown_0300127C->unk2A4; + gPlttBufferUnfaded[228] = gPlttBufferUnfaded[244]; + } + gUnknown_0300127C->fromSummaryScreen = FALSE; + gTasks[taskId].data[0] = 3; + } + break; + case 13: + sub_819B844(); + gTasks[taskId].data[0] = 12; + break; + } +} + +void Task_HandleSelectionScreenChooseMons(u8 taskId) +{ + if (gUnknown_0300127C->unk2A0 != 1) + { + switch (gTasks[taskId].data[0]) + { + case 0: + if (!gPaletteFade.active) + { + gTasks[taskId].data[0] = 1; + gUnknown_0300127C->unk2A2 = 1; + } + break; + case 1: + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + gUnknown_0300127C->unk2A2 = 0; + gTasks[taskId].data[0] = 2; + gTasks[taskId].func = Task_HandleSelectionScreenMenu; + } + else if (gMain.newAndRepeatedKeys & DPAD_LEFT) + { + PlaySE(SE_SELECT); + UpdateBallCursorPosition(-1); + PrintMonCategory(); + PrintMonSpecies(); + } + else if (gMain.newAndRepeatedKeys & DPAD_RIGHT) + { + PlaySE(SE_SELECT); + UpdateBallCursorPosition(1); + PrintMonCategory(); + PrintMonSpecies(); + } + break; + case 11: + if (gMain.newKeys & A_BUTTON) + { + PlaySE(SE_SELECT); + sub_819F3F8(gUnknown_0300127C->unk298, &gUnknown_0300127C->unk2A0, 0); + PrintSelectMonString(); + gUnknown_0300127C->unk2A2 = 1; + gTasks[taskId].data[0] = 1; + } + break; + } + } +} + +void CreateFrontierFactorySelectableMons(u8 firstMonId) +{ + u8 i, j = 0; + u8 ivs = 0; + u8 level = 0; + u8 happiness = 0; + u32 otId = 0; + u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE); + u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; + u8 var_2C = gSaveBlock2Ptr->frontier.field_DE2[battleMode][lvlMode] / 7; + u8 var_28 = 0; + + gFacilityTrainerMons = gBattleFrontierMons; + if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50) + level = 100; + else + level = 50; + + var_28 = sub_81A6F70(battleMode, lvlMode); + otId = T1_READ_32(gSaveBlock2Ptr->playerTrainerId); + + for (i = 0; i < SELECTABLE_MONS_COUNT; i++) + { + u16 monSetId = gSaveBlock2Ptr->frontier.field_E70[i].monId; + gUnknown_0300127C->mons[i + firstMonId].monSetId = monSetId; + if (i < var_28) + ivs = sub_81A6CA8(var_2C + 1, 0); + else + ivs = sub_81A6CA8(var_2C, 0); + CreateMonWithEVSpreadPersonalityOTID(&gUnknown_0300127C->mons[i + firstMonId].monData, + gFacilityTrainerMons[monSetId].species, + level, + gFacilityTrainerMons[monSetId].nature, + ivs, + gFacilityTrainerMons[monSetId].evSpread, + otId); + happiness = 0; + for (j = 0; j < 4; j++) + SetMonMoveAvoidReturn(&gUnknown_0300127C->mons[i + firstMonId].monData, gFacilityTrainerMons[monSetId].moves[j], j); + SetMonData(&gUnknown_0300127C->mons[i + firstMonId].monData, MON_DATA_FRIENDSHIP, &happiness); + SetMonData(&gUnknown_0300127C->mons[i + firstMonId].monData, MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + } +} + +void CreateTentFactorySelectableMons(u8 firstMonId) +{ + u8 i, j; + u8 ivs = 0; + u8 level = 30; + u8 happiness = 0; + u32 otId = 0; + + gFacilityTrainerMons = gSlateportBattleTentMons; + otId = T1_READ_32(gSaveBlock2Ptr->playerTrainerId); + + for (i = 0; i < SELECTABLE_MONS_COUNT; i++) + { + u16 monSetId = gSaveBlock2Ptr->frontier.field_E70[i].monId; + gUnknown_0300127C->mons[i + firstMonId].monSetId = monSetId; + CreateMonWithEVSpreadPersonalityOTID(&gUnknown_0300127C->mons[i + firstMonId].monData, + gFacilityTrainerMons[monSetId].species, + level, + gFacilityTrainerMons[monSetId].nature, + ivs, + gFacilityTrainerMons[monSetId].evSpread, + otId); + happiness = 0; + for (j = 0; j < 4; j++) + SetMonMoveAvoidReturn(&gUnknown_0300127C->mons[i + firstMonId].monData, gFacilityTrainerMons[monSetId].moves[j], j); + SetMonData(&gUnknown_0300127C->mons[i + firstMonId].monData, MON_DATA_FRIENDSHIP, &happiness); + SetMonData(&gUnknown_0300127C->mons[i + firstMonId].monData, MON_DATA_HELD_ITEM, &gBattleFrontierHeldItems[gFacilityTrainerMons[monSetId].itemTableId]); + } +} + +void CopySelectedMonsToPlayerParty(void) +{ + u8 i, j; + + for (i = 0; i < 3; i++) + { + for (j = 0; j < SELECTABLE_MONS_COUNT; j++) + { + if (gUnknown_0300127C->mons[j].selectedId == i + 1) + { + gPlayerParty[i] = gUnknown_0300127C->mons[j].monData; + gSaveBlock2Ptr->frontier.field_E70[i].monId = gUnknown_0300127C->mons[j].monSetId; + gSaveBlock2Ptr->frontier.field_E70[i].personality = GetMonData(&gPlayerParty[i].box, MON_DATA_PERSONALITY, NULL); + gSaveBlock2Ptr->frontier.field_E70[i].abilityBit = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ALT_ABILITY, NULL); + gSaveBlock2Ptr->frontier.field_E70[i].ivs = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ATK_IV, NULL); + break; + } + } + } + CalculatePlayerPartyCount(); +} + +void sub_819B844(void) +{ + if (!gUnknown_0300127C->fromSummaryScreen) + gUnknown_0300127C->menuCursorPos = 0; + + gSprites[gUnknown_0300127C->menuCursor1SpriteId].pos1.x = 176; + gSprites[gUnknown_0300127C->menuCursor1SpriteId].pos1.y = (gUnknown_0300127C->menuCursorPos * 16) + 112; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].pos1.x = 208; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].pos1.y = (gUnknown_0300127C->menuCursorPos * 16) + 112; + + gSprites[gUnknown_0300127C->menuCursor1SpriteId].invisible = 0; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].invisible = 0; + + PrintSelectableMenuOptions(); +} + +void sub_819B8D4(void) +{ + gUnknown_0300127C->yesNoCursorPos = 0; + + gSprites[gUnknown_0300127C->menuCursor1SpriteId].pos1.x = 176; + gSprites[gUnknown_0300127C->menuCursor1SpriteId].pos1.y = 112; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].pos1.x = 208; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].pos1.y = 112; + + gSprites[gUnknown_0300127C->menuCursor1SpriteId].invisible = 0; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].invisible = 0; + + PrintSelectableYesNo(); +} + +void sub_819B958(u8 windowId) +{ + gSprites[gUnknown_0300127C->menuCursor1SpriteId].invisible = 1; + gSprites[gUnknown_0300127C->menuCursor2SpriteId].invisible = 1; + FillWindowPixelBuffer(windowId, 0); + CopyWindowToVram(windowId, 2); + ClearWindowTilemap(windowId); +} + +void PrintRentalPkmnString(void) +{ + FillWindowPixelBuffer(0, 0); + PrintTextOnWindow(0, 1, gText_RentalPkmn2, 2, 1, 0, NULL); + CopyWindowToVram(0, 3); +} + +extern const u8 gUnknown_08610479[]; +extern const u8 gUnknown_08610476[]; + +void PrintMonSpecies(void) +{ + u16 species; + u8 x; + u8 monId = gUnknown_0300127C->cursorPos; + + FillWindowPixelBuffer(1, 0); + species = GetMonData(&gUnknown_0300127C->mons[monId].monData, MON_DATA_SPECIES, NULL); + StringCopy(gStringVar4, gSpeciesNames[species]); + x = GetStringRightAlignXOffset(1, gStringVar4, 86); + AddTextPrinterParameterized3(1, 1, x, 1, gUnknown_08610479, 0, gStringVar4); + CopyWindowToVram(1, 2); +} + +void PrintSelectMonString(void) +{ + const u8 *str = NULL; + + FillWindowPixelBuffer(2, 0); + if (gUnknown_0300127C->selectingMonsState == 1) + str = gText_SelectFirstPkmn; + else if (gUnknown_0300127C->selectingMonsState == 2) + str = gText_SelectSecondPkmn; + else if (gUnknown_0300127C->selectingMonsState == 3) + str = gText_SelectThirdPkmn; + else + str = gText_TheseThreePkmnOkay; + + PrintTextOnWindow(2, 1, str, 2, 5, 0, NULL); + CopyWindowToVram(2, 2); +} + +void PrintCantSelectSameMon(void) +{ + FillWindowPixelBuffer(2, 0); + PrintTextOnWindow(2, 1, gText_CantSelectSamePkmn, 2, 5, 0, NULL); + CopyWindowToVram(2, 2); +} + +void PrintSelectableMenuOptions(void) +{ + u8 selectedId = gUnknown_0300127C->mons[gUnknown_0300127C->cursorPos].selectedId; + + PutWindowTilemap(3); + FillWindowPixelBuffer(3, 0); + AddTextPrinterParameterized3(3, 1, 7, 1, gUnknown_08610476, 0, gText_Summary); + if (selectedId != 0) + AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Deselect); + else + AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Rent); + + AddTextPrinterParameterized3(3, 1, 7, 33, gUnknown_08610476, 0, gText_Others2); + CopyWindowToVram(3, 3); +} + +void PrintSelectableYesNo(void) +{ + PutWindowTilemap(4); + FillWindowPixelBuffer(4, 0); + AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610476, 0, gText_Yes2); + AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610476, 0, gText_No2); + CopyWindowToVram(4, 3); +} + +extern u8 (* const gUnknown_0861041C[])(void); + +u8 sub_819BC04(void) +{ + gUnknown_030062E8 = gUnknown_0861041C[gUnknown_0300127C->menuCursorPos]; + return gUnknown_030062E8(); +} + +u8 sub_819BC30(void) +{ + u8 selectedId = gUnknown_0300127C->mons[gUnknown_0300127C->cursorPos].selectedId; + u16 monSetId = gUnknown_0300127C->mons[gUnknown_0300127C->cursorPos].monSetId; + if (selectedId == 0 && !sub_819C634(monSetId)) + { + PrintCantSelectSameMon(); + sub_819B958(3); + return 3; + } + else + { + sub_819F3F8(gUnknown_0300127C->unk298, &gUnknown_0300127C->unk2A0, 0); + HandleMonSelectionChange(); + PrintSelectMonString(); + sub_819B958(3); + if (gUnknown_0300127C->selectingMonsState > 3) + return 2; + else + return 1; + } +} + +u8 sub_819BC9C(void) +{ + sub_819C568(); + HandleMonSelectionChange(); + PrintSelectMonString(); + sub_819B958(3); + if (gUnknown_0300127C->selectingMonsState > 3) + return 2; + else + return 1; +} + +u8 sub_819BCCC(void) +{ + return 0; +} + +u8 sub_819BCD0(void) +{ + sub_819F3F8(gUnknown_0300127C->unk298, &gUnknown_0300127C->unk2A0, 0); + sub_819B958(3); + return 1; +} + +void PrintMonCategory(void) +{ + u16 species; + u8 text[30]; + u8 x; + u8 monId = gUnknown_0300127C->cursorPos; + if (monId < SELECTABLE_MONS_COUNT) + { + PutWindowTilemap(5); + FillWindowPixelBuffer(5, 0); + species = GetMonData(&gUnknown_0300127C->mons[monId].monData, MON_DATA_SPECIES, NULL); + CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); + x = GetStringRightAlignXOffset(1, text, 0x76); + PrintTextOnWindow(5, 1, text, x, 1, 0, NULL); + CopyWindowToVram(5, 2); + } +} + +void sub_819BD70(void) +{ + u8 monId = gUnknown_0300127C->cursorPos; + struct Pokemon *mon = &gUnknown_0300127C->mons[monId].monData; + u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); + u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL); + u32 otId = GetMonData(mon, MON_DATA_OT_ID, NULL); + + gUnknown_0300127C->unk298.field0 = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF); + gSprites[gUnknown_0300127C->unk298.field0].centerToCornerVecX = 0; + gSprites[gUnknown_0300127C->unk298.field0].centerToCornerVecY = 0; + + gUnknown_0300127C->unk2A0 = 0; +} + +extern const struct SpriteTemplate gUnknown_08610638; + +void sub_819BE20(u8 arg0) +{ + gUnknown_0300127C->unk2A0 = arg0; +} + +void sub_819BE34(void) +{ + struct Pokemon *mon; + u16 species; + u32 personality, otId; + + gUnknown_0300127C->unk298.field1 = CreateSprite(&gUnknown_08610638, 120, 64, 1); + StartSpriteAffineAnim(&gSprites[gUnknown_0300127C->unk298.field1], 2); + + mon = &gUnknown_0300127C->mons[gUnknown_0300127C->cursorPos].monData; + species = GetMonData(mon, MON_DATA_SPECIES, NULL); + personality = GetMonData(mon, MON_DATA_PERSONALITY, NULL); + otId = GetMonData(mon, MON_DATA_OT_ID, NULL); + + gUnknown_0300127C->unk298.field0 = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, 88, 32, 15, 0xFFFF); + gSprites[gUnknown_0300127C->unk298.field0].centerToCornerVecX = 0; + gSprites[gUnknown_0300127C->unk298.field0].centerToCornerVecY = 0; + + gSprites[gUnknown_0300127C->unk298.field1].invisible = 1; +} diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index f6a5895a9..2ae15a806 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -250,19 +250,19 @@ static void berry_fix_gpu_set(void) width = GetStringWidth(0, sUnknown_08617E9B, 0); left = (0x78 - width) / 2; - box_print(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E9B); + AddTextPrinterParameterized3(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E9B); width = GetStringWidth(0, sUnknown_08617E8D, 0); left = (0x78 - width) / 2 + 0x78; - box_print(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D); + AddTextPrinterParameterized3(2, 0, left, 3, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D); width = GetStringWidth(0, sUnknown_08617E8D, 0); left = (0x70 - width) / 2; - box_print(3, 0, left, 0, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D); + AddTextPrinterParameterized3(3, 0, left, 0, sUnknown_0861815B, TEXT_SPEED_FF, sUnknown_08617E8D); width = GetStringWidth(1, sUnknown_08617E78, 0); left = (0xD0 - width) / 2; - box_print(0, 1, left, 2, sUnknown_08618158, TEXT_SPEED_FF, sUnknown_08617E78); + AddTextPrinterParameterized3(0, 1, left, 2, sUnknown_08618158, TEXT_SPEED_FF, sUnknown_08617E78); CopyWindowToVram(2, 2); CopyWindowToVram(3, 2); @@ -292,7 +292,7 @@ static void berry_fix_text_print(int scene) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); FillWindowPixelBuffer(1, 0xAA); - box_print(1, 1, 0, 0, sUnknown_08618158, -1, gUnknown_08618160[scene]); + AddTextPrinterParameterized3(1, 1, 0, 0, sUnknown_08618158, -1, gUnknown_08618160[scene]); PutWindowTilemap(1); CopyWindowToVram(1, 2); switch (scene) diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 33c85d448..081c963ee 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -1128,7 +1128,7 @@ static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2) { FillWindowPixelBuffer(0, 0); PutWindowTilemap(0); - box_print(0, 1, GetStringCenterAlignXOffset(1, gText_WelcomeToHOF, 0xD0), 1, sUnknown_085E5388, 0, gText_WelcomeToHOF); + AddTextPrinterParameterized3(0, 1, GetStringCenterAlignXOffset(1, gText_WelcomeToHOF, 0xD0), 1, sUnknown_085E5388, 0, gText_WelcomeToHOF); CopyWindowToVram(0, 3); } @@ -1164,7 +1164,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u *(stringPtr)++ = CHAR_QUESTION_MARK; } stringPtr[0] = EOS; - box_print(0, 1, 0x10, 1, sUnknown_085E5388, -1, text); + AddTextPrinterParameterized3(0, 1, 0x10, 1, sUnknown_085E5388, -1, text); } // nick, species names, gender and level @@ -1173,13 +1173,13 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u if (currMon->species == SPECIES_EGG) { width = GetStringCenterAlignXOffset(1, text, 0xD0); - box_print(0, 1, width, 1, sUnknown_085E5388, -1, text); + AddTextPrinterParameterized3(0, 1, width, 1, sUnknown_085E5388, -1, text); CopyWindowToVram(0, 3); } else { width = GetStringRightAlignXOffset(1, text, 0x80); - box_print(0, 1, width, 1, sUnknown_085E5388, -1, text); + AddTextPrinterParameterized3(0, 1, width, 1, sUnknown_085E5388, -1, text); text[0] = CHAR_SLASH; stringPtr = StringCopy(text + 1, gSpeciesNames[currMon->species]); @@ -1200,15 +1200,15 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u } stringPtr[0] = EOS; - box_print(0, 1, 0x80, 1, sUnknown_085E5388, -1, text); + AddTextPrinterParameterized3(0, 1, 0x80, 1, sUnknown_085E5388, -1, text); stringPtr = StringCopy(text, gText_Level); ConvertIntToDecimalStringN(stringPtr, currMon->lvl, STR_CONV_MODE_LEFT_ALIGN, 3); - box_print(0, 1, 0x24, 0x11, sUnknown_085E5388, -1, text); + AddTextPrinterParameterized3(0, 1, 0x24, 0x11, sUnknown_085E5388, -1, text); stringPtr = StringCopy(text, gText_IDNumber); ConvertIntToDecimalStringN(stringPtr, (u16)(currMon->tid), STR_CONV_MODE_LEADING_ZEROS, 5); - box_print(0, 1, 0x68, 0x11, sUnknown_085E5388, -1, text); + AddTextPrinterParameterized3(0, 1, 0x68, 0x11, sUnknown_085E5388, -1, text); CopyWindowToVram(0, 3); } @@ -1223,13 +1223,13 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) FillWindowPixelBuffer(1, 0x11); PutWindowTilemap(1); SetWindowBorderStyle(1, FALSE, 0x21D, 0xD); - box_print(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); + AddTextPrinterParameterized3(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); width = GetStringRightAlignXOffset(1, gSaveBlock2Ptr->playerName, 0x70); - box_print(1, 1, width, 1, sUnknown_085E538C, -1, gSaveBlock2Ptr->playerName); + AddTextPrinterParameterized3(1, 1, width, 1, sUnknown_085E538C, -1, gSaveBlock2Ptr->playerName); trainerId = (gSaveBlock2Ptr->playerTrainerId[0]) | (gSaveBlock2Ptr->playerTrainerId[1] << 8); - box_print(1, 1, 0, 0x11, sUnknown_085E538C, 0, gText_IDNumber); + AddTextPrinterParameterized3(1, 1, 0, 0x11, sUnknown_085E538C, 0, gText_IDNumber); text[0] = (trainerId % 100000) / 10000 + CHAR_0; text[1] = (trainerId % 10000) / 1000 + CHAR_0; text[2] = (trainerId % 1000) / 100 + CHAR_0; @@ -1237,9 +1237,9 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) text[4] = (trainerId % 10) / 1 + CHAR_0; text[5] = EOS; width = GetStringRightAlignXOffset(1, text, 0x70); - box_print(1, 1, width, 0x11, sUnknown_085E538C, -1, text); + AddTextPrinterParameterized3(1, 1, width, 0x11, sUnknown_085E538C, -1, text); - box_print(1, 1, 0, 0x21, sUnknown_085E538C, -1, gText_MainMenuTime); + AddTextPrinterParameterized3(1, 1, 0, 0x21, sUnknown_085E538C, -1, gText_MainMenuTime); text[0] = (gSaveBlock2Ptr->playTimeHours / 100) + CHAR_0; text[1] = (gSaveBlock2Ptr->playTimeHours % 100) / 10 + CHAR_0; text[2] = (gSaveBlock2Ptr->playTimeHours % 10) + CHAR_0; @@ -1255,7 +1255,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) text[6] = EOS; width = GetStringRightAlignXOffset(1, text, 0x70); - box_print(1, 1, width, 0x21, sUnknown_085E538C, -1, text); + AddTextPrinterParameterized3(1, 1, width, 0x21, sUnknown_085E538C, -1, text); CopyWindowToVram(1, 3); } diff --git a/src/link.c b/src/link.c index 457e44a01..627327181 100644 --- a/src/link.c +++ b/src/link.c @@ -1685,8 +1685,8 @@ static void sub_800B080(void) LoadPalette(gWirelessLinkDisplayPal, 0, 0x20); FillWindowPixelBuffer(0, 0x00); FillWindowPixelBuffer(2, 0x00); - box_print(0, 3, 2, 6, gUnknown_082ED224, 0, gText_CommErrorEllipsis); - box_print(2, 3, 2, 1, gUnknown_082ED224, 0, gText_MoveCloserToLinkPartner); + AddTextPrinterParameterized3(0, 3, 2, 6, gUnknown_082ED224, 0, gText_CommErrorEllipsis); + AddTextPrinterParameterized3(2, 3, 2, 1, gUnknown_082ED224, 0, gText_MoveCloserToLinkPartner); PutWindowTilemap(0); PutWindowTilemap(2); CopyWindowToVram(0, 0); @@ -1698,7 +1698,7 @@ static void sub_800B138(void) LoadBgTiles(0, g2BlankTilesGfx, 0x20, 0); FillWindowPixelBuffer(1, 0x00); FillWindowPixelBuffer(2, 0x00); - box_print(1, 3, 2, 0, gUnknown_082ED224, 0, gText_CommErrorCheckConnections); + AddTextPrinterParameterized3(1, 3, 2, 0, gUnknown_082ED224, 0, gText_CommErrorCheckConnections); PutWindowTilemap(1); PutWindowTilemap(2); CopyWindowToVram(1, 0); @@ -1738,11 +1738,11 @@ static void CB2_PrintErrorMessage(void) case 130: if (gWirelessCommType == 2) { - box_print(0, 3, 2, 20, gUnknown_082ED224, 0, gText_ABtnTitleScreen); + AddTextPrinterParameterized3(0, 3, 2, 20, gUnknown_082ED224, 0, gText_ABtnTitleScreen); } else if (gWirelessCommType == 1) { - box_print(0, 3, 2, 20, gUnknown_082ED224, 0, gText_ABtnRegistrationCounter); + AddTextPrinterParameterized3(0, 3, 2, 20, gUnknown_082ED224, 0, gText_ABtnRegistrationCounter); } break; } diff --git a/src/mail.c b/src/mail.c index 625b52de3..3c12bed3f 100644 --- a/src/mail.c +++ b/src/mail.c @@ -485,14 +485,14 @@ static void sub_8121B1C(void) { continue; } - box_print(0, 1, sMailRead->layout->var8[i].xOffset + sMailRead->layout->wordsYPos, y + sMailRead->layout->wordsXPos, sUnknown_0859F2AC, 0, sMailRead->strbuf[i]); + AddTextPrinterParameterized3(0, 1, sMailRead->layout->var8[i].xOffset + sMailRead->layout->wordsYPos, y + sMailRead->layout->wordsXPos, sUnknown_0859F2AC, 0, sMailRead->strbuf[i]); y += sMailRead->layout->var8[i].lineHeight; } bufptr = StringCopy(strbuf, gText_FromSpace); StringCopy(bufptr, sMailRead->playerName); box_x = GetStringCenterAlignXOffset(1, strbuf, sMailRead->signatureWidth) + 0x68; box_y = sMailRead->layout->signatureYPos + 0x58; - box_print(0, 1, box_x, box_y, sUnknown_0859F2AC, 0, strbuf); + AddTextPrinterParameterized3(0, 1, box_x, box_y, sUnknown_0859F2AC, 0, strbuf); CopyWindowToVram(0, 3); CopyWindowToVram(1, 3); } diff --git a/src/main_menu.c b/src/main_menu.c index e28faf986..b4b343fc6 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -527,8 +527,8 @@ void Task_DisplayMainMenu(u8 taskId) default: FillWindowPixelBuffer(0, 0xAA); FillWindowPixelBuffer(1, 0xAA); - box_print(0, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); - box_print(1, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); + AddTextPrinterParameterized3(0, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); + AddTextPrinterParameterized3(1, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); PutWindowTilemap(0); PutWindowTilemap(1); CopyWindowToVram(0, 2); @@ -540,9 +540,9 @@ void Task_DisplayMainMenu(u8 taskId) FillWindowPixelBuffer(2, 0xAA); FillWindowPixelBuffer(3, 0xAA); FillWindowPixelBuffer(4, 0xAA); - box_print(2, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuContinue); - box_print(3, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); - box_print(4, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); + AddTextPrinterParameterized3(2, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuContinue); + AddTextPrinterParameterized3(3, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); + AddTextPrinterParameterized3(4, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); fmt_savegame(); PutWindowTilemap(2); PutWindowTilemap(3); @@ -559,10 +559,10 @@ void Task_DisplayMainMenu(u8 taskId) FillWindowPixelBuffer(3, 0xAA); FillWindowPixelBuffer(4, 0xAA); FillWindowPixelBuffer(5, 0xAA); - box_print(2, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuContinue); - box_print(3, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); - box_print(4, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuMysteryGift); - box_print(5, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); + AddTextPrinterParameterized3(2, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuContinue); + AddTextPrinterParameterized3(3, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); + AddTextPrinterParameterized3(4, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuMysteryGift); + AddTextPrinterParameterized3(5, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); fmt_savegame(); PutWindowTilemap(2); PutWindowTilemap(3); @@ -583,11 +583,11 @@ void Task_DisplayMainMenu(u8 taskId) FillWindowPixelBuffer(4, 0xAA); FillWindowPixelBuffer(5, 0xAA); FillWindowPixelBuffer(6, 0xAA); - box_print(2, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuContinue); - box_print(3, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); - box_print(4, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuMysteryGift2); - box_print(5, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuMysteryEvents); - box_print(6, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); + AddTextPrinterParameterized3(2, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuContinue); + AddTextPrinterParameterized3(3, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuNewGame); + AddTextPrinterParameterized3(4, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuMysteryGift2); + AddTextPrinterParameterized3(5, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuMysteryEvents); + AddTextPrinterParameterized3(6, 1, 0, 1, gTextColor_Headers, -1, gText_MainMenuOption); fmt_savegame(); PutWindowTilemap(2); PutWindowTilemap(3); @@ -1839,8 +1839,8 @@ void fmt_savegame(void) void fmt_time(void) { StringExpandPlaceholders(gStringVar4, gText_ContinueMenuPlayer); - box_print(2, 1, 0, 17, gUnknown_082FF0E3, -1, gStringVar4); - box_print(2, 1, GetStringRightAlignXOffset(1, gSaveBlock2Ptr->playerName, 100), 17, gUnknown_082FF0E3, -1, gSaveBlock2Ptr->playerName); + AddTextPrinterParameterized3(2, 1, 0, 17, gUnknown_082FF0E3, -1, gStringVar4); + AddTextPrinterParameterized3(2, 1, GetStringRightAlignXOffset(1, gSaveBlock2Ptr->playerName, 100), 17, gUnknown_082FF0E3, -1, gSaveBlock2Ptr->playerName); } void fmt_player(void) @@ -1849,11 +1849,11 @@ void fmt_player(void) u8* ptr; StringExpandPlaceholders(gStringVar4, gText_ContinueMenuTime); - box_print(2, 1, 0x6C, 17, gUnknown_082FF0E3, -1, gStringVar4); + AddTextPrinterParameterized3(2, 1, 0x6C, 17, gUnknown_082FF0E3, -1, gStringVar4); ptr = ConvertIntToDecimalStringN(str, gSaveBlock2Ptr->playTimeHours, 0, 3); *ptr = 0xF0; ConvertIntToDecimalStringN(ptr + 1, gSaveBlock2Ptr->playTimeMinutes, 2, 2); - box_print(2, 1, GetStringRightAlignXOffset(1, str, 0xD0), 17, gUnknown_082FF0E3, -1, str); + AddTextPrinterParameterized3(2, 1, GetStringRightAlignXOffset(1, str, 0xD0), 17, gUnknown_082FF0E3, -1, str); } void fmt_pokedex(void) @@ -1868,9 +1868,9 @@ void fmt_pokedex(void) else dexCount = GetHoennPokedexCount(1); StringExpandPlaceholders(gStringVar4, gText_ContinueMenuPokedex); - box_print(2, 1, 0, 33, gUnknown_082FF0E3, -1, gStringVar4); + AddTextPrinterParameterized3(2, 1, 0, 33, gUnknown_082FF0E3, -1, gStringVar4); ConvertIntToDecimalStringN(str, dexCount, 0, 3); - box_print(2, 1, GetStringRightAlignXOffset(1, str, 100), 33, gUnknown_082FF0E3, -1, str); + AddTextPrinterParameterized3(2, 1, GetStringRightAlignXOffset(1, str, 100), 33, gUnknown_082FF0E3, -1, str); } } @@ -1886,9 +1886,9 @@ void fmt_badges(void) badgeCount++; } StringExpandPlaceholders(gStringVar4, gText_ContinueMenuBadges); - box_print(2, 1, 0x6C, 33, gUnknown_082FF0E3, -1, gStringVar4); + AddTextPrinterParameterized3(2, 1, 0x6C, 33, gUnknown_082FF0E3, -1, gStringVar4); ConvertIntToDecimalStringN(str, badgeCount, 2, 1); - box_print(2, 1, GetStringRightAlignXOffset(1, str, 0xD0), 33, gUnknown_082FF0E3, -1, str); + AddTextPrinterParameterized3(2, 1, GetStringRightAlignXOffset(1, str, 0xD0), 33, gUnknown_082FF0E3, -1, str); } void LoadMainMenuWindowFrameTiles(u8 bgId, u16 tileOffset) diff --git a/src/menu.c b/src/menu.c index 8a4b4fce5..7c9c2f8a8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -799,7 +799,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) PutWindowTilemap(gUnknown_0203CDA0); FillWindowPixelBuffer(gUnknown_0203CDA0, 0xFF); width = GetStringWidth(0, string, 0); - box_print(gUnknown_0203CDA0, + AddTextPrinterParameterized3(gUnknown_0203CDA0, 0, 0xEC - (GetWindowAttribute(gUnknown_0203CDA0, WINDOW_TILEMAP_LEFT) * 8) - a2 - width, 1, @@ -835,7 +835,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo if (string2 != NULL) { width = GetStringWidth(0, string2, 0); - box_print(gUnknown_0203CDA0, + AddTextPrinterParameterized3(gUnknown_0203CDA0, 0, 0xEC - (GetWindowAttribute(gUnknown_0203CDA0, WINDOW_TILEMAP_LEFT) * 8) - a4 - width, 1, @@ -1925,7 +1925,7 @@ void sub_8199DF0(u32 bg, u8 a1, int a2, int a3) RequestDma3Fill(a1 << 24 | a1 << 16 | a1 << 8 | a1, addr + VRAM, a3 * temp, 1); } -void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str) +void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str) { struct TextSubPrinter printer; diff --git a/src/naming_screen.c b/src/naming_screen.c index f99d23bc3..35a05499b 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1515,7 +1515,7 @@ static void sub_80E49BC(void) StringCopy(genderSymbol, gText_FemaleSymbol); isFemale = TRUE; } - box_print(gNamingScreenData->windows[2], 1, 0x68, 1, sGenderColors[isFemale], -1, genderSymbol); + AddTextPrinterParameterized3(gNamingScreenData->windows[2], 1, 0x68, 1, sGenderColors[isFemale], -1, genderSymbol); } } @@ -1694,7 +1694,7 @@ static void sub_80E4DE4(u8 window, u8 a1) for (i = 0; i < 4; i++) { - box_print(window, 1, 0, i * 16 + 1, sUnkColors[a1], 0, gUnknown_0858C198[a1][i]); + AddTextPrinterParameterized3(window, 1, 0, i * 16 + 1, sUnkColors[a1], 0, gUnknown_0858C198[a1][i]); } PutWindowTilemap(window); @@ -1739,7 +1739,7 @@ static void sub_80E4EF0(void) const u8 color[3] = { 15, 1, 2 }; FillWindowPixelBuffer(gNamingScreenData->windows[4], 0xFF); - box_print(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack); + AddTextPrinterParameterized3(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack); PutWindowTilemap(gNamingScreenData->windows[4]); CopyWindowToVram(gNamingScreenData->windows[4], 3); } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 7c622c223..eae868134 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -627,12 +627,12 @@ void sub_80C7BE4(void) FillWindowPixelBuffer(windowId, 0x44); center = GetStringCenterAlignXOffset(1, boxName, 0x40); - box_print(windowId, 1, center, 1, gUnknown_08571734, TEXT_SPEED_FF, boxName); + AddTextPrinterParameterized3(windowId, 1, center, 1, gUnknown_08571734, TEXT_SPEED_FF, boxName); ConvertIntToDecimalStringN(text, nPokemonInBox, 1, 2); StringAppend(text, gUnknown_08571737); center = GetStringCenterAlignXOffset(1, text, 0x40); - box_print(windowId, 1, center, 0x11, gUnknown_08571734, TEXT_SPEED_FF, text); + AddTextPrinterParameterized3(windowId, 1, center, 0x11, gUnknown_08571734, TEXT_SPEED_FF, text); winTileData = GetWindowAttribute(windowId, WINDOW_TILE_DATA); CpuCopy32((void *)winTileData, (void *)OBJ_VRAM0 + 0x100 + (GetSpriteTileStartByTag(gUnknown_02039D04->unk_0240) * 32), 0x400); diff --git a/src/starter_choose.c b/src/starter_choose.c index c1e7eea40..5625b6184 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -301,10 +301,10 @@ static void CreateStarterPokemonLabel(u8 selection) FillWindowPixelBuffer(sStarterChooseWindowId, 0); width = GetStringCenterAlignXOffset(7, text, 0x68); - box_print(sStarterChooseWindowId, 7, width, 1, gUnknown_085B1E0C, 0, text); + AddTextPrinterParameterized3(sStarterChooseWindowId, 7, width, 1, gUnknown_085B1E0C, 0, text); width = GetStringCenterAlignXOffset(1, speciesName, 0x68); - box_print(sStarterChooseWindowId, 1, width, 0x11, gUnknown_085B1E0C, 0, speciesName); + AddTextPrinterParameterized3(sStarterChooseWindowId, 1, width, 0x11, gUnknown_085B1E0C, 0, speciesName); PutWindowTilemap(sStarterChooseWindowId); schedule_bg_copy_tilemap_to_vram(0);