diff --git a/asm/battle_frontier_2.s b/asm/battle_frontier_2.s index ee5f37944..982a7f4e7 100644 --- a/asm/battle_frontier_2.s +++ b/asm/battle_frontier_2.s @@ -6,1120 +6,6 @@ .text - - - thumb_func_start sub_81A070C -sub_81A070C: @ 81A070C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0730 - bl Menu_ProcessInputNoWrapAround - b _081A0734 - .pool -_081A0730: - bl ProcessMenuInput -_081A0734: - lsls r0, 24 - lsrs r0, 24 - lsls r0, 24 - asrs r1, r0, 24 - movs r0, 0x2 - negs r0, r0 - cmp r1, r0 - beq _081A0778 - adds r0, 0x1 - cmp r1, r0 - bne _081A0764 - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _081A0778 - movs r0, 0x5 - bl PlaySE - ldr r1, =gSpecialVar_Result - movs r0, 0x7F - strh r0, [r1] - b _081A0768 - .pool -_081A0764: - ldr r0, =gSpecialVar_Result - strh r1, [r0] -_081A0768: - ldrb r0, [r4, 0xC] - bl sub_81A07E8 - adds r0, r5, 0 - bl DestroyTask - bl EnableBothScriptContexts -_081A0778: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A070C - - thumb_func_start sub_81A0784 -sub_81A0784: @ 81A0784 - push {r4,r5,lr} - sub sp, 0x20 - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsls r5, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0x80 - lsls r0, 17 - adds r4, r0 - lsrs r4, 24 - adds r5, r0 - lsrs r5, 24 - str r2, [sp] - str r3, [sp, 0x4] - movs r0, 0xF - str r0, [sp, 0x8] - movs r0, 0x64 - str r0, [sp, 0xC] - add r0, sp, 0x10 - movs r1, 0 - adds r2, r4, 0 - adds r3, r5, 0 - bl CreateWindowTemplate - ldr r0, [sp, 0x10] - ldr r1, [sp, 0x14] - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - add r0, sp, 0x18 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0 - add sp, 0x20 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81A0784 - - thumb_func_start sub_81A07E8 -sub_81A07E8: @ 81A07E8 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_8198070 - adds r0, r4, 0 - bl RemoveWindow - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A07E8 - - thumb_func_start sub_81A0804 -sub_81A0804: @ 81A0804 - push {r4-r6,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r2, 24 - lsrs r6, r2, 24 - ldr r0, =sub_81A070C - movs r1, 0x50 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r1, r0, r1 - strh r4, [r1, 0x10] - cmp r5, 0x3 - bls _081A0840 - movs r0, 0x1 - b _081A0842 - .pool -_081A0840: - movs r0, 0 -_081A0842: - strh r0, [r1, 0x12] - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - strh r6, [r0, 0x14] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0804 - - thumb_func_start sub_81A085C -sub_81A085C: @ 81A085C - push {lr} - ldr r1, =gUnknown_086114E0 - ldr r0, =gSpecialVar_0x8004 - ldrh r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A085C - - thumb_func_start sub_81A087C -sub_81A087C: @ 81A087C - push {r4-r7,lr} - bl sub_819FBC8 - ldr r3, =gSaveBlock2Ptr - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x4 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3D - negs r0, r0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB1 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0xB2 - ldrb r2, [r1] - movs r0, 0x8 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - movs r4, 0 - movs r1, 0 -_081A08BE: - ldr r0, [r3] - adds r0, 0xB4 - adds r0, r4 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _081A08BE - movs r4, 0 - ldr r5, =gSaveBlock2Ptr - movs r0, 0x4 - negs r0, r0 - mov r12, r0 - movs r7, 0xD - negs r7, r7 - movs r6, 0x31 - negs r6, r6 -_081A08E2: - ldr r1, [r5] - lsls r3, r4, 2 - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - mov r0, r12 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - ldr r1, [r5] - adds r1, r3 - adds r1, 0xB8 - ldrb r2, [r1] - movs r0, 0x3F - ands r0, r2 - strb r0, [r1] - ldr r0, [r5] - adds r0, r3 - adds r0, 0xBA - movs r1, 0 - strh r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x8 - bls _081A08E2 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A087C - - thumb_func_start sub_81A093C -sub_81A093C: @ 81A093C - push {lr} - bl sub_819FBB0 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _081A0954 - ldr r0, =gSpecialVar_Result - strh r1, [r0] - b _081A095A - .pool -_081A0954: - ldr r1, =gSpecialVar_Result - movs r0, 0x1 - strh r0, [r1] -_081A095A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A093C - - thumb_func_start sub_81A0964 -sub_81A0964: @ 81A0964 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_819FC40 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0964 - - thumb_func_start sub_81A0978 -sub_81A0978: @ 81A0978 - push {lr} - bl sub_819FBC8 - pop {r0} - bx r0 - thumb_func_end sub_81A0978 - - thumb_func_start sub_81A0984 -sub_81A0984: @ 81A0984 - push {lr} - bl sub_819FD64 - pop {r0} - bx r0 - thumb_func_end sub_81A0984 - - thumb_func_start sub_81A0990 -sub_81A0990: @ 81A0990 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB1 - ldrb r3, [r2] - lsls r1, r3, 26 - lsrs r1, 28 - adds r1, 0x1 - movs r0, 0xF - ands r1, r0 - lsls r1, 2 - movs r0, 0x3D - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_81A0990 - - thumb_func_start sub_81A09B4 -sub_81A09B4: @ 81A09B4 - ldr r1, =gSpecialVar_Result - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - strh r0, [r1] - bx lr - .pool - thumb_func_end sub_81A09B4 - - thumb_func_start sub_81A09D0 -sub_81A09D0: @ 81A09D0 - push {lr} - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r1, r0, 0x3 - cmp r1, 0 - bge _081A09F4 - ldr r1, =gSpecialVar_Result - movs r0, 0 - strh r0, [r1] - b _081A0A1C - .pool -_081A09F4: - ldr r2, =gSpecialVar_Result - cmp r1, 0x8 - ble _081A09FE - movs r0, 0x1 - strh r0, [r2] -_081A09FE: - ldr r0, [r3] - lsls r1, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0A18 - movs r0, 0x1 - b _081A0A1A - .pool -_081A0A18: - movs r0, 0 -_081A0A1A: - strh r0, [r2] -_081A0A1C: - pop {r0} - bx r0 - thumb_func_end sub_81A09D0 - - thumb_func_start sub_81A0A20 -sub_81A0A20: @ 81A0A20 - push {lr} - ldr r0, =gSpecialVar_0x8005 - ldrb r0, [r0] - bl sub_81A04E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A20 - - thumb_func_start sub_81A0A34 -sub_81A0A34: @ 81A0A34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - bl RunTextPrintersAndIsPrinter0Active - lsls r0, 16 - cmp r0, 0 - bne _081A0A68 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0A64 - ldr r0, =EnableBothScriptContexts - bl sub_81A172C - b _081A0A68 - .pool -_081A0A64: - bl EnableBothScriptContexts -_081A0A68: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81A0A34 - - thumb_func_start sub_81A0A70 -sub_81A0A70: @ 81A0A70 - push {lr} - ldr r1, =gSpecialVar_0x8006 - ldrh r0, [r1] - cmp r0, 0x6 - bne _081A0A94 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0A94: - cmp r0, 0x7 - bne _081A0AB0 - ldr r1, =gUnknown_08610FF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AB0: - cmp r0, 0x8 - bne _081A0ACC - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0ACC: - cmp r0, 0x9 - bne _081A0AE8 - ldr r1, =gUnknown_086111B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0AE8: - cmp r0, 0x4 - bne _081A0B04 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B04: - cmp r0, 0x5 - bne _081A0B20 - ldr r1, =gUnknown_08611230 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0B20: - cmp r0, 0xA - bne _081A0B40 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - b _081A0BD6 - .pool -_081A0B40: - cmp r0, 0xB - bne _081A0B5C - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - b _081A0C66 - .pool -_081A0B5C: - cmp r0, 0xC - bne _081A0B7C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0xC - b _081A0BD6 - .pool -_081A0B7C: - cmp r0, 0xD - bne _081A0B9C - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x4 - b _081A0BD6 - .pool -_081A0B9C: - ldrh r0, [r1] - cmp r0, 0x10 - bne _081A0BC0 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x10 - b _081A0BD6 - .pool -_081A0BC0: - cmp r0, 0xE - bne _081A0BE4 - ldr r2, =gUnknown_08611070 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r2, 0x8 -_081A0BD6: - adds r0, r2 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0BE4: - cmp r0, 0xF - bne _081A0C00 - ldr r1, =gUnknown_086112B0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 3 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C00: - cmp r0, 0 - bne _081A0C1C - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - b _081A0C66 - .pool -_081A0C1C: - cmp r0, 0x1 - bne _081A0C38 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x4 - b _081A0C66 - .pool -_081A0C38: - cmp r0, 0x2 - bne _081A0C54 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0x8 - b _081A0C66 - .pool -_081A0C54: - cmp r0, 0x3 - bne _081A0C74 - ldr r1, =gUnknown_08610EF0 - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - adds r0, 0xB0 - ldrb r0, [r0] - lsls r0, 4 - adds r1, 0xC -_081A0C66: - adds r0, r1 - ldr r1, [r0] - b _081A0C7A - .pool -_081A0C74: - bl EnableBothScriptContexts - b _081A0C8E -_081A0C7A: - ldr r0, =gStringVar4 - bl StringExpandPlaceholders - movs r0, 0x1 - bl AddTextPrinterForMessage - ldr r0, =sub_81A0A34 - movs r1, 0x1 - bl CreateTask -_081A0C8E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0A70 - - thumb_func_start sub_81A0C9C -sub_81A0C9C: @ 81A0C9C - push {lr} - bl ScriptContext2_Enable - bl FreezeEventObjects - bl sub_808B864 - bl sub_808BCF4 - movs r0, 0 - movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame - bl sub_81A0A70 - pop {r0} - bx r0 - thumb_func_end sub_81A0C9C - - thumb_func_start sub_81A0CC0 -sub_81A0CC0: @ 81A0CC0 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r0, r2, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bhi _081A0CE4 - ldr r1, =gSpecialVar_Result - movs r0, 0x2 - b _081A0D34 - .pool -_081A0CE4: - lsrs r0, r1, 28 - cmp r0, 0xB - bhi _081A0D30 - lsrs r0, r1, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r2, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0D18 - cmp r0, 0x2 - bgt _081A0D08 - cmp r0, 0x1 - beq _081A0D0E - b _081A0D30 -_081A0D08: - cmp r0, 0x3 - beq _081A0D24 - b _081A0D30 -_081A0D0E: - ldr r1, =gSpecialVar_Result - movs r0, 0x4 - b _081A0D34 - .pool -_081A0D18: - ldr r1, =gSpecialVar_Result - movs r0, 0x3 - b _081A0D34 - .pool -_081A0D24: - ldr r1, =gSpecialVar_Result - movs r0, 0x1 - b _081A0D34 - .pool -_081A0D30: - ldr r1, =gSpecialVar_Result - movs r0, 0x5 -_081A0D34: - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0CC0 - - thumb_func_start sub_81A0D40 -sub_81A0D40: @ 81A0D40 - push {r4,lr} - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0D6E - ldr r4, =gSpecialVar_0x8006 - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - adds r2, 0xB2 - ldrb r3, [r2] - lsls r0, r3, 29 - lsrs r0, 29 - movs r1, 0x1 - ldrb r4, [r4] - lsls r1, r4 - orrs r1, r0 - movs r0, 0x7 - ands r1, r0 - movs r0, 0x8 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] -_081A0D6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0D40 - - thumb_func_start sub_81A0D80 -sub_81A0D80: @ 81A0D80 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0DCE - subs r0, 0x3 - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0 - beq _081A0DC0 - lsls r2, 2 - adds r2, r3, r2 - adds r2, 0xB8 - ldrb r1, [r2] - movs r0, 0x3F - ands r0, r1 - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - b _081A0DCE - .pool -_081A0DC0: - lsls r0, r2, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r2, [r0] - movs r1, 0x3F - ands r1, r2 - strb r1, [r0] -_081A0DCE: - pop {r0} - bx r0 - thumb_func_end sub_81A0D80 - - thumb_func_start sub_81A0DD4 -sub_81A0DD4: @ 81A0DD4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r6, 0 - movs r2, 0 - ldr r1, =gSaveBlock2Ptr - ldr r0, [r1] - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - ldr r3, =gUnknown_030062F0 - mov r9, r3 - cmp r0, 0 - beq _081A0E14 - adds r3, r1, 0 -_081A0DF4: - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x8 - bhi _081A0E14 - ldr r0, [r3] - lsls r1, r2, 2 - adds r0, r1 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - cmp r0, 0 - bne _081A0DF4 -_081A0E14: - mov r4, r9 - movs r0, 0x8 - bl AllocZeroed - adds r7, r0, 0 - str r7, [r4] - ldr r0, =gSpecialVar_0x8005 - ldrh r0, [r0] - cmp r0, 0x2 - bne _081A0E88 - ldr r0, =gSaveBlock2Ptr - ldr r5, [r0] - adds r6, r5, 0 - adds r6, 0xB1 - ldrb r0, [r6] - lsls r1, r0, 26 - lsrs r0, r1, 28 - cmp r0, 0x2 - bls _081A0E3C - b _081A0FCE -_081A0E3C: - adds r2, r5, 0 - adds r2, 0xB4 - adds r0, r2, r0 - ldrb r0, [r0] - lsrs r4, r0, 4 - ldr r3, =gApprentices - lsls r1, r4, 1 - adds r5, 0xB0 - ldrb r0, [r5] - movs r4, 0x58 - muls r0, r4 - adds r1, r0 - adds r3, 0x34 - adds r1, r3 - ldrh r0, [r1] - strh r0, [r7, 0x2] - ldrb r0, [r6] - lsls r0, 26 - lsrs r0, 28 - adds r2, r0 - ldrb r1, [r2] - movs r0, 0xF - ands r0, r1 - lsls r0, 1 - ldrb r1, [r5] - muls r1, r4 - adds r0, r1 - adds r0, r3 - b _081A0FCA - .pool -_081A0E88: - cmp r0, 0x3 - bne _081A0F54 - ldr r0, =gSaveBlock2Ptr - mov r8, r0 - ldr r5, [r0] - movs r1, 0xB1 - adds r1, r5 - mov r12, r1 - ldrb r0, [r1] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bhi _081A0EA4 - b _081A0FCE -_081A0EA4: - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - blt _081A0EAE - b _081A0FCE -_081A0EAE: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x2 - beq _081A0EC4 - b _081A0FCE -_081A0EC4: - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r5, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r5, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r4, [r0] - lsls r1, 2 - asrs r4, r1 - movs r0, 0xF - ands r4, r0 - ldr r2, =gApprentices - lsls r1, r4, 1 - adds r0, r5, 0 - adds r0, 0xB0 - ldrb r3, [r0] - movs r0, 0x58 - muls r0, r3 - adds r1, r0 - adds r2, 0x34 - adds r1, r2 - ldrh r0, [r1] - strh r0, [r7] - mov r3, r12 - ldrb r0, [r3] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r0, r5, r0 - adds r0, 0xB8 - ldrb r2, [r0] - lsls r2, 26 - lsrs r2, 30 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_81A0284 - mov r1, r9 - ldr r2, [r1] - strh r0, [r2, 0x4] - mov r3, r8 - ldr r1, [r3] - adds r0, r1, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r0, 26 - lsrs r0, 28 - subs r0, 0x3 - lsls r0, 2 - adds r1, r0 - adds r1, 0xBA - ldrh r0, [r1] - strh r0, [r2, 0x6] - b _081A0FCE - .pool -_081A0F54: - cmp r0, 0x4 - bne _081A0FCE - ldr r0, =gSaveBlock2Ptr - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xB1 - ldrb r0, [r0] - lsls r2, r0, 26 - lsrs r0, r2, 28 - cmp r0, 0x2 - bls _081A0FCE - adds r1, r0, 0 - adds r0, r6, 0x3 - cmp r1, r0 - bge _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - cmp r0, 0x1 - bne _081A0FCE - adds r0, r1, 0 - subs r0, 0x3 - lsls r0, 2 - adds r0, r3, r0 - adds r0, 0xB8 - ldrb r0, [r0] - lsls r0, 28 - lsrs r6, r0, 30 - adds r0, r3, 0 - adds r0, 0xB2 - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 29 - asrs r1, r6 - movs r0, 0x1 - ands r1, r0 - adds r0, r3, 0 - adds r0, 0xB4 - adds r0, r6 - ldrb r0, [r0] - lsls r1, 2 - asrs r0, r1 - movs r1, 0xF - ands r0, r1 - ldr r2, =gApprentices - lsls r0, 1 - adds r1, r3, 0 - adds r1, 0xB0 - ldrb r3, [r1] - movs r1, 0x58 - muls r1, r3 - adds r0, r1 - adds r2, 0x34 - adds r0, r2 -_081A0FCA: - ldrh r0, [r0] - strh r0, [r7] -_081A0FCE: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0DD4 - - thumb_func_start sub_81A0FE4 -sub_81A0FE4: @ 81A0FE4 - push {r4,lr} - ldr r4, =gUnknown_030062F0 - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81A0FE4 - thumb_func_start sub_81A0FFC sub_81A0FFC: @ 81A0FFC push {r4-r6,lr} diff --git a/include/global.h b/include/global.h index ec9fc99bf..0100d04db 100644 --- a/include/global.h +++ b/include/global.h @@ -310,7 +310,7 @@ struct Apprentice u8 field_2; u8 field_3; struct ApprenticeMon monData[3]; - u16 unk28[6]; + u16 easyChatWords[6]; u8 playerId[4]; u8 playerName[PLAYER_NAME_LENGTH]; u8 language; diff --git a/include/menu.h b/include/menu.h index cddab0870..7815f71d8 100644 --- a/include/menu.h +++ b/include/menu.h @@ -50,7 +50,7 @@ void blit_move_info_icon(u8 winId, u8 a2, u16 x, u16 y); void reset_temp_tile_data_buffers(void); void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, u16 offset, u8 mode); bool8 free_temp_tile_data_buffers_if_possible(void); -struct WindowTemplate CreateWindowTemplate(u8, u8, u8, u8, u8, u8, u16); +struct WindowTemplate CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock); void CreateYesNoMenu(const struct WindowTemplate *windowTemplate, u16 borderFirstTileNum, u8 borderPalette, u8 initialCursorPos); void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode); s8 Menu_ProcessInputNoWrap_(void); diff --git a/ld_script.txt b/ld_script.txt index 7728a498b..e9a915fed 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -247,7 +247,7 @@ SECTIONS { asm/battle_frontier_1.o(.text); src/menu.o(.text); src/battle_factory.o(.text); - src/battle_frontier_2.o(.text); + src/apprentice.o(.text); asm/battle_frontier_2.o(.text); src/item_menu.o(.text); src/list_menu.o(.text); diff --git a/src/battle_frontier_2.c b/src/apprentice.c similarity index 55% rename from src/battle_frontier_2.c rename to src/apprentice.c index 45e4a1683..a0237706c 100644 --- a/src/battle_frontier_2.c +++ b/src/apprentice.c @@ -11,7 +11,13 @@ #include "script_menu.h" #include "party_menu.h" #include "data2.h" +#include "task.h" +#include "sound.h" +#include "event_data.h" +#include "field_player_avatar.h" +#include "event_object_movement.h" #include "constants/items.h" +#include "constants/songs.h" struct Unk030062ECStruct { @@ -32,9 +38,16 @@ extern struct Unk030062ECStruct *gUnknown_030062EC; extern struct Unk030062F0Struct *gUnknown_030062F0; extern const u8 *const gUnknown_08611330[]; +extern const u8 *const gUnknown_08610FF0[][2]; +extern const u8 *const gUnknown_086112B0[][2]; +extern const u8 *const gUnknown_08611230[][2]; +extern const u8 *const gUnknown_086111B0[][2]; +extern const u8 *const gUnknown_08610EF0[][4]; +extern const u8 *const gUnknown_08611070[][5]; extern const u8 gUnknown_08611548[8]; extern const u8 gUnknown_086114D3[]; extern const bool8 gUnknown_08611370[]; +extern void (* const gUnknown_086114E0[])(void); // text extern const u8 gText_Give[]; @@ -46,8 +59,10 @@ extern const u8 gText_No[]; void sub_81A087C(void); u16 sub_819FF98(u8 arg0); bool8 sub_81A0194(u8 arg0, u16 moveId); -void sub_81A0804(u8 arg0, u8 itemsCount, u8 windowId); -u8 sub_81A0784(u8 arg0, u8 arg1, u8 arg2, u8 arg3); +void sub_81A0804(bool8 noBButton, u8 itemsCount, u8 windowId); +u8 sub_81A0784(u8 left, u8 top, u8 width, u8 height); +void sub_81A07E8(u8 windowId); +void sub_81A172C(void (*func)(void)); void sub_819F99C(u8 id) { @@ -77,7 +92,7 @@ void sub_819FA5C(struct Apprentice *apprentice) u8 i; for (i = 0; i < 6; i++) - apprentice->unk28[i] |= 0xFFFF; + apprentice->easyChatWords[i] |= 0xFFFF; apprentice->playerName[0] = EOS; apprentice->field_0_0 = 16; @@ -91,7 +106,7 @@ void sub_819FAA0(void) for (i = 0; i < 4; i++) { for (j = 0; j < 6; j++) - gSaveBlock2Ptr->field_DC[i].unk28[j] |= 0xFFFF; + gSaveBlock2Ptr->field_DC[i].easyChatWords[j] |= 0xFFFF; gSaveBlock2Ptr->field_DC[i].field_0_0 = 16; gSaveBlock2Ptr->field_DC[i].playerName[0] = EOS; gSaveBlock2Ptr->field_DC[i].field_0_1 = 0; @@ -106,7 +121,7 @@ void sub_819FAA0(void) sub_81A087C(); } -u8 sub_819FBB0(void) +bool8 sub_819FBB0(void) { return (gSaveBlock2Ptr->field_B1_0 != 0); } @@ -251,7 +266,13 @@ void sub_819FD64(void) #define APPRENTICE_SPECIES_ID(speciesArrId, monId) speciesArrId = (gSaveBlock2Ptr->field_B4[monId] >> \ (((gSaveBlock2Ptr->field_B2_0 >> monId) & 1) << 2)) & 0xF; \ - do {} while (0) + do {} while (0) + +// Why the need to have two macros do the exact thing differently? +#define APPRENTICE_SPECIES_ID_2(speciesArrId, monId) { u8 a0 = ((gSaveBlock2Ptr->field_B2_0 >> monId) & 1);\ + speciesArrId = gSaveBlock2Ptr->field_B4[monId]; \ + speciesArrId = ((speciesArrId) >> (a0 << 2)) & 0xF; \ + } u16 sub_819FF98(u8 arg0) { @@ -483,23 +504,23 @@ void sub_81A04E4(u8 arg0) u8 windowId; const u8 *strings[3]; u8 count = 2; - u8 tileWidth; - u8 r10; - u8 r6; + u8 width; + u8 left; + u8 top; s32 pixelWidth; switch (arg0) { case 0: - r10 = 0x12; - r6 = 8; + left = 0x12; + top = 8; strings[0] = gText_Lv50; strings[1] = gText_OpenLevel; break; case 1: count = 3; - r10 = 0x12; - r6 = 6; + left = 0x12; + top = 6; for (i = 0; i < 3; i++) { u16 species; @@ -511,34 +532,34 @@ void sub_81A04E4(u8 arg0) } break; case 2: - r10 = 0x12; - r6 = 8; + left = 0x12; + top = 8; if (gSaveBlock2Ptr->field_B1_1 > 2) return; strings[1] = gSpeciesNames[gUnknown_030062F0->unk2]; strings[0] = gSpeciesNames[gUnknown_030062F0->unk0]; break; case 3: - r10 = 0x11; - r6 = 8; + left = 0x11; + top = 8; strings[0] = gMoveNames[gUnknown_030062F0->unk4]; strings[1] = gMoveNames[gUnknown_030062F0->unk6]; break; case 4: - r10 = 0x12; - r6 = 8; + left = 0x12; + top = 8; strings[0] = gText_Give; strings[1] = gText_NoNeed; break; case 6: - r10 = 0x14; - r6 = 8; + left = 0x14; + top = 8; strings[0] = gText_Yes; strings[1] = gText_No; break; default: - r10 = 0; - r6 = 0; + left = 0; + top = 0; break; } @@ -550,14 +571,377 @@ void sub_81A04E4(u8 arg0) pixelWidth = width; } - tileWidth = convert_pixel_width_to_tile_width(pixelWidth); - r10 = sub_80E2D5C(r10, tileWidth); - windowId = sub_81A0784(r10, r6, tileWidth, count * 2); + width = convert_pixel_width_to_tile_width(pixelWidth); + left = sub_80E2D5C(left, width); + windowId = sub_81A0784(left, top, width, count * 2); SetStandardWindowBorderStyle(windowId, 0); for (i = 0; i < count; i++) AddTextPrinterParameterized(windowId, 1, strings[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, 0); - sub_81A0804(1, count, windowId); + sub_81A0804(TRUE, count, windowId); +} + +#define tNoBButton data[4] +#define tWrapAround data[5] +#define tWindowId data[6] + +void sub_81A070C(u8 taskId) +{ + s8 input; + s16 *data = gTasks[taskId].data; + + if (!tWrapAround) + input = Menu_ProcessInputNoWrapAround(); + else + input = ProcessMenuInput(); + + switch (input) + { + case MENU_NOTHING_CHOSEN: + return; + case MENU_B_PRESSED: + if (tNoBButton) + return; + + PlaySE(SE_SELECT); + gSpecialVar_Result = 0x7F; + break; + default: + gSpecialVar_Result = input; + break; + } + + sub_81A07E8(tWindowId); + DestroyTask(taskId); + EnableBothScriptContexts(); +} + +u8 sub_81A0784(u8 left, u8 top, u8 width, u8 height) +{ + u8 windowId; + struct WindowTemplate winTemplate = CreateWindowTemplate(0, left + 1, top + 1, width, height, 15, 100); + + windowId = AddWindow(&winTemplate); + PutWindowTilemap(windowId); + CopyWindowToVram(windowId, 3); + return windowId; +} + +void sub_81A07E8(u8 windowId) +{ + sub_8198070(windowId, TRUE); + RemoveWindow(windowId); +} + +void sub_81A0804(bool8 noBButton, u8 itemsCount, u8 windowId) +{ + u8 taskId = CreateTask(sub_81A070C, 80); + gTasks[taskId].tNoBButton = noBButton; + + if (itemsCount > 3) + gTasks[taskId].tWrapAround = TRUE; + else + gTasks[taskId].tWrapAround = FALSE; + + gTasks[taskId].tWindowId = windowId; +} + +#undef tNoBButton +#undef tWrapAround +#undef tWindowId + +void sub_81A085C(void) +{ + gUnknown_086114E0[gSpecialVar_0x8004](); +} + +void sub_81A087C(void) +{ + u8 i; + + sub_819FBC8(); + gSaveBlock2Ptr->field_B1_0 = 0; + gSaveBlock2Ptr->field_B1_1 = 0; + gSaveBlock2Ptr->field_B1_2 = 0; + gSaveBlock2Ptr->field_B2_0 = 0; + + for (i = 0; i < 3; i++) + gSaveBlock2Ptr->field_B4[i] = 0; + + for (i = 0; i < 9; i++) + { + gSaveBlock2Ptr->field_B8[i].unk0_0 = 0; + gSaveBlock2Ptr->field_B8[i].unk0_1 = 0; + gSaveBlock2Ptr->field_B8[i].unk0_2 = 0; + gSaveBlock2Ptr->field_B8[i].unk0_3 = 0; + gSaveBlock2Ptr->field_B8[i].unk2 = 0; + } +} + +void sub_81A093C(void) +{ + if (!sub_819FBB0()) + gSpecialVar_Result = FALSE; + else + gSpecialVar_Result = TRUE; +} + +void sub_81A0964(void) +{ + sub_819FC40(gSpecialVar_0x8005); +} + +void sub_81A0978(void) +{ + sub_819FBC8(); +} + +void sub_81A0984(void) +{ + sub_819FD64(); +} + +void sub_81A0990(void) +{ + gSaveBlock2Ptr->field_B1_1++; +} + +void sub_81A09B4(void) +{ + gSpecialVar_Result = gSaveBlock2Ptr->field_B1_1; +} + +void sub_81A09D0(void) +{ + s32 var = gSaveBlock2Ptr->field_B1_1 - 3; + if (var < 0) + { + gSpecialVar_Result = FALSE; + } + else + { + if (var > 8) + gSpecialVar_Result = TRUE; + + if (!gSaveBlock2Ptr->field_B8[var].unk0_0) + gSpecialVar_Result = TRUE; + else + gSpecialVar_Result = FALSE; + } +} + +void sub_81A0A20(void) +{ + sub_81A04E4(gSpecialVar_0x8005); +} + +void sub_81A0A34(u8 taskId) +{ + if (!RunTextPrintersAndIsPrinter0Active()) + { + DestroyTask(taskId); + if (gSpecialVar_0x8005) + sub_81A172C(EnableBothScriptContexts); + else + EnableBothScriptContexts(); + } +} + +void sub_81A0A70(void) +{ + const u8 *string; + + if (gSpecialVar_0x8006 == 6) + { + string = gUnknown_08610FF0[gSaveBlock2Ptr->field_B0][0]; + } + else if (gSpecialVar_0x8006 == 7) + { + string = gUnknown_08610FF0[gSaveBlock2Ptr->field_B0][1]; + } + else if (gSpecialVar_0x8006 == 8) + { + string = gUnknown_086111B0[gSaveBlock2Ptr->field_B0][0]; + } + else if (gSpecialVar_0x8006 == 9) + { + string = gUnknown_086111B0[gSaveBlock2Ptr->field_B0][1]; + } + else if (gSpecialVar_0x8006 == 4) + { + string = gUnknown_08611230[gSaveBlock2Ptr->field_B0][0]; + } + else if (gSpecialVar_0x8006 == 5) + { + string = gUnknown_08611230[gSaveBlock2Ptr->field_B0][1]; + } + else if (gSpecialVar_0x8006 == 10) + { + string = gUnknown_08611070[gSaveBlock2Ptr->field_B0][0]; + } + else if (gSpecialVar_0x8006 == 11) + { + string = gUnknown_086112B0[gSaveBlock2Ptr->field_B0][0]; + } + else if (gSpecialVar_0x8006 == 12) + { + string = gUnknown_08611070[gSaveBlock2Ptr->field_B0][3]; + } + else if (gSpecialVar_0x8006 == 13) + { + string = gUnknown_08611070[gSaveBlock2Ptr->field_B0][1]; + } + else if (gSpecialVar_0x8006 == 16) + { + string = gUnknown_08611070[gSaveBlock2Ptr->field_B0][4]; + } + else if (gSpecialVar_0x8006 == 14) + { + string = gUnknown_08611070[gSaveBlock2Ptr->field_B0][2]; + } + else if (gSpecialVar_0x8006 == 15) + { + string = gUnknown_086112B0[gSaveBlock2Ptr->field_B0][1]; + } + else if (gSpecialVar_0x8006 == 0) + { + string = gUnknown_08610EF0[gSaveBlock2Ptr->field_B0][0]; + } + else if (gSpecialVar_0x8006 == 1) + { + string = gUnknown_08610EF0[gSaveBlock2Ptr->field_B0][1]; + } + else if (gSpecialVar_0x8006 == 2) + { + string = gUnknown_08610EF0[gSaveBlock2Ptr->field_B0][2]; + } + else if (gSpecialVar_0x8006 == 3) + { + string = gUnknown_08610EF0[gSaveBlock2Ptr->field_B0][3]; + } + else + { + EnableBothScriptContexts(); + return; + } + + StringExpandPlaceholders(gStringVar4, string); + AddTextPrinterForMessage(TRUE); + CreateTask(sub_81A0A34, 1); +} + +void sub_81A0C9C(void) +{ + ScriptContext2_Enable(); + FreezeEventObjects(); + sub_808B864(); + sub_808BCF4(); + NewMenuHelpers_DrawDialogueFrame(0, 1); + sub_81A0A70(); +} + +void sub_81A0CC0(void) +{ + if (gSaveBlock2Ptr->field_B1_1 < 3) + { + gSpecialVar_Result = 2; + } + else if (gSaveBlock2Ptr->field_B1_1 > 11) + { + gSpecialVar_Result = 5; + } + else + { + s32 id = gSaveBlock2Ptr->field_B1_1 - 3; + switch (gSaveBlock2Ptr->field_B8[id].unk0_0) + { + case 1: + gSpecialVar_Result = 4; + break; + case 2: + gSpecialVar_Result = 3; + break; + case 3: + gSpecialVar_Result = 1; + break; + default: + gSpecialVar_Result = 5; + break; + } + } +} + +void sub_81A0D40(void) +{ + if (gSpecialVar_0x8005) + { + u8 bitNo = gSpecialVar_0x8006; + gSaveBlock2Ptr->field_B2_0 |= 1 << bitNo; + } +} + +void sub_81A0D80(void) +{ + if (gSaveBlock2Ptr->field_B1_1 >= 3) + { + u8 id = gSaveBlock2Ptr->field_B1_1 - 3; + if (gSpecialVar_0x8005) + gSaveBlock2Ptr->field_B8[id].unk0_3 = 1; + else + gSaveBlock2Ptr->field_B8[id].unk0_3 = 0; + } +} + +void sub_81A0DD4(void) +{ + u8 i; + u8 count = 0; + u8 id1, id2; + + for (i = 0; i < 9 && gSaveBlock2Ptr->field_B8[i].unk0_0; count++, i++) + ; + + gUnknown_030062F0 = AllocZeroed(sizeof(*gUnknown_030062F0)); + if (gSpecialVar_0x8005 == 2) + { + if (gSaveBlock2Ptr->field_B1_1 < 3) + { + id1 = gSaveBlock2Ptr->field_B4[gSaveBlock2Ptr->field_B1_1] >> 4; + gUnknown_030062F0->unk2 = gApprentices[gSaveBlock2Ptr->field_B0].species[id1]; + + id2 = gSaveBlock2Ptr->field_B4[gSaveBlock2Ptr->field_B1_1] & 0xF; + gUnknown_030062F0->unk0 = gApprentices[gSaveBlock2Ptr->field_B0].species[id2]; + } + } + else if (gSpecialVar_0x8005 == 3) + { + if (gSaveBlock2Ptr->field_B1_1 >= 3 + && gSaveBlock2Ptr->field_B1_1 < count + 3 + && gSaveBlock2Ptr->field_B8[gSaveBlock2Ptr->field_B1_1 - 3].unk0_0 == 2) + { + count = gSaveBlock2Ptr->field_B8[gSaveBlock2Ptr->field_B1_1 - 3].unk0_1; + APPRENTICE_SPECIES_ID_2(id1, count); + gUnknown_030062F0->unk0 = gApprentices[gSaveBlock2Ptr->field_B0].species[id1]; + gUnknown_030062F0->unk4 = sub_81A0284(count, id1, gSaveBlock2Ptr->field_B8[gSaveBlock2Ptr->field_B1_1 - 3].unk0_2); + gUnknown_030062F0->unk6 = gSaveBlock2Ptr->field_B8[gSaveBlock2Ptr->field_B1_1 - 3].unk2; + } + } + else if (gSpecialVar_0x8005 == 4) + { + if (gSaveBlock2Ptr->field_B1_1 >= 3 + && gSaveBlock2Ptr->field_B1_1 < count + 3 + && gSaveBlock2Ptr->field_B8[gSaveBlock2Ptr->field_B1_1 - 3].unk0_0 == 1) + { + count = gSaveBlock2Ptr->field_B8[gSaveBlock2Ptr->field_B1_1 - 3].unk0_1; + APPRENTICE_SPECIES_ID_2(id2, count); + gUnknown_030062F0->unk0 = gApprentices[gSaveBlock2Ptr->field_B0].species[id2]; + } + } +} + +void sub_81A0FE4(void) +{ + FREE_AND_SET_NULL(gUnknown_030062F0); } diff --git a/src/easy_chat.c b/src/easy_chat.c index fbf4c0e70..50ed0a649 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -352,7 +352,7 @@ void easy_chat_input_maybe(void) words = &gSaveBlock1Ptr->lilycoveLady.quiz.unk_014; break; case 19: - words = (u16 *)&gSaveBlock2Ptr->field_DC[0].field_0[0x28]; + words = gSaveBlock2Ptr->field_DC[0].easyChatWords; break; case 20: words = sub_801B058();