diff --git a/asm/battle_7.s b/asm/battle_7.s deleted file mode 100644 index 94cc1ba8e..000000000 --- a/asm/battle_7.s +++ /dev/null @@ -1,3815 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start AllocateBattleSpritesData -AllocateBattleSpritesData: @ 805D118 - push {r4,lr} - ldr r4, =gBattleSpritesDataPtr - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] - movs r0, 0x30 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x4] - movs r0, 0x10 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0x8] - movs r0, 0x50 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1, 0xC] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end AllocateBattleSpritesData - - thumb_func_start FreeBattleSpritesData -FreeBattleSpritesData: @ 805D158 - push {r4,r5,lr} - ldr r5, =gBattleSpritesDataPtr - ldr r0, [r5] - cmp r0, 0 - beq _0805D192 - ldr r0, [r0, 0xC] - bl Free - ldr r0, [r5] - movs r4, 0 - str r4, [r0, 0xC] - ldr r0, [r0, 0x8] - bl Free - ldr r0, [r5] - str r4, [r0, 0x8] - ldr r0, [r0, 0x4] - bl Free - ldr r0, [r5] - str r4, [r0, 0x4] - ldr r0, [r0] - bl Free - ldr r0, [r5] - str r4, [r0] - bl Free - str r4, [r5] -_0805D192: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end FreeBattleSpritesData - - thumb_func_start ChooseMoveAndTargetInBattlePalace -ChooseMoveAndTargetInBattlePalace: @ 805D19C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r0, 0x1 - negs r0, r0 - mov r9, r0 - ldr r4, =gActiveBank - ldrb r0, [r4] - lsls r2, r0, 9 - ldr r1, =gBattleBufferA + 4 - adds r2, r1 - mov r10, r2 - movs r1, 0 - movs r2, 0xFF - bl CheckMoveLimitations - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r7, r0, 16 - ldr r0, =gBattleStruct - ldr r0, [r0] - adds r0, 0x92 - ldrb r1, [r0] - ldr r2, =gBitTable - ldrb r0, [r4] - lsls r0, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r4, r0, 31 - movs r0, 0x2 - ands r4, r0 - adds r6, r4, 0 - adds r5, r4, 0x2 - b _0805D20E - .pool -_0805D20C: - adds r4, 0x1 -_0805D20E: - cmp r4, r5 - bge _0805D234 - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r0, 0x58 - muls r0, r1 - ldr r1, =gBattleMons + 0x48 - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 22 - adds r0, r4, r0 - ldr r2, =gUnknown_0831C494 - adds r0, r2 - ldrb r0, [r0] - cmp r0, r7 - ble _0805D20C -_0805D234: - subs r7, r4, r6 - cmp r4, r5 - bne _0805D23C - movs r7, 0x2 -_0805D23C: - movs r6, 0 - movs r4, 0 - mov r1, r10 - ldrh r0, [r1] - cmp r0, 0 - beq _0805D27C - mov r5, r10 -_0805D24A: - ldrh r0, [r5] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0805D26E - mov r0, r10 - adds r0, 0x8 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0 - beq _0805D26E - ldr r0, =gBitTable - lsls r1, r4, 2 - adds r1, r0 - ldr r0, [r1] - orrs r6, r0 -_0805D26E: - adds r5, 0x2 - adds r4, 0x1 - cmp r4, 0x3 - bgt _0805D27C - ldrh r0, [r5] - cmp r0, 0 - bne _0805D24A -_0805D27C: - cmp r6, 0 - beq _0805D2AC - ldr r3, =gBattleStruct - ldr r1, [r3] - adds r1, 0x92 - ldrb r2, [r1] - movs r0, 0xF - ands r0, r2 - strb r0, [r1] - ldr r1, [r3] - adds r1, 0x92 - lsls r0, r6, 4 - ldrb r2, [r1] - orrs r0, r2 - strb r0, [r1] - lsls r0, r6, 24 - lsrs r0, 24 - bl BattleAI_SetupAIData - bl BattleAI_ChooseMoveOrAction - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 -_0805D2AC: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D2B6 - b _0805D40C -_0805D2B6: - mov r2, r8 - cmp r2, 0xF - bne _0805D2BE - b _0805D3EA -_0805D2BE: - movs r5, 0 - movs r6, 0 - ldr r7, =gBitTable - mov r4, r10 -_0805D2C6: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - cmp r0, 0 - bne _0805D2DE - ldr r0, [r7] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D2DE - adds r5, 0x1 -_0805D2DE: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805D2F8 - ldr r0, [r7] - mov r2, r8 - ands r0, r2 - cmp r0, 0 - bne _0805D2F8 - adds r5, 0x10 -_0805D2F8: - ldrh r0, [r4] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bne _0805D316 - ldr r0, [r7] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D316 - movs r2, 0x80 - lsls r2, 1 - adds r5, r2 -_0805D316: - adds r7, 0x4 - adds r4, 0x2 - ldr r0, =gBitTable - adds r0, 0xC - cmp r7, r0 - ble _0805D2C6 - movs r1, 0xF - ands r1, r5 - cmp r1, 0x1 - ble _0805D32C - adds r6, 0x1 -_0805D32C: - movs r0, 0xF0 - ands r0, r5 - cmp r0, 0x1F - ble _0805D336 - adds r6, 0x1 -_0805D336: - ldr r2, =0x000001ff - cmp r0, r2 - ble _0805D33E - adds r6, 0x1 -_0805D33E: - cmp r6, 0x1 - bgt _0805D346 - cmp r6, 0 - bne _0805D388 -_0805D346: - ldr r5, =gBitTable -_0805D348: - bl Random - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r4, r1, 16 - lsls r0, r4, 2 - adds r0, r5 - ldr r0, [r0] - mov r1, r8 - ands r0, r1 - cmp r0, 0 - bne _0805D366 - mov r9, r4 -_0805D366: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D348 - b _0805D3D4 - .pool -_0805D388: - cmp r1, 0x1 - ble _0805D38E - movs r6, 0 -_0805D38E: - cmp r0, 0x1F - ble _0805D394 - movs r6, 0x1 -_0805D394: - cmp r0, r2 - ble _0805D39A - movs r6, 0x2 -_0805D39A: - bl Random - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 10 - ands r1, r0 - lsrs r4, r1, 16 - ldr r1, =gBitTable - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - mov r2, r8 - ands r0, r2 - cmp r0, 0 - bne _0805D3CC - lsls r0, r4, 1 - add r0, r10 - ldrh r0, [r0] - bl sub_805D4A8 - lsls r0, 24 - lsrs r0, 24 - cmp r6, r0 - bne _0805D3CC - mov r9, r4 -_0805D3CC: - movs r0, 0x1 - negs r0, r0 - cmp r9, r0 - beq _0805D39A -_0805D3D4: - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x31 - bls _0805D40C -_0805D3EA: - ldr r2, =gProtectStructs - ldr r0, =gActiveBank - ldrb r1, [r0] - lsls r1, 4 - adds r1, r2 - ldrb r0, [r1, 0x2] - movs r2, 0x10 - orrs r0, r2 - strb r0, [r1, 0x2] - movs r0, 0 - b _0805D496 - .pool -_0805D40C: - mov r1, r9 - lsls r0, r1, 1 - mov r2, r10 - adds r1, r2, r0 - ldrh r0, [r1] - cmp r0, 0xAE - bne _0805D434 - ldrb r0, [r2, 0x12] - movs r5, 0 - cmp r0, 0x7 - beq _0805D442 - ldrb r1, [r2, 0x13] - movs r0, 0x7 - eors r1, r0 - negs r0, r1 - orrs r0, r1 - asrs r5, r0, 31 - movs r0, 0x10 - ands r5, r0 - b _0805D442 -_0805D434: - ldr r2, =gBattleMoves - ldrh r1, [r1] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r5, [r0, 0x6] -_0805D442: - movs r0, 0x10 - ands r0, r5 - cmp r0, 0 - beq _0805D45C - ldr r0, =gActiveBank - ldrb r0, [r0] - lsls r0, 8 - b _0805D48A - .pool -_0805D45C: - cmp r5, 0 - bne _0805D470 - bl sub_805D5F4 - lsls r0, 16 - lsrs r0, 16 - mov r2, r9 - orrs r2, r0 - mov r9, r2 - b _0805D490 -_0805D470: - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankIdentity - adds r1, r0, 0 - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 16 -_0805D48A: - mov r1, r9 - orrs r1, r0 - mov r9, r1 -_0805D490: - mov r2, r9 - lsls r0, r2, 16 - lsrs r0, 16 -_0805D496: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end ChooseMoveAndTargetInBattlePalace - - thumb_func_start sub_805D4A8 -sub_805D4A8: @ 805D4A8 - push {lr} - lsls r0, 16 - lsrs r2, r0, 16 - ldr r1, =gBattleMoves - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - ldrb r0, [r0, 0x6] - adds r3, r1, 0 - cmp r0, 0x40 - bls _0805D4C2 - b _0805D5EE -_0805D4C2: - lsls r0, 2 - ldr r1, =_0805D4D4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805D4D4: - .4byte _0805D5D8 - .4byte _0805D5E6 - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EA - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5D8 - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5EE - .4byte _0805D5E6 -_0805D5D8: - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r0, [r0, 0x1] - cmp r0, 0 - bne _0805D5EE -_0805D5E6: - movs r0, 0x2 - b _0805D5F0 -_0805D5EA: - movs r0, 0x1 - b _0805D5F0 -_0805D5EE: - movs r0, 0 -_0805D5F0: - pop {r1} - bx r1 - thumb_func_end sub_805D4A8 - - thumb_func_start sub_805D5F4 -sub_805D5F4: @ 805D5F4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805D6FA - ldr r0, =gActiveBank - ldrb r0, [r0] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0805D630 - movs r0, 0x1 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x3 - b _0805D63E - .pool -_0805D630: - movs r0, 0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x2 -_0805D63E: - bl GetBankByIdentity - lsls r0, 24 - lsrs r7, r0, 24 - ldr r1, =gBattleMons - movs r2, 0x58 - mov r0, r8 - muls r0, r2 - adds r5, r0, r1 - adds r0, r7, 0 - muls r0, r2 - adds r6, r0, r1 - ldrh r0, [r5, 0x28] - ldrh r3, [r6, 0x28] - cmp r0, r3 - bne _0805D680 - bl Random - adds r3, r0, 0 - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - movs r1, 0x2 - ands r1, r3 - adds r0, r1 - b _0805D702 - .pool -_0805D680: - ldr r4, =gUnknown_0831C604 - ldr r0, =gActiveBank - mov r9, r0 - ldrb r0, [r0] - muls r0, r2 - adds r1, 0x48 - adds r0, r1 - ldr r0, [r0] - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - adds r0, r4 - ldrb r4, [r0] - cmp r4, 0x1 - beq _0805D6CC - cmp r4, 0x1 - bgt _0805D6B4 - cmp r4, 0 - beq _0805D6BA - b _0805D6FA - .pool -_0805D6B4: - cmp r4, 0x2 - beq _0805D6DE - b _0805D6FA -_0805D6BA: - ldrh r0, [r5, 0x28] - ldrh r6, [r6, 0x28] - cmp r0, r6 - bls _0805D6C8 - mov r1, r8 - lsls r0, r1, 8 - b _0805D704 -_0805D6C8: - lsls r0, r7, 8 - b _0805D704 -_0805D6CC: - ldrh r0, [r5, 0x28] - ldrh r6, [r6, 0x28] - cmp r0, r6 - bcs _0805D6DA - mov r3, r8 - lsls r0, r3, 8 - b _0805D704 -_0805D6DA: - lsls r0, r7, 8 - b _0805D704 -_0805D6DE: - bl Random - adds r3, r0, 0 - mov r0, r9 - ldrb r1, [r0] - movs r2, 0x1 - movs r0, 0x1 - ands r0, r1 - eors r0, r2 - ands r4, r3 - adds r0, r4 - lsls r0, 24 - lsrs r0, 16 - b _0805D704 -_0805D6FA: - ldr r0, =gActiveBank - ldrb r1, [r0] - movs r0, 0x1 - eors r0, r1 -_0805D702: - lsls r0, 8 -_0805D704: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_805D5F4 - - thumb_func_start sub_805D714 -sub_805D714: @ 805D714 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x30] - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - adds r0, r1, 0 - adds r0, 0x3F - ldrb r3, [r0] - lsls r0, r3, 26 - cmp r0, 0 - bge _0805D766 - adds r0, r1, 0 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _0805D766 - adds r2, r1, 0 - adds r2, 0x2C - ldrb r1, [r2] - lsls r0, r1, 25 - cmp r0, 0 - bge _0805D75C - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - b _0805D766 - .pool -_0805D75C: - lsls r0, r3, 27 - cmp r0, 0 - bge _0805D766 - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] -_0805D766: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D714 - - thumb_func_start sub_805D770 -sub_805D770: @ 805D770 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - adds r3, r4, 0 - adds r3, 0x2C - ldrb r0, [r3] - movs r2, 0x40 - orrs r0, r2 - strb r0, [r3] - ldr r0, =SpriteCallbackDummy - str r0, [r4, 0x1C] - cmp r1, 0 - bne _0805D798 - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim - b _0805D7A0 - .pool -_0805D798: - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAffineAnim -_0805D7A0: - adds r0, r4, 0 - bl AnimateSprite - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_805D770 - - thumb_func_start sub_805D7AC -sub_805D7AC: @ 805D7AC - push {lr} - adds r2, r0, 0 - ldr r0, =gUnknown_020243FC - ldrh r1, [r0] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _0805D7E4 - ldrh r0, [r2, 0x2E] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - lsls r0, 16 - cmp r0, 0 - bne _0805D7E4 - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0805D7E0 - ldr r0, =sub_805D7EC - b _0805D7E2 - .pool -_0805D7E0: - ldr r0, =SpriteCallbackDummy -_0805D7E2: - str r0, [r2, 0x1C] -_0805D7E4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D7AC - - thumb_func_start sub_805D7EC -sub_805D7EC: @ 805D7EC - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0x26] - subs r0, 0x2 - strh r0, [r1, 0x26] - lsls r0, 16 - cmp r0, 0 - bne _0805D800 - ldr r0, =SpriteCallbackDummy - str r0, [r1, 0x1C] -_0805D800: - pop {r0} - bx r0 - .pool - thumb_func_end sub_805D7EC - - thumb_func_start DoStatusAnimation -DoStatusAnimation: @ 805D808 - push {r4-r6,lr} - adds r4, r1, 0 - lsls r0, 24 - ldr r6, =gBattleSpritesDataPtr - ldr r1, [r6] - ldr r5, =gActiveBank - ldrb r2, [r5] - ldr r3, [r1, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - ldrb r2, [r1] - movs r3, 0x10 - orrs r2, r3 - strb r2, [r1] - cmp r0, 0 - bne _0805D888 - cmp r4, 0x20 - bne _0805D844 - ldrb r0, [r5] - movs r1, 0x6 - bl move_anim_start_t2 - b _0805D902 - .pool -_0805D844: - cmp r4, 0x8 - beq _0805D850 - movs r0, 0x80 - ands r0, r4 - cmp r0, 0 - beq _0805D85A -_0805D850: - ldrb r0, [r5] - movs r1, 0 - bl move_anim_start_t2 - b _0805D902 -_0805D85A: - cmp r4, 0x10 - bne _0805D868 - ldrb r0, [r5] - movs r1, 0x2 - bl move_anim_start_t2 - b _0805D902 -_0805D868: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _0805D87A - ldrb r0, [r5] - movs r1, 0x4 - bl move_anim_start_t2 - b _0805D902 -_0805D87A: - cmp r4, 0x40 - bne _0805D8EA - ldrb r0, [r5] - movs r1, 0x5 - bl move_anim_start_t2 - b _0805D902 -_0805D888: - movs r0, 0xF0 - lsls r0, 12 - ands r0, r4 - cmp r0, 0 - beq _0805D89C - ldrb r0, [r5] - movs r1, 0x3 - bl move_anim_start_t2 - b _0805D902 -_0805D89C: - movs r0, 0x7 - ands r0, r4 - cmp r0, 0 - beq _0805D8AE - ldrb r0, [r5] - movs r1, 0x1 - bl move_anim_start_t2 - b _0805D902 -_0805D8AE: - movs r0, 0x80 - lsls r0, 21 - ands r0, r4 - cmp r0, 0 - beq _0805D8C2 - ldrb r0, [r5] - movs r1, 0x7 - bl move_anim_start_t2 - b _0805D902 -_0805D8C2: - movs r0, 0x80 - lsls r0, 20 - ands r0, r4 - cmp r0, 0 - beq _0805D8D6 - ldrb r0, [r5] - movs r1, 0x8 - bl move_anim_start_t2 - b _0805D902 -_0805D8D6: - movs r0, 0xE0 - lsls r0, 8 - ands r0, r4 - cmp r0, 0 - beq _0805D8EA - ldrb r0, [r5] - movs r1, 0x9 - bl move_anim_start_t2 - b _0805D902 -_0805D8EA: - ldr r0, [r6] - ldrb r2, [r5] - ldr r0, [r0, 0x4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x11 - negs r0, r0 - ands r0, r2 - strb r0, [r1] -_0805D902: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end DoStatusAnimation - - thumb_func_start DoBattleAnimationFromTable -DoBattleAnimationFromTable: @ 805D908 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - ldr r4, [sp, 0x24] - lsls r0, 24 - lsrs r6, r0, 24 - lsls r1, 24 - lsrs r1, 24 - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp] - lsls r3, 24 - lsrs r5, r3, 24 - lsls r4, 16 - lsrs r7, r4, 16 - cmp r5, 0 - bne _0805D950 - movs r0, 0x80 - ands r0, r7 - cmp r0, 0 - beq _0805D950 - ldr r0, =gBattleMonForms - adds r0, r6, r0 - movs r2, 0x7F - adds r1, r7, 0 - ands r1, r2 - strb r1, [r0] - movs r0, 0x1 - b _0805DA1E - .pool -_0805D950: - ldr r0, =gBattleSpritesDataPtr - mov r9, r0 - ldr r0, [r0] - ldr r0, [r0] - lsls r4, r6, 2 - adds r0, r4, r0 - ldrb r1, [r0] - movs r2, 0x4 - mov r8, r2 - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _0805D9CC - adds r0, r5, 0 - bl sub_805DAA0 - lsls r0, 24 - cmp r0, 0 - bne _0805D980 - movs r0, 0x1 - b _0805DA1E - .pool -_0805D980: - mov r1, r9 - ldr r0, [r1] - ldr r0, [r0] - adds r0, r4, r0 - ldrb r1, [r0] - mov r0, r8 - ands r0, r1 - cmp r0, 0 - beq _0805D9CC - cmp r5, 0x2 - bne _0805D9CC - ldr r1, =gSprites - ldr r0, =gBankSpriteIds - adds r0, r6, r0 - ldrb r2, [r0] - lsls r0, r2, 4 - adds r0, r2 - lsls r0, 2 - adds r0, r1 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - bge _0805D9CC - adds r0, r6, 0 - movs r1, 0x1 - bl refresh_graphics_maybe - adds r0, r6, 0 - bl sub_805E974 - movs r0, 0x1 - b _0805DA1E - .pool -_0805D9CC: - ldr r0, =gAnimBankAttacker - mov r2, r10 - strb r2, [r0] - ldr r0, =gAnimBankTarget - mov r1, sp - ldrb r1, [r1] - strb r1, [r0] - ldr r4, =gBattleSpritesDataPtr - ldr r0, [r4] - ldr r0, [r0, 0x8] - strh r7, [r0] - ldr r0, =gUnknown_082C9320 - adds r1, r5, 0 - movs r2, 0 - bl LaunchBattleAnimation - ldr r0, =task0A_0803415C - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r6, [r1, 0x8] - ldr r0, [r4] - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x20 - orrs r1, r2 - strb r1, [r0] - movs r0, 0 -_0805DA1E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end DoBattleAnimationFromTable - - thumb_func_start task0A_0803415C -task0A_0803415C: @ 805DA48 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gAnimScriptCallback - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gAnimScriptActive - ldrb r0, [r0] - cmp r0, 0 - bne _0805DA8A - ldr r0, =gBattleSpritesDataPtr - ldr r2, [r0] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x21 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_0805DA8A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_0803415C - - thumb_func_start sub_805DAA0 -sub_805DAA0: @ 805DAA0 - push {lr} - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xD - bgt _0805DAB4 - cmp r0, 0xA - bge _0805DAB8 - cmp r0, 0x2 - beq _0805DAB8 - b _0805DABC -_0805DAB4: - cmp r0, 0x11 - bne _0805DABC -_0805DAB8: - movs r0, 0x1 - b _0805DABE -_0805DABC: - movs r0, 0 -_0805DABE: - pop {r1} - bx r1 - thumb_func_end sub_805DAA0 - - thumb_func_start DoSpecialBattleAnimation -DoSpecialBattleAnimation: @ 805DAC4 - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gAnimBankAttacker - strb r1, [r0] - ldr r0, =gAnimBankTarget - strb r2, [r0] - ldr r0, =gUnknown_082C937C - adds r1, r3, 0 - movs r2, 0 - bl LaunchBattleAnimation - ldr r0, =task0A_08034248 - movs r1, 0xA - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - movs r2, 0x8 - ldrsh r1, [r1, r2] - ldr r2, [r0, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DoSpecialBattleAnimation - - thumb_func_start task0A_08034248 -task0A_08034248: @ 805DB34 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gAnimScriptCallback - ldr r0, [r0] - bl _call_via_r0 - ldr r0, =gAnimScriptActive - ldrb r0, [r0] - cmp r0, 0 - bne _0805DB76 - ldr r0, =gBattleSpritesDataPtr - ldr r2, [r0] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0x8 - ldrsh r0, [r0, r1] - ldr r2, [r2, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r2, [r1] - movs r0, 0x41 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyTask -_0805DB76: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end task0A_08034248 - - thumb_func_start IsMoveWithoutAnimation -IsMoveWithoutAnimation: @ 805DB8C - movs r0, 0 - bx lr - thumb_func_end IsMoveWithoutAnimation - - thumb_func_start mplay_80342A4 -mplay_80342A4: @ 805DB90 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - movs r5, 0 - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - beq _0805DBD8 - ldr r2, =gBattleSpritesDataPtr - ldr r0, [r2] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x8] - adds r1, 0x1 - strb r1, [r0, 0x8] - ldr r2, [r2] - ldr r0, =gActiveBank - ldrb r1, [r0] - ldr r2, [r2, 0x4] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r0, [r0, 0x8] - cmp r0, 0x1D - bls _0805DBDC - ldr r0, =gMPlay_SE1 - bl m4aMPlayStop - ldr r0, =gMPlay_SE2 - bl m4aMPlayStop -_0805DBD8: - cmp r5, 0 - beq _0805DBF0 -_0805DBDC: - movs r0, 0x1 - b _0805DC02 - .pool -_0805DBF0: - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r1, [r0, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - strb r5, [r0, 0x8] - movs r0, 0 -_0805DC02: - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end mplay_80342A4 - - thumb_func_start BattleLoadOpponentMonSpriteGfx -BattleLoadOpponentMonSpriteGfx: @ 805DC0C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl GetMonData - str r0, [sp] - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - adds r2, r1, r0 - ldrh r0, [r2, 0x2] - cmp r0, 0 - bne _0805DC50 - adds r0, r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - ldr r6, [sp] - b _0805DC58 - .pool -_0805DC50: - ldrh r5, [r2, 0x2] - ldr r0, =gTransformedPersonalities - adds r0, r1, r0 - ldr r6, [r0] -_0805DC58: - adds r0, r4, 0 - movs r1, 0x1 - bl GetMonData - mov r10, r0 - mov r0, r8 - bl GetBankIdentity - lsls r0, 24 - lsls r2, r5, 3 - ldr r1, =gMonFrontPicTable - adds r2, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - adds r2, r5, 0 - adds r3, r6, 0 - bl HandleLoadSpecialPokePic_DontHandleDeoxys - mov r3, r8 - lsls r2, r3, 4 - movs r0, 0x80 - lsls r0, 1 - adds r7, r2, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r3, 2 - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - str r1, [sp, 0x4] - mov r9, r2 - cmp r0, 0 - bne _0805DCBC - adds r0, r4, 0 - bl pokemon_get_pal - b _0805DCC6 - .pool -_0805DCBC: - adds r0, r5, 0 - mov r1, r10 - ldr r2, [sp] - bl species_and_otid_get_pal -_0805DCC6: - adds r6, r0, 0 - ldr r4, =0x0201c000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x20 - bl LoadPalette - mov r1, r9 - adds r1, 0x80 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =0x00000181 - cmp r5, r0 - bne _0805DD1A - movs r7, 0x80 - lsls r7, 1 - add r7, r9 - ldr r5, =gBattleStruct - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - adds r0, r6, 0 - bl LZDecompressWram - ldr r0, =gBattleMonForms - add r0, r8 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x20 - bl LoadPalette -_0805DD1A: - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - ldr r1, [sp, 0x4] - adds r0, r1, r0 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DD46 - ldr r3, =0x00007fff - adds r0, r7, 0 - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette - lsls r1, r7, 1 - ldr r0, =gPlttBufferFaded - adds r0, r1, r0 - ldr r2, =gPlttBufferUnfaded - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805DD46: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BattleLoadOpponentMonSpriteGfx - - thumb_func_start BattleLoadPlayerMonSpriteGfx -BattleLoadPlayerMonSpriteGfx: @ 805DD7C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x8 - adds r6, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - movs r1, 0 - bl GetMonData - str r0, [sp] - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - mov r2, r8 - lsls r1, r2, 2 - adds r2, r1, r0 - ldrh r0, [r2, 0x2] - cmp r0, 0 - bne _0805DDC0 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r5, r0, 16 - ldr r4, [sp] - b _0805DDC8 - .pool -_0805DDC0: - ldrh r5, [r2, 0x2] - ldr r0, =gTransformedPersonalities - adds r0, r1, r0 - ldr r4, [r0] -_0805DDC8: - adds r0, r6, 0 - movs r1, 0x1 - bl GetMonData - str r0, [sp, 0x4] - mov r0, r8 - bl GetBankIdentity - lsls r0, 24 - lsrs r7, r0, 24 - movs r0, 0x1 - mov r1, r8 - bl sub_80688F8 - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - lsls r1, 2 - mov r10, r1 - cmp r0, 0x1 - beq _0805DE00 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DE2C -_0805DE00: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsls r2, r7, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl HandleLoadSpecialPokePic_DontHandleDeoxys - b _0805DE46 - .pool -_0805DE2C: - lsls r0, r5, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsls r2, r7, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - adds r2, r5, 0 - adds r3, r4, 0 - bl HandleLoadSpecialPokePic -_0805DE46: - mov r2, r8 - lsls r1, r2, 4 - movs r0, 0x80 - lsls r0, 1 - adds r7, r1, r0 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - mov r9, r1 - cmp r0, 0 - bne _0805DE74 - adds r0, r6, 0 - bl pokemon_get_pal - b _0805DE7E - .pool -_0805DE74: - adds r0, r5, 0 - ldr r1, [sp, 0x4] - ldr r2, [sp] - bl species_and_otid_get_pal -_0805DE7E: - adds r6, r0, 0 - ldr r4, =0x0201c000 - adds r0, r6, 0 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r7, 0 - movs r2, 0x20 - bl LoadPalette - mov r1, r9 - adds r1, 0x80 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =0x00000181 - cmp r5, r0 - bne _0805DED2 - movs r7, 0x80 - lsls r7, 1 - add r7, r9 - ldr r5, =gBattleStruct - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - adds r0, r6, 0 - bl LZDecompressWram - ldr r0, =gBattleMonForms - add r0, r8 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r7, 0 - movs r2, 0x20 - bl LoadPalette -_0805DED2: - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - add r0, r10 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805DEFC - ldr r3, =0x00007fff - adds r0, r7, 0 - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette - lsls r1, r7, 1 - ldr r0, =gPlttBufferFaded - adds r0, r1, r0 - ldr r2, =gPlttBufferUnfaded - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805DEFC: - add sp, 0x8 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BattleLoadPlayerMonSpriteGfx - - thumb_func_start nullsub_23 -nullsub_23: @ 805DF30 - bx lr - thumb_func_end nullsub_23 - - thumb_func_start nullsub_24 -nullsub_24: @ 805DF34 - bx lr - thumb_func_end nullsub_24 - - thumb_func_start DecompressTrainerFrontPic -DecompressTrainerFrontPic: @ 805DF38 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - lsls r4, 16 - lsrs r4, 16 - lsls r0, 24 - lsrs r0, 24 - bl GetBankIdentity - lsls r0, 24 - lsls r4, 3 - ldr r2, =gTrainerFrontPicTable - adds r2, r4, r2 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - movs r2, 0 - bl DecompressPicFromTable_2 - ldr r0, =gTrainerFrontPicPaletteTable - adds r4, r0 - adds r0, r4, 0 - bl LoadCompressedObjectPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressTrainerFrontPic - - thumb_func_start DecompressTrainerBackPic -DecompressTrainerBackPic: @ 805DF84 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl GetBankIdentity - lsls r0, 24 - lsls r5, 3 - ldr r2, =gTrainerBackPicTable - adds r2, r5, r2 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsrs r0, 22 - adds r1, 0x4 - adds r1, r0 - ldr r1, [r1] - adds r0, r2, 0 - movs r2, 0 - bl DecompressPicFromTable_2 - ldr r0, =gTrainerBackPicPaletteTable - adds r5, r0 - ldr r0, [r5] - lsls r4, 20 - movs r1, 0x80 - lsls r1, 17 - adds r4, r1 - lsrs r4, 16 - adds r1, r4, 0 - movs r2, 0x20 - bl LoadCompressedPalette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end DecompressTrainerBackPic - - thumb_func_start nullsub_25 -nullsub_25: @ 805DFE0 - bx lr - thumb_func_end nullsub_25 - - thumb_func_start FreeTrainerFrontPicPalette -FreeTrainerFrontPicPalette: @ 805DFE4 - push {lr} - lsls r0, 16 - ldr r1, =gTrainerFrontPicPaletteTable - lsrs r0, 13 - adds r0, r1 - ldrh r0, [r0, 0x4] - bl FreeSpritePaletteByTag - pop {r0} - bx r0 - .pool - thumb_func_end FreeTrainerFrontPicPalette - - thumb_func_start sub_805DFFC -sub_805DFFC: @ 805DFFC - push {r4-r7,lr} - ldr r4, =gUnknown_0832C128 - adds r0, r4, 0 - bl LoadSpritePalette - adds r4, 0x8 - adds r0, r4, 0 - bl LoadSpritePalette - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - bne _0805E034 - ldr r0, =gUnknown_0832C0D0 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_0832C0D8 - bl LoadCompressedObjectPic - movs r5, 0x2 - b _0805E056 - .pool -_0805E034: - ldr r4, =gUnknown_0832C0E0 - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r0, r4, 0 - bl LoadCompressedObjectPic - ldr r4, =gUnknown_0832C0F0 - adds r0, r4, 0 - bl LoadCompressedObjectPic - adds r4, 0x8 - adds r0, r4, 0 - bl LoadCompressedObjectPic - movs r5, 0x4 -_0805E056: - movs r4, 0 - cmp r4, r5 - bcs _0805E076 - ldr r7, =gBanksByIdentity - ldr r6, =gUnknown_0832C108 -_0805E060: - adds r0, r4, r7 - ldrb r0, [r0] - lsls r0, 3 - adds r0, r6 - bl LoadCompressedObjectPic - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r5 - bcc _0805E060 -_0805E076: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805DFFC - - thumb_func_start BattleLoadAllHealthBoxesGfx -BattleLoadAllHealthBoxesGfx: @ 805E08C - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r6, 0 - cmp r4, 0 - bne _0805E09C - b _0805E1AE -_0805E09C: - cmp r4, 0x1 - bne _0805E0B8 - ldr r4, =gUnknown_0832C128 - adds r0, r4, 0 - bl LoadSpritePalette - adds r4, 0x8 - adds r0, r4, 0 - bl LoadSpritePalette - b _0805E1AE - .pool -_0805E0B8: - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - bne _0805E120 - cmp r4, 0x2 - bne _0805E0F0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0805E0E4 - ldr r0, =gUnknown_0832C100 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E0E4: - ldr r0, =gUnknown_0832C0D0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E0F0: - cmp r4, 0x3 - bne _0805E100 - ldr r0, =gUnknown_0832C0D8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E100: - cmp r4, 0x4 - bne _0805E110 - ldr r0, =gBanksByIdentity - ldrb r0, [r0] - b _0805E198 - .pool -_0805E110: - cmp r4, 0x5 - bne _0805E1AC - ldr r0, =gBanksByIdentity - ldrb r0, [r0, 0x1] - b _0805E198 - .pool -_0805E120: - cmp r4, 0x2 - bne _0805E130 - ldr r0, =gUnknown_0832C0E0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E130: - cmp r4, 0x3 - bne _0805E140 - ldr r0, =gUnknown_0832C0E8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E140: - cmp r4, 0x4 - bne _0805E150 - ldr r0, =gUnknown_0832C0F0 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E150: - cmp r4, 0x5 - bne _0805E160 - ldr r0, =gUnknown_0832C0F8 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E160: - cmp r4, 0x6 - bne _0805E170 - ldr r0, =gBanksByIdentity - ldrb r0, [r0] - b _0805E198 - .pool -_0805E170: - cmp r4, 0x7 - bne _0805E180 - ldr r0, =gBanksByIdentity - ldrb r0, [r0, 0x1] - b _0805E198 - .pool -_0805E180: - cmp r4, 0x8 - bne _0805E190 - ldr r0, =gBanksByIdentity - ldrb r0, [r0, 0x2] - b _0805E198 - .pool -_0805E190: - cmp r5, 0x9 - bne _0805E1AC - ldr r0, =gBanksByIdentity - ldrb r0, [r0, 0x3] -_0805E198: - lsls r0, 3 - ldr r1, =gUnknown_0832C108 - adds r0, r1 - bl LoadCompressedObjectPic - b _0805E1AE - .pool -_0805E1AC: - movs r6, 0x1 -_0805E1AE: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end BattleLoadAllHealthBoxesGfx - - thumb_func_start LoadBattleBarGfx -LoadBattleBarGfx: @ 805E1B8 - push {lr} - ldr r0, =gUnknown_08C093F0 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - movs r2, 0xBA - lsls r2, 1 - adds r1, r2 - ldr r1, [r1] - bl LZDecompressWram - pop {r0} - bx r0 - .pool - thumb_func_end LoadBattleBarGfx - - thumb_func_start BattleInitAllSprites -BattleInitAllSprites: @ 805E1D8 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r6, 0 - ldrb r0, [r5] - cmp r0, 0x6 - bls _0805E1E8 - b _0805E346 -_0805E1E8: - lsls r0, 2 - ldr r1, =_0805E1F8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0805E1F8: - .4byte _0805E214 - .4byte _0805E21A - .4byte _0805E324 - .4byte _0805E230 - .4byte _0805E260 - .4byte _0805E29C - .4byte _0805E33C -_0805E214: - bl sub_805E378 - b _0805E324 -_0805E21A: - ldrb r0, [r4] - bl BattleLoadAllHealthBoxesGfx - lsls r0, 24 - cmp r0, 0 - beq _0805E228 - b _0805E320 -_0805E228: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - b _0805E346 -_0805E230: - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0805E24C - ldrb r0, [r4] - cmp r0, 0 - bne _0805E24C - bl CreateSafariPlayerHealthboxSprites - b _0805E252 - .pool -_0805E24C: - ldrb r0, [r4] - bl CreateBankHealthboxSprites -_0805E252: - ldr r2, =gHealthBoxesIds - ldrb r1, [r4] - adds r1, r2 - strb r0, [r1] - b _0805E30E - .pool -_0805E260: - ldrb r0, [r4] - bl SetBankHealthboxSpritePos - ldr r0, =gBanksByIdentity - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - cmp r0, 0x1 - bhi _0805E288 - ldr r0, =gHealthBoxesIds - adds r0, r1, r0 - ldrb r0, [r0] - movs r1, 0 - bl DummyBattleInterfaceFunc - b _0805E30E - .pool -_0805E288: - ldr r0, =gHealthBoxesIds - adds r0, r1, r0 - ldrb r0, [r0] - movs r1, 0x1 - bl DummyBattleInterfaceFunc - b _0805E30E - .pool -_0805E29C: - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0805E2E4 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0805E302 - ldr r0, =gHealthBoxesIds - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gPlayerParty - adds r1, r2 - movs r2, 0 - bl UpdateHealthboxAttribute - b _0805E302 - .pool -_0805E2E4: - ldr r0, =gHealthBoxesIds - ldrb r1, [r4] - adds r0, r1, r0 - ldrb r0, [r0] - ldr r2, =gBattlePartyID - lsls r1, 1 - adds r1, r2 - ldrh r2, [r1] - movs r1, 0x64 - muls r1, r2 - ldr r2, =gEnemyParty - adds r1, r2 - movs r2, 0 - bl UpdateHealthboxAttribute -_0805E302: - ldr r1, =gHealthBoxesIds - ldrb r0, [r4] - adds r0, r1 - ldrb r0, [r0] - bl SetHealthboxSpriteInvisible -_0805E30E: - ldrb r0, [r4] - adds r0, 0x1 - strb r0, [r4] - ldr r1, =gNoOfAllBanks - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1] - cmp r0, r1 - bne _0805E346 -_0805E320: - movs r0, 0 - strb r0, [r4] -_0805E324: - ldrb r0, [r5] - adds r0, 0x1 - strb r0, [r5] - b _0805E346 - .pool -_0805E33C: - bl LoadAndCreateEnemyShadowSprites - bl sub_81B8C68 - movs r6, 0x1 -_0805E346: - adds r0, r6, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end BattleInitAllSprites - - thumb_func_start sub_805E350 -sub_805E350: @ 805E350 - push {r4,lr} - ldr r4, =gBattleSpritesDataPtr - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0 - movs r2, 0x30 - bl memset - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E350 - - thumb_func_start sub_805E378 -sub_805E378: @ 805E378 - push {lr} - bl sub_805E350 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - movs r1, 0 - movs r2, 0x10 - bl memset - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E378 - - thumb_func_start sub_805E394 -sub_805E394: @ 805E394 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r4, 0 - ldr r5, =gNoOfAllBanks - ldrb r0, [r5] - cmp r4, r0 - bge _0805E3EA - ldr r0, =gSprites - mov r9, r0 - movs r0, 0x1 - mov r12, r0 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ldr r7, =gBattleSpritesDataPtr - ldr r6, =gBankSpriteIds -_0805E3B8: - ldr r0, [r7] - ldr r0, [r0] - lsls r3, r4, 2 - adds r3, r0 - adds r0, r4, r6 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r9 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - mov r0, r12 - ands r1, r0 - ldrb r2, [r3] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - adds r4, 0x1 - ldrb r0, [r5] - cmp r4, r0 - blt _0805E3B8 -_0805E3EA: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E394 - - thumb_func_start CopyBattleSpriteInvisibility -CopyBattleSpriteInvisibility: @ 805E408 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gBattleSpritesDataPtr - ldr r1, [r1] - ldr r1, [r1] - lsls r3, r0, 2 - adds r3, r1 - ldr r2, =gSprites - ldr r1, =gBankSpriteIds - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r1, [r0] - lsls r1, 29 - lsrs r1, 31 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - bx lr - .pool - thumb_func_end CopyBattleSpriteInvisibility - - thumb_func_start sub_805E448 -sub_805E448: @ 805E448 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r1, 24 - str r1, [sp] - lsls r2, 24 - cmp r2, 0 - beq _0805E51C - ldr r0, =gBankSpriteIds - adds r5, r7, r0 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - mov r8, r1 - add r0, r8 - ldr r4, =gBattleSpritesDataPtr - ldr r1, [r4] - ldr r1, [r1, 0x8] - ldrb r1, [r1] - bl StartSpriteAnim - lsls r0, r7, 20 - movs r2, 0x80 - lsls r2, 17 - adds r0, r2 - lsrs r6, r0, 16 - ldr r2, =gBattleStruct - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrh r1, [r0] - lsls r1, 5 - movs r3, 0x80 - lsls r3, 1 - adds r1, r3 - ldr r0, [r2] - adds r0, r1 - adds r1, r6, 0 - movs r2, 0x20 - bl LoadPalette - ldr r1, =gBattleMonForms - adds r1, r7, r1 - ldr r0, [r4] - ldr r0, [r0, 0x8] - ldrh r0, [r0] - strb r0, [r1] - ldr r0, [r4] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - ldrh r0, [r0, 0x2] - cmp r0, 0 - beq _0805E4DE - ldr r3, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette - lsls r1, r6, 1 - ldr r0, =gPlttBufferFaded - adds r0, r1, r0 - ldr r2, =gPlttBufferUnfaded - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet -_0805E4DE: - adds r0, r7, 0 - bl sub_80A6138 - ldrb r2, [r5] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - add r1, r8 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x22] - b _0805E77A - .pool -_0805E51C: - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0805E558 - movs r0, 0 - mov r10, r0 - ldr r0, =gContestResources - ldr r0, [r0] - ldr r2, [r0, 0x18] - ldrh r1, [r2, 0x2] - mov r8, r1 - ldr r3, [r2, 0x8] - mov r9, r3 - ldr r4, [r2, 0xC] - lsls r0, r1, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - ldr r1, [r1, 0x4] - ldr r3, [r2, 0x10] - b _0805E5FA - .pool -_0805E558: - adds r0, r7, 0 - bl GetBankIdentity - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - ldr r0, [sp] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805E58C - ldr r1, =gBattlePartyID - ldr r2, [sp] - lsls r0, r2, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - b _0805E59C - .pool -_0805E58C: - ldr r1, =gBattlePartyID - ldr r3, [sp] - lsls r0, r3, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty -_0805E59C: - adds r0, r1 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - mov r8, r0 - adds r0, r7, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - bne _0805E618 - ldr r0, =gBattlePartyID - lsls r4, r7, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gPlayerParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - adds r4, r0, 0 - mov r1, r8 - lsls r0, r1, 3 - ldr r1, =gMonBackPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - mov r3, r10 - lsls r2, r3, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - ldr r3, =gTransformedPersonalities - lsls r2, r7, 2 - adds r2, r3 - ldr r3, [r2] -_0805E5FA: - mov r2, r8 - bl HandleLoadSpecialPokePic_DontHandleDeoxys - b _0805E662 - .pool -_0805E618: - ldr r0, =gBattlePartyID - lsls r4, r7, 1 - adds r4, r0 - ldrh r0, [r4] - movs r6, 0x64 - muls r0, r6 - ldr r5, =gEnemyParty - adds r0, r5 - movs r1, 0 - bl GetMonData - mov r9, r0 - ldrh r0, [r4] - muls r0, r6 - adds r0, r5 - movs r1, 0x1 - bl GetMonData - adds r4, r0, 0 - mov r1, r8 - lsls r0, r1, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - mov r3, r10 - lsls r2, r3, 2 - adds r1, 0x4 - adds r1, r2 - ldr r1, [r1] - ldr r3, =gTransformedPersonalities - lsls r2, r7, 2 - adds r2, r3 - ldr r3, [r2] - mov r2, r8 - bl HandleLoadSpecialPokePic_DontHandleDeoxys -_0805E662: - ldr r0, =gMonSpritesGfxPtr - ldr r0, [r0] - mov r2, r10 - lsls r1, r2, 2 - adds r0, 0x4 - adds r0, r1 - ldr r2, [r0] - ldr r0, =gBankSpriteIds - adds r0, r7 - mov r10, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r3, =gSprites - adds r0, r3 - ldrh r0, [r0, 0x4] - lsls r0, 22 - lsrs r0, 17 - ldr r1, =0x06010000 - adds r0, r1 - ldr r1, =0x040000d4 - str r2, [r1] - str r0, [r1, 0x4] - ldr r0, =0x84000200 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - lsls r0, r7, 20 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r6, r0, 16 - mov r0, r8 - adds r1, r4, 0 - mov r2, r9 - bl species_and_otid_get_pal - mov r9, r0 - ldr r4, =0x0201c000 - adds r1, r4, 0 - bl LZDecompressWram - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =0x00000181 - cmp r8, r0 - bne _0805E70A - mov r2, r10 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r1, 0x8 - adds r0, r1 - ldr r1, =gMonAnimationsSpriteAnimsPtrTable - mov r3, r8 - lsls r2, r3, 2 - adds r1, r2 - ldr r1, [r1] - str r1, [r0] - ldr r5, =gBattleStruct - ldr r1, [r5] - movs r4, 0x80 - lsls r4, 1 - adds r1, r4 - mov r0, r9 - bl LZDecompressWram - ldr r0, =gBattleMonForms - ldr r1, [sp] - adds r0, r1, r0 - ldrb r1, [r0] - lsls r1, 5 - adds r1, r4 - ldr r0, [r5] - adds r0, r1 - adds r1, r6, 0 - movs r2, 0x20 - bl LoadPalette -_0805E70A: - ldr r3, =0x00007fff - adds r0, r6, 0 - movs r1, 0x10 - movs r2, 0x6 - bl BlendPalette - lsls r1, r6, 1 - ldr r0, =gPlttBufferFaded - adds r0, r1, r0 - ldr r2, =gPlttBufferUnfaded - adds r1, r2 - ldr r2, =0x04000008 - bl CpuSet - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0805E74A - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r1, [r0] - lsls r0, r7, 2 - adds r0, r1 - mov r2, r8 - strh r2, [r0, 0x2] - ldr r0, =gBattleMonForms - adds r1, r7, r0 - ldr r3, [sp] - adds r0, r3, r0 - ldrb r0, [r0] - strb r0, [r1] -_0805E74A: - adds r0, r7, 0 - bl sub_80A6138 - mov r1, r10 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - ldr r2, =gSprites - adds r1, r2 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r1, 0x22] - mov r3, r10 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldr r1, =gBattleMonForms - adds r1, r7, r1 - ldrb r1, [r1] - bl StartSpriteAnim -_0805E77A: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805E448 - - thumb_func_start BattleLoadSubstituteSpriteGfx -BattleLoadSubstituteSpriteGfx: @ 805E7DC - push {r4-r7,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - lsls r1, 24 - cmp r1, 0 - bne _0805E898 - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0805E7F8 - movs r4, 0 - b _0805E802 -_0805E7F8: - adds r0, r4, 0 - bl GetBankIdentity - lsls r0, 24 - lsrs r4, r0, 24 -_0805E802: - bl IsContest - lsls r0, 24 - cmp r0, 0 - beq _0805E814 - ldr r0, =gUnknown_08C2D120 - b _0805E822 - .pool -_0805E814: - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0805E83C - ldr r0, =gUnknown_08C2CEE0 -_0805E822: - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x4 - adds r1, r4 - ldr r1, [r1] - bl LZDecompressVram - b _0805E84E - .pool -_0805E83C: - ldr r0, =gUnknown_08C2D120 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - lsls r4, 2 - adds r1, 0x4 - adds r1, r4 - ldr r1, [r1] - bl LZDecompressVram -_0805E84E: - movs r3, 0x1 - lsls r6, r5, 4 - ldr r7, =gUnknown_08C2CEBC - ldr r0, =gMonSpritesGfxPtr - ldr r0, [r0] - adds r0, 0x4 - adds r4, r0, r4 - ldr r2, =0x040000d4 - ldr r5, =0x84000200 -_0805E860: - ldr r0, [r4] - lsls r1, r3, 11 - adds r1, r0, r1 - str r0, [r2] - str r1, [r2, 0x4] - str r5, [r2, 0x8] - ldr r0, [r2, 0x8] - adds r3, 0x1 - cmp r3, 0x3 - ble _0805E860 - movs r0, 0x80 - lsls r0, 1 - adds r1, r6, r0 - adds r0, r7, 0 - movs r2, 0x20 - bl LoadCompressedPalette - b _0805E8E6 - .pool -_0805E898: - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0805E8E6 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0805E8D0 - ldr r1, =gBattlePartyID - lsls r0, r4, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gEnemyParty - adds r0, r1 - adds r1, r4, 0 - bl BattleLoadOpponentMonSpriteGfx - b _0805E8E6 - .pool -_0805E8D0: - ldr r1, =gBattlePartyID - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - adds r1, r5, 0 - bl BattleLoadPlayerMonSpriteGfx -_0805E8E6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end BattleLoadSubstituteSpriteGfx - - thumb_func_start refresh_graphics_maybe -refresh_graphics_maybe: @ 805E8F4 - push {r4-r6,lr} - adds r5, r1, 0 - adds r4, r2, 0 - lsls r0, 24 - lsrs r6, r0, 24 - lsls r5, 24 - lsrs r5, 24 - lsls r4, 24 - lsrs r4, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl BattleLoadSubstituteSpriteGfx - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r4, r0, r1 - ldr r0, =gBattleMonForms - adds r0, r6, r0 - ldrb r1, [r0] - adds r0, r4, 0 - bl StartSpriteAnim - cmp r5, 0 - bne _0805E938 - adds r0, r6, 0 - bl sub_80A614C - b _0805E93E - .pool -_0805E938: - adds r0, r6, 0 - bl sub_80A6138 -_0805E93E: - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end refresh_graphics_maybe - - thumb_func_start TrySetBehindSubstituteSpriteBit -TrySetBehindSubstituteSpriteBit: @ 805E94C - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0xA4 - bne _0805E96C - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0] - lsls r1, r2, 2 - adds r1, r0 - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] -_0805E96C: - pop {r0} - bx r0 - .pool - thumb_func_end TrySetBehindSubstituteSpriteBit - - thumb_func_start sub_805E974 -sub_805E974: @ 805E974 - lsls r0, 24 - ldr r1, =gBattleSpritesDataPtr - ldr r1, [r1] - ldr r1, [r1] - lsrs r0, 22 - adds r0, r1 - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_805E974 - - thumb_func_start sub_805E990 -sub_805E990: @ 805E990 - push {r4-r7,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r6, r1, 24 - adds r7, r6, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl GetHPBarLevel - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _0805EA08 - ldr r7, =gBattleSpritesDataPtr - ldr r0, [r7] - ldr r2, [r0] - lsls r4, r6, 2 - adds r0, r4, r2 - ldrb r1, [r0] - movs r5, 0x2 - movs r3, 0x2 - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EA5A - adds r0, r6, 0 - eors r0, r5 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _0805E9F6 - movs r0, 0x5A - bl PlaySE -_0805E9F6: - ldr r0, [r7] - ldr r1, [r0] - adds r1, r4, r1 - ldrb r0, [r1] - orrs r0, r5 - strb r0, [r1] - b _0805EA5A - .pool -_0805EA08: - ldr r4, =gBattleSpritesDataPtr - ldr r0, [r4] - ldr r0, [r0] - lsls r1, r6, 2 - adds r1, r0 - ldrb r2, [r1] - movs r0, 0x3 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - bne _0805EA34 - movs r0, 0x5A - bl m4aSongNumStop - b _0805EA5A - .pool -_0805EA34: - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - beq _0805EA5A - ldr r1, [r4] - movs r0, 0x2 - eors r7, r0 - ldr r1, [r1] - lsls r0, r7, 2 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _0805EA5A - movs r0, 0x5A - bl m4aSongNumStop -_0805EA5A: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_805E990 - - thumb_func_start BattleMusicStop -BattleMusicStop: @ 805EA60 - push {r4-r6,lr} - movs r0, 0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r4, r0, 24 - ldr r5, =gBattleSpritesDataPtr - ldr r0, [r5] - ldr r0, [r0] - lsls r1, r4, 2 - adds r1, r0 - ldrb r2, [r1] - movs r6, 0x3 - negs r6, r6 - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - beq _0805EAA2 - ldr r2, [r5] - movs r0, 0x2 - adds r1, r4, 0 - eors r1, r0 - ldr r0, [r2] - lsls r1, 2 - adds r1, r0 - ldrb r2, [r1] - adds r0, r6, 0 - ands r0, r2 - strb r0, [r1] -_0805EAA2: - movs r0, 0x5A - bl m4aSongNumStop - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end BattleMusicStop - - thumb_func_start sub_805EAB4 -sub_805EAB4: @ 805EAB4 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl GetHPBarLevel - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_805EAB4 - - thumb_func_start sub_805EAE8 -sub_805EAE8: @ 805EAE8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _0805EB7E - movs r0, 0 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r0, 0x2 - bl GetBankByIdentity - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r5, =gBattlePartyID - mov r1, r8 - lsls r0, r1, 1 - adds r0, r5 - ldrb r0, [r0] - bl pokemon_order_func - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - mov r1, r9 - lsls r0, r1, 1 - adds r0, r5 - ldrb r0, [r0] - bl pokemon_order_func - lsls r0, 24 - lsrs r5, r0, 24 - movs r7, 0x64 - adds r0, r4, 0 - muls r0, r7 - ldr r6, =gPlayerParty - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _0805EB5A - adds r0, r4, 0 - mov r1, r8 - bl sub_805E990 -_0805EB5A: - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - beq _0805EB7E - adds r0, r5, 0 - muls r0, r7 - adds r4, r0, r6 - adds r0, r4, 0 - movs r1, 0x39 - bl GetMonData - cmp r0, 0 - beq _0805EB7E - adds r0, r4, 0 - mov r1, r9 - bl sub_805E990 -_0805EB7E: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EAE8 - - thumb_func_start sub_805EB9C -sub_805EB9C: @ 805EB9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r5, 0 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - bge _0805EC6C - movs r0, 0x3 - mov r10, r8 - mov r1, r10 - ands r1, r0 - mov r10, r1 - movs r6, 0 - movs r2, 0x3F - negs r2, r2 - mov r9, r2 -_0805EBC8: - lsls r0, r5, 24 - lsrs r0, 24 - bl IsBankSpritePresent - lsls r0, 24 - cmp r0, 0 - beq _0805EC60 - ldr r4, =gSprites - ldr r0, =gBankSpriteIds - adds r3, r5, r0 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x1] - movs r7, 0x4 - negs r7, r7 - adds r2, r7, 0 - ands r1, r2 - mov r2, r10 - orrs r1, r2 - strb r1, [r0, 0x1] - mov r7, r8 - cmp r7, 0 - bne _0805EC3C - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r2, [r0, 0x4] - adds r2, r6, r2 - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - strb r0, [r2, 0x6] - ldrb r1, [r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x3] - mov r2, r9 - ands r1, r2 - strb r1, [r0, 0x3] - b _0805EC60 - .pool -_0805EC3C: - ldrb r0, [r3] - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r4 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r0, [r0, 0x4] - adds r0, r6, r0 - ldrb r1, [r0, 0x6] - movs r0, 0x1F - ands r1, r0 - lsls r1, 1 - ldrb r0, [r2, 0x3] - mov r3, r9 - ands r0, r3 - orrs r0, r1 - strb r0, [r2, 0x3] -_0805EC60: - adds r6, 0xC - adds r5, 0x1 - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r5, r0 - blt _0805EBC8 -_0805EC6C: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EB9C - - thumb_func_start LoadAndCreateEnemyShadowSprites -LoadAndCreateEnemyShadowSprites: @ 805EC84 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_0831C6A0 - bl LoadCompressedObjectPic - movs r0, 0x1 - bl GetBankByIdentity - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - ldr r0, =gUnknown_0831C6B0 - mov r8, r0 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 8 - movs r0, 0xE8 - lsls r0, 13 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0xC8 - bl CreateSprite - ldr r6, =gBattleSpritesDataPtr - ldr r1, [r6] - ldr r2, [r1, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r2 - strb r0, [r2, 0x7] - ldr r7, =gSprites - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x2E] - bl IsDoubleBattle - lsls r0, 24 - cmp r0, 0 - beq _0805ED56 - movs r0, 0x3 - bl GetBankByIdentity - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r5, 0 - movs r1, 0 - bl sub_80A5C6C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - movs r1, 0x1 - bl sub_80A5C6C - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 8 - movs r0, 0xE8 - lsls r0, 13 - adds r2, r0 - asrs r2, 16 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0xC8 - bl CreateSprite - ldr r1, [r6] - ldr r2, [r1, 0x4] - lsls r1, r5, 1 - adds r1, r5 - lsls r1, 2 - adds r2, r1, r2 - strb r0, [r2, 0x7] - ldr r0, [r6] - ldr r0, [r0, 0x4] - adds r1, r0 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - strh r5, [r0, 0x2E] -_0805ED56: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end LoadAndCreateEnemyShadowSprites - - thumb_func_start sub_805ED70 -@ int sub_805ED70(obj *a1) -sub_805ED70: @ 805ED70 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - movs r0, 0 - mov r8, r0 - ldrh r0, [r5, 0x2E] - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gBankSpriteIds - adds r0, r4, r0 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r7, r0, r1 - adds r6, r7, 0 - adds r6, 0x3E - ldrb r1, [r6] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0805EDAC - adds r0, r4, 0 - bl IsBankSpritePresent - lsls r0, 24 - cmp r0, 0 - bne _0805EDC0 -_0805EDAC: - ldr r0, =sub_805EE48 - str r0, [r5, 0x1C] - b _0805EE36 - .pool -_0805EDC0: - ldr r0, =gAnimScriptActive - ldrb r0, [r0] - cmp r0, 0 - bne _0805EDD2 - ldrb r1, [r6] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805EDE4 -_0805EDD2: - movs r0, 0x1 - mov r8, r0 - ldr r2, =gBattleSpritesDataPtr - lsls r4, 2 - b _0805EE06 - .pool -_0805EDE4: - ldr r2, =gBattleSpritesDataPtr - ldr r0, [r2] - ldr r0, [r0] - lsls r1, r4, 2 - adds r3, r1, r0 - ldrh r0, [r3, 0x2] - adds r4, r1, 0 - cmp r0, 0 - beq _0805EE06 - ldr r0, =gEnemyMonElevation - ldrh r1, [r3, 0x2] - adds r1, r0 - ldrb r0, [r1] - cmp r0, 0 - bne _0805EE06 - movs r0, 0x1 - mov r8, r0 -_0805EE06: - ldr r0, [r2] - ldr r0, [r0] - adds r0, r4, r0 - ldrb r1, [r0] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0805EE1A - movs r0, 0x1 - mov r8, r0 -_0805EE1A: - ldrh r0, [r7, 0x20] - strh r0, [r5, 0x20] - ldrh r0, [r7, 0x24] - strh r0, [r5, 0x24] - adds r2, r5, 0 - adds r2, 0x3E - mov r0, r8 - lsls r3, r0, 2 - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - orrs r0, r3 - strb r0, [r2] -_0805EE36: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805ED70 - - thumb_func_start sub_805EE48 -sub_805EE48: @ 805EE48 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - bx lr - thumb_func_end sub_805EE48 - - thumb_func_start SetBankEnemyShadowSpriteCallback -SetBankEnemyShadowSpriteCallback: @ 805EE54 - push {r4-r6,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r6, r4, 0 - lsls r1, 16 - lsrs r5, r1, 16 - adds r0, r4, 0 - bl GetBankSide - lsls r0, 24 - cmp r0, 0 - beq _0805EED0 - ldr r0, =gBattleSpritesDataPtr - ldr r3, [r0] - ldr r1, [r3] - lsls r0, r4, 2 - adds r1, r0, r1 - ldrh r0, [r1, 0x2] - cmp r0, 0 - beq _0805EE7E - adds r5, r0, 0 -_0805EE7E: - ldr r0, =gEnemyMonElevation - adds r0, r5, r0 - ldrb r0, [r0] - cmp r0, 0 - beq _0805EEB4 - ldr r2, =gSprites - ldr r1, [r3, 0x4] - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805ED70 - b _0805EECE - .pool -_0805EEB4: - ldr r2, =gSprites - ldr r1, [r3, 0x4] - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 2 - adds r0, r1 - ldrb r1, [r0, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805EE48 -_0805EECE: - str r1, [r0] -_0805EED0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SetBankEnemyShadowSpriteCallback - - thumb_func_start sub_805EEE0 -sub_805EEE0: @ 805EEE0 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - ldr r1, =gBattleSpritesDataPtr - ldr r1, [r1] - ldr r3, [r1, 0x4] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 2 - adds r1, r3 - ldrb r1, [r1, 0x7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, =sub_805EE48 - str r1, [r0] - bx lr - .pool - thumb_func_end sub_805EEE0 - - thumb_func_start sub_805EF14 -sub_805EF14: @ 805EF14 - push {r4-r6,lr} - ldr r3, =0x06000240 - movs r0, 0 - movs r6, 0xF0 - lsls r6, 8 -_0805EF1E: - adds r5, r0, 0x1 - movs r4, 0xF -_0805EF22: - ldrh r1, [r3] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EF32 - adds r0, r6, 0 - orrs r0, r1 - strh r0, [r3] -_0805EF32: - ldrh r1, [r3] - movs r2, 0xF0 - lsls r2, 4 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0805EF46 - adds r0, r2, 0 - orrs r0, r1 - strh r0, [r3] -_0805EF46: - ldrh r1, [r3] - movs r2, 0xF0 - movs r0, 0xF0 - ands r0, r1 - cmp r0, 0 - bne _0805EF58 - adds r0, r1, 0 - orrs r0, r2 - strh r0, [r3] -_0805EF58: - ldrh r1, [r3] - movs r2, 0xF - movs r0, 0xF - ands r0, r1 - cmp r0, 0 - bne _0805EF6A - adds r0, r1, 0 - orrs r0, r2 - strh r0, [r3] -_0805EF6A: - adds r3, 0x2 - subs r4, 0x1 - cmp r4, 0 - bge _0805EF22 - adds r0, r5, 0 - cmp r0, 0x8 - ble _0805EF1E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_805EF14 - - thumb_func_start ClearTemporarySpeciesSpriteData -ClearTemporarySpeciesSpriteData: @ 805EF84 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r0, =gBattleSpritesDataPtr - ldr r0, [r0] - ldr r2, [r0] - lsls r0, r4, 2 - adds r0, r2 - movs r3, 0 - movs r2, 0 - strh r2, [r0, 0x2] - ldr r0, =gBattleMonForms - adds r0, r4, r0 - strb r3, [r0] - cmp r1, 0 - bne _0805EFAC - adds r0, r4, 0 - bl sub_805E974 -_0805EFAC: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end ClearTemporarySpeciesSpriteData - - thumb_func_start AllocateMonSpritesGfx -AllocateMonSpritesGfx: @ 805EFBC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r6, 0 - ldr r4, =gMonSpritesGfxPtr - str r6, [r4] - movs r0, 0xC0 - lsls r0, 1 - bl AllocZeroed - str r0, [r4] - movs r0, 0x80 - lsls r0, 8 - bl AllocZeroed - ldr r1, [r4] - str r0, [r1] -_0805EFE2: - ldr r0, =gMonSpritesGfxPtr - ldr r1, [r0] - lsls r4, r6, 2 - adds r2, r1, 0x4 - adds r2, r4 - lsls r3, r6, 13 - ldr r0, [r1] - adds r0, r3 - str r0, [r2] - lsls r3, r6, 1 - adds r0, r3, r6 - lsls r0, 3 - adds r1, r0, r1 - ldr r2, =gUnknown_08329D98 - adds r1, 0x14 - adds r0, r2 - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - ldm r0!, {r2,r5,r7} - stm r1!, {r2,r5,r7} - movs r5, 0 - mov r9, r3 - lsls r0, r6, 5 - mov r8, r0 - adds r1, r6, 0x1 - mov r10, r1 - mov r12, r8 - adds r7, r4, 0 -_0805F01A: - ldr r2, =gMonSpritesGfxPtr - ldr r1, [r2] - lsls r4, r5, 3 - add r4, r12 - adds r3, r1, 0 - adds r3, 0x74 - adds r3, r4 - adds r0, r1, 0x4 - adds r0, r7 - lsls r2, r5, 11 - ldr r0, [r0] - adds r0, r2 - str r0, [r3] - adds r1, r4 - adds r1, 0x78 - movs r0, 0x80 - lsls r0, 4 - strh r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _0805F01A - ldr r1, =gMonSpritesGfxPtr - ldr r2, [r1] - mov r5, r9 - adds r0, r5, r6 - lsls r0, 3 - adds r1, r2, 0 - adds r1, 0x20 - adds r1, r0 - mov r0, r8 - adds r0, 0x74 - adds r2, r0 - str r2, [r1] - mov r7, r10 - lsls r0, r7, 24 - lsrs r6, r0, 24 - cmp r6, 0x3 - bls _0805EFE2 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - movs r2, 0xBA - lsls r2, 1 - adds r1, r2 - str r0, [r1] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end AllocateMonSpritesGfx - - thumb_func_start FreeMonSpritesGfx -FreeMonSpritesGfx: @ 805F094 - push {r4-r6,lr} - ldr r6, =gMonSpritesGfxPtr - ldr r0, [r6] - cmp r0, 0 - beq _0805F106 - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0805F0BA - bl Free - ldr r0, [r6] - movs r1, 0xBE - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0805F0BA: - ldr r0, [r6] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _0805F0D8 - bl Free - ldr r0, [r6] - movs r1, 0xBC - lsls r1, 1 - adds r0, r1 - movs r1, 0 - str r1, [r0] -_0805F0D8: - ldr r0, [r6] - movs r5, 0xBA - lsls r5, 1 - adds r0, r5 - ldr r0, [r0] - bl Free - ldr r0, [r6] - adds r5, r0, r5 - movs r4, 0 - str r4, [r5] - ldr r0, [r0] - bl Free - ldr r0, [r6] - str r4, [r0] - str r4, [r0, 0x4] - str r4, [r0, 0x8] - str r4, [r0, 0xC] - str r4, [r0, 0x10] - bl Free - str r4, [r6] -_0805F106: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end FreeMonSpritesGfx - - thumb_func_start sub_805F110 -sub_805F110: @ 805F110 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x37 - bl GetMonData - ldr r1, =0x00000fff - ands r1, r0 - cmp r1, 0 - bne _0805F158 - adds r0, r5, 0 - movs r1, 0x39 - bl GetMonData - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - movs r1, 0x3A - bl GetMonData - adds r1, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl GetHPBarLevel - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - ble _0805F158 - movs r0, 0x1 - b _0805F15A - .pool -_0805F158: - movs r0, 0 -_0805F15A: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_805F110 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/battle_anim_80A5C6C.s b/asm/battle_anim_80A5C6C.s index 705146ce5..158da2a02 100644 --- a/asm/battle_anim_80A5C6C.s +++ b/asm/battle_anim_80A5C6C.s @@ -586,8 +586,8 @@ _080A612E: bx r1 thumb_func_end sub_80A60AC - thumb_func_start sub_80A6138 -sub_80A6138: @ 80A6138 + thumb_func_start GetBankSpriteDefault_Y +GetBankSpriteDefault_Y: @ 80A6138 push {lr} lsls r0, 24 lsrs r0, 24 @@ -597,10 +597,10 @@ sub_80A6138: @ 80A6138 lsrs r0, 24 pop {r1} bx r1 - thumb_func_end sub_80A6138 + thumb_func_end GetBankSpriteDefault_Y - thumb_func_start sub_80A614C -sub_80A614C: @ 80A614C + thumb_func_start GetSubstituteSpriteDefault_Y +GetSubstituteSpriteDefault_Y: @ 80A614C push {r4,lr} lsls r0, 24 lsrs r4, r0, 24 @@ -633,7 +633,7 @@ _080A6180: pop {r4} pop {r1} bx r1 - thumb_func_end sub_80A614C + thumb_func_end GetSubstituteSpriteDefault_Y thumb_func_start sub_80A6190 sub_80A6190: @ 80A6190 @@ -5180,7 +5180,7 @@ _080A8412: adds r0, r6, 0 ldr r1, [sp, 0x3C] mov r2, r8 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality lsls r1, r5, 20 movs r2, 0x80 lsls r2, 17 @@ -5243,7 +5243,7 @@ _080A84B0: adds r0, r6, 0 ldr r1, [sp, 0x3C] mov r2, r8 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality lsls r1, r5, 20 movs r3, 0x80 lsls r3, 17 diff --git a/asm/battle_anim_80A9C70.s b/asm/battle_anim_80A9C70.s index 681802e12..d27852961 100644 --- a/asm/battle_anim_80A9C70.s +++ b/asm/battle_anim_80A9C70.s @@ -855,8 +855,8 @@ _080AA352: .pool thumb_func_end sub_80AA18C - thumb_func_start move_anim_start_t2 -move_anim_start_t2: @ 80AA364 + thumb_func_start LaunchStatusAnimation +LaunchStatusAnimation: @ 80AA364 push {r4,lr} adds r4, r0, 0 lsls r4, 24 @@ -885,7 +885,7 @@ move_anim_start_t2: @ 80AA364 pop {r0} bx r0 .pool - thumb_func_end move_anim_start_t2 + thumb_func_end LaunchStatusAnimation thumb_func_start task0A_80788BC task0A_80788BC: @ 80AA3B4 diff --git a/asm/battle_anim_815A0D4.s b/asm/battle_anim_815A0D4.s index 69835bf4e..d2a401f59 100755 --- a/asm/battle_anim_815A0D4.s +++ b/asm/battle_anim_815A0D4.s @@ -3006,7 +3006,7 @@ _0815B8A8: lsls r2, 3 adds r2, r3 ldrb r2, [r2, 0x1C] - bl sub_805E448 + bl HandleSpeciesGfxDataChange ldrb r1, [r5] mov r0, sp bl sub_80A6BFC @@ -3310,7 +3310,7 @@ sub_815BB58: @ 815BB58 ldr r1, =gAnimBankTarget ldrb r1, [r1] movs r2, 0x1 - bl sub_805E448 + bl HandleSpeciesGfxDataChange adds r0, r4, 0 bl DestroyAnimVisualTask pop {r4} @@ -10129,7 +10129,7 @@ _0815F2AC: ldr r4, =gAnimBankAttacker ldrb r0, [r4] movs r1, 0 - bl refresh_graphics_maybe + bl LoadBattleMonGfxAndAnimate bl IsContest lsls r0, 24 cmp r0, 0 diff --git a/asm/battle_anim_8170478.s b/asm/battle_anim_8170478.s index 8de82c629..a5e3b5f88 100644 --- a/asm/battle_anim_8170478.s +++ b/asm/battle_anim_8170478.s @@ -4825,7 +4825,7 @@ _08172CC8: ldrb r1, [r5, 0x1E] adds r0, r2, 0 adds r2, r6, 0 - bl refresh_graphics_maybe + bl LoadBattleMonGfxAndAnimate ldrh r0, [r5, 0x1C] adds r0, 0x1 strh r0, [r5, 0x1C] @@ -5030,7 +5030,7 @@ _08172E4E: movs r3, 0x1 bl RequestDma3Fill ldrb r0, [r4] - bl sub_805E974 + bl ClearBehindSubstituteBit adds r0, r5, 0 bl DestroyAnimVisualTask _08172E84: diff --git a/asm/berry_blender.s b/asm/berry_blender.s index 6d18ab7cb..69c561beb 100644 --- a/asm/berry_blender.s +++ b/asm/berry_blender.s @@ -127,7 +127,7 @@ _0807F824: b _0807F966 .pool _0807F854: - ldr r1, =gUnknown_083390F4 + ldr r1, =sBlenderCenterMap movs r2, 0x80 lsls r2, 3 movs r0, 0x2 @@ -135,7 +135,7 @@ _0807F854: bl CopyToBgTilemapBuffer movs r0, 0x2 bl CopyBgTilemapBufferToVram - ldr r0, =gUnknown_083390D4 + ldr r0, =sBlenderCenterPal movs r2, 0x80 lsls r2, 1 movs r1, 0 @@ -216,14 +216,14 @@ _0807F910: b _0807F966 .pool _0807F940: - ldr r0, =gUnknown_083394F4 + ldr r0, =sBlenderOuterPal movs r1, 0x80 movs r2, 0x20 bl LoadPalette b _0807F962 .pool _0807F950: - ldr r0, =gUnknown_08339AC0 + ldr r0, =sSpriteSheet_BlenderArrow bl LoadSpriteSheet ldr r0, =gUnknown_08339BD8 bl LoadSpriteSheet @@ -243,9 +243,9 @@ _0807F980: bl LoadSpriteSheet ldr r0, =gUnknown_08339C58 bl LoadSpriteSheet - ldr r0, =gUnknown_08339AD0 + ldr r0, =sSpritePal_BlenderArrow bl LoadSpritePalette - ldr r0, =gUnknown_08339AC8 + ldr r0, =sSpritePal_BlenderMisc bl LoadSpritePalette ldr r4, =gUnknown_020322A4 ldr r0, [r4] @@ -482,12 +482,12 @@ _0807FBAC: b _0807FCE2 _0807FBB8: movs r4, 0 - ldr r5, =gUnknown_083399C8 + ldr r5, =sBlenderSyncArrowsPos ldr r6, =gUnknown_020322A4 _0807FBBE: ldrb r1, [r5] ldrb r2, [r5, 0x1] - ldr r0, =gUnknown_08339AD8 + ldr r0, =sBlenderSyncArrow_SpriteTemplate movs r3, 0x1 bl CreateSprite ldr r1, [r6] @@ -553,7 +553,7 @@ _0807FC64: ldr r4, [r6] ldr r0, =0x000011b8 adds r4, r0 - ldr r5, =gUnknown_0833973A + ldr r5, =gText_BerryBlenderStart bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 @@ -833,7 +833,7 @@ _0807FE7C: bne _0807FEC8 adds r0, r4, 0 adds r0, 0x1C - ldr r1, =gUnknown_083397D0 + ldr r1, =sBlenderOpponentsNames ldr r1, [r1, 0xC] bl StringCopy b _0807FED4 @@ -841,7 +841,7 @@ _0807FE7C: _0807FEC8: adds r0, r4, 0 adds r0, 0x1C - ldr r1, =gUnknown_083397D0 + ldr r1, =sBlenderOpponentsNames ldr r1, [r1] bl StringCopy _0807FED4: @@ -866,7 +866,7 @@ _0807FEE8: bl StringCopy adds r0, r6, 0 adds r0, 0x1C - ldr r4, =gUnknown_083397D0 + ldr r4, =sBlenderOpponentsNames ldr r1, [r4, 0x10] bl StringCopy adds r0, r6, 0 @@ -896,7 +896,7 @@ _0807FF3C: bl StringCopy adds r0, r5, 0 adds r0, 0x1C - ldr r4, =gUnknown_083397D0 + ldr r4, =sBlenderOpponentsNames ldr r1, [r4, 0x14] bl StringCopy adds r0, r5, 0 @@ -1086,12 +1086,12 @@ _0808010C: .pool _08080120: movs r5, 0 - ldr r4, =gUnknown_083399C8 + ldr r4, =sBlenderSyncArrowsPos ldr r6, =gUnknown_020322A4 _08080126: ldrb r1, [r4] ldrb r2, [r4, 0x1] - ldr r0, =gUnknown_08339AD8 + ldr r0, =sBlenderSyncArrow_SpriteTemplate movs r3, 0x1 bl CreateSprite ldr r1, [r6] @@ -1160,7 +1160,7 @@ _080801C8: ldr r0, [r4] ldr r3, =0x000011b8 adds r0, r3 - ldr r1, =gUnknown_0833981A + ldr r1, =sText_CommunicationStandby movs r2, 0 bl sub_808417C ldr r1, [r4] @@ -2121,12 +2121,12 @@ _080809F0: .pool _08080A04: movs r4, 0 - ldr r5, =gUnknown_083399C8 + ldr r5, =sBlenderSyncArrowsPos ldr r6, =gUnknown_020322A4 _08080A0A: ldrb r1, [r5] ldrb r2, [r5, 0x1] - ldr r0, =gUnknown_08339AD8 + ldr r0, =sBlenderSyncArrow_SpriteTemplate movs r3, 0x1 bl CreateSprite ldr r1, [r6] @@ -3095,7 +3095,7 @@ sub_8081288: @ 8081288 mov r8, r7 lsls r1, 24 ldr r0, =gUnknown_08339B40 - ldr r4, =gUnknown_083399C8 + ldr r4, =sBlenderSyncArrowsPos lsrs r1, 23 adds r2, r1, r4 ldrb r6, [r2] @@ -5062,7 +5062,7 @@ _080822B0: ldr r4, [r6] ldr r5, =0x000011b8 adds r4, r5 - ldr r5, =gUnknown_08339831 + ldr r5, =sText_WouldLikeToBlendAnotherBerry bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 @@ -5263,7 +5263,7 @@ _0808246C: ldr r4, [r6] ldr r0, =0x000011b8 adds r4, r0 - ldr r5, =gUnknown_0833981A + ldr r5, =sText_CommunicationStandby bl sav2_get_text_speed adds r2, r0, 0 lsls r2, 24 @@ -5555,7 +5555,7 @@ _080826EC: adds r1, r0 adds r0, r4, 0 bl StringCopy - ldr r1, =gUnknown_083398DD + ldr r1, =sText_ApostropheSPokeblockCaseIsFull b _08082740 .pool _0808271C: @@ -5575,7 +5575,7 @@ _0808271C: adds r1, r0 adds r0, r4, 0 bl StringCopy - ldr r1, =gUnknown_083398B0 + ldr r1, =sText_HasNoBerriesToPut _08082740: adds r0, r4, 0 bl StringAppend @@ -5856,7 +5856,7 @@ _080829AA: adds r0, r1 strh r2, [r0] ldr r0, =gStringVar4 - ldr r1, =gUnknown_08339896 + ldr r1, =sText_YourPokeblockCaseIsFull bl StringCopy b _08082A92 .pool @@ -5872,7 +5872,7 @@ _080829D4: adds r0, r1 strh r2, [r0] ldr r0, =gStringVar4 - ldr r1, =gUnknown_08339858 + ldr r1, =sText_RunOutOfBerriesForBlending bl StringCopy b _08082A92 .pool @@ -7276,7 +7276,7 @@ _080834DE: b _08083854 .pool _08083518: - ldr r4, =gUnknown_083398F5 + ldr r4, =sText_BlendingResults movs r0, 0x1 adds r1, r4, 0 movs r2, 0xA8 @@ -7329,7 +7329,7 @@ _08083564: bl ConvertIntToDecimalStringN ldr r0, [r7] adds r0, 0x9F - ldr r1, =gUnknown_08339941 + ldr r1, =sText_Dot bl StringAppend ldr r0, [r7] adds r0, 0x9F @@ -7374,7 +7374,7 @@ _08083564: bl ConvertInternationalString ldr r0, [r7] adds r0, 0x9F - ldr r1, =gUnknown_08339914 + ldr r1, =sText_SpaceBerry bl StringAppend ldr r1, [r7] adds r1, 0x9F @@ -7397,7 +7397,7 @@ _08083564: cmp r6, r0 bcc _08083564 _0808361A: - ldr r1, =gUnknown_0833992E + ldr r1, =sText_MaximumSpeed movs r3, 0xFF mov r10, r3 str r3, [sp] @@ -7425,7 +7425,7 @@ _0808361A: bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F - ldr r1, =gUnknown_08339941 + ldr r1, =sText_Dot bl StringAppend ldr r0, [r6] adds r0, 0x4E @@ -7445,7 +7445,7 @@ _0808361A: bl StringAppend ldr r0, [r6] adds r0, 0x9F - ldr r1, =gUnknown_0833993C + ldr r1, =sText_RPM bl StringAppend ldr r1, [r6] adds r1, 0x9F @@ -7463,7 +7463,7 @@ _0808361A: movs r0, 0x5 movs r3, 0x51 bl sub_80840D4 - ldr r1, =gUnknown_0833991B + ldr r1, =sText_Time mov r2, r10 str r2, [sp] mov r3, r9 @@ -7499,7 +7499,7 @@ _0808361A: bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F - ldr r1, =gUnknown_08339921 + ldr r1, =sText_Min bl StringAppend adds r1, r4, 0 movs r2, 0x2 @@ -7507,7 +7507,7 @@ _0808361A: bl ConvertIntToDecimalStringN ldr r0, [r6] adds r0, 0x9F - ldr r1, =gUnknown_08339928 + ldr r1, =sText_Sec bl StringAppend ldr r1, [r6] adds r1, 0x9F @@ -7682,10 +7682,10 @@ sub_80838AC: @ 80838AC ldr r1, [r0] adds r0, r6, 0 bl StringCopy - ldr r1, =gUnknown_0833979D + ldr r1, =gText_WasMade adds r0, r6, 0 bl StringAppend - ldr r1, =gUnknown_08339943 + ldr r1, =sText_NewLine adds r0, r6, 0 bl StringAppend adds r0, r5, 0 @@ -7698,7 +7698,7 @@ sub_80838AC: @ 80838AC adds r5, r0, 0 lsls r5, 24 lsrs r5, 24 - ldr r1, =gUnknown_0833994F + ldr r1, =sText_TheLevelIs adds r0, r6, 0 bl StringAppend mov r0, sp @@ -7709,7 +7709,7 @@ sub_80838AC: @ 80838AC adds r0, r6, 0 mov r1, sp bl StringAppend - ldr r1, =gUnknown_0833995D + ldr r1, =sText_TheFeelIs adds r0, r6, 0 bl StringAppend mov r0, sp @@ -7720,10 +7720,10 @@ sub_80838AC: @ 80838AC adds r0, r6, 0 mov r1, sp bl StringAppend - ldr r1, =gUnknown_08339970 + ldr r1, =sText_Dot2 adds r0, r6, 0 bl StringAppend - ldr r1, =gUnknown_0833979B + ldr r1, =gText_NewParagraph adds r0, r6, 0 bl StringAppend add sp, 0xC @@ -8041,7 +8041,7 @@ _08083B9A: movs r2, 0x1 movs r3, 0xD bl SetWindowBorderStyle - ldr r4, =gUnknown_08339947 + ldr r4, =sText_Ranking movs r0, 0x1 adds r1, r4, 0 movs r2, 0xA8 @@ -8161,7 +8161,7 @@ _08083C84: bl ConvertIntToDecimalStringN ldr r0, [r7] adds r0, 0x9F - ldr r1, =gUnknown_08339941 + ldr r1, =sText_Dot bl StringAppend ldr r0, [r7] adds r0, 0x9F @@ -8395,7 +8395,7 @@ _08083E8A: movs r3, 0x3 bl ConvertIntToDecimalStringN adds r5, r0, 0 - ldr r1, =gUnknown_08339941 + ldr r1, =sText_Dot bl StringAppend adds r5, r0, 0 adds r0, r4, 0 @@ -8407,7 +8407,7 @@ _08083E8A: movs r3, 0x2 bl ConvertIntToDecimalStringN adds r5, r0, 0 - ldr r1, =gUnknown_0833993C + ldr r1, =sText_RPM bl StringAppend movs r0, 0x1 add r1, sp, 0xC diff --git a/asm/contest.s b/asm/contest.s index 9c0684663..4852a548f 100644 --- a/asm/contest.s +++ b/asm/contest.s @@ -6763,7 +6763,7 @@ _080DB1CC: adds r0, r5, 0 adds r1, r7, 0 adds r2, r6, 0 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality movs r1, 0x90 lsls r1, 1 movs r2, 0x20 diff --git a/asm/contest_painting.s b/asm/contest_painting.s index 2caf15194..4e58b4cc3 100644 --- a/asm/contest_painting.s +++ b/asm/contest_painting.s @@ -386,7 +386,7 @@ sub_813010C: @ 813010C ldr r1, =gText_Space adds r0, r4, 0 bl StringAppend - ldr r1, =gUnknown_085B07D4 + ldr r1, =gContestRankTextPointers ldr r0, [r6] ldrb r0, [r0, 0x1E] lsls r0, 2 @@ -415,7 +415,7 @@ _08130190: adds r1, 0xB bl StringCopy ldr r0, =gStringVar4 - ldr r2, =gUnknown_085B07F4 + ldr r2, =gContestPaintingDescriptionPointers lsls r1, r5, 2 adds r1, r2 ldr r1, [r1] @@ -572,7 +572,7 @@ sub_81302E8: @ 81302E8 ldr r1, [r0, 0x4] ldr r2, [r0] adds r0, r5, 0 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality ldr r7, =gUnknown_030061C4 ldr r1, [r7] bl LZDecompressVram diff --git a/asm/credits.s b/asm/credits.s index 0b2da16b8..a9373c042 100644 --- a/asm/credits.s +++ b/asm/credits.s @@ -26,7 +26,7 @@ sub_81754DC: @ 81754DC ands r0, r1 cmp r0, 0 beq _08175522 - ldr r0, =gUnknown_0203BCE4 + ldr r0, =gHasHallOfFameRecords ldrb r0, [r0] cmp r0, 0 beq _08175522 diff --git a/asm/hall_of_fame.s b/asm/hall_of_fame.s deleted file mode 100644 index 9227c1795..000000000 --- a/asm/hall_of_fame.s +++ /dev/null @@ -1,3603 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_817354C -sub_817354C: @ 817354C - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_817354C - - thumb_func_start sub_8173560 -sub_8173560: @ 8173560 - push {lr} - bl RunTasks - bl RunTextPrinters - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_8173560 - - thumb_func_start sub_817357C -sub_817357C: @ 817357C - push {r4,lr} - sub sp, 0x4 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - bls _08173590 - b _08173688 -_08173590: - lsls r0, 2 - ldr r1, =_081735A4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081735A4: - .4byte _081735B8 - .4byte _081735E8 - .4byte _081735EE - .4byte _08173620 - .4byte _0817365C -_081735B8: - movs r0, 0 - bl SetVBlankCallback - bl sub_8174EC4 - ldr r4, =gUnknown_0203BCDC - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] - b _08173688 - .pool -_081735E8: - bl sub_8174F70 - b _08173642 -_081735EE: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0xE2 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl sub_8174FAC - ldr r0, =gUnknown_0203BCDC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08173642 - .pool -_08173620: - bl sub_8175024 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _08173688 - ldr r0, =sub_817354C - bl SetVBlankCallback - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_08173642: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08173688 - .pool -_0817365C: - bl UpdatePaletteFade - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08173688 - ldr r0, =sub_8173560 - bl SetMainCallback2 - movs r0, 0xDA - lsls r0, 1 - bl PlayBGM - movs r0, 0 - b _0817368A - .pool -_08173688: - movs r0, 0x1 -_0817368A: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_817357C - - thumb_func_start sub_8173694 -sub_8173694: @ 8173694 - push {r4,lr} - bl sub_817357C - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0 - bne _081736C4 - ldr r0, =sub_817371C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x8] - ldr r4, =gUnknown_0203BCD8 - movs r0, 0x78 - bl AllocZeroed - str r0, [r4] -_081736C4: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173694 - - thumb_func_start sub_81736D8 -sub_81736D8: @ 81736D8 - push {r4,lr} - bl sub_817357C - lsls r0, 24 - cmp r0, 0 - bne _08173708 - ldr r0, =sub_817371C - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - ldr r4, =gUnknown_0203BCD8 - movs r0, 0x78 - bl AllocZeroed - str r0, [r4] -_08173708: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81736D8 - - thumb_func_start sub_817371C -sub_817371C: @ 817371C - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0xC - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r1, =gTasks - lsls r0, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r1, 0 - strh r1, [r0, 0xC] - movs r7, 0 - ldr r0, =gUnknown_0203BCD8 - mov r9, r0 -_08173740: - movs r0, 0x64 - adds r1, r7, 0 - muls r1, r0 - ldr r0, =gPlayerParty - adds r6, r1, r0 - adds r0, r6, 0 - movs r1, 0xB - bl GetMonData - adds r5, r0, 0 - cmp r5, 0 - beq _0817380C - adds r0, r6, 0 - movs r1, 0x41 - bl GetMonData - mov r1, r9 - ldr r3, [r1] - lsls r4, r7, 2 - adds r4, r7 - lsls r4, 2 - adds r3, r4 - ldr r2, =0x000001ff - adds r1, r2, 0 - ands r0, r1 - ldrh r1, [r3, 0x8] - ldr r5, =0xfffffe00 - adds r2, r5, 0 - ands r1, r2 - orrs r1, r0 - strh r1, [r3, 0x8] - adds r0, r6, 0 - movs r1, 0x1 - bl GetMonData - mov r2, r9 - ldr r1, [r2] - adds r1, r4 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0 - bl GetMonData - mov r5, r9 - ldr r1, [r5] - adds r1, 0x4 - adds r1, r4 - str r0, [r1] - adds r0, r6, 0 - movs r1, 0x38 - bl GetMonData - ldr r2, [r5] - adds r2, r4 - lsls r0, 1 - ldrb r3, [r2, 0x9] - movs r1, 0x1 - ands r1, r3 - orrs r1, r0 - strb r1, [r2, 0x9] - adds r0, r6, 0 - movs r1, 0x2 - mov r2, sp - bl GetMonData - movs r2, 0 - mov r6, r8 - lsls r5, r6, 2 - ldr r3, =gUnknown_0203BCD8 -_081737CA: - ldr r0, [r3] - adds r1, r2, r4 - adds r0, 0xA - adds r0, r1 - mov r6, sp - adds r1, r6, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bls _081737CA - ldr r0, =gTasks - mov r2, r8 - adds r1, r5, r2 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0xC] - adds r0, 0x1 - strh r0, [r1, 0xC] - b _08173840 - .pool -_0817380C: - mov r6, r9 - ldr r3, [r6] - lsls r2, r7, 2 - adds r2, r7 - lsls r2, 2 - adds r4, r3, r2 - ldrh r0, [r4, 0x8] - ldr r6, =0xfffffe00 - adds r1, r6, 0 - ands r0, r1 - strh r0, [r4, 0x8] - str r5, [r4] - adds r3, 0x4 - adds r3, r2 - str r5, [r3] - ldrb r1, [r4, 0x9] - movs r0, 0x1 - ands r0, r1 - strb r0, [r4, 0x9] - mov r1, r9 - ldr r0, [r1] - adds r0, r2 - movs r1, 0xFF - strb r1, [r0, 0xA] - mov r2, r8 - lsls r5, r2, 2 -_08173840: - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bhi _0817384C - b _08173740 -_0817384C: - ldr r0, =gUnknown_0203BCD4 - movs r3, 0 - str r3, [r0] - ldr r4, =gTasks - mov r6, r8 - adds r1, r5, r6 - lsls r1, 3 - adds r2, r1, r4 - strh r3, [r2, 0xA] - movs r0, 0xFF - strh r0, [r2, 0x10] - movs r7, 0 - adds r3, r4, 0 - adds r3, 0x8 - movs r2, 0xFF -_0817386A: - adds r0, r7, 0x5 - lsls r0, 1 - adds r0, r1 - adds r0, r3 - strh r2, [r0] - adds r0, r7, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - cmp r7, 0x5 - bls _0817386A - mov r1, r8 - adds r0, r5, r1 - lsls r0, 3 - adds r1, r0, r4 - movs r2, 0x8 - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _081738A4 - ldr r0, =sub_8173A8C - b _081738A6 - .pool -_081738A4: - ldr r0, =sub_81738BC -_081738A6: - str r0, [r1] - add sp, 0xC - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_817371C - - thumb_func_start sub_81738BC -sub_81738BC: @ 81738BC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - ldr r7, =0x0201c000 - ldr r0, =gUnknown_0203BCE4 - ldrb r0, [r0] - cmp r0, 0 - bne _081738EC - movs r2, 0x80 - lsls r2, 6 - adds r0, r7, 0 - movs r1, 0 - bl memset - b _08173906 - .pool -_081738EC: - movs r0, 0x3 - bl sub_81534D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08173906 - movs r2, 0x80 - lsls r2, 6 - adds r0, r7, 0 - movs r1, 0 - bl memset -_08173906: - movs r5, 0 - ldrh r1, [r7, 0x8] - ldr r2, =0x000001ff - adds r0, r2, 0 - ands r0, r1 - mov r1, r9 - lsls r1, 2 - mov r8, r1 - cmp r0, 0 - beq _08173930 -_0817391A: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r7, 0x78 - cmp r5, 0x31 - bhi _08173934 - ldrh r1, [r7, 0x8] - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - bne _0817391A -_08173930: - cmp r5, 0x31 - bls _08173956 -_08173934: - ldr r4, =0x0201c000 - adds r6, r4, 0 - adds r4, 0x78 - movs r5, 0 - subs r7, 0x78 -_0817393E: - adds r0, r6, 0 - adds r1, r4, 0 - movs r2, 0x78 - bl memcpy - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x78 - adds r4, 0x78 - cmp r5, 0x30 - bls _0817393E -_08173956: - ldr r0, =gUnknown_0203BCD8 - ldr r1, [r0] - adds r0, r7, 0 - movs r2, 0x78 - bl memcpy - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gUnknown_082C8959 - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gTasks - mov r0, r8 - add r0, r9 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81739C4 - str r1, [r0] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81738BC - - thumb_func_start sub_81739C4 -sub_81739C4: @ 81739C4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gGameContinueCallback - ldr r0, =sub_81736D8 - str r0, [r1] - movs r0, 0x3 - bl TrySavingData - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08173A34 - ldr r0, =gDamagedSaveSectors - ldr r0, [r0] - cmp r0, 0 - beq _08173A34 - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - bl FreeAllWindowBuffers - ldr r5, =gUnknown_0203BCDC - ldr r0, [r5] - cmp r0, 0 - beq _08173A06 - bl Free - movs r0, 0 - str r0, [r5] -_08173A06: - ldr r5, =gUnknown_0203BCD8 - ldr r0, [r5] - cmp r0, 0 - beq _08173A16 - bl Free - movs r0, 0 - str r0, [r5] -_08173A16: - adds r0, r4, 0 - bl DestroyTask - b _08173A4C - .pool -_08173A34: - movs r0, 0x37 - bl PlaySE - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8173A5C - str r1, [r0] - movs r1, 0x20 - strh r1, [r0, 0xE] -_08173A4C: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81739C4 - - thumb_func_start sub_8173A5C -sub_8173A5C: @ 8173A5C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08173A80 - subs r0, r2, 0x1 - strh r0, [r1, 0xE] - b _08173A84 - .pool -_08173A80: - ldr r0, =sub_8173A8C - str r0, [r1] -_08173A84: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173A5C - - thumb_func_start sub_8173A8C -sub_8173A8C: @ 8173A8C - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldr r0, =sub_8173AA8 - str r0, [r1] - bx lr - .pool - thumb_func_end sub_8173A8C - - thumb_func_start sub_8173AA8 -sub_8173AA8: @ 8173AA8 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gTasks - mov r2, r8 - lsls r1, r2, 2 - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldrh r6, [r1, 0xA] - ldr r2, =gUnknown_0203BCD8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - ldr r2, [r2] - adds r7, r2, r0 - movs r2, 0xC - ldrsh r0, [r1, r2] - cmp r0, 0x3 - ble _08173AEC - ldr r1, =gUnknown_085E53B4 - b _08173AEE - .pool -_08173AEC: - ldr r1, =gUnknown_085E53E4 -_08173AEE: - lsls r2, r6, 3 - adds r0, r2, r1 - ldrh r3, [r0] - adds r0, r1, 0x2 - adds r0, r2, r0 - ldrh r4, [r0] - adds r0, r1, 0x4 - adds r0, r2, r0 - ldrh r0, [r0] - mov r9, r0 - adds r1, 0x6 - adds r2, r1 - ldrh r5, [r2] - ldrh r2, [r7, 0x8] - ldr r0, =0x000001ff - ands r0, r2 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08173B20 - lsls r0, r5, 16 - movs r1, 0xA0 - lsls r1, 12 - adds r0, r1 - lsrs r5, r0, 16 -_08173B20: - lsls r0, r2, 23 - lsrs r0, 23 - ldr r1, [r7] - ldr r2, [r7, 0x4] - lsls r3, 16 - asrs r3, 16 - str r3, [sp] - lsls r3, r4, 16 - asrs r3, 16 - str r3, [sp, 0x4] - lsls r3, r6, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D3E4 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gSprites - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r3, r2, r4 - movs r1, 0 - mov r12, r1 - mov r1, r9 - strh r1, [r3, 0x30] - strh r5, [r3, 0x32] - mov r1, r12 - strh r1, [r3, 0x2E] - ldrh r1, [r7, 0x8] - lsls r1, 23 - lsrs r1, 23 - strh r1, [r3, 0x3C] - adds r4, 0x1C - adds r2, r4 - ldr r1, =sub_8175120 - str r1, [r2] - ldr r5, =gTasks - adds r1, r6, 0x5 - lsls r1, 1 - mov r2, r8 - lsls r4, r2, 2 - add r4, r8 - lsls r4, 3 - adds r1, r4 - adds r2, r5, 0 - adds r2, 0x8 - adds r1, r2 - strh r0, [r1] - movs r0, 0 - movs r1, 0x1 - bl sub_8197434 - adds r4, r5 - ldr r0, =sub_8173BC0 - str r0, [r4] - add sp, 0x10 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173AA8 - - thumb_func_start sub_8173BC0 -sub_8173BC0: @ 8173BC0 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gTasks - lsls r3, r0, 2 - adds r3, r0 - lsls r3, 3 - adds r5, r3, r4 - ldrh r0, [r5, 0xA] - ldr r2, =gUnknown_0203BCD8 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - ldr r2, [r2] - adds r2, r1 - adds r0, 0x5 - lsls r0, 1 - adds r0, r3 - adds r4, 0x8 - adds r0, r4 - movs r3, 0 - ldrsh r1, [r0, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r3, r0, r1 - ldr r1, [r3, 0x1C] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - bne _08173C1A - ldrb r1, [r3, 0x1] - movs r0, 0x4 - negs r0, r0 - ands r0, r1 - strb r0, [r3, 0x1] - adds r0, r2, 0 - movs r1, 0 - movs r2, 0xE - bl sub_8174A88 - movs r0, 0x78 - strh r0, [r5, 0xE] - ldr r0, =sub_8173C34 - str r0, [r5] -_08173C1A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173BC0 - - thumb_func_start sub_8173C34 -sub_8173C34: @ 8173C34 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r2, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r6, r0, 3 - adds r4, r6, r2 - ldrh r3, [r4, 0xA] - ldr r1, =gUnknown_0203BCD8 - lsls r0, r3, 2 - adds r0, r3 - lsls r0, 2 - ldr r1, [r1] - adds r1, r0 - mov r9, r1 - ldrh r1, [r4, 0xE] - movs r7, 0xE - ldrsh r0, [r4, r7] - mov r12, r2 - cmp r0, 0 - beq _08173C78 - subs r0, r1, 0x1 - strh r0, [r4, 0xE] - b _08173D10 - .pool -_08173C78: - ldr r2, =gUnknown_0203BCD4 - ldr r0, =gSprites - mov r8, r0 - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r6 - mov r1, r12 - adds r1, 0x8 - adds r6, r0, r1 - movs r7, 0 - ldrsh r1, [r6, r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - movs r1, 0x80 - lsls r1, 9 - lsls r1, r0 - ldr r3, [r2] - orrs r3, r1 - str r3, [r2] - ldrh r2, [r4, 0xA] - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x4 - bgt _08173D04 - mov r7, r9 - ldrh r1, [r7, 0x1C] - ldr r0, =0x000001ff - ands r0, r1 - cmp r0, 0 - beq _08173D04 - adds r0, r2, 0x1 - strh r0, [r4, 0xA] - ldr r0, =0x000063b0 - str r0, [sp] - adds r0, r3, 0 - movs r1, 0 - movs r2, 0xC - movs r3, 0xC - bl BeginNormalPaletteFade - movs r0, 0 - ldrsh r1, [r6, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r0, =sub_8173AA8 - str r0, [r4] - b _08173D10 - .pool -_08173D04: - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - add r0, r12 - ldr r1, =sub_8173D24 - str r1, [r0] -_08173D10: - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173C34 - - thumb_func_start sub_8173D24 -sub_8173D24: @ 8173D24 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =0xffff0000 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0 - bl BeginNormalPaletteFade - movs r3, 0 - lsls r1, r4, 2 - adds r0, r1, r4 - lsls r5, r0, 3 - ldr r0, =gTasks + 0x8 - mov r12, r0 - mov r8, r1 - ldr r6, =gSprites - movs r7, 0xD - negs r7, r7 -_08173D52: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r5 - mov r2, r12 - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - beq _08173D74 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r6 - ldrb r2, [r1, 0x5] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1, 0x5] -_08173D74: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _08173D52 - movs r0, 0 - movs r1, 0xF - bl sub_8174A38 - movs r0, 0x69 - bl PlaySE - ldr r1, =gTasks - mov r2, r8 - adds r0, r2, r4 - lsls r0, 3 - adds r0, r1 - movs r1, 0xC8 - lsls r1, 1 - strh r1, [r0, 0xE] - ldr r1, =sub_8173DC0 - str r1, [r0] - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173D24 - - thumb_func_start sub_8173DC0 -sub_8173DC0: @ 8173DC0 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r7, =gTasks - lsls r4, r6, 2 - adds r0, r4, r6 - lsls r5, r0, 3 - adds r1, r5, r7 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _08173E04 - subs r2, 0x1 - strh r2, [r1, 0xE] - movs r0, 0x3 - ands r0, r2 - cmp r0, 0 - bne _08173E7E - lsls r0, r2, 16 - asrs r0, 16 - cmp r0, 0x6E - ble _08173E7E - bl sub_81751FC - b _08173E7E - .pool -_08173E04: - movs r3, 0 - mov r9, r4 - ldr r0, =gUnknown_0203BCD4 - mov r10, r0 - adds r4, r5, 0 - adds r7, 0x8 - mov r8, r7 - ldr r7, =gSprites - movs r1, 0xD - negs r1, r1 - mov r12, r1 - movs r5, 0x4 -_08173E1C: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r4 - mov r2, r8 - adds r1, r0, r2 - movs r2, 0 - ldrsh r0, [r1, r2] - cmp r0, 0xFF - beq _08173E40 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r7 - ldrb r2, [r1, 0x5] - mov r0, r12 - ands r0, r2 - orrs r0, r5 - strb r0, [r1, 0x5] -_08173E40: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _08173E1C - mov r3, r10 - ldr r0, [r3] - ldr r1, =0x000063b0 - str r1, [sp] - movs r1, 0 - movs r2, 0xC - movs r3, 0xC - bl BeginNormalPaletteFade - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gTasks - mov r2, r9 - adds r0, r2, r6 - lsls r0, 3 - adds r0, r1 - movs r1, 0x7 - strh r1, [r0, 0xE] - ldr r1, =sub_8173EA4 - str r1, [r0] -_08173E7E: - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173DC0 - - thumb_func_start sub_8173EA4 -sub_8173EA4: @ 8173EA4 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - ldrh r2, [r1, 0xE] - movs r3, 0xE - ldrsh r0, [r1, r3] - cmp r0, 0xF - ble _08173ECC - ldr r0, =sub_8173EE4 - str r0, [r1] - b _08173EDE - .pool -_08173ECC: - adds r0, r2, 0x1 - strh r0, [r1, 0xE] - movs r0, 0xE - ldrsh r1, [r1, r0] - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x52 - bl SetGpuReg -_08173EDE: - pop {r0} - bx r0 - thumb_func_end sub_8173EA4 - - thumb_func_start sub_8173EE4 -sub_8173EE4: @ 8173EE4 - push {r4-r6,lr} - sub sp, 0x8 - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r6, =gSaveBlock2Ptr - ldr r0, [r6] - ldrb r0, [r0, 0x8] - movs r1, 0x1 - bl sub_818D97C - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - str r1, [sp] - ldr r1, =0x0000ffff - str r1, [sp, 0x4] - movs r1, 0x1 - movs r2, 0x78 - movs r3, 0x48 - bl sub_818D8AC - ldr r1, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r1 - strh r0, [r4, 0x10] - ldr r0, =gUnknown_085E5380 - bl AddWindow - ldr r0, [r6] - ldrb r1, [r0, 0x14] - lsrs r1, 3 - ldr r2, =0x0000021d - movs r0, 0x1 - movs r3, 0xD0 - bl sub_80987D4 - movs r0, 0x1 - bl stdpal_get - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - movs r0, 0x78 - strh r0, [r4, 0xE] - ldr r0, =sub_8173F84 - str r0, [r4] - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173EE4 - - thumb_func_start sub_8173F84 -sub_8173F84: @ 8173F84 - push {r4,r5,lr} - sub sp, 0x10 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 - ldrh r0, [r4, 0xE] - movs r1, 0xE - ldrsh r5, [r4, r1] - cmp r5, 0 - beq _08173FAC - subs r0, 0x1 - strh r0, [r4, 0xE] - b _08174018 - .pool -_08173FAC: - ldr r2, =gSprites - movs r3, 0x10 - ldrsh r1, [r4, r3] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r2 - ldrh r2, [r1, 0x20] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0xC0 - beq _08173FD0 - adds r0, r2, 0x1 - strh r0, [r1, 0x20] - b _08174018 - .pool -_08173FD0: - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - movs r1, 0x2 - bl sub_8174C98 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gText_LeagueChamp - str r5, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =sub_8174028 - str r0, [r4] -_08174018: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8173F84 - - thumb_func_start sub_8174028 -sub_8174028: @ 8174028 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0817404E - movs r0, 0x4 - bl FadeOutBGM - ldr r0, =gTasks - lsls r1, r4, 2 - adds r1, r4 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174060 - str r0, [r1] -_0817404E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174028 - - thumb_func_start sub_8174060 -sub_8174060: @ 8174060 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gPlttBufferFaded - ldr r1, =gPlttBufferUnfaded - movs r2, 0x80 - lsls r2, 2 - bl CpuSet - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r1, 0x8 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81740B0 - str r1, [r0] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174060 - - thumb_func_start sub_81740B0 -sub_81740B0: @ 81740B0 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _08174164 - lsls r0, r7, 2 - mov r8, r0 - ldr r1, =gTasks - adds r0, r7 - lsls r0, 3 - adds r1, 0x12 - adds r5, r0, r1 - ldr r2, =gSprites - mov r9, r2 - movs r6, 0x5 -_081740DC: - ldrb r4, [r5] - cmp r4, 0xFF - beq _081740FA - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - add r0, r9 - ldrb r0, [r0, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - adds r0, r4, 0 - bl sub_818D820 -_081740FA: - adds r5, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _081740DC - ldr r0, =gTasks - mov r2, r8 - adds r1, r2, r7 - lsls r1, 3 - adds r1, r0 - ldrh r0, [r1, 0x10] - bl sub_818D8F0 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl FreeAllWindowBuffers - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - adds r0, r7, 0 - bl DestroyTask - ldr r4, =gUnknown_0203BCDC - ldr r0, [r4] - cmp r0, 0 - beq _08174150 - bl Free - movs r0, 0 - str r0, [r4] -_08174150: - ldr r4, =gUnknown_0203BCD8 - ldr r0, [r4] - cmp r0, 0 - beq _08174160 - bl Free - movs r0, 0 - str r0, [r4] -_08174160: - bl sub_8174184 -_08174164: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81740B0 - - thumb_func_start sub_8174184 -sub_8174184: @ 8174184 - push {lr} - ldr r0, =sub_8175620 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174184 - - thumb_func_start sub_8174194 -sub_8174194: @ 8174194 - push {r4,lr} - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _081741D0 - lsls r0, 2 - ldr r1, =_081741B8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081741B8: - .4byte _081741D0 - .4byte _08174200 - .4byte _08174214 - .4byte _08174240 - .4byte _08174280 - .4byte _081742B0 -_081741D0: - movs r0, 0 - bl SetVBlankCallback - bl sub_8174EC4 - ldr r4, =gUnknown_0203BCDC - ldr r0, =0x00002014 - bl AllocZeroed - str r0, [r4] - ldr r0, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r2 - movs r1, 0x1 - strb r1, [r0] - b _08174308 - .pool -_08174200: - bl sub_8174F70 - ldr r1, =gMain - movs r3, 0x87 - lsls r3, 3 - adds r1, r3 - b _081742A2 - .pool -_08174214: - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - bl sub_8174FAC - ldr r1, =gMain - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _081742A2 - .pool -_08174240: - bl sub_8175024 - lsls r0, 24 - cmp r0, 0 - bne _08174308 - ldr r1, =0x0201c000 - ldr r0, =gUnknown_085E56D4 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80F9BCC - ldr r0, =sub_817354C - bl SetVBlankCallback - ldr r1, =gMain - movs r4, 0x87 - lsls r4, 3 - adds r1, r4 - b _081742A2 - .pool -_08174280: - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - bl sub_80F9C1C - lsls r0, 24 - cmp r0, 0 - bne _08174308 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 -_081742A2: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _08174308 - .pool -_081742B0: - ldr r1, =0x00003f42 - movs r0, 0x50 - bl SetGpuReg - movs r1, 0xE2 - lsls r1, 3 - movs r0, 0x52 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - ldr r0, =sub_8174324 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - movs r2, 0 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r4, =gTasks + 0x8 - movs r3, 0xFF -_081742E2: - adds r0, r2, 0x5 - lsls r0, 1 - adds r0, r1 - adds r0, r4 - strh r3, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x5 - bls _081742E2 - ldr r4, =gUnknown_0203BCD8 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - ldr r0, =sub_8173560 - bl SetMainCallback2 -_08174308: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174194 - - thumb_func_start sub_8174324 -sub_8174324: @ 8174324 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =0x00000226 - str r0, [sp] - movs r0, 0 - movs r1, 0x1E - movs r2, 0 - movs r3, 0xC - bl sub_81980F0 - movs r0, 0x3 - bl sub_81534D0 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _08174364 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81749A0 - b _081743DA - .pool -_08174364: - ldr r0, =0x0201c000 - ldr r4, =gUnknown_0203BCD8 - ldr r1, [r4] - movs r2, 0x80 - lsls r2, 5 - bl CpuSet - ldr r4, [r4] - movs r2, 0 - ldrh r1, [r4, 0x8] - ldr r3, =0x000001ff - adds r0, r3, 0 - ands r0, r1 - lsls r5, r6, 2 - cmp r0, 0 - beq _0817439A -_08174384: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - adds r4, 0x78 - cmp r2, 0x31 - bhi _081743BC - ldrh r1, [r4, 0x8] - adds r0, r3, 0 - ands r0, r1 - cmp r0, 0 - bne _08174384 -_0817439A: - cmp r2, 0x31 - bhi _081743BC - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - subs r0, r2, 0x1 - b _081743C6 - .pool -_081743BC: - ldr r0, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r0 - movs r0, 0x31 -_081743C6: - strh r0, [r1, 0x8] - movs r0, 0xA - bl GetGameStat - ldr r2, =gTasks - adds r1, r5, r6 - lsls r1, 3 - adds r1, r2 - strh r0, [r1, 0xA] - ldr r0, =sub_81743EC -_081743DA: - str r0, [r1] - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174324 - - thumb_func_start sub_81743EC -sub_81743EC: @ 81743EC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gUnknown_0203BCD8 - ldr r3, [r0] - movs r5, 0 - ldr r1, =gTasks - mov r2, r8 - lsls r0, r2, 2 - add r0, r8 - lsls r0, 3 - adds r0, r1 - movs r4, 0x8 - ldrsh r0, [r0, r4] - adds r4, r1, 0 - ldr r2, =gUnknown_0203BCD4 - cmp r5, r0 - bge _0817442A - adds r1, r0, 0 -_0817441E: - adds r3, 0x78 - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r1 - blt _0817441E -_0817442A: - adds r6, r3, 0 - movs r0, 0 - str r0, [r2] - mov r5, r8 - lsls r2, r5, 2 - adds r1, r2, r5 - lsls r1, 3 - adds r1, r4 - strh r0, [r1, 0xC] - strh r0, [r1, 0x10] - movs r5, 0 - str r2, [sp, 0x14] - ldr r4, =0x000001ff - adds r2, r1, 0 -_08174446: - ldrh r1, [r6, 0x8] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0 - beq _08174456 - ldrh r0, [r2, 0x10] - adds r0, 0x1 - strh r0, [r2, 0x10] -_08174456: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x14 - cmp r5, 0x5 - bls _08174446 - adds r6, r3, 0 - movs r5, 0 - ldr r1, =gTasks - ldr r0, [sp, 0x14] - add r0, r8 - lsls r0, 3 - mov r9, r0 - adds r0, r1 - str r0, [sp, 0x10] - ldr r1, =0x000001ff - mov r10, r1 -_08174478: - ldrh r0, [r6, 0x8] - mov r1, r10 - ands r1, r0 - adds r7, r0, 0 - cmp r1, 0 - beq _08174540 - ldr r2, [sp, 0x10] - movs r4, 0x10 - ldrsh r0, [r2, r4] - cmp r0, 0x3 - ble _081744B8 - lsls r1, r5, 3 - ldr r0, =gUnknown_085E53B4 - adds r0, 0x4 - adds r0, r1, r0 - ldrh r3, [r0] - ldr r0, =gUnknown_085E53BA - adds r1, r0 - ldrh r4, [r1] - b _081744C8 - .pool -_081744B8: - ldr r0, =gUnknown_085E53E4 - lsls r2, r5, 3 - adds r1, r0, 0x4 - adds r1, r2, r1 - ldrh r3, [r1] - adds r0, 0x6 - adds r2, r0 - ldrh r4, [r2] -_081744C8: - mov r1, r10 - ands r1, r7 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - bne _081744DE - lsls r0, r4, 16 - movs r1, 0xA0 - lsls r1, 12 - adds r0, r1 - lsrs r4, r0, 16 -_081744DE: - lsls r0, r7, 23 - lsrs r0, 23 - ldr r1, [r6] - ldr r2, [r6, 0x4] - lsls r3, 16 - asrs r3, 16 - str r3, [sp] - lsls r3, r4, 16 - asrs r3, 16 - str r3, [sp, 0x4] - lsls r3, r5, 24 - lsrs r3, 24 - str r3, [sp, 0x8] - ldr r3, =0x0000ffff - str r3, [sp, 0xC] - movs r3, 0x1 - bl sub_818D7D8 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r4, 0xD - negs r4, r4 - adds r2, r4, 0 - ands r3, r2 - movs r2, 0x4 - orrs r3, r2 - strb r3, [r1, 0x5] - adds r1, r5, 0x5 - lsls r1, 1 - add r1, r9 - ldr r2, =gTasks + 0x8 - adds r1, r2 - strh r0, [r1] - b _0817454E - .pool -_08174540: - adds r0, r5, 0x5 - lsls r0, 1 - add r0, r9 - ldr r4, =gTasks + 0x8 - adds r0, r4 - movs r1, 0xFF - strh r1, [r0] -_0817454E: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - adds r6, 0x14 - cmp r5, 0x5 - bls _08174478 - ldr r0, =0xffff0000 - ldr r2, =0x000063b0 - movs r1, 0xC - bl BlendPalettes - ldr r0, =gStringVar1 - ldr r1, =gTasks - ldr r4, [sp, 0x14] - add r4, r8 - lsls r4, 3 - adds r4, r1 - movs r5, 0xA - ldrsh r1, [r4, r5] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gText_HOFNumber - adds r0, r5, 0 - bl StringExpandPlaceholders - movs r1, 0x8 - ldrsh r0, [r4, r1] - cmp r0, 0 - bgt _081745C0 - ldr r1, =gText_PickCancel - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_8198204 - b _081745D0 - .pool -_081745C0: - ldr r1, =gText_PickNextCancel - movs r0, 0x1 - str r0, [sp] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0 - bl sub_8198204 -_081745D0: - ldr r0, =gTasks - ldr r1, [sp, 0x14] - add r1, r8 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81745FC - str r0, [r1] - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81743EC - - thumb_func_start sub_81745FC -sub_81745FC: @ 81745FC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gUnknown_0203BCD8 - ldr r5, [r0] - movs r3, 0 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - movs r2, 0x8 - ldrsh r0, [r0, r2] - cmp r3, r0 - bge _08174630 - adds r1, r0, 0 -_08174624: - adds r5, 0x78 - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, r1 - blt _08174624 -_08174630: - movs r3, 0 - lsls r7, r4, 2 - adds r0, r7, r4 - lsls r6, r0, 3 - ldr r0, =gTasks + 0x8 - mov r10, r0 - ldr r1, =gSprites - mov r8, r1 - movs r2, 0xD - negs r2, r2 - mov r9, r2 - movs r0, 0x4 - mov r12, r0 -_0817464A: - adds r0, r3, 0x5 - lsls r0, 1 - adds r0, r6 - add r0, r10 - ldrh r1, [r0] - cmp r1, 0xFF - beq _0817466C - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - add r0, r8 - ldrb r2, [r0, 0x5] - mov r1, r9 - ands r1, r2 - mov r2, r12 - orrs r1, r2 - strb r1, [r0, 0x5] -_0817466C: - adds r0, r3, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - cmp r3, 0x5 - bls _0817464A - adds r1, r7, r4 - lsls r1, 3 - ldr r0, =gTasks - adds r6, r1, r0 - movs r2, 0xC - ldrsh r0, [r6, r2] - adds r0, 0x5 - lsls r0, 1 - adds r0, r1 - ldr r1, =gTasks - adds r1, 0x8 - adds r0, r1 - ldrh r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - strb r1, [r0, 0x5] - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 9 - lsls r0, r1 - ldr r1, =0xffff0000 - eors r0, r1 - ldr r2, =gUnknown_0203BCD4 - str r0, [r2] - ldr r2, =0x000063b0 - movs r1, 0xC - bl BlendPalettesUnfaded - movs r0, 0xC - ldrsh r1, [r6, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - adds r4, r5, r0 - ldrh r1, [r4, 0x8] - ldr r0, =0x000001ff - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - beq _081746E6 - bl StopCryAndClearCrySongs - ldrh r0, [r4, 0x8] - lsls r0, 23 - lsrs r0, 23 - movs r1, 0 - bl PlayCry1 -_081746E6: - adds r0, r4, 0 - movs r1, 0 - movs r2, 0xE - bl sub_8174A88 - ldr r0, =sub_8174728 - str r0, [r6] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81745FC - - thumb_func_start sub_8174728 -sub_8174728: @ 8174728 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, =gMain - ldrh r2, [r1, 0x2E] - movs r0, 0x1 - ands r0, r2 - adds r3, r1, 0 - cmp r0, 0 - beq _081747E4 - ldr r0, =gTasks - mov r12, r0 - lsls r0, r6, 2 - adds r1, r0, r6 - lsls r3, r1, 3 - mov r1, r12 - adds r4, r3, r1 - ldrh r2, [r4, 0x8] - movs r5, 0x8 - ldrsh r1, [r4, r5] - mov r9, r0 - cmp r1, 0 - beq _081747B8 - subs r0, r2, 0x1 - strh r0, [r4, 0x8] - movs r5, 0 - adds r7, r3, 0 - movs r0, 0x8 - add r0, r12 - mov r8, r0 -_0817476A: - adds r0, r5, 0x5 - lsls r0, 1 - adds r0, r7 - mov r1, r8 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08174782 - bl sub_818D820 - movs r0, 0xFF - strh r0, [r4] -_08174782: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x5 - bls _0817476A - ldr r0, =gTasks - mov r2, r9 - adds r1, r2, r6 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xA] - movs r3, 0xA - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _081747A4 - subs r0, r2, 0x1 - strh r0, [r1, 0xA] -_081747A4: - ldr r0, =sub_81743EC - str r0, [r1] - b _08174884 - .pool -_081747B8: - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - beq _081747D2 - bl StopCryAndClearCrySongs - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_081747D2: - ldr r0, =sub_8174898 - str r0, [r4] - b _08174884 - .pool -_081747E4: - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _08174828 - bl IsCryPlayingOrClearCrySongs - lsls r0, 24 - cmp r0, 0 - beq _08174806 - bl StopCryAndClearCrySongs - ldr r0, =gMPlay_BGM - ldr r1, =0x0000ffff - movs r2, 0x80 - lsls r2, 1 - bl m4aMPlayVolumeControl -_08174806: - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174898 - str r0, [r1] - b _08174884 - .pool -_08174828: - movs r0, 0x40 - ands r0, r2 - cmp r0, 0 - beq _08174858 - ldr r0, =gTasks - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - adds r1, r0 - ldrh r2, [r1, 0xC] - movs r4, 0xC - ldrsh r0, [r1, r4] - cmp r0, 0 - beq _08174858 - subs r0, r2, 0x1 - strh r0, [r1, 0xC] - ldr r0, =sub_81745FC - str r0, [r1] - b _08174884 - .pool -_08174858: - ldrh r1, [r3, 0x2E] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _08174884 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r2, r0, r1 - movs r5, 0xC - ldrsh r1, [r2, r5] - movs r3, 0x10 - ldrsh r0, [r2, r3] - subs r0, 0x1 - cmp r1, r0 - bge _08174884 - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - ldr r0, =sub_81745FC - str r0, [r2] -_08174884: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174728 - - thumb_func_start sub_8174898 -sub_8174898: @ 8174898 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gPlttBufferFaded - ldr r1, =gPlttBufferUnfaded - movs r2, 0x80 - lsls r2, 2 - bl CpuSet - ldr r1, =0x0201c000 - ldr r0, =gUnknown_085E56D4 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3} - stm r1!, {r2,r3} - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl sub_80F9BF4 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81748F0 - str r1, [r0] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174898 - - thumb_func_start sub_81748F0 -sub_81748F0: @ 81748F0 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - bl sub_80F9C30 - lsls r0, 24 - cmp r0, 0 - bne _08174988 - movs r5, 0 - lsls r0, r6, 2 - adds r0, r6 - lsls r7, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 -_08174910: - adds r0, r5, 0x5 - lsls r0, 1 - adds r0, r7 - mov r1, r8 - adds r4, r0, r1 - ldrh r0, [r4] - cmp r0, 0xFF - beq _08174928 - bl sub_818D820 - movs r0, 0xFF - strh r0, [r4] -_08174928: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08174910 - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl sub_8198314 - bl FreeAllWindowBuffers - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x3 - bl UnsetBgTilemapBuffer - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - adds r0, r6, 0 - bl DestroyTask - ldr r4, =gUnknown_0203BCDC - ldr r0, [r4] - cmp r0, 0 - beq _08174974 - bl Free - movs r0, 0 - str r0, [r4] -_08174974: - ldr r4, =gUnknown_0203BCD8 - ldr r0, [r4] - cmp r0, 0 - beq _08174984 - bl Free - movs r0, 0 - str r0, [r4] -_08174984: - bl sub_8137C3C -_08174988: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81748F0 - - thumb_func_start sub_81749A0 -sub_81749A0: @ 81749A0 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gText_UnkCtrlF800Exit - movs r1, 0x8 - movs r2, 0x1 - bl sub_8198180 - movs r0, 0 - movs r1, 0 - bl sub_81973C4 - ldr r2, =gText_HOFCorrupted - movs r0, 0 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - str r0, [sp, 0x8] - movs r0, 0x3 - str r0, [sp, 0xC] - movs r0, 0 - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParametrized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_8174A08 - str r1, [r0] - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81749A0 - - thumb_func_start sub_8174A08 -sub_8174A08: @ 8174A08 - push {lr} - lsls r0, 24 - lsrs r2, r0, 24 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08174A28 - ldr r0, =gTasks - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_8174898 - str r0, [r1] -_08174A28: - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A08 - - thumb_func_start sub_8174A38 -sub_8174A38: @ 8174A38 - push {r4,lr} - sub sp, 0xC - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - ldr r4, =gText_WelcomeToHOF - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A38 - - thumb_func_start sub_8174A88 -sub_8174A88: @ 8174A88 - push {r4-r7,lr} - sub sp, 0x2C - adds r7, r0, 0 - movs r0, 0 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0 - bl PutWindowTilemap - ldrh r0, [r7, 0x8] - ldr r1, =0x000001ff - ands r1, r0 - movs r0, 0xCE - lsls r0, 1 - cmp r1, r0 - beq _08174B30 - ldr r1, =gText_Number - add r0, sp, 0xC - bl StringCopy - adds r6, r0, 0 - ldrh r0, [r7, 0x8] - lsls r0, 23 - lsrs r0, 23 - bl SpeciesToPokedexNum - lsls r0, 16 - lsrs r4, r0, 16 - ldr r0, =0x0000ffff - cmp r4, r0 - beq _08174B04 - adds r0, r4, 0 - movs r1, 0x64 - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - adds r6, 0x1 - adds r0, r4, 0 - movs r1, 0x64 - bl __modsi3 - adds r4, r0, 0 - movs r1, 0xA - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - adds r6, 0x1 - adds r0, r4, 0 - movs r1, 0xA - bl __modsi3 - subs r0, 0x5F - b _08174B0E - .pool -_08174B04: - movs r0, 0xAC - strb r0, [r6] - adds r6, 0x1 - strb r0, [r6] - adds r6, 0x1 -_08174B0E: - strb r0, [r6] - adds r6, 0x1 - movs r0, 0xFF - strb r0, [r6] - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x1 - bl box_print -_08174B30: - adds r1, r7, 0 - adds r1, 0xA - add r0, sp, 0xC - movs r2, 0xA - bl memcpy - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0xA] - ldrh r1, [r7, 0x8] - ldr r4, =0x000001ff - adds r0, r4, 0 - ands r0, r1 - movs r1, 0xCE - lsls r1, 1 - cmp r0, r1 - bne _08174B8C - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0xD0 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - b _08174C82 - .pool -_08174B8C: - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x80 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E5388 - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - add r1, sp, 0xC - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0xD - ldrh r1, [r7, 0x8] - lsls r1, 23 - lsrs r1, 23 - movs r2, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - adds r6, r0, 0 - ldrh r1, [r7, 0x8] - adds r0, r4, 0 - ands r0, r1 - cmp r0, 0x20 - beq _08174C0A - cmp r0, 0x1D - beq _08174C0A - lsls r0, r1, 23 - lsrs r0, 23 - ldr r1, [r7, 0x4] - bl GetGenderFromSpeciesAndPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _08174C00 - cmp r0, 0xFE - beq _08174C04 - b _08174C0A - .pool -_08174C00: - movs r0, 0xB5 - b _08174C06 -_08174C04: - movs r0, 0xB6 -_08174C06: - strb r0, [r6] - adds r6, 0x1 -_08174C0A: - movs r0, 0xFF - strb r0, [r6] - ldr r5, =gUnknown_085E5388 - str r5, [sp] - movs r4, 0x1 - negs r4, r4 - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x80 - movs r3, 0x1 - bl box_print - ldr r1, =gText_Level - add r0, sp, 0xC - bl StringCopy - adds r6, r0, 0 - ldrb r1, [r7, 0x9] - lsrs r1, 1 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - str r5, [sp] - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x24 - movs r3, 0x11 - bl box_print - ldr r1, =gText_IDNumber - add r0, sp, 0xC - bl StringCopy - adds r6, r0, 0 - ldrh r1, [r7] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - str r5, [sp] - str r4, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0 - movs r1, 0x1 - movs r2, 0x68 - movs r3, 0x11 - bl box_print - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram -_08174C82: - add sp, 0x2C - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174A88 - - thumb_func_start sub_8174C98 -sub_8174C98: @ 8174C98 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - movs r0, 0x1 - movs r1, 0x11 - bl FillWindowPixelBuffer - movs r0, 0x1 - bl PutWindowTilemap - ldr r2, =0x0000021d - movs r0, 0x1 - movs r1, 0 - movs r3, 0xD - bl SetWindowBorderStyle - ldr r0, =gUnknown_085E538C - mov r8, r0 - str r0, [sp] - movs r1, 0x1 - negs r1, r1 - mov r9, r1 - str r1, [sp, 0x4] - ldr r0, =gText_Name - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x1 - bl box_print - ldr r0, =gSaveBlock2Ptr - mov r10, r0 - ldr r1, [r0] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - mov r1, r10 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x1 - bl box_print - mov r1, r10 - ldr r0, [r1] - ldrb r4, [r0, 0xA] - ldrb r0, [r0, 0xB] - lsls r0, 8 - orrs r4, r0 - mov r0, r8 - str r0, [sp] - movs r7, 0 - str r7, [sp, 0x4] - ldr r0, =gText_IDNumber - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x11 - bl box_print - add r6, sp, 0xC - ldr r1, =0x000186a0 - adds r0, r4, 0 - bl __modsi3 - ldr r5, =0x00002710 - adds r1, r5, 0 - bl __divsi3 - subs r0, 0x5F - strb r0, [r6] - add r6, sp, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r5, 0xFA - lsls r5, 2 - adds r1, r5, 0 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r6, 0x1] - add r6, sp, 0xC - adds r0, r4, 0 - adds r1, r5, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r6, 0x2] - add r5, sp, 0xC - adds r0, r4, 0 - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x3] - add r5, sp, 0xC - adds r0, r4, 0 - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x4] - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0x5] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - mov r1, r8 - str r1, [sp] - mov r0, r9 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x11 - bl box_print - mov r0, r8 - str r0, [sp] - mov r1, r9 - str r1, [sp, 0x4] - ldr r0, =gText_MainMenuTime - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x21 - bl box_print - add r5, sp, 0xC - mov r0, r10 - ldr r4, [r0] - ldrh r0, [r4, 0xE] - movs r1, 0x64 - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5] - add r5, sp, 0xC - ldrh r0, [r4, 0xE] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r5, 0x1] - add r5, sp, 0xC - ldrh r0, [r4, 0xE] - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r5, 0x2] - add r0, sp, 0xC - ldrb r0, [r0] - cmp r0, 0xA1 - bne _08174E1E - add r0, sp, 0xC - strb r7, [r0] -_08174E1E: - add r0, sp, 0xC - ldrb r1, [r0] - cmp r1, 0 - bne _08174E30 - ldrb r0, [r0, 0x1] - cmp r0, 0xA1 - bne _08174E30 - add r0, sp, 0xC - strb r1, [r0, 0x8] -_08174E30: - add r1, sp, 0xC - movs r0, 0xF0 - strb r0, [r1, 0x3] - adds r4, r1, 0 - ldr r0, =gSaveBlock2Ptr - ldr r5, [r0] - ldrb r0, [r5, 0x10] - movs r1, 0x64 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xA - bl __udivsi3 - adds r0, 0xA1 - strb r0, [r4, 0x4] - add r4, sp, 0xC - ldrb r0, [r5, 0x10] - movs r1, 0xA - bl __umodsi3 - adds r0, 0xA1 - strb r0, [r4, 0x5] - add r1, sp, 0xC - movs r0, 0xFF - strb r0, [r1, 0x6] - movs r0, 0x1 - movs r2, 0x70 - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_085E538C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x21 - bl box_print - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174C98 - - thumb_func_start sub_8174EC4 -sub_8174EC4: @ 8174EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - movs r3, 0xC0 - lsls r3, 19 - movs r4, 0xC0 - lsls r4, 9 - add r0, sp, 0x4 - mov r8, r0 - mov r2, sp - movs r6, 0 - ldr r1, =0x040000d4 - movs r5, 0x80 - lsls r5, 5 - ldr r7, =0x81000800 - movs r0, 0x81 - lsls r0, 24 - mov r12, r0 -_08174EEA: - strh r6, [r2] - mov r0, sp - str r0, [r1] - str r3, [r1, 0x4] - str r7, [r1, 0x8] - ldr r0, [r1, 0x8] - adds r3, r5 - subs r4, r5 - cmp r4, r5 - bhi _08174EEA - strh r6, [r2] - mov r2, sp - str r2, [r1] - str r3, [r1, 0x4] - lsrs r0, r4, 1 - mov r2, r12 - orrs r0, r2 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] - movs r0, 0xE0 - lsls r0, 19 - movs r3, 0x80 - lsls r3, 3 - movs r4, 0 - str r4, [sp, 0x4] - ldr r2, =0x040000d4 - mov r1, r8 - str r1, [r2] - str r0, [r2, 0x4] - lsrs r0, r3, 2 - movs r1, 0x85 - lsls r1, 24 - orrs r0, r1 - str r0, [r2, 0x8] - ldr r0, [r2, 0x8] - movs r1, 0xA0 - lsls r1, 19 - mov r0, sp - strh r4, [r0] - str r0, [r2] - str r1, [r2, 0x4] - lsrs r3, 1 - movs r0, 0x81 - lsls r0, 24 - orrs r3, r0 - str r3, [r2, 0x8] - ldr r0, [r2, 0x8] - bl ResetPaletteFade - ldr r0, =gUnknown_085E54E8 - movs r1, 0 - movs r2, 0x20 - bl LoadPalette - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174EC4 - - thumb_func_start sub_8174F70 -sub_8174F70: @ 8174F70 - push {lr} - bl remove_some_task - bl ResetTasks - bl ResetSpriteData - bl reset_temp_tile_data_buffers - bl dp13_810BB8C - bl FreeAllSpritePalettes - ldr r1, =gReservedSpritePaletteCount - movs r0, 0x8 - strb r0, [r1] - ldr r0, =gUnknown_085E5394 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E53A4 - bl LoadCompressedObjectPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174F70 - - thumb_func_start sub_8174FAC -sub_8174FAC: @ 8174FAC - push {r4,lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085E5374 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_0203BCDC - ldr r1, [r4] - adds r1, 0x12 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001012 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8174FAC - - thumb_func_start sub_8175024 -sub_8175024: @ 8175024 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203BCDC - ldr r0, [r0] - ldrh r0, [r0] - cmp r0, 0x4 - bhi _08175108 - lsls r0, 2 - ldr r1, =_08175044 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_08175044: - .4byte _08175058 - .4byte _08175070 - .4byte _0817507C - .4byte _081750D2 - .4byte _081750DC -_08175058: - ldr r1, =gUnknown_085E5508 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _08175108 - .pool -_08175070: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _08175108 - b _08175112 -_0817507C: - movs r4, 0x20 - str r4, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0xB - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0x3 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0 - movs r3, 0xE - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0x2 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - b _08175108 -_081750D2: - bl sub_81971D0 - bl sub_8197200 - b _08175108 -_081750DC: - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - ldr r0, =gUnknown_0203BCDC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1] - b _08175114 - .pool -_08175108: - ldr r0, =gUnknown_0203BCDC - ldr r1, [r0] - ldrh r0, [r1] - adds r0, 0x1 - strh r0, [r1] -_08175112: - movs r0, 0x1 -_08175114: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8175024 - - thumb_func_start sub_8175120 -sub_8175120: @ 8175120 - push {r4,lr} - adds r2, r0, 0 - ldr r1, [r2, 0x20] - ldr r0, [r2, 0x30] - cmp r1, r0 - beq _08175176 - ldrh r3, [r2, 0x20] - movs r1, 0x20 - ldrsh r0, [r2, r1] - movs r4, 0x30 - ldrsh r1, [r2, r4] - cmp r0, r1 - bge _08175140 - adds r0, r3, 0 - adds r0, 0xF - strh r0, [r2, 0x20] -_08175140: - ldrh r3, [r2, 0x20] - movs r4, 0x20 - ldrsh r0, [r2, r4] - cmp r0, r1 - ble _08175150 - adds r0, r3, 0 - subs r0, 0xF - strh r0, [r2, 0x20] -_08175150: - ldrh r3, [r2, 0x22] - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r4, 0x32 - ldrsh r1, [r2, r4] - cmp r0, r1 - bge _08175164 - adds r0, r3, 0 - adds r0, 0xA - strh r0, [r2, 0x22] -_08175164: - ldrh r3, [r2, 0x22] - movs r4, 0x22 - ldrsh r0, [r2, r4] - cmp r0, r1 - ble _0817519C - adds r0, r3, 0 - subs r0, 0xA - strh r0, [r2, 0x22] - b _0817519C -_08175176: - ldrh r0, [r2, 0x3C] - lsls r1, r0, 16 - movs r0, 0xCE - lsls r0, 17 - cmp r1, r0 - bne _08175190 - lsrs r1, 16 - adds r0, r2, 0 - movs r2, 0x1 - movs r3, 0x3 - bl DoMonFrontSpriteAnimation - b _0817519C -_08175190: - lsrs r1, 16 - adds r0, r2, 0 - movs r2, 0 - movs r3, 0x3 - bl DoMonFrontSpriteAnimation -_0817519C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8175120 - - thumb_func_start sub_81751A4 -sub_81751A4: @ 81751A4 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0x26] - movs r2, 0x26 - ldrsh r0, [r5, r2] - cmp r0, 0x78 - ble _081751BA - adds r0, r5, 0 - bl DestroySprite - b _081751F2 -_081751BA: - adds r0, r1, 0x1 - ldrh r1, [r5, 0x30] - adds r0, r1 - strh r0, [r5, 0x26] - ldrh r4, [r5, 0x2E] - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, 0x8 - ldr r1, =gSineTable - lsls r4, 1 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - muls r0, r1 - cmp r0, 0 - bge _081751E8 - adds r0, 0xFF -_081751E8: - asrs r0, 8 - strh r0, [r5, 0x24] - ldrh r0, [r5, 0x2E] - adds r0, 0x4 - strh r0, [r5, 0x2E] -_081751F2: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81751A4 - - thumb_func_start sub_81751FC -sub_81751FC: @ 81751FC - push {r4,lr} - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - bl Random - adds r2, r0, 0 - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x7 - ands r2, r0 - negs r2, r2 - ldr r0, =gUnknown_085E54D0 - lsls r4, 16 - asrs r4, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r4, 0 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r4, r1, r0 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - bl Random - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - beq _08175274 - movs r0, 0 - b _08175276 - .pool -_08175274: - movs r0, 0x1 -_08175276: - strh r0, [r4, 0x30] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_81751FC - - thumb_func_start sub_8175280 -sub_8175280: @ 8175280 - push {r4,lr} - ldr r4, =gSpecialVar_0x8004 - movs r0, 0xB4 - strh r0, [r4] - ldr r0, =sub_8175364 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xFF - beq _081752AA - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r4] - strh r1, [r0, 0xA] - ldr r0, =gSpecialVar_0x8005 - strh r2, [r0] -_081752AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175280 - - thumb_func_start sub_81752C0 -sub_81752C0: @ 81752C0 - push {r4,lr} - ldr r0, =sub_8175364 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _081752D4 - bl DestroyTask -_081752D4: - bl sub_8152254 - ldr r4, =0x000003e9 - adds r0, r4, 0 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl FreeSpritePaletteByTag - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81752C0 - - thumb_func_start sub_81752F4 -sub_81752F4: @ 81752F4 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r1, [r5, 0xE] - movs r2, 0xE - ldrsh r0, [r5, r2] - cmp r0, 0x6E - ble _08175324 - ldr r2, =gTasks - movs r0, 0x28 - ldrsh r1, [r5, r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r1, [r0, 0x26] - subs r1, 0x1 - strh r1, [r0, 0x26] - ldrb r0, [r5, 0x16] - bl sub_81525D0 - b _08175358 - .pool -_08175324: - adds r0, r1, 0x1 - ldrh r1, [r5, 0x1C] - adds r0, r1 - strh r0, [r5, 0xE] - ldrb r4, [r5, 0x1A] - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x3 - ands r0, r1 - adds r0, 0x8 - ldr r1, =gSineTable - lsls r4, 1 - adds r4, r1 - movs r2, 0 - ldrsh r1, [r4, r2] - muls r0, r1 - cmp r0, 0 - bge _0817534E - adds r0, 0xFF -_0817534E: - asrs r0, 8 - strh r0, [r5, 0xC] - ldrh r0, [r5, 0x1A] - adds r0, 0x4 - strh r0, [r5, 0x1A] -_08175358: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81752F4 - - thumb_func_start sub_8175364 -sub_8175364: @ 8175364 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - mov r8, r4 - movs r7, 0 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r6, r0, r1 - ldrh r0, [r6] - cmp r0, 0x1 - beq _081753E0 - cmp r0, 0x1 - bgt _08175394 - cmp r0, 0 - beq _0817539C - b _081754B0 - .pool -_08175394: - cmp r0, 0xFF - bne _0817539A - b _081754A0 -_0817539A: - b _081754B0 -_0817539C: - movs r0, 0x40 - bl sub_81521C0 - cmp r0, 0 - bne _081753B8 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =gSpecialVar_0x8004 - strh r7, [r0] - ldr r1, =gSpecialVar_0x8005 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_081753B8: - ldr r0, =gUnknown_085E5394 - bl LoadCompressedObjectPic - ldr r0, =gUnknown_085E53A4 - bl LoadCompressedObjectPalette - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - b _081754B0 - .pool -_081753E0: - ldrh r0, [r6, 0x2] - cmp r0, 0 - beq _08175478 - movs r1, 0x3 - bl __umodsi3 - lsls r0, 16 - cmp r0, 0 - bne _08175478 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0xF0 - bl __umodsi3 - adds r5, r0, 0 - lsls r5, 16 - asrs r5, 16 - bl Random - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - movs r0, 0x7 - ands r4, r0 - negs r4, r4 - lsls r4, 16 - asrs r4, 16 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x11 - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_085E53FC - ldr r2, =0x000003e9 - str r4, [sp] - str r0, [sp, 0x4] - str r7, [sp, 0x8] - adds r0, r1, 0 - adds r1, r2, 0 - adds r3, r5, 0 - bl sub_81524C4 - lsls r0, 24 - lsrs r7, r0, 24 - cmp r7, 0xFF - beq _08175478 - adds r4, r7, 0 - ldr r1, =sub_81752F4 - adds r0, r4, 0 - bl sub_8152438 - bl Random - movs r1, 0x3 - ands r1, r0 - cmp r1, 0 - bne _08175468 - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0x1 - bl sub_8152474 -_08175468: - adds r0, r4, 0 - movs r1, 0x7 - mov r2, r8 - bl sub_8152474 - ldrh r0, [r6, 0x1E] - adds r0, 0x1 - strh r0, [r6, 0x1E] -_08175478: - bl sub_81522D4 - ldrh r0, [r6, 0x2] - cmp r0, 0 - beq _08175494 - subs r0, 0x1 - strh r0, [r6, 0x2] - b _081754B0 - .pool -_08175494: - ldrh r0, [r6, 0x1E] - cmp r0, 0 - bne _081754B0 - movs r0, 0xFF - strh r0, [r6] - b _081754B0 -_081754A0: - bl sub_81752C0 - ldr r0, =gSpecialVar_0x8004 - strh r7, [r0] - ldr r1, =gSpecialVar_0x8005 - ldr r2, =0x0000ffff - adds r0, r2, 0 - strh r0, [r1] -_081754B0: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8175364 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/link.s b/asm/link.s index 291f71a57..da4bfbfd1 100644 --- a/asm/link.s +++ b/asm/link.s @@ -52022,7 +52022,7 @@ _080241A6: movs r0, 0 movs r1, 0 bl sub_81973C4 - ldr r2, =gUnknown_082C8959 + ldr r2, =gText_SavingDontTurnOffPower movs r0, 0 str r0, [sp] movs r0, 0x2 @@ -64112,7 +64112,7 @@ _0802A3AE: movs r0, 0 movs r1, 0 bl sub_81973C4 - ldr r2, =gUnknown_082C8959 + ldr r2, =gText_SavingDontTurnOffPower str r4, [sp] movs r0, 0x2 str r0, [sp, 0x4] @@ -69004,7 +69004,7 @@ _0802CA32: ldrh r0, [r7] ldr r1, [r7, 0x4] ldr r2, [r7, 0x8] - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality str r0, [sp, 0x20] add r0, sp, 0x20 ldr r1, [r0, 0x4] @@ -70355,7 +70355,7 @@ _0802D516: strh r0, [r1, 0x12] lsls r0, 24 lsrs r0, 24 - ldr r2, =gUnknown_082C8959 + ldr r2, =gText_SavingDontTurnOffPower movs r1, 0x1 str r1, [sp] movs r1, 0xFF diff --git a/asm/party_menu.s b/asm/party_menu.s index 3d2af7e7d..280b658d4 100755 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -4249,7 +4249,7 @@ _081B243E: adds r0, r4, 0 movs r1, 0 bl FillWindowPixelBuffer - ldr r5, =gText_Confirm + ldr r5, =gMenuText_Confirm movs r0, 0 adds r1, r5, 0 movs r2, 0x30 diff --git a/asm/pokeball.s b/asm/pokeball.s index 0afd27932..b4fc36d97 100755 --- a/asm/pokeball.s +++ b/asm/pokeball.s @@ -936,7 +936,7 @@ _08075B9E: .pool _08075BB4: adds r0, r3, 0 - bl sub_805F110 + bl ShouldPlayNormalPokeCry cmp r0, 0x1 bne _08075BCC lsls r1, r5, 24 @@ -976,7 +976,7 @@ _08075BF8: cmp r0, 0 bne _08075CBA adds r0, r3, 0 - bl sub_805F110 + bl ShouldPlayNormalPokeCry cmp r0, 0x1 bne _08075C22 lsls r1, r5, 24 @@ -1066,7 +1066,7 @@ _08075CBA: b _08075D04 _08075CC0: adds r0, r3, 0 - bl sub_805F110 + bl ShouldPlayNormalPokeCry cmp r0, 0x1 bne _08075CD8 lsls r1, r5, 24 diff --git a/asm/pokedex.s b/asm/pokedex.s index 3d69281c2..e9506881e 100644 --- a/asm/pokedex.s +++ b/asm/pokedex.s @@ -8824,7 +8824,7 @@ _080C0168: adds r3, r5 ldrb r4, [r3, 0x5] lsrs r4, 4 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality lsls r4, 4 movs r2, 0x80 lsls r2, 1 diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index d1f7bd161..a8365ba18 100755 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -14656,7 +14656,7 @@ _080CEC86: adds r1, r3 str r0, [r1] adds r0, r6, 0 - bl pokemon_get_pal + bl GetMonFrontSpritePal ldr r1, [r4] ldr r2, =0x00000cdc adds r1, r2 @@ -14759,7 +14759,7 @@ _080CED7E: adds r1, r4 ldrh r0, [r1] mov r1, r9 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality ldr r1, [r5] ldr r3, =0x00000cdc adds r2, r1, r3 diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index a89c54304..db11f6865 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -1116,7 +1116,7 @@ sub_81C4778: @ 81C4778 bne _081C47AE adds r0, r1, 0 adds r0, 0xC - bl sub_805F110 + bl ShouldPlayNormalPokeCry cmp r0, 0x1 bne _081C47A4 ldrh r0, [r4, 0x2] diff --git a/asm/pokenav.s b/asm/pokenav.s index 0c7a80742..ba6d4fca0 100755 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -13532,7 +13532,7 @@ _081CDBD0: adds r0, r4, 0 mov r1, r8 adds r2, r5, 0 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality mov r2, r9 lsls r1, r2, 7 adds r1, r7, r1 @@ -24408,7 +24408,7 @@ _081D30C4: adds r0, r4, 0 adds r1, r6, 0 adds r2, r5, 0 - bl species_and_otid_get_pal + bl GetFrontSpritePalFromSpeciesAndPersonality mov r1, r9 bl LZ77UnCompWram _081D311A: diff --git a/asm/rom6.s b/asm/rom6.s index 87b780ba5..68719469f 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -4043,12 +4043,12 @@ sub_8137734: @ 8137734 lsrs r1, r0, 24 cmp r1, 0x1 bne _08137760 - ldr r0, =gUnknown_0203BCE4 + ldr r0, =gHasHallOfFameRecords strb r1, [r0] b _0813776C .pool _08137760: - ldr r1, =gUnknown_0203BCE4 + ldr r1, =gHasHallOfFameRecords movs r0, 0 strb r0, [r1] adds r0, r4, 0 @@ -4165,7 +4165,7 @@ _08137838: movs r1, 0x43 bl sub_80EE4DC _0813785A: - ldr r0, =sub_8173694 + ldr r0, =CB2_DoHallOfFameScreen bl SetMainCallback2 movs r0, 0 add sp, 0x1C @@ -4638,7 +4638,7 @@ sub_8137C10: @ 8137C10 thumb_func_start sub_8137C28 sub_8137C28: @ 8137C28 push {lr} - ldr r0, =sub_8174194 + ldr r0, =CB2_DoHallOfFamePC bl SetMainCallback2 bl ScriptContext2_Enable pop {r0} diff --git a/asm/start_menu.s b/asm/start_menu.s index 4f8544eea..e5e91bac8 100644 --- a/asm/start_menu.s +++ b/asm/start_menu.s @@ -1683,7 +1683,7 @@ _080A05AC: movs r0, 0 movs r1, 0x11 bl FillWindowPixelBuffer - ldr r2, =gUnknown_082C8959 + ldr r2, =gText_SavingDontTurnOffPower movs r4, 0 str r4, [sp] movs r0, 0x2 diff --git a/asm/trade.s b/asm/trade.s index ebb624d90..57253154e 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -13814,7 +13814,7 @@ _0807ED98: movs r0, 0x32 strb r0, [r1] ldr r4, =gStringVar4 - ldr r1, =gUnknown_082C8959 + ldr r1, =gText_SavingDontTurnOffPower _0807EDA6: adds r0, r4, 0 bl StringExpandPlaceholders @@ -14668,7 +14668,7 @@ _0807F50A: movs r1, 0x3 strb r1, [r0] ldr r4, =gStringVar4 - ldr r1, =gUnknown_082C8959 + ldr r1, =gText_SavingDontTurnOffPower adds r0, r4, 0 bl StringExpandPlaceholders movs r0, 0 diff --git a/data/battle_7.s b/data/battle_7.s deleted file mode 100644 index ffd2e8daa..000000000 --- a/data/battle_7.s +++ /dev/null @@ -1,44 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2, 0 - -gUnknown_0832C0D0:: @ 832C0D0 - obj_tiles gUnknown_08C1F1C8, 0x1000, 0xd6ff - - .align 2 -gUnknown_0832C0D8:: @ 832C0D8 - obj_tiles gUnknown_08C1F46C, 0x1000, 0xd701 - - .align 2 -gUnknown_0832C0E0:: @ 832C0E0 - obj_tiles gUnknown_08C1F5E8, 0x0800, 0xd6ff - - .align 2 -gUnknown_0832C0E8:: @ 832C0E8 - obj_tiles gUnknown_08C1F5E8, 0x0800, 0xd700 - - .align 2 -gUnknown_0832C0F0:: @ 832C0F0 - obj_tiles gUnknown_08C1F76C, 0x0800, 0xd701 - - .align 2 -gUnknown_0832C0F8:: @ 832C0F8 - obj_tiles gUnknown_08C1F76C, 0x0800, 0xd702 - - .align 2 -gUnknown_0832C100:: @ 832C100 - obj_tiles gUnknown_08C1F8E8, 0x1000, 0xd70b - - .align 2 -gUnknown_0832C108:: @ 832C108 - obj_tiles gUnknown_08C0237C, 0x0100, 0xd704 - obj_tiles gUnknown_08C0237C, 0x0120, 0xd705 - obj_tiles gUnknown_08C0237C, 0x0100, 0xd706 - obj_tiles gUnknown_08C0237C, 0x0120, 0xd707 - - .align 2 -gUnknown_0832C128:: @ 832C128 - obj_pal gBattleInterface_BallStatusBarPal, 0xd6ff - obj_pal gBattleInterface_BallDisplayPal, 0xd704 diff --git a/data/battle_frontier_1.s b/data/battle_frontier_1.s index 03d8e54ad..7bfe075ec 100644 --- a/data/battle_frontier_1.s +++ b/data/battle_frontier_1.s @@ -11,7 +11,6 @@ gUnknown_0860C988:: @ 860C988 .incbin "baserom.gba", 0x60c988, 0x269 gUnknown_0860CBF1:: @ 860CBF1 -@ replacing .incbin "baserom.gba", 0x0060cbf1, 0x283 .byte 0x07, 0x01, 0x08, 0x10, 0x07, 0x01, 0x08, 0x10, 0x07, 0x01, 0x08, 0x10, 0x07, 0x01, 0x08, 0x10, 0x07, 0x01, 0x08, 0x10, 0x00, 0x02, 0x09, 0x10, 0x00, 0x02, 0x09, 0x10, 0x00, 0x02, 0x09, 0x10 .byte 0x00, 0x02, 0x09, 0x10, 0x00, 0x02, 0x09, 0x10, 0x01, 0x03, 0x0a, 0x11, 0x01, 0x03, 0x0a, 0x11, 0x01, 0x03, 0x0a, 0x11, 0x01, 0x03, 0x0a, 0x11, 0x01, 0x03, 0x0a, 0x11, 0x02, 0x04, 0x0b, 0x11 .byte 0x02, 0x04, 0x0b, 0x11, 0x02, 0x04, 0x0b, 0x11, 0x02, 0x04, 0x0b, 0x11, 0x02, 0x04, 0x0b, 0x11, 0x03, 0x05, 0x0c, 0x12, 0x03, 0x05, 0x0c, 0x12, 0x03, 0x05, 0x0c, 0x12, 0x03, 0x05, 0x0c, 0x12 @@ -44,7 +43,7 @@ gUnknown_0860CE94:: @ 860CE94 window_template 0x00, 0x00, 0x03, 0x08, 0x10, 0x0f, 0x0010 window_template 0x00, 0x16, 0x03, 0x08, 0x10, 0x0f, 0x0090 window_template 0x00, 0x08, 0x01, 0x0e, 0x02, 0x0f, 0x0110 - window_template 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 + window_template_terminator gUnknown_0860CEB4:: @ 860CEB4 window_template 0x00, 0x02, 0x02, 0x1a, 0x02, 0x0f, 0x0001 @@ -88,11 +87,9 @@ gUnknown_0860D068:: @ 860D068 .incbin "baserom.gba", 0x60d068, 0x18 gUnknown_0860D080:: @ 860D080 -@ replacing .incbin "baserom.gba", 0x0060d080, 0x10 .byte 0x00, 0x08, 0x0c, 0x04, 0x07, 0x0f, 0x0b, 0x03, 0x02, 0x0a, 0x0e, 0x06, 0x05, 0x0d, 0x09, 0x01 gUnknown_0860D090:: @ 860D090 -@ replacing .incbin "baserom.gba", 0x0060d090, 0x5c .4byte sub_818E9CC .4byte sub_818EA84 .4byte sub_818ED28 @@ -118,41 +115,32 @@ gUnknown_0860D090:: @ 860D090 .4byte sub_818F02C gUnknown_0860D0EC:: @ 860D0EC -@ replacing .incbin "baserom.gba", 0x0060d0ec, 0x10 .4byte 0x00000004, 0x00000008, 0x00100000, 0x00200000 gUnknown_0860D0FC:: @ 860D0FC -@ replacing .incbin "baserom.gba", 0x0060d0fc, 0x10 .4byte 0xfffffffb, 0xfffffff7, 0xffefffff, 0xffdfffff gUnknown_0860D10C:: @ 860D10C -@ replacing .incbin "baserom.gba", 0x0060d10c, 0x40 .byte 0x08, 0x00, 0x04, 0x08, 0x09, 0x0c, 0x08, 0x00, 0x0a, 0x08, 0x0c, 0x00, 0x0b, 0x04, 0x00, 0x08, 0x0c, 0x00, 0x04, 0x08, 0x0d, 0x0c, 0x08, 0x00, 0x0e, 0x08, 0x0c, 0x00, 0x0f, 0x04, 0x00, 0x08 .byte 0x00, 0x00, 0x04, 0x08, 0x01, 0x0c, 0x08, 0x00, 0x02, 0x08, 0x0c, 0x00, 0x03, 0x04, 0x00, 0x08, 0x04, 0x00, 0x04, 0x08, 0x05, 0x0c, 0x08, 0x00, 0x06, 0x08, 0x0c, 0x00, 0x07, 0x04, 0x00, 0x08 gUnknown_0860D14C:: @ 860D14C -@ replacing .incbin "baserom.gba", 0x0060d14c, 0x10 .byte 0x00, 0x08, 0x04, 0x0c, 0x07, 0x0f, 0x03, 0x0b, 0x02, 0x0a, 0x06, 0x0e, 0x05, 0x0d, 0x01, 0x09 gUnknown_0860D15C:: @ 860D15C -@ replacing .incbin "baserom.gba", 0x0060d15c, 0x40 .byte 0x00, 0x08, 0x0c, 0x0e, 0x00, 0x08, 0x0c, 0x0e, 0x01, 0x08, 0x0c, 0x0e, 0x01, 0x08, 0x0c, 0x0e, 0x02, 0x09, 0x0c, 0x0e, 0x02, 0x09, 0x0c, 0x0e, 0x03, 0x09, 0x0c, 0x0e, 0x03, 0x09, 0x0c, 0x0e .byte 0x04, 0x0a, 0x0d, 0x0e, 0x04, 0x0a, 0x0d, 0x0e, 0x05, 0x0a, 0x0d, 0x0e, 0x05, 0x0a, 0x0d, 0x0e, 0x06, 0x0b, 0x0d, 0x0e, 0x06, 0x0b, 0x0d, 0x0e, 0x07, 0x0b, 0x0d, 0x0e, 0x07, 0x0b, 0x0d, 0x0e gUnknown_0860D19C:: @ 860D19C -@ replacing .incbin "baserom.gba", 0x0060d19c, 0x4 .byte 0x17, 0x1b, 0x1d, 0x1e gUnknown_0860D1A0:: @ 860D1A0 -@ replacing .incbin "baserom.gba", 0x0060d1a0, 0x20 .byte 0x10, 0x18, 0x1c, 0x1e, 0x11, 0x18, 0x1c, 0x1e, 0x12, 0x19, 0x1c, 0x1e, 0x13, 0x19, 0x1c, 0x1e, 0x14, 0x1a, 0x1d, 0x1e, 0x15, 0x1a, 0x1d, 0x1e, 0x16, 0x1b, 0x1d, 0x1e, 0x17, 0x1b, 0x1d, 0x1e gUnknown_0860D1C0:: @ 860D1C0 -@ replacing .incbin "baserom.gba", 0x0060d1c0, 0x10 .byte 0x00, 0x0f, 0x08, 0x07, 0x03, 0x0c, 0x0b, 0x04, 0x01, 0x0e, 0x09, 0x06, 0x02, 0x0d, 0x0a, 0x05 gUnknown_0860D1D0:: @ 860D1D0 -@ replacing .incbin "baserom.gba", 0x0060d1d0, 0x44 .4byte 0x82c3188 .4byte 0x82c31aa .4byte 0x82c31c0 @@ -172,7 +160,6 @@ gUnknown_0860D1D0:: @ 860D1D0 .4byte 0x82c3378 gUnknown_0860D214:: @ 860D214 -@ replacing .incbin "baserom.gba", 0x0060d214, 0x80 .4byte 0x82c339b .4byte 0x82c33c4 .4byte 0x82c33e6 @@ -207,7 +194,6 @@ gUnknown_0860D214:: @ 860D214 .4byte 0x82c37bd gUnknown_0860D294:: @ 860D294 -@ replacing .incbin "baserom.gba", 0x0060d294, 0xac .4byte 0x82c37d7 .4byte 0x82c37f1 .4byte 0x82c380c @@ -253,23 +239,18 @@ gUnknown_0860D294:: @ 860D294 .4byte 0x82c3c51 gUnknown_0860D340:: @ 860D340 -@ replacing .incbin "baserom.gba", 0x0060d340, 0x3 .byte 0x68, 0x88, 0x68 gUnknown_0860D343:: @ 860D343 -@ replacing .incbin "baserom.gba", 0x0060d343, 0x3 .byte 0x26, 0x3e, 0x4e gUnknown_0860D346:: @ 860D346 -@ replacing .incbin "baserom.gba", 0x0060d346, 0x3 .byte 0x00, 0x04, 0x00 gUnknown_0860D349:: @ 860D349 -@ replacing .incbin "baserom.gba", 0x0060d349, 0x7 .byte 0x00, 0x05, 0x09, 0x0c, 0x0e, 0x00, 0x00 gUnknown_0860D350:: @ 860D350 -@ replacing .incbin "baserom.gba", 0x0060d350, 0x3c .4byte 0x82c3d1f .4byte 0x82c3d30 .4byte 0x82c3d41 @@ -287,7 +268,6 @@ gUnknown_0860D350:: @ 860D350 .4byte 0x82c3e0f gUnknown_0860D38C:: @ 860D38C -@ replacing .incbin "baserom.gba", 0x0060d38c, 0x1c .4byte 0x82c3c78 .4byte 0x82c3c8e .4byte 0x82c3c9f @@ -297,47 +277,37 @@ gUnknown_0860D38C:: @ 860D38C .4byte 0x82c3d00 gUnknown_0860D3A8:: @ 860D3A8 -@ replacing .incbin "baserom.gba", 0x0060d3a8, 0x3 .byte 0x60, 0x60, 0x60 gUnknown_0860D3AB:: @ 860D3AB -@ replacing .incbin "baserom.gba", 0x0060d3ab, 0x3 .byte 0x38, 0x50, 0x68 gUnknown_0860D3AE:: @ 860D3AE -@ replacing .incbin "baserom.gba", 0x0060d3ae, 0x3 .byte 0x90, 0x90, 0x90 gUnknown_0860D3B1:: @ 860D3B1 -@ replacing .incbin "baserom.gba", 0x0060d3b1, 0x3 .byte 0x38, 0x50, 0x68 gUnknown_0860D3B4:: @ 860D3B4 -@ replacing .incbin "baserom.gba", 0x0060d3b4, 0x10 .byte 0x00, 0x08, 0x0c, 0x04, 0x07, 0x0f, 0x0b, 0x03, 0x02, 0x0a, 0x0e, 0x06, 0x05, 0x0d, 0x09, 0x01 gUnknown_0860D3C4:: @ 860D3C4 -@ replacing .incbin "baserom.gba", 0x0060d3c4, 0x2 .byte 0x00, 0x02 gUnknown_0860D3C6:: @ 860D3C6 -@ replacing .incbin "baserom.gba", 0x0060d3c6, 0x2b .byte 0x00, 0x02, 0x02, 0x00, 0x04, 0x02, 0x00, 0x06, 0x02, 0x00, 0x08, 0x02, 0x00, 0x0a, 0x02, 0x00, 0x0c, 0x02, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x04, 0x01, 0x04, 0x04, 0x01, 0x08, 0x04, 0x01, 0x0c .byte 0x04, 0x01, 0x00, 0x08, 0x02, 0x08, 0x08, 0x02, 0x00, 0x10, 0x03 gUnknown_0860D3F1:: @ 860D3F1 -@ replacing .incbin "baserom.gba", 0x0060d3f1, 0x1 .byte 0x00 gUnknown_0860D3F2:: @ 860D3F2 -@ replacing .incbin "baserom.gba", 0x0060d3f2, 0x1f .byte 0x00, 0x01, 0x70, 0x01, 0x00, 0x00, 0x70, 0x00, 0x30, 0x01, 0x40, 0x01, 0x30, 0x00, 0x40, 0x00, 0x10, 0x01, 0x60, 0x01, 0x10, 0x00, 0x60, 0x00, 0x20, 0x01, 0x50, 0x01, 0x20, 0x00, 0x50 gUnknown_0860D411:: @ 860D411 .incbin "baserom.gba", 0x60d411, 0x8ff //struct - byte 1 and 2 loaded seperately, 2 added to move 1 addr across gUnknown_0860DD10:: @ 860DD10 -@ replacing .incbin "baserom.gba", 0x0060dd10, 0x100 .4byte 0x860d450 .4byte 0x860d460 .4byte 0x860d47c @@ -404,12 +374,10 @@ gUnknown_0860DD10:: @ 860DD10 .4byte 0x860d764 gUnknown_0860DE10:: @ 860DE10 -@ replacing .incbin "baserom.gba", 0x0060de10, 0x40 .byte 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d .byte 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d, 0x04, 0x07, 0x0b, 0x0d gUnknown_0860DE50:: @ 860DE50 -@ replacing .incbin "baserom.gba", 0x0060de50, 0x28 .4byte 0x8195981 .4byte 0x8195a39 .4byte 0x8195ae5 @@ -422,37 +390,30 @@ gUnknown_0860DE50:: @ 860DE50 .4byte 0x8195db9 gUnknown_0860DE78:: @ 860DE78 -@ replacing .incbin "baserom.gba", 0x0060de78, 0xc .2byte 0x003f, 0x0040, 0x0041, 0x0043, 0x0042, 0x0046 gUnknown_0860DE84:: @ 860DE84 -@ replacing .incbin "baserom.gba", 0x0060de84, 0x14 .2byte 0x00b3, 0x00b4, 0x00b7, 0x00c8, 0x00b9, 0x00bb, 0x00c4, 0x00c6, 0x00ba, 0x0000 gUnknown_0860DE98:: @ 860DE98 -@ replacing .incbin "baserom.gba", 0x0060de98, 0x10 .4byte 0x00000010, 0x00000020, 0x00400000, 0x00800000 gUnknown_0860DEA8:: @ 860DEA8 -@ replacing .incbin "baserom.gba", 0x0060dea8, 0x10 .4byte 0xffffffef, 0xffffffdf, 0xffbfffff, 0xff7fffff gUnknown_0860DEB8:: @ 860DEB8 //struct .incbin "baserom.gba", 0x60deb8, 0xb68 gUnknown_0860EA20:: @ 860EA20 -@ replacing .incbin "baserom.gba", 0x0060ea20, 0xc .4byte 0x860e3b8 .4byte 0x860e430 .4byte 0x860e4a0 gUnknown_0860EA2C:: @ 860EA2C -@ replacing .incbin "baserom.gba", 0x0060ea2c, 0x8 .4byte 0x860e510 .4byte 0x860e580 gUnknown_0860EA34:: @ 860EA34 -@ replacing .incbin "baserom.gba", 0x0060ea34, 0x18 .4byte 0x860e5f0 .4byte 0x860e7f0 .4byte 0x860e860 @@ -476,7 +437,6 @@ gUnknown_0860EF70:: @ 860EF70 .incbin "baserom.gba", 0x60ef70, 0x8 gUnknown_0860EF78:: @ 860EF78 -@ replacing .incbin "baserom.gba", 0x0060ef78, 0x20 .4byte sub_819612C .4byte sub_81961F0 .4byte sub_8196274 @@ -490,13 +450,11 @@ gUnknown_0860EF98:: @ 860EF98 .incbin "baserom.gba", 0x60ef98, 0x8 gUnknown_0860EFA0:: @ 860EFA0 -@ replacing .incbin "baserom.gba", 0x0060efa0, 0xc .4byte 0x2021cc4 .4byte 0x2021dc4 .4byte 0x2021ec4 gUnknown_0860EFAC:: @ 860EFAC -@ replacing .incbin "baserom.gba", 0x0060efac, 0x18 .4byte sub_8196A44 .4byte sub_8196A9C .4byte sub_8196B98 @@ -505,12 +463,10 @@ gUnknown_0860EFAC:: @ 860EFAC .4byte sub_8196D14 gUnknown_0860EFC4:: @ 860EFC4 -@ replacing .incbin "baserom.gba", 0x0060efc4, 0x30 .2byte 0x0282, 0x0000, 0xfa72, 0x085e, 0x01e1, 0x0000, 0xfa77, 0x085e, 0x02a9, 0x0000, 0xfa7b, 0x085e, 0x02af, 0x0000, 0xfa80, 0x085e .2byte 0x0033, 0x0000, 0xfa84, 0x085e, 0x011f, 0x0000, 0xfa8a, 0x085e gUnknown_0860EFF4:: @ 860EFF4 -@ replacing .incbin "baserom.gba", 0x0060eff4, 0x1c .4byte 0x85ed104 .4byte 0x85ed111 .4byte 0x85ed11d @@ -520,14 +476,12 @@ gUnknown_0860EFF4:: @ 860EFF4 .4byte 0x85ed153 gUnknown_0860F010:: @ 860F010 -@ replacing .incbin "baserom.gba", 0x0060f010, 0x10 .4byte 0x8680867 .4byte 0x86a0869 .4byte 0x86c086b .4byte 0x86e086d gUnknown_0860F020:: @ 860F020 -@ replacing .incbin "baserom.gba", 0x0060f020, 0x54 .4byte 0x82a5d6c .4byte 0x82a5dab .4byte 0x82a5df1 diff --git a/data/berry_blender.s b/data/berry_blender.s deleted file mode 100644 index d3360d4d8..000000000 --- a/data/berry_blender.s +++ /dev/null @@ -1,167 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2, 0 - -gUnknown_083390D4:: @ 83390D4 - .incbin "baserom.gba", 0x3390d4, 0x20 - -gUnknown_083390F4:: @ 83390F4 - .incbin "baserom.gba", 0x3390f4, 0x400 - -gUnknown_083394F4:: @ 83394F4 - .incbin "baserom.gba", 0x3394f4, 0x246 - -gUnknown_0833973A:: @ 833973A - .incbin "baserom.gba", 0x33973a, 0x61 - -gUnknown_0833979B:: @ 833979B - .incbin "baserom.gba", 0x33979b, 0x2 - -gUnknown_0833979D:: @ 833979D - .incbin "baserom.gba", 0x33979d, 0x33 - -gUnknown_083397D0:: @ 83397D0 - .incbin "baserom.gba", 0x3397d0, 0x4a - -gUnknown_0833981A:: @ 833981A - .incbin "baserom.gba", 0x33981a, 0x17 - -gUnknown_08339831:: @ 8339831 - .incbin "baserom.gba", 0x339831, 0x27 - -gUnknown_08339858:: @ 8339858 - .incbin "baserom.gba", 0x339858, 0x3e - -gUnknown_08339896:: @ 8339896 - .incbin "baserom.gba", 0x339896, 0x1a - -gUnknown_083398B0:: @ 83398B0 - .incbin "baserom.gba", 0x3398b0, 0x2d - -gUnknown_083398DD:: @ 83398DD - .incbin "baserom.gba", 0x3398dd, 0x18 - -gUnknown_083398F5:: @ 83398F5 - .incbin "baserom.gba", 0x3398f5, 0x1f - -gUnknown_08339914:: @ 8339914 - .incbin "baserom.gba", 0x339914, 0x7 - -gUnknown_0833991B:: @ 833991B - .incbin "baserom.gba", 0x33991b, 0x6 - -gUnknown_08339921:: @ 8339921 - .incbin "baserom.gba", 0x339921, 0x7 - -gUnknown_08339928:: @ 8339928 - .incbin "baserom.gba", 0x339928, 0x6 - -gUnknown_0833992E:: @ 833992E - .incbin "baserom.gba", 0x33992e, 0xe - -gUnknown_0833993C:: @ 833993C - .incbin "baserom.gba", 0x33993c, 0x5 - -gUnknown_08339941:: @ 8339941 - .incbin "baserom.gba", 0x339941, 0x2 - -gUnknown_08339943:: @ 8339943 - .incbin "baserom.gba", 0x339943, 0x4 - -gUnknown_08339947:: @ 8339947 - .incbin "baserom.gba", 0x339947, 0x8 - -gUnknown_0833994F:: @ 833994F - .incbin "baserom.gba", 0x33994f, 0xe - -gUnknown_0833995D:: @ 833995D - .incbin "baserom.gba", 0x33995d, 0x13 - -gUnknown_08339970:: @ 8339970 - .incbin "baserom.gba", 0x339970, 0x4 - -gUnknown_08339974:: @ 8339974 - .incbin "baserom.gba", 0x339974, 0xc - -gUnknown_08339980:: @ 8339980 - .incbin "baserom.gba", 0x339980, 0x38 - -gUnknown_083399B8:: @ 83399B8 - .incbin "baserom.gba", 0x3399b8, 0x8 - -gUnknown_083399C0:: @ 83399C0 - .incbin "baserom.gba", 0x3399c0, 0x8 - -gUnknown_083399C8:: @ 83399C8 - .incbin "baserom.gba", 0x3399c8, 0x8 - -gUnknown_083399D0:: @ 83399D0 - .incbin "baserom.gba", 0x3399d0, 0xc - -gUnknown_083399DC:: @ 83399DC - .incbin "baserom.gba", 0x3399dc, 0x8 - -gUnknown_083399E4:: @ 83399E4 - .incbin "baserom.gba", 0x3399e4, 0x3 - -gUnknown_083399E7:: @ 83399E7 - .incbin "baserom.gba", 0x3399e7, 0x5 - -gUnknown_083399EC:: @ 83399EC - .incbin "baserom.gba", 0x3399ec, 0xd4 - -gUnknown_08339AC0:: @ 8339AC0 - .incbin "baserom.gba", 0x339ac0, 0x8 - -gUnknown_08339AC8:: @ 8339AC8 - .incbin "baserom.gba", 0x339ac8, 0x8 - -gUnknown_08339AD0:: @ 8339AD0 - .incbin "baserom.gba", 0x339ad0, 0x8 - -gUnknown_08339AD8:: @ 8339AD8 - .incbin "baserom.gba", 0x339ad8, 0x60 - -gUnknown_08339B38:: @ 8339B38 - .incbin "baserom.gba", 0x339b38, 0x8 - -gUnknown_08339B40:: @ 8339B40 - .incbin "baserom.gba", 0x339b40, 0x98 - -gUnknown_08339BD8:: @ 8339BD8 - .incbin "baserom.gba", 0x339bd8, 0x8 - -gUnknown_08339BE0:: @ 8339BE0 - .incbin "baserom.gba", 0x339be0, 0x44 - -gUnknown_08339C24:: @ 8339C24 - .incbin "baserom.gba", 0x339c24, 0x8 - -gUnknown_08339C2C:: @ 8339C2C - .incbin "baserom.gba", 0x339c2c, 0x2c - -gUnknown_08339C58:: @ 8339C58 - .incbin "baserom.gba", 0x339c58, 0x8 - -gUnknown_08339C60:: @ 8339C60 - .incbin "baserom.gba", 0x339c60, 0x18 - -gUnknown_08339C78:: @ 8339C78 - .incbin "baserom.gba", 0x339c78, 0x28 - -gUnknown_08339CA0:: @ 8339CA0 - .incbin "baserom.gba", 0x339ca0, 0x1e - -gUnknown_08339CBE:: @ 8339CBE - .incbin "baserom.gba", 0x339cbe, 0x5 - -gUnknown_08339CC3:: @ 8339CC3 - .incbin "baserom.gba", 0x339cc3, 0x5 - -gUnknown_08339CC8:: @ 8339CC8 - .incbin "baserom.gba", 0x339cc8, 0x4c - -gUnknown_08339D14:: @ 8339D14 - .incbin "baserom.gba", 0x339d14, 0x8 diff --git a/data/contest.s b/data/contest.s index e9f4f6a1f..ec91ba216 100644 --- a/data/contest.s +++ b/data/contest.s @@ -5,12 +5,10 @@ .align 2, 0 gUnknown_08587A6C:: @ 8587A6C -@ replacing .incbin "baserom.gba", 0x00587a6c, 0x4 -.byte 0x24, 0x4c, 0x74, 0x9c + .byte 0x24, 0x4c, 0x74, 0x9c gUnknown_08587A70:: @ 8587A70 -@ replacing .incbin "baserom.gba", 0x00587a70, 0x4 -.byte 0x24, 0x4c, 0x74, 0x9c + .byte 0x24, 0x4c, 0x74, 0x9c gUnknown_08587A74:: @ 8587A74 .incbin "baserom.gba", 0x587a74, 0x5c @@ -61,137 +59,132 @@ gUnknown_08587C30:: @ 8587C30 .include "data/text/contest_text_pointers.inc" @ 8587D5C -@ replacing .incbin "baserom.gba", 0x00587d5c, 0x34 -.4byte 0x827d5c1 -.4byte 0x827d5dc -.4byte 0x827d600 -.4byte 0x827d612 -.4byte 0x827d612 -.4byte 0x827d62d -.4byte 0x827d654 -.4byte 0x827d67e -.4byte 0x827d69c -.4byte 0x827d6ba -.4byte 0x827d6e5 -.4byte 0x827d706 -.4byte 0x827d71d + .4byte 0x827d5c1 + .4byte 0x827d5dc + .4byte 0x827d600 + .4byte 0x827d612 + .4byte 0x827d612 + .4byte 0x827d62d + .4byte 0x827d654 + .4byte 0x827d67e + .4byte 0x827d69c + .4byte 0x827d6ba + .4byte 0x827d6e5 + .4byte 0x827d706 + .4byte 0x827d71d gUnknown_08587D90:: @ 8587D90 -@ replacing .incbin "baserom.gba", 0x00587d90, 0x80 -.4byte 0x827d743 -.4byte 0x827d764 -.4byte 0x827d785 -.4byte 0x827d7a5 -.4byte 0x827d7c8 -.4byte 0x827d7e8 -.4byte 0x827d831 -.4byte 0x827d855 -.4byte 0x827d830 -.4byte 0x827d872 -.4byte 0x827d88f -.4byte 0x827d8b5 -.4byte 0x827d8e4 -.4byte 0x827d8fe -.4byte 0x827d926 -.4byte 0x827d947 -.4byte 0x827d961 -.4byte 0x827d986 -.4byte 0x827d9b1 -.4byte 0x827d9d9 -.4byte 0x827da03 -.4byte 0x827da31 -.4byte 0x827da5b -.4byte 0x827da85 -.4byte 0x827dab2 -.4byte 0x827dada -.4byte 0x827db03 -.4byte 0x827d830 -.4byte 0x827d830 -.4byte 0x827d830 -.4byte 0x827db1f -.4byte 0x827db4e + .4byte 0x827d743 + .4byte 0x827d764 + .4byte 0x827d785 + .4byte 0x827d7a5 + .4byte 0x827d7c8 + .4byte 0x827d7e8 + .4byte 0x827d831 + .4byte 0x827d855 + .4byte 0x827d830 + .4byte 0x827d872 + .4byte 0x827d88f + .4byte 0x827d8b5 + .4byte 0x827d8e4 + .4byte 0x827d8fe + .4byte 0x827d926 + .4byte 0x827d947 + .4byte 0x827d961 + .4byte 0x827d986 + .4byte 0x827d9b1 + .4byte 0x827d9d9 + .4byte 0x827da03 + .4byte 0x827da31 + .4byte 0x827da5b + .4byte 0x827da85 + .4byte 0x827dab2 + .4byte 0x827dada + .4byte 0x827db03 + .4byte 0x827d830 + .4byte 0x827d830 + .4byte 0x827d830 + .4byte 0x827db1f + .4byte 0x827db4e gUnknown_08587E10:: @ 8587E10 -@ replacing .incbin "baserom.gba", 0x00587e10, 0xf8 -.4byte 0x827db75 -.4byte 0x827dbb0 -.4byte 0x827dbe0 -.4byte 0x827dc0f -.4byte 0x827dc45 -.4byte 0x827dc7c -.4byte 0x827dcb4 -.4byte 0x827dce7 -.4byte 0x827dd12 -.4byte 0x827dd3d -.4byte 0x827dd6f -.4byte 0x827dd8e -.4byte 0x827ddc7 -.4byte 0x827ddf2 -.4byte 0x827de14 -.4byte 0x827de44 -.4byte 0x827de73 -.4byte 0x827dea5 -.4byte 0x827ded9 -.4byte 0x827df02 -.4byte 0x827df3a -.4byte 0x827df63 -.4byte 0x827df8c -.4byte 0x827dfb8 -.4byte 0x827dfe2 -.4byte 0x827e00c -.4byte 0x827e02f -.4byte 0x827e05f -.4byte 0x827e08b -.4byte 0x827e0b5 -.4byte 0x827e0dd -.4byte 0x827e107 -.4byte 0x827e143 -.4byte 0x827e17f -.4byte 0x827e1bb -.4byte 0x827e1f3 -.4byte 0x827e220 -.4byte 0x827e254 -.4byte 0x827e289 -.4byte 0x827e2c5 -.4byte 0x827e2fe -.4byte 0x827e32e -.4byte 0x827e35b -.4byte 0x827e38d -.4byte 0x827e3c1 -.4byte 0x827e3eb -.4byte 0x827e416 -.4byte 0x827e448 -.4byte 0x827e473 -.4byte 0x827e4a6 -.4byte 0x827e4d5 -.4byte 0x827e504 -.4byte 0x827e531 -.4byte 0x827e55a -.4byte 0x827e5b2 -.4byte 0x827e5d0 -.4byte 0x827e606 -.4byte 0x827e638 -.4byte 0x827e658 -.4byte 0x827e68b -.4byte 0x827e6c4 -.4byte 0x827e7ba + .4byte 0x827db75 + .4byte 0x827dbb0 + .4byte 0x827dbe0 + .4byte 0x827dc0f + .4byte 0x827dc45 + .4byte 0x827dc7c + .4byte 0x827dcb4 + .4byte 0x827dce7 + .4byte 0x827dd12 + .4byte 0x827dd3d + .4byte 0x827dd6f + .4byte 0x827dd8e + .4byte 0x827ddc7 + .4byte 0x827ddf2 + .4byte 0x827de14 + .4byte 0x827de44 + .4byte 0x827de73 + .4byte 0x827dea5 + .4byte 0x827ded9 + .4byte 0x827df02 + .4byte 0x827df3a + .4byte 0x827df63 + .4byte 0x827df8c + .4byte 0x827dfb8 + .4byte 0x827dfe2 + .4byte 0x827e00c + .4byte 0x827e02f + .4byte 0x827e05f + .4byte 0x827e08b + .4byte 0x827e0b5 + .4byte 0x827e0dd + .4byte 0x827e107 + .4byte 0x827e143 + .4byte 0x827e17f + .4byte 0x827e1bb + .4byte 0x827e1f3 + .4byte 0x827e220 + .4byte 0x827e254 + .4byte 0x827e289 + .4byte 0x827e2c5 + .4byte 0x827e2fe + .4byte 0x827e32e + .4byte 0x827e35b + .4byte 0x827e38d + .4byte 0x827e3c1 + .4byte 0x827e3eb + .4byte 0x827e416 + .4byte 0x827e448 + .4byte 0x827e473 + .4byte 0x827e4a6 + .4byte 0x827e4d5 + .4byte 0x827e504 + .4byte 0x827e531 + .4byte 0x827e55a + .4byte 0x827e5b2 + .4byte 0x827e5d0 + .4byte 0x827e606 + .4byte 0x827e638 + .4byte 0x827e658 + .4byte 0x827e68b + .4byte 0x827e6c4 + .4byte 0x827e7ba gUnknown_08587F08:: @ 8587F08 -@ replacing .incbin "baserom.gba", 0x00587f08, 0x14 -.4byte 0x827e85f -.4byte 0x827e868 -.4byte 0x827e86f -.4byte 0x827e878 -.4byte 0x827e882 + .4byte 0x827e85f + .4byte 0x827e868 + .4byte 0x827e86f + .4byte 0x827e878 + .4byte 0x827e882 gUnknown_08587F1C:: @ 8587F1C -@ replacing .incbin "baserom.gba", 0x00587f1c, 0x18 -.4byte 0x827e894 -.4byte 0x827e89e -.4byte 0x827e8aa -.4byte 0x827e8b4 -.4byte 0x827e8bf -.4byte 0x827e8ca + .4byte 0x827e894 + .4byte 0x827e89e + .4byte 0x827e8aa + .4byte 0x827e8b4 + .4byte 0x827e8bf + .4byte 0x827e8ca gUnknown_08587F34:: @ 8587F34 .incbin "baserom.gba", 0x587f34, 0x10 diff --git a/data/contest_painting.s b/data/contest_painting.s index 8b1b2afb9..fca82a2b5 100644 --- a/data/contest_painting.s +++ b/data/contest_painting.s @@ -45,13 +45,12 @@ gUnknown_085AFDA4:: @ 85AFDA4 gUnknown_085B02B0:: @ 85B02B0 .incbin "baserom.gba", 0x5b02b0, 0x524 -gUnknown_085B07D4:: @ 85B07D4 -@ replacing .incbin "baserom.gba", 0x005b07d4, 0x14 -.4byte 0x827ea1f -.4byte 0x827ea2b -.4byte 0x827ea36 -.4byte 0x827ea41 -.4byte 0x827ea4d +gContestRankTextPointers:: @ 85B07D4 + .4byte gContestRankNormal + .4byte gContestRankSuper + .4byte gContestRankHyper + .4byte gContestRankMaster + .4byte gContestLink gUnknown_085B07E8:: @ 85B07E8 .incbin "baserom.gba", 0x5b07e8, 0x4 @@ -59,28 +58,25 @@ gUnknown_085B07E8:: @ 85B07E8 gUnknown_085B07EC:: @ 85B07EC .incbin "baserom.gba", 0x5b07ec, 0x8 -gUnknown_085B07F4:: @ 85B07F4 -@ replacing .incbin "baserom.gba", 0x005b07f4, 0x3c -.4byte 0x827ea7f -.4byte 0x827eaa6 -.4byte 0x827eace -.4byte 0x827eafa -.4byte 0x827eb27 -.4byte 0x827eb47 -.4byte 0x827eb79 -.4byte 0x827eb91 -.4byte 0x827ebb2 -.4byte 0x827ebd7 -.4byte 0x827ec03 -.4byte 0x827ec28 -.4byte 0x827ec4e -.4byte 0x827ec73 -.4byte 0x827ec9a +gContestPaintingDescriptionPointers:: @ 85B07F4 + .4byte gContestPaintingCool1 + .4byte gContestPaintingCool2 + .4byte gContestPaintingCool3 + .4byte gContestPaintingBeauty1 + .4byte gContestPaintingBeauty2 + .4byte gContestPaintingBeauty3 + .4byte gContestPaintingCute1 + .4byte gContestPaintingCute2 + .4byte gContestPaintingCute3 + .4byte gContestPaintingSmart1 + .4byte gContestPaintingSmart2 + .4byte gContestPaintingSmart3 + .4byte gContestPaintingTough1 + .4byte gContestPaintingTough2 + .4byte gContestPaintingTough3 gUnknown_085B0830:: @ 85B0830 -@ replacing .incbin "baserom.gba", 0x005b0830, 0x8 -.4byte 0xc0003000, 0x00000000 + .4byte 0xc0003000, 0x00000000 gUnknown_085B0838:: @ 85B0838 .incbin "baserom.gba", 0x5b0838, 0x4 - diff --git a/data/easy_chat.s b/data/easy_chat.s index 2e3b480b5..db2e620ef 100644 --- a/data/easy_chat.s +++ b/data/easy_chat.s @@ -11,45 +11,42 @@ gUnknown_08597550:: @ 8597550 .incbin "baserom.gba", 0x597550, 0x1f8 gUnknown_08597748:: @ 8597748 -@ replacing .incbin "baserom.gba", 0x00597748, 0x1c -.byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a + .byte 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x00, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a gUnknown_08597764:: @ 8597764 -@ replacing .incbin "baserom.gba", 0x00597764, 0x8 -.2byte 0x0209, 0x140b, 0x1030, 0x102a + .2byte 0x0209, 0x140b, 0x1030, 0x102a gUnknown_0859776C:: @ 859776C -@ replacing .incbin "baserom.gba", 0x0059776c, 0x3a8 -.2byte 0x1240, 0x0628, 0x061f, 0x2204, 0x1422, 0x0197, 0x0415, 0x0198, 0x2207, 0x0449, 0x4bff, 0x4b1f, 0x2e3d, 0x1577, 0x6b5f, 0x5ade -.2byte 0x4218, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c5, 0x318c, 0x5af6, 0x6f5b, 0x7fff, 0xccc0, 0x0000, 0xddc0, 0x000c, 0xddc0, 0x00cd -.2byte 0xddc0, 0x0cdd, 0xddc0, 0x0cdd, 0xddc0, 0x00cd, 0xddc0, 0x000c, 0xccc0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -.2byte 0x0000, 0x0000, 0x0000, 0xc000, 0x0000, 0x6c00, 0x0000, 0x66c0, 0x0000, 0x666c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -.2byte 0x0000, 0x0000, 0x000c, 0x0000, 0x00c6, 0x0000, 0x0c66, 0x0000, 0xc666, 0x0000, 0xc000, 0x6666, 0xc000, 0x6666, 0xc000, 0x6666 -.2byte 0xc000, 0xcccc, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6666, 0x000c, 0x6666, 0x000c, 0x6666, 0x000c -.2byte 0xcccc, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -.2byte 0x0000, 0x0000, 0x0000, 0xc000, 0x0000, 0x6c00, 0x0000, 0x66c0, 0x0000, 0x666c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 -.2byte 0x0000, 0x0000, 0x000c, 0x0000, 0x00c6, 0x0000, 0x0c66, 0x0000, 0xc666, 0x0000, 0xc000, 0x6666, 0xc000, 0x6666, 0xc000, 0x6666 -.2byte 0xc000, 0xcccc, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6666, 0x000c, 0x6666, 0x000c, 0x6666, 0x000c -.2byte 0xcccc, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x99c0, 0x9999, 0xf99c, 0xff9f, 0xf99c, 0xf999 -.2byte 0xf99c, 0xf99f, 0x999c, 0xf99f, 0xf99c, 0xf99f, 0x99c0, 0x9999, 0xcc00, 0xcccc, 0x9999, 0x9999, 0xff9f, 0xff9f, 0x9f99, 0x9f9f -.2byte 0xff99, 0xff9f, 0x9f99, 0x9f9f, 0x9f99, 0x9f9f, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x9999, 0xff9f, 0x999f, 0xf99f, 0x9999 -.2byte 0xf999, 0x9999, 0xf99f, 0xf999, 0xf99f, 0x9999, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x0c99, 0x9999, 0xc999, 0x9ff9, 0xc999 -.2byte 0xffff, 0xc999, 0xffff, 0xc99f, 0x9999, 0xc999, 0x9999, 0xcc99, 0xcccc, 0x0ccc, 0x99c0, 0x9999, 0xf99c, 0xff9f, 0xf99c, 0x9f99 -.2byte 0xf99c, 0xff9f, 0x999c, 0x9f9f, 0xf99c, 0xff9f, 0x99c0, 0x9999, 0xcc00, 0xcccc, 0x9999, 0x9999, 0x99f9, 0xf9ff, 0x99f9, 0xf99f -.2byte 0x99f9, 0xf9ff, 0x99f9, 0xf99f, 0x9ff9, 0xf9ff, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x9999, 0xff9f, 0x999f, 0xf999, 0xf999 -.2byte 0xf999, 0x9999, 0xf999, 0x9999, 0xf99f, 0x9999, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x0c99, 0x9999, 0xc999, 0xffff, 0xc99f -.2byte 0xffff, 0xc999, 0x9ff9, 0xc999, 0x9999, 0xc999, 0x9999, 0xcc99, 0xcccc, 0x0ccc, 0x0000, 0x5fff, 0x67bd, 0x4b1a, 0x6fff, 0x0000 -.2byte 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0008, 0x003f, 0xf000, 0xf001, 0xf001 -.2byte 0xf001, 0xf001, 0xf001, 0xff01, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0xf0d5, 0x0001, 0x1001, 0x0300 -.2byte 0x0024, 0x1106, 0x0600, 0x2240, 0x1cd0, 0x1111, 0x1111, 0x2222, 0x223f, 0x5022, 0xf007, 0xf01f, 0xf01f, 0xf01f, 0xf01f, 0xfb1f -.2byte 0x1ff0, 0x1ff0, 0x1ff0, 0x1ff0, 0x01b0, 0x0001, 0x1003, 0x4f14, 0x0011, 0x2208, 0x3032, 0x3031, 0xf0e7, 0x1007, 0xff07, 0x4fd0 -.2byte 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xf0ff, 0xf007, 0xd007, 0x3007, 0xf0e7, 0xf007, 0xf0ff, 0xf007, 0xffff -.2byte 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xf0ff, 0xf007, 0xf0ff, 0xf0f7, 0xf0ff, 0xf007, 0xf0ff, 0xf007 -.2byte 0xff07, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xf0ff, 0xf0f7, 0xf0ff, 0xf0f7, 0xf0ff, 0xf007, 0xf007 -.2byte 0xf007, 0xff07, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xff60, 0xcd40, 0xf0db, 0x50ff, 0x40ff, 0x1224, 0x0300, 0xf430 -.2byte 0x704f, 0x0f4f, 0x3333, 0x3333, 0x1ff0, 0x1ff0, 0x1ff0, 0x1ff0, 0xf0fe, 0xf01f, 0xf01f, 0xf01f, 0xf01f, 0xd01f, 0x001f, 0x03e7 -.2byte 0x30ff, 0x00dc, 0xf006, 0xf001, 0xf001, 0xf001, 0xf001, 0xf001, 0xff01, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0 -.2byte 0x01f0, 0xf0c0, 0x0001, 0x0001 + .2byte 0x1240, 0x0628, 0x061f, 0x2204, 0x1422, 0x0197, 0x0415, 0x0198, 0x2207, 0x0449, 0x4bff, 0x4b1f, 0x2e3d, 0x1577, 0x6b5f, 0x5ade + .2byte 0x4218, 0x0000, 0x0000, 0x0000, 0x0000, 0x18c5, 0x318c, 0x5af6, 0x6f5b, 0x7fff, 0xccc0, 0x0000, 0xddc0, 0x000c, 0xddc0, 0x00cd + .2byte 0xddc0, 0x0cdd, 0xddc0, 0x0cdd, 0xddc0, 0x00cd, 0xddc0, 0x000c, 0xccc0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + .2byte 0x0000, 0x0000, 0x0000, 0xc000, 0x0000, 0x6c00, 0x0000, 0x66c0, 0x0000, 0x666c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + .2byte 0x0000, 0x0000, 0x000c, 0x0000, 0x00c6, 0x0000, 0x0c66, 0x0000, 0xc666, 0x0000, 0xc000, 0x6666, 0xc000, 0x6666, 0xc000, 0x6666 + .2byte 0xc000, 0xcccc, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6666, 0x000c, 0x6666, 0x000c, 0x6666, 0x000c + .2byte 0xcccc, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + .2byte 0x0000, 0x0000, 0x0000, 0xc000, 0x0000, 0x6c00, 0x0000, 0x66c0, 0x0000, 0x666c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 + .2byte 0x0000, 0x0000, 0x000c, 0x0000, 0x00c6, 0x0000, 0x0c66, 0x0000, 0xc666, 0x0000, 0xc000, 0x6666, 0xc000, 0x6666, 0xc000, 0x6666 + .2byte 0xc000, 0xcccc, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x6666, 0x000c, 0x6666, 0x000c, 0x6666, 0x000c + .2byte 0xcccc, 0x000c, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x99c0, 0x9999, 0xf99c, 0xff9f, 0xf99c, 0xf999 + .2byte 0xf99c, 0xf99f, 0x999c, 0xf99f, 0xf99c, 0xf99f, 0x99c0, 0x9999, 0xcc00, 0xcccc, 0x9999, 0x9999, 0xff9f, 0xff9f, 0x9f99, 0x9f9f + .2byte 0xff99, 0xff9f, 0x9f99, 0x9f9f, 0x9f99, 0x9f9f, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x9999, 0xff9f, 0x999f, 0xf99f, 0x9999 + .2byte 0xf999, 0x9999, 0xf99f, 0xf999, 0xf99f, 0x9999, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x0c99, 0x9999, 0xc999, 0x9ff9, 0xc999 + .2byte 0xffff, 0xc999, 0xffff, 0xc99f, 0x9999, 0xc999, 0x9999, 0xcc99, 0xcccc, 0x0ccc, 0x99c0, 0x9999, 0xf99c, 0xff9f, 0xf99c, 0x9f99 + .2byte 0xf99c, 0xff9f, 0x999c, 0x9f9f, 0xf99c, 0xff9f, 0x99c0, 0x9999, 0xcc00, 0xcccc, 0x9999, 0x9999, 0x99f9, 0xf9ff, 0x99f9, 0xf99f + .2byte 0x99f9, 0xf9ff, 0x99f9, 0xf99f, 0x9ff9, 0xf9ff, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x9999, 0xff9f, 0x999f, 0xf999, 0xf999 + .2byte 0xf999, 0x9999, 0xf999, 0x9999, 0xf99f, 0x9999, 0x9999, 0x9999, 0xcccc, 0xcccc, 0x9999, 0x0c99, 0x9999, 0xc999, 0xffff, 0xc99f + .2byte 0xffff, 0xc999, 0x9ff9, 0xc999, 0x9999, 0xc999, 0x9999, 0xcc99, 0xcccc, 0x0ccc, 0x0000, 0x5fff, 0x67bd, 0x4b1a, 0x6fff, 0x0000 + .2byte 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0010, 0x0008, 0x003f, 0xf000, 0xf001, 0xf001 + .2byte 0xf001, 0xf001, 0xf001, 0xff01, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0xf0d5, 0x0001, 0x1001, 0x0300 + .2byte 0x0024, 0x1106, 0x0600, 0x2240, 0x1cd0, 0x1111, 0x1111, 0x2222, 0x223f, 0x5022, 0xf007, 0xf01f, 0xf01f, 0xf01f, 0xf01f, 0xfb1f + .2byte 0x1ff0, 0x1ff0, 0x1ff0, 0x1ff0, 0x01b0, 0x0001, 0x1003, 0x4f14, 0x0011, 0x2208, 0x3032, 0x3031, 0xf0e7, 0x1007, 0xff07, 0x4fd0 + .2byte 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xf0ff, 0xf007, 0xd007, 0x3007, 0xf0e7, 0xf007, 0xf0ff, 0xf007, 0xffff + .2byte 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xf0ff, 0xf007, 0xf0ff, 0xf0f7, 0xf0ff, 0xf007, 0xf0ff, 0xf007 + .2byte 0xff07, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xf0ff, 0xf0f7, 0xf0ff, 0xf0f7, 0xf0ff, 0xf007, 0xf007 + .2byte 0xf007, 0xff07, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0x07f0, 0xff60, 0xcd40, 0xf0db, 0x50ff, 0x40ff, 0x1224, 0x0300, 0xf430 + .2byte 0x704f, 0x0f4f, 0x3333, 0x3333, 0x1ff0, 0x1ff0, 0x1ff0, 0x1ff0, 0xf0fe, 0xf01f, 0xf01f, 0xf01f, 0xf01f, 0xd01f, 0x001f, 0x03e7 + .2byte 0x30ff, 0x00dc, 0xf006, 0xf001, 0xf001, 0xf001, 0xf001, 0xf001, 0xff01, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0, 0x01f0 + .2byte 0x01f0, 0xf0c0, 0x0001, 0x0001 gUnknown_08597B14:: @ 8597B14 .incbin "baserom.gba", 0x597b14, 0x20 @@ -67,9 +64,8 @@ gUnknown_08597C24:: @ 8597C24 .incbin "baserom.gba", 0x597c24, 0xc gUnknown_08597C30:: @ 8597C30 -@ replacing .incbin "baserom.gba", 0x00597c30, 0x24 -.byte 0x83, 0x18, 0x04, 0x00, 0x63, 0x18, 0x06, 0x00, 0x03, 0x18, 0x0a, 0x00, 0xa3, 0x18, 0x02, 0x00, 0xb0, 0x0c, 0x02, 0x00, 0x83, 0x18, 0x04, 0x00, 0x89, 0x0c, 0x02, 0x01, 0x65, 0x14, 0x0a, 0x03 -.byte 0x03, 0x18, 0x0a, 0x02 + .byte 0x83, 0x18, 0x04, 0x00, 0x63, 0x18, 0x06, 0x00, 0x03, 0x18, 0x0a, 0x00, 0xa3, 0x18, 0x02, 0x00, 0xb0, 0x0c, 0x02, 0x00, 0x83, 0x18, 0x04, 0x00, 0x89, 0x0c, 0x02, 0x01, 0x65, 0x14, 0x0a, 0x03 + .byte 0x03, 0x18, 0x0a, 0x02 gUnknown_08597C54:: @ 8597C54 .incbin "baserom.gba", 0x597c54, 0x10 @@ -84,11 +80,10 @@ gUnknown_08597C8C:: @ 8597C8C .incbin "baserom.gba", 0x597c8c, 0x4 gUnknown_08597C90:: @ 8597C90 -@ replacing .incbin "baserom.gba", 0x00597c90, 0x10 -.4byte 0x862b810 -.4byte 0x862b832 -.4byte 0x862b84b -.4byte 0x862b86c + .4byte 0x862b810 + .4byte 0x862b832 + .4byte 0x862b84b + .4byte 0x862b86c gUnknown_08597CA0:: @ 8597CA0 .incbin "baserom.gba", 0x597ca0, 0x20 @@ -100,8 +95,7 @@ gUnknown_08597CE8:: @ 8597CE8 .incbin "baserom.gba", 0x597ce8, 0x20 gUnknown_08597D08:: @ 8597D08 -@ replacing .incbin "baserom.gba", 0x00597d08, 0x10 -.byte 0x00, 0x0c, 0x18, 0x38, 0x44, 0x50, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00 + .byte 0x00, 0x0c, 0x18, 0x38, 0x44, 0x50, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00 gUnknown_08597D18:: @ 8597D18 .incbin "baserom.gba", 0x597d18, 0x50 @@ -122,8 +116,7 @@ gUnknown_08597E48:: @ 8597E48 .incbin "baserom.gba", 0x597e48, 0x18 gUnknown_08597E60:: @ 8597E60 -@ replacing .incbin "baserom.gba", 0x00597e60, 0xc -.byte 0x10, 0x6f, 0xc4, 0x00, 0x10, 0x4e, 0x82, 0xa0, 0x10, 0x50, 0x86, 0xaa + .byte 0x10, 0x6f, 0xc4, 0x00, 0x10, 0x4e, 0x82, 0xa0, 0x10, 0x50, 0x86, 0xaa gUnknown_08597E6C:: @ 8597E6C .incbin "baserom.gba", 0x597e6c, 0x30 @@ -138,21 +131,16 @@ gUnknown_08597E6C:: @ 8597E6C .include "data/text/easy_chat/easy_chat_group_name_pointers.inc" gUnknown_0859E62C:: @ 859E62C -@ replacing .incbin "baserom.gba", 0x0059e62c, 0x8 -.2byte 0x0a29, 0x1020, 0x020e, 0x0a33 + .2byte 0x0a29, 0x1020, 0x020e, 0x0a33 gUnknown_0859E634:: @ 859E634 -@ replacing .incbin "baserom.gba", 0x0059e634, 0xc -.2byte 0x100f, 0x0a02, 0x0e25, 0x0c03, 0x0803, 0x0c00 + .2byte 0x100f, 0x0a02, 0x0e25, 0x0c03, 0x0803, 0x0c00 gUnknown_0859E640:: @ 859E640 -@ replacing .incbin "baserom.gba", 0x0059e640, 0xc -.2byte 0x0c3a, 0x0c3a, 0x0c01, 0x0a2a, 0x0607, 0x0c01 + .2byte 0x0c3a, 0x0c3a, 0x0c01, 0x0a2a, 0x0607, 0x0c01 gUnknown_0859E64C:: @ 859E64C -@ replacing .incbin "baserom.gba", 0x0059e64c, 0xc -.2byte 0x1039, 0x122e, 0x0c04, 0x0a3d, 0x0630, 0x0c04 + .2byte 0x1039, 0x122e, 0x0c04, 0x0a3d, 0x0630, 0x0c04 gUnknown_0859E658:: @ 859E658 -@ replacing .incbin "baserom.gba", 0x0059e658, 0x4 -.2byte 0x019a, 0x0000 + .2byte 0x019a, 0x0000 diff --git a/data/event_scripts.s b/data/event_scripts.s index ad1216b91..b650c7501 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -683,7 +683,16 @@ gUnknown_0827E8DA:: @ 827E8DA .incbin "baserom.gba", 0x27e8da, 0x132 gUnknown_0827EA0C:: @ 827EA0C - .incbin "baserom.gba", 0x27ea0c, 0x2b0 + .incbin "baserom.gba", 0x27ea0c, 0x13 + +@ 827EA1F + .include "data/text/contest_rank_text.inc" + +gUnknown_0827EA52:: @ 827EA52 + .incbin "baserom.gba", 0x27ea52, 0x2d + +@ 827EA7F + .include "data/text/contest_painting_descriptions.inc" gUnknown_0827ECBC:: @ 27ECBC .incbin "baserom.gba", 0x27ecbc, 0x7 @@ -1029,7 +1038,7 @@ gUnknown_082C8845:: @ 82C8845 gUnknown_082C892A:: @ 82C892A .incbin "baserom.gba", 0x2c892a, 0x2f -gUnknown_082C8959:: @ 82C8959 +gText_SavingDontTurnOffPower:: @ 82C8959 .incbin "baserom.gba", 0x2c8959, 0x22 gUnknown_082C897B:: @ 82C897B diff --git a/data/field_effect_helpers.s b/data/field_effect_helpers.s index 015318e5a..6d0b0b3bb 100644 --- a/data/field_effect_helpers.s +++ b/data/field_effect_helpers.s @@ -7,23 +7,19 @@ gUnknown_085CDC38:: @ 85CDC38 .incbin "baserom.gba", 0x5cdc38, 0x6 gUnknown_085CDC3E:: @ 85CDC3E -@ replacing .incbin "baserom.gba", 0x005cdc3e, 0x4 -.byte 0x00, 0x01, 0x02, 0x03 + .byte 0x00, 0x01, 0x02, 0x03 gUnknown_085CDC42:: @ 85CDC42 -@ replacing .incbin "baserom.gba", 0x005cdc42, 0xa -.2byte 0x0004, 0x0004, 0x0004, 0x0010, 0x0000 + .2byte 0x0004, 0x0004, 0x0004, 0x0010, 0x0000 gUnknown_085CDC4C:: @ 85CDC4C -@ replacing .incbin "baserom.gba", 0x005cdc4c, 0x8 -.4byte sub_8154C7C -.4byte sub_8154CA0 + .4byte sub_8154C7C + .4byte sub_8154CA0 gUnknown_085CDC54:: @ 85CDC54 -@ replacing .incbin "baserom.gba", 0x005cdc54, 0xc -.4byte sub_815547C -.4byte sub_81554AC -.4byte sub_815550C + .4byte sub_815547C + .4byte sub_81554AC + .4byte sub_815550C gUnknown_085CDC60:: @ 85CDC60 .incbin "baserom.gba", 0x5cdc60, 0xa diff --git a/data/field_ground_effect.s b/data/field_ground_effect.s index 78742a058..be5639406 100644 --- a/data/field_ground_effect.s +++ b/data/field_ground_effect.s @@ -5,110 +5,100 @@ .align 2, 0 gUnknown_0850E5DC:: @ 850E5DC -@ replacing .incbin "baserom.gba", 0x0050e5dc, 0x8 -.4byte 0x00000020, 0x00000010 + .4byte 0x00000020, 0x00000010 gUnknown_0850E5E4:: @ 850E5E4 -@ replacing .incbin "baserom.gba", 0x0050e5e4, 0x18 -.4byte MetatileBehavior_IsTallGrass -.4byte MetatileBehavior_IsLongGrass -.4byte MetatileBehavior_IsPuddle -.4byte MetatileBehavior_IsSurfableWaterOrUnderwater -.4byte MetatileBehavior_IsShallowFlowingWater -.4byte ShouldDoJumpLandingDustEffect + .4byte MetatileBehavior_IsTallGrass + .4byte MetatileBehavior_IsLongGrass + .4byte MetatileBehavior_IsPuddle + .4byte MetatileBehavior_IsSurfableWaterOrUnderwater + .4byte MetatileBehavior_IsShallowFlowingWater + .4byte ShouldDoJumpLandingDustEffect gUnknown_0850E5FC:: @ 850E5FC -@ replacing .incbin "baserom.gba", 0x0050e5fc, 0x18 -.4byte 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00004000, 0x00010000 + .4byte 0x00001000, 0x00002000, 0x00004000, 0x00008000, 0x00004000, 0x00010000 gUnknown_0850E614:: @ 850E614 -@ replacing .incbin "baserom.gba", 0x0050e614, 0x10 -.4byte MetatileBehavior_IsJumpSouth -.4byte MetatileBehavior_IsJumpNorth -.4byte MetatileBehavior_IsJumpWest -.4byte MetatileBehavior_IsJumpEast + .4byte MetatileBehavior_IsJumpSouth + .4byte MetatileBehavior_IsJumpNorth + .4byte MetatileBehavior_IsJumpWest + .4byte MetatileBehavior_IsJumpEast gUnknown_0850E624:: @ 850E624 -@ replacing .incbin "baserom.gba", 0x0050e624, 0x10 -.byte 0x73, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, 0x00, 0x73 + .byte 0x73, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x73, 0x53, 0x00, 0x00, 0x73 gUnknown_0850E634:: @ 850E634 -@ replacing .incbin "baserom.gba", 0x0050e634, 0x10 -.byte 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x02 + .byte 0x02, 0x02, 0x02, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, 0x00, 0x02 gUnknown_0850E644:: @ 850E644 -@ replacing .incbin "baserom.gba", 0x0050e644, 0x10 -.byte 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x01 + .byte 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, 0x01 gUnknown_0850E654:: @ 850E654 -@ replacing .incbin "baserom.gba", 0x0050e654, 0xc -.4byte DoTracksGroundEffect_None -.4byte DoTracksGroundEffect_Footprints -.4byte DoTracksGroundEffect_BikeTireTracks + .4byte DoTracksGroundEffect_None + .4byte DoTracksGroundEffect_Footprints + .4byte DoTracksGroundEffect_BikeTireTracks gUnknown_0850E660:: @ 850E660 .incbin "baserom.gba", 0x50e660, 0x4 gUnknown_0850E664:: @ 850E664 -@ replacing .incbin "baserom.gba", 0x0050e664, 0x10 -.byte 0x01, 0x02, 0x07, 0x08, 0x01, 0x02, 0x06, 0x05, 0x05, 0x08, 0x03, 0x04, 0x06, 0x07, 0x03, 0x04 + .byte 0x01, 0x02, 0x07, 0x08, 0x01, 0x02, 0x06, 0x05, 0x05, 0x08, 0x03, 0x04, 0x06, 0x07, 0x03, 0x04 gUnknown_0850E674:: @ 850E674 -@ replacing .incbin "baserom.gba", 0x0050e674, 0xe0 -.4byte GroundEffect_SpawnOnTallGrass -.4byte GroundEffect_StepOnTallGrass -.4byte GroundEffect_SpawnOnLongGrass -.4byte GroundEffect_StepOnLongGrass -.4byte GroundEffect_WaterReflection -.4byte GroundEffect_IceReflection -.4byte GroundEffect_FlowingWater -.4byte GroundEffect_SandTracks -.4byte GroundEffect_DeepSandTracks -.4byte GroundEffect_Ripple -.4byte GroundEffect_StepOnPuddle -.4byte GroundEffect_SandHeap -.4byte GroundEffect_JumpOnTallGrass -.4byte GroundEffect_JumpOnLongGrass -.4byte GroundEffect_JumpOnShallowWater -.4byte GroundEffect_JumpOnWater -.4byte GroundEffect_JumpLandingDust -.4byte GroundEffect_ShortGrass -.4byte GroundEffect_HotSprings -.4byte GroundEffect_Seaweed -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte little_step -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte double_little_steps -.4byte triple_little_steps -.4byte triple_little_steps -.4byte double_little_steps -.4byte triple_little_steps -.4byte triple_little_steps -.4byte quad_little_steps -.4byte quad_little_steps -.4byte quad_little_steps -.4byte quad_little_steps -.4byte oct_little_steps -.4byte oct_little_steps + .4byte GroundEffect_SpawnOnTallGrass + .4byte GroundEffect_StepOnTallGrass + .4byte GroundEffect_SpawnOnLongGrass + .4byte GroundEffect_StepOnLongGrass + .4byte GroundEffect_WaterReflection + .4byte GroundEffect_IceReflection + .4byte GroundEffect_FlowingWater + .4byte GroundEffect_SandTracks + .4byte GroundEffect_DeepSandTracks + .4byte GroundEffect_Ripple + .4byte GroundEffect_StepOnPuddle + .4byte GroundEffect_SandHeap + .4byte GroundEffect_JumpOnTallGrass + .4byte GroundEffect_JumpOnLongGrass + .4byte GroundEffect_JumpOnShallowWater + .4byte GroundEffect_JumpOnWater + .4byte GroundEffect_JumpLandingDust + .4byte GroundEffect_ShortGrass + .4byte GroundEffect_HotSprings + .4byte GroundEffect_Seaweed + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte little_step + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte double_little_steps + .4byte triple_little_steps + .4byte triple_little_steps + .4byte double_little_steps + .4byte triple_little_steps + .4byte triple_little_steps + .4byte quad_little_steps + .4byte quad_little_steps + .4byte quad_little_steps + .4byte quad_little_steps + .4byte oct_little_steps + .4byte oct_little_steps diff --git a/data/field_player_avatar.s b/data/field_player_avatar.s index 082f04d64..efb2f34cb 100644 --- a/data/field_player_avatar.s +++ b/data/field_player_avatar.s @@ -8,127 +8,111 @@ gUnknown_084973FC:: @ 84973FC -@ replacing .incbin "baserom.gba", 0x004973fc, 0x48 -.4byte MetatileBehavior_IsTrickHouseSlipperyFloor -.4byte MetatileBehavior_IsIce_2 -.4byte MetatileBehavior_IsWalkSouth -.4byte MetatileBehavior_IsWalkNorth -.4byte MetatileBehavior_IsWalkWest -.4byte MetatileBehavior_IsWalkEast -.4byte MetatileBehavior_IsSouthwardCurrent -.4byte MetatileBehavior_IsNorthwardCurrent -.4byte MetatileBehavior_IsWestwardCurrent -.4byte MetatileBehavior_IsEastwardCurrent -.4byte MetatileBehavior_IsSlideSouth -.4byte MetatileBehavior_IsSlideNorth -.4byte MetatileBehavior_IsSlideWest -.4byte MetatileBehavior_IsSlideEast -.4byte MetatileBehavior_IsWaterfall -.4byte MetatileBehavior_IsSecretBaseJumpMat -.4byte MetatileBehavior_IsSecretBaseSpinMat -.4byte MetatileBehavior_IsMuddySlope + .4byte MetatileBehavior_IsTrickHouseSlipperyFloor + .4byte MetatileBehavior_IsIce_2 + .4byte MetatileBehavior_IsWalkSouth + .4byte MetatileBehavior_IsWalkNorth + .4byte MetatileBehavior_IsWalkWest + .4byte MetatileBehavior_IsWalkEast + .4byte MetatileBehavior_IsSouthwardCurrent + .4byte MetatileBehavior_IsNorthwardCurrent + .4byte MetatileBehavior_IsWestwardCurrent + .4byte MetatileBehavior_IsEastwardCurrent + .4byte MetatileBehavior_IsSlideSouth + .4byte MetatileBehavior_IsSlideNorth + .4byte MetatileBehavior_IsSlideWest + .4byte MetatileBehavior_IsSlideEast + .4byte MetatileBehavior_IsWaterfall + .4byte MetatileBehavior_IsSecretBaseJumpMat + .4byte MetatileBehavior_IsSecretBaseSpinMat + .4byte MetatileBehavior_IsMuddySlope gUnknown_08497444:: @ 8497444 -@ replacing .incbin "baserom.gba", 0x00497444, 0x4c -.4byte ForcedMovement_None -.4byte ForcedMovement_Slip -.4byte ForcedMovement_Slip -.4byte ForcedMovement_WalkSouth -.4byte ForcedMovement_WalkNorth -.4byte ForcedMovement_WalkWest -.4byte ForcedMovement_WalkEast -.4byte ForcedMovement_PushedSouthByCurrent -.4byte ForcedMovement_PushedNorthByCurrent -.4byte ForcedMovement_PushedWestByCurrent -.4byte ForcedMovement_PushedEastByCurrent -.4byte ForcedMovement_SlideSouth -.4byte ForcedMovement_SlideNorth -.4byte ForcedMovement_SlideWest -.4byte ForcedMovement_SlideEast -.4byte ForcedMovement_PushedSouthByCurrent -.4byte ForcedMovement_0xBB -.4byte ForcedMovement_0xBC -.4byte ForcedMovement_MuddySlope + .4byte ForcedMovement_None + .4byte ForcedMovement_Slip + .4byte ForcedMovement_Slip + .4byte ForcedMovement_WalkSouth + .4byte ForcedMovement_WalkNorth + .4byte ForcedMovement_WalkWest + .4byte ForcedMovement_WalkEast + .4byte ForcedMovement_PushedSouthByCurrent + .4byte ForcedMovement_PushedNorthByCurrent + .4byte ForcedMovement_PushedWestByCurrent + .4byte ForcedMovement_PushedEastByCurrent + .4byte ForcedMovement_SlideSouth + .4byte ForcedMovement_SlideNorth + .4byte ForcedMovement_SlideWest + .4byte ForcedMovement_SlideEast + .4byte ForcedMovement_PushedSouthByCurrent + .4byte ForcedMovement_0xBB + .4byte ForcedMovement_0xBC + .4byte ForcedMovement_MuddySlope gUnknown_08497490:: @ 8497490 -@ replacing .incbin "baserom.gba", 0x00497490, 0xc -.4byte PlayerNotOnBikeNotMoving -.4byte PlayerNotOnBikeTurningInPlace -.4byte PlayerNotOnBikeMoving + .4byte PlayerNotOnBikeNotMoving + .4byte PlayerNotOnBikeTurningInPlace + .4byte PlayerNotOnBikeMoving gUnknown_0849749C:: @ 849749C -@ replacing .incbin "baserom.gba", 0x0049749c, 0x14 -.4byte MetatileBehavior_IsBumpySlope -.4byte MetatileBehavior_IsIsolatedVerticalRail -.4byte MetatileBehavior_IsIsolatedHorizontalRail -.4byte MetatileBehavior_IsVerticalRail -.4byte MetatileBehavior_IsHorizontalRail + .4byte MetatileBehavior_IsBumpySlope + .4byte MetatileBehavior_IsIsolatedVerticalRail + .4byte MetatileBehavior_IsIsolatedHorizontalRail + .4byte MetatileBehavior_IsVerticalRail + .4byte MetatileBehavior_IsHorizontalRail gUnknown_084974B0:: @ 84974B0 -@ replacing .incbin "baserom.gba", 0x004974b0, 0x8 -.byte 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x00, 0x00, 0x00 + .byte 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x00, 0x00, 0x00 gUnknown_084974B8:: @ 84974B8 -@ replacing .incbin "baserom.gba", 0x004974b8, 0x20 -.4byte PlayerAvatarTransition_Normal -.4byte PlayerAvatarTransition_MachBike -.4byte PlayerAvatarTransition_AcroBike -.4byte PlayerAvatarTransition_Surfing -.4byte PlayerAvatarTransition_Underwater -.4byte PlayerAvatarTransition_ReturnToField -.4byte PlayerAvatarTransition_Dummy -.4byte PlayerAvatarTransition_Dummy + .4byte PlayerAvatarTransition_Normal + .4byte PlayerAvatarTransition_MachBike + .4byte PlayerAvatarTransition_AcroBike + .4byte PlayerAvatarTransition_Surfing + .4byte PlayerAvatarTransition_Underwater + .4byte PlayerAvatarTransition_ReturnToField + .4byte PlayerAvatarTransition_Dummy + .4byte PlayerAvatarTransition_Dummy gUnknown_084974D8:: @ 84974D8 -@ replacing .incbin "baserom.gba", 0x004974d8, 0x10 -.4byte MetatileBehavior_IsSouthArrowWarp -.4byte MetatileBehavior_IsNorthArrowWarp -.4byte MetatileBehavior_IsWestArrowWarp -.4byte MetatileBehavior_IsEastArrowWarp + .4byte MetatileBehavior_IsSouthArrowWarp + .4byte MetatileBehavior_IsNorthArrowWarp + .4byte MetatileBehavior_IsWestArrowWarp + .4byte MetatileBehavior_IsEastArrowWarp gUnknown_084974E8:: @ 84974E8 -@ replacing .incbin "baserom.gba", 0x004974e8, 0x10 -.byte 0x64, 0x69, 0x65, 0x6a, 0x66, 0x6b, 0x67, 0x6c, 0x6f, 0x70, 0x68, 0x6d, 0x89, 0x8a, 0xbf, 0xc0 + .byte 0x64, 0x69, 0x65, 0x6a, 0x66, 0x6b, 0x67, 0x6c, 0x6f, 0x70, 0x68, 0x6d, 0x89, 0x8a, 0xbf, 0xc0 gUnknown_084974F8:: @ 84974F8 -@ replacing .incbin "baserom.gba", 0x004974f8, 0x10 -.byte 0x00, 0x59, 0x01, 0x5a, 0x3f, 0x5b, 0x02, 0x5c, 0x6f, 0x70, 0x03, 0x5d, 0x89, 0x8a, 0xbf, 0xc0 + .byte 0x00, 0x59, 0x01, 0x5a, 0x3f, 0x5b, 0x02, 0x5c, 0x6f, 0x70, 0x03, 0x5d, 0x89, 0x8a, 0xbf, 0xc0 gUnknown_08497508:: @ 8497508 -@ replacing .incbin "baserom.gba", 0x00497508, 0x2 -.byte 0xe6, 0xe7 + .byte 0xe6, 0xe7 gUnknown_0849750A:: @ 849750A -@ replacing .incbin "baserom.gba", 0x0049750a, 0x2 -.byte 0xeb, 0xec + .byte 0xeb, 0xec gUnknown_0849750C:: @ 849750C -@ replacing .incbin "baserom.gba", 0x0049750c, 0x14 -.byte 0x00, 0x01, 0x01, 0x02, 0x3f, 0x04, 0x02, 0x08, 0x6f, 0x10, 0x59, 0x01, 0x5a, 0x02, 0x5b, 0x04, 0x5c, 0x08, 0x70, 0x10 + .byte 0x00, 0x01, 0x01, 0x02, 0x3f, 0x04, 0x02, 0x08, 0x6f, 0x10, 0x59, 0x01, 0x5a, 0x02, 0x5b, 0x04, 0x5c, 0x08, 0x70, 0x10 gUnknown_08497520:: @ 8497520 -@ replacing .incbin "baserom.gba", 0x00497520, 0x10 -.4byte MetatileBehavior_IsSouthArrowWarp -.4byte MetatileBehavior_IsNorthArrowWarp -.4byte MetatileBehavior_IsWestArrowWarp -.4byte MetatileBehavior_IsEastArrowWarp + .4byte MetatileBehavior_IsSouthArrowWarp + .4byte MetatileBehavior_IsNorthArrowWarp + .4byte MetatileBehavior_IsWestArrowWarp + .4byte MetatileBehavior_IsEastArrowWarp gUnknown_08497530:: @ 8497530 -@ replacing .incbin "baserom.gba", 0x00497530, 0xc -.4byte sub_808C3A4 -.4byte do_boulder_dust -.4byte sub_808C484 + .4byte sub_808C3A4 + .4byte do_boulder_dust + .4byte sub_808C484 gUnknown_0849753C:: @ 849753C -@ replacing .incbin "baserom.gba", 0x0049753c, 0x4 -.4byte sub_808C544 + .4byte sub_808C544 gUnknown_08497540:: @ 8497540 -@ replacing .incbin "baserom.gba", 0x00497540, 0x10 -.4byte sub_808C61C -.4byte sub_808C644 -.4byte sub_808C6BC -.4byte sub_808C6FC + .4byte sub_808C61C + .4byte sub_808C644 + .4byte sub_808C6BC + .4byte sub_808C6FC gUnknown_08497550:: @ 8497550 .incbin "baserom.gba", 0x497550, 0x4 @@ -137,23 +121,22 @@ gUnknown_08497554:: @ 8497554 .incbin "baserom.gba", 0x497554, 0x8 gUnknown_0849755C:: @ 849755C -@ replacing .incbin "baserom.gba", 0x0049755c, 0x40 -.4byte fish0 -.4byte fish1 -.4byte fish2 -.4byte fish3 -.4byte fish4 -.4byte fish5 -.4byte fish6 -.4byte fish7 -.4byte fish8 -.4byte fish9 -.4byte fishA_wait_for_a_pressed -.4byte fishB -.4byte fishC -.4byte fishD -.4byte fishE -.4byte fishF + .4byte fish0 + .4byte fish1 + .4byte fish2 + .4byte fish3 + .4byte fish4 + .4byte fish5 + .4byte fish6 + .4byte fish7 + .4byte fish8 + .4byte fish9 + .4byte fishA_wait_for_a_pressed + .4byte fishB + .4byte fishC + .4byte fishD + .4byte fishE + .4byte fishF gUnknown_0849759C:: @ 849759C .incbin "baserom.gba", 0x49759c, 0x6 @@ -171,6 +154,5 @@ gUnknown_084975B0:: @ 84975B0 .incbin "baserom.gba", 0x4975b0, 0xc gUnknown_084975BC:: @ 84975BC -@ replacing .incbin "baserom.gba", 0x004975bc, 0x8 -.byte 0x01, 0x03, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00 + .byte 0x01, 0x03, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00 diff --git a/data/fieldmap.s b/data/fieldmap.s index 83b0b2a50..1daa3efdf 100644 --- a/data/fieldmap.s +++ b/data/fieldmap.s @@ -5,5 +5,4 @@ .align 2, 0 gUnknown_08486EF8:: @ 8486EF8 -@ replacing .incbin "baserom.gba", 0x00486ef8, 0x4 -.4byte 0x00000000 + .4byte 0x00000000 diff --git a/data/graphics.s b/data/graphics.s index e89177a1d..87b983a80 100644 --- a/data/graphics.s +++ b/data/graphics.s @@ -149,14 +149,38 @@ gUnknown_08C2A6D4:: @ 8C2A6D4 gUnknown_08C2A6EC:: @ 8C2A6EC .incbin "baserom.gba", 0xc2a6ec, 0x27d0 -gUnknown_08C2CEBC:: @ 8C2CEBC +gSubstituteDollPal:: @ 8C2CEBC .incbin "baserom.gba", 0xc2cebc, 0x24 -gUnknown_08C2CEE0:: @ 8C2CEE0 +gSubstituteDollGfx:: @ 8C2CEE0 .incbin "baserom.gba", 0xc2cee0, 0x240 -gUnknown_08C2D120:: @ 8C2D120 - .incbin "baserom.gba", 0xc2d120, 0x600 +gSubstituteDollTilemap:: @ 8C2D120 + .incbin "baserom.gba", 0xc2d120, 552 + +gUnknown_08C2D348:: @ 8C2D348 + .incbin "baserom.gba", 0xC2D348, 196 + +gUnknown_08C2D40C:: @ 8C2D40C + .incbin "baserom.gba", 0xC2D40C, 28 + +gContestConfetti_Gfx:: @ 8C2D428 + .incbin "baserom.gba", 0xC2D428, 288 + +gContestConfetti_Pal:: @ 8C2D548 + .incbin "baserom.gba", 0xC2D548, 40 + +gUnknown_08C2D570:: @ 8C2D570 + .incbin "baserom.gba", 0xC2D570, 316 + +gUnknown_08C2D6AC:: @ 8C2D6AC + .incbin "baserom.gba", 0xC2D6AC, 36 + +gUnknown_08C2D6D0:: @ 8C2D6D0 + .incbin "baserom.gba", 0xC2D6D0, 40 + +gUnknown_08C2D6F8:: @ 8C2D6F8 + .incbin "baserom.gba", 0xC2D6F8, 40 gUnknown_08C2D720:: @ 8C2D720 .incbin "baserom.gba", 0xc2d720, 0x210 @@ -1197,8 +1221,44 @@ gUnknown_08DC9608:: @ 8DC9608 .incbin "baserom.gba", 0xdc9608, 0x20 gUnknown_08DC9628:: @ 8DC9628 - .incbin "baserom.gba", 0xdc9628, 0x2788 + .incbin "baserom.gba", 0xdc9628, 0x320 + +gBerryBlenderMiscPalette:: @ 8DCAB88 + .incbin "graphics/berry_blender/misc.gbapal" + +gBerryBlenderArrowPalette:: @ 8DC9948 + .incbin "graphics/berry_blender/arrow.gbapal" +gUnknown_8DC9988:: @ 8DC9988 + .incbin "baserom.gba", 0xdc9988, 0x200 + + .align 2 +gBerryBlenderMarubatsuTiles:: @ 8DC9B88 + .incbin "graphics/berry_blender/marubatsu.4bpp" + + .align 2 +gBerryBlenderParticlesTiles:: @ 8E90818 + .incbin "graphics/berry_blender/particles.4bpp" + + .space 0x120 + + .align 2 +gBerryBlenderCountdownNumbersTiles:: @ 8DC9F88 + .incbin "graphics/berry_blender/countdown_numbers.4bpp" + + .align 2 +gBerryBlenderStartTiles:: @ 8DCA588 + .incbin "graphics/berry_blender/start.4bpp" + + .space 0x200 + + .align 2 +gBerryBlenderArrowTiles:: @ 8DCAB88 + .incbin "graphics/berry_blender/arrow.4bpp" + +gUnknown_08DCB388:: @ 8DCB388 + .incbin "baserom.gba", 0xdcb388, 0xA28 + gUnknown_08DCBDB0:: @ 8DCBDB0 .incbin "baserom.gba", 0xdcbdb0, 0x20 diff --git a/data/hall_of_fame.s b/data/hall_of_fame.s deleted file mode 100644 index 2678d96a6..000000000 --- a/data/hall_of_fame.s +++ /dev/null @@ -1,46 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -gUnknown_085E5374:: @ 85E5374 - .incbin "baserom.gba", 0x5e5374, 0xc - -gUnknown_085E5380:: @ 85E5380 - .incbin "baserom.gba", 0x5e5380, 0x8 - -gUnknown_085E5388:: @ 85E5388 - .incbin "baserom.gba", 0x5e5388, 0x4 - -gUnknown_085E538C:: @ 85E538C - .incbin "baserom.gba", 0x5e538c, 0x8 - -gUnknown_085E5394:: @ 85E5394 - .incbin "baserom.gba", 0x5e5394, 0x10 - -gUnknown_085E53A4:: @ 85E53A4 - .incbin "baserom.gba", 0x5e53a4, 0x10 - -gUnknown_085E53B4:: @ 85E53B4 - .incbin "baserom.gba", 0x5e53b4, 0x6 - -gUnknown_085E53BA:: @ 85E53BA - .incbin "baserom.gba", 0x5e53ba, 0x2a - -gUnknown_085E53E4:: @ 85E53E4 - .incbin "baserom.gba", 0x5e53e4, 0x18 - -gUnknown_085E53FC:: @ 85E53FC - .incbin "baserom.gba", 0x5e53fc, 0xd4 - -gUnknown_085E54D0:: @ 85E54D0 - .incbin "baserom.gba", 0x5e54d0, 0x18 - -gUnknown_085E54E8:: @ 85E54E8 - .incbin "baserom.gba", 0x5e54e8, 0x20 - -gUnknown_085E5508:: @ 85E5508 - .incbin "baserom.gba", 0x5e5508, 0x1cc - -gUnknown_085E56D4:: @ 85E56D4 - .incbin "baserom.gba", 0x5e56d4, 0x1c diff --git a/data/item_menu.s b/data/item_menu.s index 762f10ca4..b160200e8 100644 --- a/data/item_menu.s +++ b/data/item_menu.s @@ -4,61 +4,100 @@ .section .rodata gUnknown_08613F90:: @ 8613F90 - .incbin "baserom.gba", 0x613f90, 0xc + .4byte 0x11F0, 0x1E1, 0x21DE +@ possibly a struct gUnknown_08613F9C:: @ 8613F9C - .incbin "baserom.gba", 0x613f9c, 0x18 + .4byte 0 + .4byte bag_menu_change_item_callback + .4byte sub_81AB520 + .4byte 0 + .4byte 0x80000 + .4byte 0x7003011 gUnknown_08613FB4:: @ 8613FB4 - .incbin "baserom.gba", 0x613fb4, 0x78 + .4byte gMenuText_Use, ItemMenu_UseOutOfBattle + .4byte gMenuText_Toss, ItemMenu_Toss + .4byte gMenuText_Register, ItemMenu_Register + .4byte gMenuText_Give, ItemMenu_Give + .4byte gText_Cancel2, ItemMenu_Cancel + .4byte gMenuText_Use, ItemMenu_UseInBattle + .4byte gMenuText_Check, ItemMenu_UseOutOfBattle + .4byte gMenuText_Walk, ItemMenu_UseOutOfBattle + .4byte gMenuText_Deselect, ItemMenu_Register + .4byte gMenuText_CheckTag, ItemMenu_CheckTag + .4byte gMenuText_Confirm, unknown_ItemMenu_Confirm + .4byte gMenuText_Show, unknown_ItemMenu_Show + .4byte gMenuText_Give2, unknown_ItemMenu_Give2 + .4byte gMenuText_Confirm, unknown_ItemMenu_Confirm2 + .4byte gText_EmptyString2, NULL gUnknown_0861402C:: @ 861402C - .incbin "baserom.gba", 0x61402c, 0x4 + .byte 0, 3, 1, 4 gUnknown_08614030:: @ 8614030 - .incbin "baserom.gba", 0x614030, 0x4 + .byte 0, 2, 14, 4 gUnknown_08614034:: @ 8614034 - .incbin "baserom.gba", 0x614034, 0x4 + .byte 3, 14, 1, 4 gUnknown_08614038:: @ 8614038 - .incbin "baserom.gba", 0x614038, 0x4 + .byte 0, 3, 14, 4 gUnknown_0861403C:: @ 861403C - .incbin "baserom.gba", 0x61403c, 0x6 + .byte 9, 14, 0, 3, 1, 4 gUnknown_08614042:: @ 8614042 - .incbin "baserom.gba", 0x614042, 0x2 + .byte 5, 4 gUnknown_08614044:: @ 8614044 - .incbin "baserom.gba", 0x614044, 0x2 + .byte 3, 4 gUnknown_08614046:: @ 8614046 - .incbin "baserom.gba", 0x614046, 0x1 + .byte 4 gUnknown_08614047:: @ 8614047 - .incbin "baserom.gba", 0x614047, 0x4 + .byte 10, 9, 14, 4 gUnknown_0861404B:: @ 861404B - .incbin "baserom.gba", 0x61404b, 0x2 + .byte 11, 4 gUnknown_0861404D:: @ 861404D - .incbin "baserom.gba", 0x61404d, 0x2 + .byte 12, 4 gUnknown_0861404F:: @ 861404F - .incbin "baserom.gba", 0x61404f, 0x5 + .byte 13, 4 + .align 2 gUnknown_08614054:: @ 8614054 - .incbin "baserom.gba", 0x614054, 0x30 + .4byte unknown_item_menu_type + .4byte unknown_item_menu_type + .4byte item_menu_type_2 + .4byte display_sell_item_ask_str + .4byte unknown_ItemMenu_Confirm + .4byte unknown_item_menu_type + .4byte display_deposit_item_ask_str + .4byte unknown_item_menu_type + .4byte unknown_item_menu_type + .4byte unknown_item_menu_type + .4byte NULL + .4byte item_menu_type_b + .align 2 gUnknown_08614084:: @ 8614084 - .incbin "baserom.gba", 0x614084, 0x8 + .4byte BagMenuActuallyToss + .4byte BagMenuCancelToss gUnknown_0861408C:: @ 861408C - .incbin "baserom.gba", 0x61408c, 0x8 + .4byte sub_81AD84C + .4byte sub_81AD6FC +@ probably a struct gUnknown_08614094:: @ 8614094 - .incbin "baserom.gba", 0x614094, 0x10 + .4byte 0x1101C00 + .4byte 0xFFFF1064 + .4byte 0x6FFFFF + .4byte 0x6F gUnknown_086140A4:: @ 86140A4 .incbin "baserom.gba", 0x6140a4, 0xc0 diff --git a/data/mauville_old_man.s b/data/mauville_old_man.s index 70146bfe4..0baca9782 100644 --- a/data/mauville_old_man.s +++ b/data/mauville_old_man.s @@ -5,30 +5,27 @@ .align 2, 0 gUnknown_0859EFE4:: @ 859EFE4 -@ replacing .incbin "baserom.gba", 0x0059efe4, 0xc -.2byte 0x2811, 0x1029, 0x1018, 0x0e0d, 0x1a1a, 0x1a1d + .2byte 0x2811, 0x1029, 0x1018, 0xE0D, 0x1A1A, 0x1A1D gUnknown_0859EFF0:: @ 859EFF0 -@ replacing .incbin "baserom.gba", 0x0059eff0, 0x20 -.4byte 0x8294295 -.4byte 0x82942a1 -.4byte 0x82942ae -.4byte 0x82942bb -.4byte 0x82942c6 -.4byte 0x82942d5 -.4byte 0x82942e3 -.4byte 0x82942f0 + .4byte 0x8294295 + .4byte 0x82942a1 + .4byte 0x82942ae + .4byte 0x82942bb + .4byte 0x82942c6 + .4byte 0x82942d5 + .4byte 0x82942e3 + .4byte 0x82942f0 gUnknown_0859F010:: @ 859F010 -@ replacing .incbin "baserom.gba", 0x0059f010, 0x20 -.4byte 0x8294313 -.4byte 0x8294359 -.4byte 0x8294398 -.4byte 0x82943da -.4byte 0x829441c -.4byte 0x8294460 -.4byte 0x82944a0 -.4byte 0x82944d5 + .4byte 0x8294313 + .4byte 0x8294359 + .4byte 0x8294398 + .4byte 0x82943da + .4byte 0x829441c + .4byte 0x8294460 + .4byte 0x82944a0 + .4byte 0x82944d5 gUnknown_0859F030:: @ 859F030 .incbin "baserom.gba", 0x59f030, 0x18 @@ -40,6 +37,4 @@ gUnknown_0859F278:: @ 859F278 .incbin "baserom.gba", 0x59f278, 0x10 gUnknown_0859F288:: @ 859F288 -@ replacing .incbin "baserom.gba", 0x0059f288, 0x8 -.4byte 0x00000024, 0x00000008 - + .4byte 0x00000024, 0x00000008 diff --git a/data/mystery_event_msg.s b/data/mystery_event_msg.s index c06d95809..2e3664a70 100644 --- a/data/mystery_event_msg.s +++ b/data/mystery_event_msg.s @@ -4,99 +4,91 @@ .section .rodata gText_MysteryGiftBerry:: @ 8674AE4 -.string "Obtained a {STR_VAR_2} BERRY!\nDad has it at PETALBURG GYM.$" + .string "Obtained a {STR_VAR_2} BERRY!\nDad has it at PETALBURG GYM.$" gText_MysteryGiftBerryTransform:: @ 8674B16 -.string "The {STR_VAR_1} BERRY transformed into\none {STR_VAR_2} BERRY.$" + .string "The {STR_VAR_1} BERRY transformed into\none {STR_VAR_2} BERRY.$" gText_MysteryGiftBerryObtained:: @ 8674B42 -.string "The {STR_VAR_1} BERRY has already been\nobtained.$" + .string "The {STR_VAR_1} BERRY has already been\nobtained.$" gText_MysteryGiftSpecialRibbon:: @ 8674B6A -.string "A special RIBBON was awarded to\nyour party POKéMON.$" + .string "A special RIBBON was awarded to\nyour party POKéMON.$" gText_MysteryGiftNationalDex:: @ 8674B9E -.string "The POKéDEX has been upgraded\nwith the NATIONAL MODE.$" + .string "The POKéDEX has been upgraded\nwith the NATIONAL MODE.$" gText_MysteryGiftRareWord:: @ 8674BD4 -.string "A rare word has been added.$" + .string "A rare word has been added.$" gText_MysteryGiftSentOver:: @ 8674BF0 -.string "{STR_VAR_1} was sent over!$" + .string "{STR_VAR_1} was sent over!$" gText_MysteryGiftFullParty:: @ 8674C02 -.string "Your party is full.\n{STR_VAR_1} could not be sent over.$" + .string "Your party is full.\n{STR_VAR_1} could not be sent over.$" gText_MysteryGiftNewTrainer:: @ 8674C31 -.string "A new TRAINER has arrived in\nHOENN.$" -.string "A new adversary has arrived in the\nBATTLE TOWER.$" + .string "A new TRAINER has arrived in\nHOENN.$" + .string "A new adversary has arrived in the\nBATTLE TOWER.$" gText_MysteryGiftCantBeUsed:: @ 8674C86 -.string "This data can’t be used in\nthis version.$" -@ replacing .incbin "baserom.gba", 0x00674caf, 0x2e //no pointer to this one -.incbin "baserom.gba", 0x00674caf, 0x2e + .string "This data can’t be used in\nthis version.$" + .incbin "baserom.gba", 0x00674caf, 0x2e //no pointer to this one gText_MysteryGiftStampCard:: -.string "Thank you for using the STAMP CARD\nSystem.\pYou have {STR_VAR_1} more to collect to\nfill your STAMP CARD.$" + .string "Thank you for using the STAMP CARD\nSystem.\pYou have {STR_VAR_1} more to collect to\nfill your STAMP CARD.$" gUnknown_08674D3D:: @ 8674D3D -@ replacing .incbin "baserom.gba", 0x00674d3d, 0xa1 -.incbin "baserom.gba", 0x00674d3d, 0xa1 + .incbin "baserom.gba", 0x00674d3d, 0xa1 gText_MysteryGiftEgg:: -.string "Thank you for using the MYSTERY\nGIFT System.\pFrom the POKéMON CENTER we\nhave a gift--a POKéMON EGG!\pPlease raise it with love and\nkindness.$" -.string "Oh, your party appears to be full.\pPlease come see me after storing\na POKéMON on a PC.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pFrom the POKéMON CENTER we\nhave a gift--a POKéMON EGG!\pPlease raise it with love and\nkindness.$" + .string "Oh, your party appears to be full.\pPlease come see me after storing\na POKéMON on a PC.$" gUnknown_08674EC1:: @ 8674EC1 -@ replacing .incbin "baserom.gba", 0x00674ec1, 0x29 -.incbin "baserom.gba", 0x00674ec1, 0x29 + .incbin "baserom.gba", 0x00674ec1, 0x29 gText_MysteryGiftVisitingTrainer:: -.string "Thank you for using the MYSTERY\nGIFT System.\pBy holding this WONDER CARD, you\nmay take part in a survey at a\lPOKéMON MART.\pUse these surveys to invite\nTRAINERS to SOOTOPOLIS CITY.\p…Let me give you a secret\npassword for a survey:\p“GIVE ME\nAWESOME TRAINER”\pWrite that in on a survey and send\nit to the WIRELESS\lCOMMUNICATION SYSTEM.$" -.string "Thank you for using the MYSTERY\nGIFT System.\pA TRAINER has arrived in\nSOOTOPOLIS CITY looking for you.\pWe hope you will enjoy\nbattling the visiting TRAINER.\pYou may invite other TRAINERS by\nentering other passwords.\pTry looking for other passwords\nthat may work.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pBy holding this WONDER CARD, you\nmay take part in a survey at a\lPOKéMON MART.\pUse these surveys to invite\nTRAINERS to SOOTOPOLIS CITY.\p…Let me give you a secret\npassword for a survey:\p“GIVE ME\nAWESOME TRAINER”\pWrite that in on a survey and send\nit to the WIRELESS\lCOMMUNICATION SYSTEM.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pA TRAINER has arrived in\nSOOTOPOLIS CITY looking for you.\pWe hope you will enjoy\nbattling the visiting TRAINER.\pYou may invite other TRAINERS by\nentering other passwords.\pTry looking for other passwords\nthat may work.$" gUnknown_0867513C:: @ 867513C -@ replacing .incbin "baserom.gba", 0x0067513c, 0x48 -.incbin "baserom.gba", 0x0067513c, 0x48 + .incbin "baserom.gba", 0x0067513c, 0x48 gText_MysteryGiftBattleCountCard:: -.string "Thank you for using the MYSTERY\nGIFT System.\pYour BATTLE COUNT CARD keeps\ntrack of your battle record against\lTRAINERS with the same CARD.\pLook for and battle TRAINERS who\nhave the same CARD as you.\pYou may check the overall rankings\nby reading the NEWS.\pPlease do give it a try!$" -.string "Thank you for using the MYSTERY\nGIFT System.\pCongratulations!\pYou have won a prize for winning\nthree battles!\pWe hope you will be inspired to\nbattle some more.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pYour BATTLE COUNT CARD keeps\ntrack of your battle record against\lTRAINERS with the same CARD.\pLook for and battle TRAINERS who\nhave the same CARD as you.\pYou may check the overall rankings\nby reading the NEWS.\pPlease do give it a try!$" + .string "Thank you for using the MYSTERY\nGIFT System.\pCongratulations!\pYou have won a prize for winning\nthree battles!\pWe hope you will be inspired to\nbattle some more.$" gUnknown_0867533C:: @ 867533C -@ replacing .incbin "baserom.gba", 0x0067533c, 0x6d -.incbin "baserom.gba", 0x0067533c, 0x6d + .incbin "baserom.gba", 0x0067533c, 0x6d gText_MysteryGiftTicket1:: -.string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" -.string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" -.string "Thank you for using the MYSTERY\nGIFT System.$" -.string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" + .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" + .string "Thank you for using the MYSTERY\nGIFT System.$" + .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" gUnknown_0867550B:: @ 867550B -@ replacing .incbin "baserom.gba", 0x0067550b, 0x76 -.incbin "baserom.gba", 0x0067550b, 0x76 + .incbin "baserom.gba", 0x0067550b, 0x76 gText_MysteryGiftTicket2:: -.string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" -.string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" -.string "Thank you for using the MYSTERY\nGIFT System.$" -.string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pYou must be {PLAYER}.\nThere is a ticket here for you.$" + .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" + .string "Thank you for using the MYSTERY\nGIFT System.$" + .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" gUnknown_086756E3:: @ 86756E3 -@ replacing .incbin "baserom.gba", 0x006756e3, 0x25 -.incbin "baserom.gba", 0x006756e3, 0x25 + .incbin "baserom.gba", 0x006756e3, 0x25 gText_MysteryGiftAlteringCave:: -.string "Thank you for using the MYSTERY\nGIFT System.\pThere appears to be a rumor about\nrare POKéMON sightings.\pThe sightings reportedly came from\nthe ALTERING CAVE on ROUTE 103.\pPerhaps it would be worthwhile for\nyou to investigate this rumor.$" + .string "Thank you for using the MYSTERY\nGIFT System.\pThere appears to be a rumor about\nrare POKéMON sightings.\pThe sightings reportedly came from\nthe ALTERING CAVE on ROUTE 103.\pPerhaps it would be worthwhile for\nyou to investigate this rumor.$" gUnknown_086757F4:: @ 86757F4 -.incbin "baserom.gba", 0x006757f4, 0x6d -@ replacing .incbin "baserom.gba", 0x00675861, 0x78 + .incbin "baserom.gba", 0x006757f4, 0x6d gText_MysteryGiftOldSeaMap:: -.string "Thank you for using the MYSTERY\nGIFT System.\pLet me confirm--you are {PLAYER}?\pWe received this OLD SEA MAP\naddressed to you.$" -.string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" -.string "Thank you for using the MYSTERY\nGIFT System.$" -.string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" -.string " " + .string "Thank you for using the MYSTERY\nGIFT System.\pLet me confirm--you are {PLAYER}?\pWe received this OLD SEA MAP\naddressed to you.$" + .string "It appears to be for use at the\nLILYCOVE CITY port.\pWhy not give it a try and see what\nit is about?$" + .string "Thank you for using the MYSTERY\nGIFT System.$" + .string "Oh, I’m sorry, {PLAYER}.\nYour BAG’s KEY ITEMS POCKET is full.\pPlease store something on your PC,\nthen come back for this.$" + .align 2 diff --git a/data/naming_screen.s b/data/naming_screen.s index 0167d0234..15b66ba5a 100644 --- a/data/naming_screen.s +++ b/data/naming_screen.s @@ -7,16 +7,14 @@ gUnknown_0858BD78:: @ 858BD78 .incbin "baserom.gba", 0x58bd78, 0x40 gUnknown_0858BDB8:: @ 858BDB8 -@ replacing .incbin "baserom.gba", 0x0058bdb8, 0x10 -.4byte 0x8273216 -.4byte 0x8273256 -.4byte 0x8273296 -.4byte 0x82732d9 + .4byte 0x8273216 + .4byte 0x8273256 + .4byte 0x8273296 + .4byte 0x82732d9 gUnknown_0858BDC8:: @ 858BDC8 -@ replacing .incbin "baserom.gba", 0x0058bdc8, 0x38 -.string "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!$" -.string " " + .string "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!$" + .align 2 gUnknown_0858BE00:: @ 858BE00 .incbin "baserom.gba", 0x58be00, 0x10 @@ -25,83 +23,67 @@ gUnknown_0858BE10:: @ 858BE10 .incbin "baserom.gba", 0x58be10, 0x30 gUnknown_0858BE40:: @ 858BE40 -@ replacing .incbin "baserom.gba", 0x0058be40, 0x60 -.string "abcdef .ghijkl ,mnopqrs tuvwxyz ABCDEF .GHIJKL ,MNOPQRS TUVWXYZ 01234 56789 !?♂♀/- …“”‘’ " + .string "abcdef .ghijkl ,mnopqrs tuvwxyz ABCDEF .GHIJKL ,MNOPQRS TUVWXYZ 01234 56789 !?♂♀/- …“”‘’ " gUnknown_0858BEA0:: @ 858BEA0 -@ replacing .incbin "baserom.gba", 0x0058bea0, 0x3 -.byte 0x08, 0x08, 0x06 + .byte 0x08, 0x08, 0x06 gUnknown_0858BEA3:: @ 858BEA3 -@ replacing .incbin "baserom.gba", 0x0058bea3, 0x18 -.byte 0x00, 0x0c, 0x18, 0x38, 0x44, 0x50, 0x5c, 0x7b, 0x00, 0x0c, 0x18, 0x38, 0x44, 0x50, 0x5c, 0x7b, 0x00, 0x16, 0x2c, 0x42, 0x58, 0x6e, 0x00, 0x00 + .byte 0x00, 0x0c, 0x18, 0x38, 0x44, 0x50, 0x5c, 0x7b, 0x00, 0x0c, 0x18, 0x38, 0x44, 0x50, 0x5c, 0x7b, 0x00, 0x16, 0x2c, 0x42, 0x58, 0x6e, 0x00, 0x00 gUnknown_0858BEBB:: @ 858BEBB -@ replacing .incbin "baserom.gba", 0x0058bebb, 0x3 -.byte 0x00, 0x02, 0x01 + .byte 0x00, 0x02, 0x01 gUnknown_0858BEBE:: @ 858BEBE -@ replacing .incbin "baserom.gba", 0x0058bebe, 0x3 -.byte 0x01, 0x00, 0x02 + .byte 0x01, 0x00, 0x02 gUnknown_0858BEC1:: @ 858BEC1 -@ replacing .incbin "baserom.gba", 0x0058bec1, 0x3 -.byte 0x02, 0x01, 0x00 + .byte 0x02, 0x01, 0x00 gUnknown_0858BEC4:: @ 858BEC4 -@ replacing .incbin "baserom.gba", 0x0058bec4, 0x10 -.4byte sub_80E37B4 -.4byte sub_80E37DC -.4byte sub_80E3870 -.4byte sub_80E3904 + .4byte sub_80E37B4 + .4byte sub_80E37DC + .4byte sub_80E3870 + .4byte sub_80E3904 gUnknown_0858BED4:: @ 858BED4 -@ replacing .incbin "baserom.gba", 0x0058bed4, 0x8 -.2byte 0x0000, 0xfffc, 0xfffe, 0xffff + .2byte 0x0000, 0xfffc, 0xfffe, 0xffff gUnknown_0858BEDC:: @ 858BEDC -@ replacing .incbin "baserom.gba", 0x0058bedc, 0x8 -.2byte 0x0002, 0x0003, 0x0002, 0x0001 + .2byte 0x0002, 0x0003, 0x0002, 0x0001 gUnknown_0858BEE4:: @ 858BEE4 -@ replacing .incbin "baserom.gba", 0x0058bee4, 0x4 -.byte 0x01, 0x02, 0x03, 0x00 + .byte 0x01, 0x02, 0x03, 0x00 gUnknown_0858BEE8:: @ 858BEE8 -@ replacing .incbin "baserom.gba", 0x0058bee8, 0x10 -.4byte sub_80E40AC -.4byte sub_80E4100 -.4byte sub_80E4104 -.4byte sub_80E4178 + .4byte sub_80E40AC + .4byte sub_80E4100 + .4byte sub_80E4104 + .4byte sub_80E4178 gUnknown_0858BEF8:: @ 858BEF8 -@ replacing .incbin "baserom.gba", 0x0058bef8, 0x6 -.2byte 0x0001, 0x0003, 0x0002 + .2byte 0x0001, 0x0003, 0x0002 gUnknown_0858BEFE:: @ 858BEFE -@ replacing .incbin "baserom.gba", 0x0058befe, 0x6 -.2byte 0x0004, 0x0006, 0x0005 + .2byte 0x0004, 0x0006, 0x0005 gUnknown_0858BF04:: @ 858BF04 -@ replacing .incbin "baserom.gba", 0x0058bf04, 0x14 -.4byte TaskDummy2 -.4byte sub_80E4384 -.4byte sub_80E43E0 -.4byte sub_80E4420 -.4byte sub_80E447C + .4byte TaskDummy2 + .4byte sub_80E4384 + .4byte sub_80E43E0 + .4byte sub_80E4420 + .4byte sub_80E447C gUnknown_0858BF18:: @ 858BF18 -@ replacing .incbin "baserom.gba", 0x0058bf18, 0x10 -.4byte sub_80E450C -.4byte sub_80E4558 -.4byte sub_80E4580 -.4byte sub_80E45A4 + .4byte sub_80E450C + .4byte sub_80E4558 + .4byte sub_80E4580 + .4byte sub_80E45A4 gUnknown_0858BF28:: @ 858BF28 -@ replacing .incbin "baserom.gba", 0x0058bf28, 0xc -.4byte sub_80E468C -.4byte sub_80E4692 -.4byte sub_80E46E8 + .4byte sub_80E468C + .4byte sub_80E4692 + .4byte sub_80E46E8 gUnknown_0858BF34:: @ 858BF34 .incbin "baserom.gba", 0x58bf34, 0xa @@ -116,47 +98,41 @@ gUnknown_0858BF50:: @ 858BF50 .incbin "baserom.gba", 0x58bf50, 0x8 gUnknown_0858BF58:: @ 858BF58 -@ replacing .incbin "baserom.gba", 0x0058bf58, 0x14 -.4byte sub_80E4894 -.4byte sub_80E4894 -.4byte sub_80E48E8 -.4byte sub_80E48E8 -.4byte sub_80E4894 + .4byte sub_80E4894 + .4byte sub_80E4894 + .4byte sub_80E48E8 + .4byte sub_80E48E8 + .4byte sub_80E4894 gUnknown_0858BF6C:: @ 858BF6C -@ replacing .incbin "baserom.gba", 0x0058bf6c, 0x8 -.4byte TaskDummy3 -.4byte sub_80E49BC + .4byte TaskDummy3 + .4byte sub_80E49BC gUnknown_0858BF74:: @ 858BF74 .incbin "baserom.gba", 0x58bf74, 0x14 gUnknown_0858BF88:: @ 858BF88 -@ replacing .incbin "baserom.gba", 0x0058bf88, 0x4 -.byte 0xee, 0xdd, 0xff, 0x00 + .byte 0xee, 0xdd, 0xff, 0x00 gUnknown_0858BF8C:: @ 858BF8C -@ replacing .incbin "baserom.gba", 0x0058bf8c, 0xc -.4byte 0x858bf80 -.4byte 0x858bf7c -.4byte 0x858bf84 + .4byte 0x858bf80 + .4byte 0x858bf7c + .4byte 0x858bf84 gUnknown_0858BF98:: @ 858BF98 -@ replacing .incbin "baserom.gba", 0x0058bf98, 0xc -.4byte 0x8dd4620 -.4byte 0x8dd46e0 -.4byte 0x8dd47a0 + .4byte 0x8dd4620 + .4byte 0x8dd46e0 + .4byte 0x8dd47a0 gUnknown_0858BFA4:: @ 858BFA4 .incbin "baserom.gba", 0x58bfa4, 0x34 gUnknown_0858BFD8:: @ 858BFD8 -@ replacing .incbin "baserom.gba", 0x0058bfd8, 0x14 -.4byte 0x858bfa8 -.4byte 0x858bfb4 -.4byte 0x858bfc0 -.4byte 0x858bfc0 -.4byte 0x858bfcc + .4byte 0x858bfa8 + .4byte 0x858bfb4 + .4byte 0x858bfc0 + .4byte 0x858bfc0 + .4byte 0x858bfcc gUnknown_0858BFEC:: @ 858BFEC .incbin "baserom.gba", 0x58bfec, 0x64 @@ -201,24 +177,21 @@ gUnknown_0858C180:: @ 858C180 .incbin "baserom.gba", 0x58c180, 0x18 gUnknown_0858C198:: @ 858C198 -@ replacing .incbin "baserom.gba", 0x0058c198, 0x30 -.4byte 0x862b88d -.4byte 0x862b8ae -.4byte 0x862b8cf -.4byte 0x862b8f0 -.4byte 0x862b911 -.4byte 0x862b932 -.4byte 0x862b953 -.4byte 0x862b974 -.4byte 0x862b995 -.4byte 0x862b9ae -.4byte 0x862b9c7 -.4byte 0x862b9e0 + .4byte 0x862b88d + .4byte 0x862b8ae + .4byte 0x862b8cf + .4byte 0x862b8f0 + .4byte 0x862b911 + .4byte 0x862b932 + .4byte 0x862b953 + .4byte 0x862b974 + .4byte 0x862b995 + .4byte 0x862b9ae + .4byte 0x862b9c7 + .4byte 0x862b9e0 gUnknown_0858C1C8:: @ 858C1C8 .incbin "baserom.gba", 0x58c1c8, 0x68 gUnknown_0858C230:: @ 858C230 .incbin "baserom.gba", 0x58c230, 0x48 - - diff --git a/data/save.s b/data/save.s index 29b750b3a..15e201baa 100644 --- a/data/save.s +++ b/data/save.s @@ -4,4 +4,17 @@ .section .rodata gSaveSectionOffsets:: @ 85CDC00 - .incbin "baserom.gba", 0x5cdc00, 0x38 + .2byte 0, 0xF2C + .2byte 0, 0xF80 + .2byte 0xF80, 0xF80 + .2byte 0x1F00, 0xF80 + .2byte 0x2E80, 0xF08 + .2byte 0, 0xF80 + .2byte 0xF80, 0xF80 + .2byte 0x1F00, 0xF80 + .2byte 0x2E80, 0xF80 + .2byte 0x3E00, 0xF80 + .2byte 0x4D80, 0xF80 + .2byte 0x5D00, 0xF80 + .2byte 0x6C80, 0xF80 + .2byte 0x7C00, 0x7D0 diff --git a/data/script_menu.s b/data/script_menu.s index 8cf395c04..cf4a5df01 100644 --- a/data/script_menu.s +++ b/data/script_menu.s @@ -4,26 +4,22 @@ .section .rodata gUnknown_0858ABD8:: @ 858ABD8 -@ replacing .incbin "baserom.gba", 0x0058abd8, 0x18 .4byte gUnknown_085EAD37, 0 .4byte gUnknown_085EAD41, 0 .4byte gText_Exit, 0 gUnknown_0858ABF0:: @ 58ABF0 -@ replacing .incbin "baserom.gba", 0x0058abf0, 0x18 .4byte gUnknown_085EAD67, 0 .4byte gUnknown_085EAD6D, 0 .4byte gText_Exit, 0 gUnknown_0858AC08:: @ 58AC08 -@ replacing .incbin "baserom.gba", 0x0058ac08, 0x20 .4byte gUnknown_085EAD72, 0 .4byte gUnknown_085EAD84, 0 .4byte gUnknown_085EAD96, 0 .4byte gText_Cancel2, 0 gUnknown_0858AC28:: @ 58AC28 -@ replacing .incbin "baserom.gba", 0x0058ac28, 0x30 .4byte gUnknown_085EADA4, 0 .4byte gUnknown_085EADB5, 0 .4byte gUnknown_085EADC4, 0 @@ -32,32 +28,27 @@ gUnknown_0858AC28:: @ 58AC28 .4byte gText_Exit, 0 gUnknown_0858AC58:: @ 58AC58 -@ replacing .incbin "baserom.gba", 0x0058ac58, 0x20 .4byte gUnknown_085EADF9, 0 .4byte gUnknown_085EAE04, 0 .4byte gUnknown_085EAE12, 0 .4byte gText_Exit, 0 gUnknown_0858AC78:: @ 58AC78 -@ replacing .incbin "baserom.gba", 0x0058ac78, 0x18 .4byte gUnknown_085EADF9, 0 .4byte gUnknown_085EAE04, 0 .4byte gText_Exit, 0 gUnknown_0858AC90:: @ 58AC90 -@ replacing .incbin "baserom.gba", 0x0058ac90, 0x20 - .4byte gUnknown_085E8CCB, 0 + .4byte gMenuText_Register, 0 .4byte gUnknown_085EAE12, 0 .4byte gUnknown_085EAE1B, 0 .4byte gText_Cancel2, 0 gUnknown_0858ACB0:: @ 58ACB0 -@ replacing .incbin "baserom.gba", 0x0058acb0, 0x10 .4byte gUnknown_085EAE27, 0 .4byte gUnknown_085EAE2C, 0 gUnknown_0858ACC0:: @ 58ACC0 -@ replacing .incbin "baserom.gba", 0x0058acc0, 0x30 .4byte gUnknown_085EAE31, 0 .4byte gUnknown_085EAE35, 0 .4byte gUnknown_085EAE39, 0 @@ -66,157 +57,131 @@ gUnknown_0858ACC0:: @ 58ACC0 .4byte gText_Exit, 0 gUnknown_0858ACF0:: @ 58ACF0 -@ replacing .incbin "baserom.gba", 0x0058acf0, 0x10 .4byte gUnknown_085EAD5F, 0 .4byte gText_Exit, 0 gUnknown_0858AD00:: @ 58AD00 -@ replacing .incbin "baserom.gba", 0x0058ad00, 0x10 .4byte gUnknown_085EAE53, 0 .4byte gUnknown_085EAE5A, 0 gUnknown_0858AD10:: @ 58AD10 -@ replacing .incbin "baserom.gba", 0x0058ad10, 0x18 .4byte gText_Yes, 0 .4byte gText_No, 0 .4byte gUnknown_085EAD6D, 0 gUnknown_0858AD28:: @ 58AD28 -@ replacing .incbin "baserom.gba", 0x0058ad28, 0x18 .4byte gUnknown_085EAEA2, 0 .4byte gUnknown_085EAEAC, 0 .4byte gText_Exit, 0 gUnknown_0858AD40:: @ 58AD40 -@ replacing .incbin "baserom.gba", 0x0058ad40, 0x18 .4byte gText_Lv50, 0 .4byte gText_OpenLevel, 0 .4byte gText_Exit, 0 gUnknown_0858AD58:: @ 58AD58 -@ replacing .incbin "baserom.gba", 0x0058ad58, 0x18 .4byte gUnknown_0827ECBC, 0 .4byte gUnknown_0827ECC3, 0 .4byte gUnknown_0827ECCD, 0 gUnknown_0858AD70:: @ 58AD70 -@ replacing .incbin "baserom.gba", 0x0058ad70, 0x18 .4byte gUnknown_0827ECD5, 0 .4byte gUnknown_0827ECDD, 0 .4byte gUnknown_0827ECE3, 0 gUnknown_0858AD88:: @ 58AD88 -@ replacing .incbin "baserom.gba", 0x0058ad88, 0x18 .4byte gUnknown_0827ECEB, 0 .4byte gUnknown_0827ECF2, 0 .4byte gUnknown_0827ECF8, 0 gUnknown_0858ADA0:: @ 58ADA0 -@ replacing .incbin "baserom.gba", 0x0058ada0, 0x18 .4byte gUnknown_0827ED00, 0 .4byte gUnknown_0827ED06, 0 .4byte gUnknown_0827ED10, 0 gUnknown_0858ADB8:: @ 58ADB8 -@ replacing .incbin "baserom.gba", 0x0058adb8, 0x18 .4byte gUnknown_0827ED18, 0 .4byte gUnknown_0827ED22, 0 .4byte gUnknown_0827ED2C, 0 gUnknown_0858ADD0:: @ 58ADD0 -@ replacing .incbin "baserom.gba", 0x0058add0, 0x18 .4byte gUnknown_0827ED36, 0 .4byte gUnknown_0827ED40, 0 .4byte gUnknown_0827ED46, 0 gUnknown_0858ADE8:: @ 58ADE8 -@ replacing .incbin "baserom.gba", 0x0058ade8, 0x18 .4byte gUnknown_0827ED4F, 0 .4byte gUnknown_0827ED59, 0 .4byte gUnknown_0827ED65, 0 gUnknown_0858AE00:: @ 58AE00 -@ replacing .incbin "baserom.gba", 0x0058ae00, 0x18 .4byte gUnknown_0827ED70, 0 .4byte gUnknown_0827ED74, 0 .4byte gUnknown_0827ED78, 0 gUnknown_0858AE18:: @ 58AE18 -@ replacing .incbin "baserom.gba", 0x0058ae18, 0x18 .4byte gUnknown_0827ED80, 0 .4byte gUnknown_0827ED95, 0 .4byte gUnknown_0827EDAA, 0 gUnknown_0858AE30:: @ 58AE30 -@ replacing .incbin "baserom.gba", 0x0058ae30, 0x18 .4byte gUnknown_0827EDB5, 0 .4byte gUnknown_0827EDBA, 0 .4byte gUnknown_0827EDC1, 0 gUnknown_0858AE48:: @ 58AE48 -@ replacing .incbin "baserom.gba", 0x0058ae48, 0x18 .4byte gUnknown_0827EDC9, 0 .4byte gUnknown_0827EDD5, 0 .4byte gUnknown_0827EDE4, 0 gUnknown_0858AE60:: @ 58AE60 -@ replacing .incbin "baserom.gba", 0x0058ae60, 0x18 .4byte gUnknown_0827EDF0, 0 .4byte gUnknown_0827EDF5, 0 .4byte gUnknown_0827EDF7, 0 gUnknown_0858AE78:: @ 58AE78 -@ replacing .incbin "baserom.gba", 0x0058ae78, 0x18 .4byte gUnknown_0827EDF9, 0 .4byte gUnknown_0827EDFB, 0 .4byte gUnknown_0827EDFD, 0 gUnknown_0858AE90:: @ 58AE90 -@ replacing .incbin "baserom.gba", 0x0058ae90, 0x18 .4byte gUnknown_0827EDFF, 0 .4byte gUnknown_0827EE01, 0 .4byte gUnknown_0827EE03, 0 gUnknown_0858AEA8:: @ 58AEA8 -@ replacing .incbin "baserom.gba", 0x0058aea8, 0x18 .4byte gUnknown_0827EE05, 0 .4byte gUnknown_0827EE07, 0 .4byte gUnknown_0827EE09, 0 gUnknown_0858AEC0:: @ 58AEC0 -@ replacing .incbin "baserom.gba", 0x0058aec0, 0x20 .4byte gUnknown_085EAEC3, 0 .4byte gUnknown_085EAED6, 0 .4byte gUnknown_085EAEE6, 0 .4byte gText_Exit, 0 gUnknown_0858AEE0:: @ 58AEE0 -@ replacing .incbin "baserom.gba", 0x0058aee0, 0x20 .4byte gUnknown_085EAEF6, 0 .4byte gUnknown_085EAF02, 0 .4byte gUnknown_085EAF0E, 0 .4byte gText_Exit, 0 gUnknown_0858AF00:: @ 58AF00 -@ replacing .incbin "baserom.gba", 0x0058af00, 0x20 .4byte gUnknown_085EAF1B, 0 .4byte gUnknown_085EAF24, 0 .4byte gUnknown_085EAF2F, 0 .4byte gText_Exit, 0 gUnknown_0858AF20:: @ 58AF20 -@ replacing .incbin "baserom.gba", 0x0058af20, 0x10 .4byte gUnknown_085EAF34, 0 .4byte gUnknown_085EAF3E, 0 gUnknown_0858AF30:: @ 58AF30 -@ replacing .incbin "baserom.gba", 0x0058af30, 0x18 .4byte gUnknown_085EAF4B, 0 .4byte gUnknown_085EAF58, 0 .4byte gText_Exit, 0 gUnknown_0858AF48:: @ 58AF48 -@ replacing .incbin "baserom.gba", 0x0058af48, 0x40 .4byte gUnknown_085EAF65, 0 .4byte gUnknown_085EAF70, 0 .4byte gUnknown_085EAF7D, 0 @@ -227,14 +192,12 @@ gUnknown_0858AF48:: @ 58AF48 .4byte gText_Cancel2, 0 gUnknown_0858AF88:: @ 58AF88 -@ replacing .incbin "baserom.gba", 0x0058af88, 0x20 .4byte gUnknown_085EAFB6, 0 .4byte gUnknown_085EAFCF, 0 .4byte gUnknown_085EAFE8, 0 .4byte gText_Exit, 0 gUnknown_0858AFA8:: @ 58AFA8 -@ replacing .incbin "baserom.gba", 0x0058afa8, 0x30 .4byte gUnknown_085EB089, 0 .4byte gUnknown_085EB09C, 0 .4byte gUnknown_085EB0AF, 0 @@ -243,40 +206,33 @@ gUnknown_0858AFA8:: @ 58AFA8 .4byte gText_Exit, 0 gUnknown_0858AFD8:: @ 58AFD8 -@ replacing .incbin "baserom.gba", 0x0058afd8, 0x18 .4byte gUnknown_085EB002, 0 .4byte gUnknown_085EB017, 0 .4byte gText_Exit, 0 gUnknown_0858AFF0:: @ 58AFF0 -@ replacing .incbin "baserom.gba", 0x0058aff0, 0x10 .4byte gUnknown_085EB02A, 0 .4byte gUnknown_085EB034, 0 gUnknown_0858B000:: @ 58B000 -@ replacing .incbin "baserom.gba", 0x0058b000, 0x18 - .4byte gUnknown_085EB79B, 0 - .4byte gUnknown_085EB06E, 0 + .4byte gText_LilycoveCity, 0 + .4byte gText_BattleFrontier, 0 .4byte gText_Exit, 0 gUnknown_0858B018:: @ 58B018 -@ replacing .incbin "baserom.gba", 0x0058b018, 0x18 - .4byte gUnknown_085EB7A9, 0 - .4byte gUnknown_085EB79B, 0 + .4byte gText_SlateportCity, 0 + .4byte gText_LilycoveCity, 0 .4byte gText_Exit, 0 gUnknown_0858B030:: @ 58B030 -@ replacing .incbin "baserom.gba", 0x0058b030, 0x10 .4byte gUnknown_085EB07E, 0 .4byte gUnknown_085EB084, 0 gUnknown_0858B040:: @ 58B040 -@ replacing .incbin "baserom.gba", 0x0058b040, 0x10 - .4byte gUnknown_085EB79B, 0 + .4byte gText_LilycoveCity, 0 .4byte gText_Exit, 0 gUnknown_0858B050:: @ 58B050 -@ replacing .incbin "baserom.gba", 0x0058b050, 0x30 .4byte gUnknown_085EB676, 0 .4byte gUnknown_085EB673, 0 .4byte gUnknown_085EB670, 0 @@ -285,91 +241,76 @@ gUnknown_0858B050:: @ 58B050 .4byte gText_Exit, 0 gUnknown_0858B080:: @ 58B080 -@ replacing .incbin "baserom.gba", 0x0058b080, 0x10 .4byte gUnknown_085EB040, 0 .4byte gText_Exit, 0 gUnknown_0858B090:: @ 58B090 -@ replacing .incbin "baserom.gba", 0x0058b090, 0x10 .4byte gUnknown_085EB04A, 0 .4byte gText_Exit, 0 gUnknown_0858B0A0:: @ 58B0A0 -@ replacing .incbin "baserom.gba", 0x0058b0a0, 0x18 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB04A, 0 .4byte gText_Exit, 0 gUnknown_0858B0B8:: @ 58B0B8 -@ replacing .incbin "baserom.gba", 0x0058b0b8, 0x10 .4byte gUnknown_085EB057, 0 .4byte gText_Exit, 0 gUnknown_0858B0C8:: @ 58B0C8 -@ replacing .incbin "baserom.gba", 0x0058b0c8, 0x18 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB057, 0 .4byte gText_Exit, 0 gUnknown_0858B0E0:: @ 58B0E0 -@ replacing .incbin "baserom.gba", 0x0058b0e0, 0x18 .4byte gUnknown_085EB04A, 0 .4byte gUnknown_085EB057, 0 .4byte gText_Exit, 0 gUnknown_0858B0F8:: @ 58B0F8 -@ replacing .incbin "baserom.gba", 0x0058b0f8, 0x20 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB04A, 0 .4byte gUnknown_085EB057, 0 .4byte gText_Exit, 0 gUnknown_0858B118:: @ 58B118 -@ replacing .incbin "baserom.gba", 0x0058b118, 0x10 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B128:: @ 58B128 -@ replacing .incbin "baserom.gba", 0x0058b128, 0x18 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B140:: @ 58B140 -@ replacing .incbin "baserom.gba", 0x0058b140, 0x18 .4byte gUnknown_085EB04A, 0 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B158:: @ 58B158 -@ replacing .incbin "baserom.gba", 0x0058b158, 0x20 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB04A, 0 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B178:: @ 58B178 -@ replacing .incbin "baserom.gba", 0x0058b178, 0x18 .4byte gUnknown_085EB057, 0 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B190:: @ 58B190 -@ replacing .incbin "baserom.gba", 0x0058b190, 0x20 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB057, 0 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B1B0:: @ 58B1B0 -@ replacing .incbin "baserom.gba", 0x0058b1b0, 0x20 .4byte gUnknown_085EB04A, 0 .4byte gUnknown_085EB057, 0 .4byte gUnknown_085EB062, 0 .4byte gText_Exit, 0 gUnknown_0858B1D0:: @ 58B1D0 -@ replacing .incbin "baserom.gba", 0x0058b1d0, 0x28 .4byte gUnknown_085EB040, 0 .4byte gUnknown_085EB04A, 0 .4byte gUnknown_085EB057, 0 @@ -377,42 +318,36 @@ gUnknown_0858B1D0:: @ 58B1D0 .4byte gText_Exit, 0 gUnknown_0858B1F8:: @ 58B1F8 -@ replacing .incbin "baserom.gba", 0x0058b1f8, 0x30 - .4byte gUnknown_085EB1A0, 0 - .4byte gUnknown_085EB1A9, 0 - .4byte gUnknown_085EB1B6, 0 + .4byte gText_Opponent, 0 + .4byte gText_Tourney_Tree, 0 + .4byte gText_ReadyToStart, 0 .4byte gUnknown_085EB5BC, 0 .4byte gUnknown_085EB5C3, 0 .4byte gUnknown_085EB5C8, 0 gUnknown_0858B228:: @ 58B228 -@ replacing .incbin "baserom.gba", 0x0058b228, 0x28 - .4byte gUnknown_085EB1A0, 0 - .4byte gUnknown_085EB1A9, 0 - .4byte gUnknown_085EB1B6, 0 + .4byte gText_Opponent, 0 + .4byte gText_Tourney_Tree, 0 + .4byte gText_ReadyToStart, 0 .4byte gUnknown_085EB5C3, 0 .4byte gUnknown_085EB5C8, 0 gUnknown_0858B250:: @ 58B250 -@ replacing .incbin "baserom.gba", 0x0058b250, 0x10 .4byte gUnknown_085EB29A, 0 .4byte gUnknown_085EB2A3, 0 gUnknown_0858B260:: @ 58B260 -@ replacing .incbin "baserom.gba", 0x0058b260, 0x20 .4byte gUnknown_085EB372, 0 .4byte gUnknown_085EB37F, 0 .4byte gUnknown_085EB389, 0 .4byte gText_Exit, 0 gUnknown_0858B280:: @ 58B280 -@ replacing .incbin "baserom.gba", 0x0058b280, 0x18 .4byte gText_Yes, 0 .4byte gText_No, 0 .4byte gUnknown_085EAD6D, 0 gUnknown_0858B298:: @ 58B298 -@ replacing .incbin "baserom.gba", 0x0058b298, 0x28 .4byte gUnknown_085EAE6E, 0 .4byte gUnknown_085EAE7C, 0 .4byte gUnknown_085EAE8A, 0 @@ -420,14 +355,12 @@ gUnknown_0858B298:: @ 58B298 .4byte gText_Exit, 0 gUnknown_0858B2C0:: @ 58B2C0 -@ replacing .incbin "baserom.gba", 0x0058b2c0, 0x20 .4byte gUnknown_085EB372, 0 .4byte gUnknown_085EB37F, 0 .4byte gUnknown_085EB397, 0 .4byte gText_Exit, 0 gUnknown_0858B2E0:: @ 58B2E0 -@ replacing .incbin "baserom.gba", 0x0058b2e0, 0x28 .4byte gUnknown_085EB372, 0 .4byte gUnknown_085EB37F, 0 .4byte gUnknown_085EB389, 0 @@ -435,52 +368,44 @@ gUnknown_0858B2E0:: @ 58B2E0 .4byte gText_Exit, 0 gUnknown_0858B308:: @ 58B308 -@ replacing .incbin "baserom.gba", 0x0058b308, 0x18 .4byte gUnknown_085EB372, 0 .4byte gUnknown_085EB37F, 0 .4byte gText_Exit, 0 gUnknown_0858B320:: @ 58B320 -@ replacing .incbin "baserom.gba", 0x0058b320, 0x18 .4byte gUnknown_085EB3A4, 0 .4byte gUnknown_085EB3B1, 0 .4byte gText_Exit, 0 gUnknown_0858B338:: @ 58B338 -@ replacing .incbin "baserom.gba", 0x0058b338, 0x18 .4byte gUnknown_085EB3D4, 0 .4byte gUnknown_085EB3C6, 0 .4byte gText_Exit, 0 gUnknown_0858B350:: @ 58B350 -@ replacing .incbin "baserom.gba", 0x0058b350, 0x28 - .4byte gUnknown_085EB1C5, 0 - .4byte gUnknown_085EB1D1, 0 - .4byte gUnknown_085EB1DC, 0 - .4byte gUnknown_085EB1E7, 0 + .4byte gText_NormalRank, 0 + .4byte gText_SuperRank, 0 + .4byte gText_HyperRank, 0 + .4byte gText_MasterRank, 0 .4byte gText_Exit, 0 gUnknown_0858B378:: @ 58B378 -@ replacing .incbin "baserom.gba", 0x0058b378, 0x18 - .4byte gUnknown_085EB212, 0 - .4byte gUnknown_085EB21D, 0 + .4byte gText_BattleBag, 0 + .4byte gText_HeldItem, 0 .4byte gText_Exit, 0 gUnknown_0858B390:: @ 58B390 -@ replacing .incbin "baserom.gba", 0x0058b390, 0x20 - .4byte gUnknown_085EB227, 0 - .4byte gUnknown_085EB234, 0 - .4byte gUnknown_085EB241, 0 + .4byte gText_LinkContest, 0 + .4byte gText_AboutE_Mode, 0 + .4byte gText_AboutG_Mode, 0 .4byte gText_Cancel2, 0 gUnknown_0858B3B0:: @ 58B3B0 -@ replacing .incbin "baserom.gba", 0x0058b3b0, 0x18 - .4byte gUnknown_085EB24E, 0 - .4byte gUnknown_085EB255, 0 + .4byte gText_E_Mode, 0 + .4byte gText_G_Mode, 0 .4byte gText_Exit, 0 gUnknown_0858B3C8:: @ 58B3C8 -@ replacing .incbin "baserom.gba", 0x0058b3c8, 0x40 .4byte gText_MenuOptionPokedex, 0 .4byte gText_MenuOptionPokemon, 0 .4byte gText_MenuOptionBag, 0 @@ -491,50 +416,42 @@ gUnknown_0858B3C8:: @ 58B3C8 .4byte gText_MenuOptionExit, 0 gUnknown_0858B408:: @ 58B408 -@ replacing .incbin "baserom.gba", 0x0058b408, 0x20 .4byte gUnknown_085EB28A, 0 .4byte gUnknown_085EB290, 0 .4byte gUnknown_085EB295, 0 .4byte gText_Exit, 0 gUnknown_0858B428:: @ 58B428 -@ replacing .incbin "baserom.gba", 0x0058b428, 0x18 - .4byte gUnknown_085EB2AD, 0 - .4byte gUnknown_085EB2BD, 0 + .4byte gText_SouthernIsland, 0 + .4byte gText_BirthIsland, 0 .4byte gText_Exit, 0 gUnknown_0858B440:: @ 58B440 -@ replacing .incbin "baserom.gba", 0x0058b440, 0x18 - .4byte gUnknown_085EB2AD, 0 - .4byte gUnknown_085EB2CA, 0 + .4byte gText_SouthernIsland, 0 + .4byte gText_FarawayIsland, 0 .4byte gText_Exit, 0 gUnknown_0858B458:: @ 58B458 -@ replacing .incbin "baserom.gba", 0x0058b458, 0x18 - .4byte gUnknown_085EB2BD, 0 - .4byte gUnknown_085EB2CA, 0 + .4byte gText_BirthIsland, 0 + .4byte gText_FarawayIsland, 0 .4byte gText_Exit, 0 gUnknown_0858B470:: @ 58B470 -@ replacing .incbin "baserom.gba", 0x0058b470, 0x20 - .4byte gUnknown_085EB2AD, 0 - .4byte gUnknown_085EB2BD, 0 - .4byte gUnknown_085EB2CA, 0 + .4byte gText_SouthernIsland, 0 + .4byte gText_BirthIsland, 0 + .4byte gText_FarawayIsland, 0 .4byte gText_Exit, 0 gUnknown_0858B490:: @ 58B490 -@ replacing .incbin "baserom.gba", 0x0058b490, 0x18 .4byte gUnknown_085EB2E4, 0 .4byte gUnknown_085EB2F0, 0 .4byte gText_Exit, 0 gUnknown_0858B4A8:: @ 58B4A8 -@ replacing .incbin "baserom.gba", 0x0058b4a8, 0x10 .4byte gText_Yes, 0 .4byte gUnknown_085EB2FC, 0 gUnknown_0858B4B8:: @ 58B4B8 -@ replacing .incbin "baserom.gba", 0x0058b4b8, 0x30 .4byte gUnknown_085EB3DF, 0 .4byte gUnknown_085EB3EA, 0 .4byte gUnknown_085EB3F1, 0 @@ -543,14 +460,12 @@ gUnknown_0858B4B8:: @ 58B4B8 .4byte gText_Exit, 0 gUnknown_0858B4E8:: @ 58B4E8 -@ replacing .incbin "baserom.gba", 0x0058b4e8, 0x20 .4byte gUnknown_085EB415, 0 .4byte gUnknown_085EB41D, 0 .4byte gUnknown_085EB424, 0 .4byte gText_Exit, 0 gUnknown_0858B508:: @ 58B508 -@ replacing .incbin "baserom.gba", 0x0058b508, 0x28 .4byte gUnknown_085EB45C, 0 .4byte gUnknown_085EB469, 0 .4byte gUnknown_085EB475, 0 @@ -558,7 +473,6 @@ gUnknown_0858B508:: @ 58B508 .4byte gText_Exit, 0 gUnknown_0858B530:: @ 58B530 -@ replacing .incbin "baserom.gba", 0x0058b530, 0x28 .4byte gUnknown_085EB42F, 0 .4byte gUnknown_085EB43A, 0 .4byte gUnknown_085EB444, 0 @@ -566,14 +480,12 @@ gUnknown_0858B530:: @ 58B530 .4byte gText_Exit, 0 gUnknown_0858B558:: @ 58B558 -@ replacing .incbin "baserom.gba", 0x0058b558, 0x20 .4byte gUnknown_085EB48E, 0 .4byte gUnknown_085EB496, 0 .4byte gUnknown_085EB4A3, 0 .4byte gText_Exit, 0 gUnknown_0858B578:: @ 58B578 -@ replacing .incbin "baserom.gba", 0x0058b578, 0x30 .4byte gUnknown_085EB4AD, 0 .4byte gUnknown_085EB4B9, 0 .4byte gUnknown_085EB4C7, 0 @@ -582,7 +494,6 @@ gUnknown_0858B578:: @ 58B578 .4byte gText_Exit, 0 gUnknown_0858B5A8:: @ 58B5A8 -@ replacing .incbin "baserom.gba", 0x0058b5a8, 0x30 .4byte gUnknown_085EB4EB, 0 .4byte gUnknown_085EB4F9, 0 .4byte gUnknown_085EB508, 0 @@ -591,7 +502,6 @@ gUnknown_0858B5A8:: @ 58B5A8 .4byte gText_Exit, 0 gUnknown_0858B5D8:: @ 58B5D8 -@ replacing .incbin "baserom.gba", 0x0058b5d8, 0x28 .4byte gUnknown_085EB532, 0 .4byte gUnknown_085EB543, 0 .4byte gUnknown_085EB555, 0 @@ -599,57 +509,48 @@ gUnknown_0858B5D8:: @ 58B5D8 .4byte gText_Exit, 0 gUnknown_0858B600:: @ 58B600 -@ replacing .incbin "baserom.gba", 0x0058b600, 0x20 .4byte gUnknown_085EB56E, 0 .4byte gUnknown_085EB57E, 0 .4byte gUnknown_085EB589, 0 .4byte gText_Exit, 0 gUnknown_0858B620:: @ 58B620 -@ replacing .incbin "baserom.gba", 0x0058b620, 0x20 .4byte gUnknown_085EB5B6, 0 .4byte gUnknown_085EB5BC, 0 .4byte gUnknown_085EB5C3, 0 .4byte gUnknown_085EB5C8, 0 gUnknown_0858B640:: @ 58B640 -@ replacing .incbin "baserom.gba", 0x0058b640, 0x18 .4byte gUnknown_085EB5B6, 0 .4byte gUnknown_085EB5C3, 0 .4byte gUnknown_085EB5C8, 0 gUnknown_0858B658:: @ 58B658 -@ replacing .incbin "baserom.gba", 0x0058b658, 0x18 .4byte gUnknown_085EB5B6, 0 .4byte gUnknown_085EB5BC, 0 .4byte gUnknown_085EB5C8, 0 gUnknown_0858B670:: @ 58B670 -@ replacing .incbin "baserom.gba", 0x0058b670, 0x10 .4byte gUnknown_085EB5B6, 0 .4byte gUnknown_085EB5C8, 0 gUnknown_0858B680:: @ 58B680 -@ replacing .incbin "baserom.gba", 0x0058b680, 0x10 .4byte gUnknown_085EE14B, 0 .4byte gUnknown_085EE14F, 0 gUnknown_0858B690:: @ 58B690 -@ replacing .incbin "baserom.gba", 0x0058b690, 0x20 .4byte gUnknown_085EB2FF, 0 .4byte gUnknown_085EB310, 0 .4byte gUnknown_085EB317, 0 .4byte gUnknown_085EB31F, 0 gUnknown_0858B6B0:: @ 58B6B0 -@ replacing .incbin "baserom.gba", 0x0058b6b0, 0x20 - .4byte gUnknown_085EB7B8, 0 - .4byte gUnknown_085EB7C7, 0 - .4byte gUnknown_085EB7D0, 0 - .4byte gUnknown_085EB7DB, 0 + .4byte gText_CaveOfOrigin, 0 + .4byte gText_MtPyre, 0 + .4byte gText_SkyPillar, 0 + .4byte gText_DontRemember, 0 gUnknown_0858B6D0:: @ 58B6D0 -@ replacing .incbin "baserom.gba", 0x0058b6d0, 0x30 .4byte gUnknown_085EB4AD, 0 .4byte gUnknown_085EB4B9, 0 .4byte gUnknown_085EB4C7, 0 @@ -658,7 +559,6 @@ gUnknown_0858B6D0:: @ 58B6D0 .4byte gText_Exit, 0 gUnknown_0858B700:: @ 58B700 -@ replacing .incbin "baserom.gba", 0x0058b700, 0x30 .4byte gUnknown_085EB5A6, 0 .4byte gUnknown_085EB45C, 0 .4byte gUnknown_085EB469, 0 @@ -667,7 +567,6 @@ gUnknown_0858B700:: @ 58B700 .4byte gText_Exit, 0 gUnknown_0858B730:: @ 58B730 -@ replacing .incbin "baserom.gba", 0x0058b730, 0x28 .4byte gUnknown_085EB32D, 0 .4byte gUnknown_085EB33E, 0 .4byte gUnknown_085EB350, 0 @@ -675,12 +574,10 @@ gUnknown_0858B730:: @ 58B730 .4byte gText_Exit, 0 gUnknown_0858B758:: @ 58B758 -@ replacing .incbin "baserom.gba", 0x0058b758, 0x8 .4byte gText_Exit, 0 gUnknown_0858B760:: @ 858B760 -@ replacing .incbin "baserom.gba", 0x0058b760, 0x390 .4byte 0x0858abd8, 3 .4byte gUnknown_0858B758, 1 .4byte gUnknown_0858ABF0, 3 @@ -797,16 +694,55 @@ gUnknown_0858B760:: @ 858B760 .4byte gUnknown_0858B730, 5 gUnknown_0858BAF0:: @ 858BAF0 - .incbin "baserom.gba", 0x58baf0, 0x78 + .4byte gText_Cool + .4byte gText_Beauty + .4byte gText_Cute + .4byte gText_Smart + .4byte gText_Tough + .4byte gText_Normal + .4byte gText_Super + .4byte gText_Hyper + .4byte gText_Master + .4byte gText_Cool2 + .4byte gText_Beauty2 + .4byte gText_Cute2 + .4byte gText_Smart2 + .4byte gText_Tough2 + .4byte gText_Items + .4byte gText_Key_Items + .4byte gText_Poke_Balls + .4byte gText_TMs_Hms + .4byte gText_Berries2 + .4byte gText_Single2 + .4byte gText_Double2 + .4byte gText_Multi + .4byte gText_MultiLink + .4byte gText_BattleTower2 + .4byte gText_BattleDome + .4byte gText_BattleFactory + .4byte gText_BattlePalace + .4byte gText_BattleArena + .4byte gText_BattlePike + .4byte gText_BattlePyramid gUnknown_0858BB68:: @ 858BB68 - .incbin "baserom.gba", 0x58bb68, 0x8 + .byte 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F + .align 2 gUnknown_0858BB70:: @ 858BB70 - .incbin "baserom.gba", 0x58bb70, 0x10 + .4byte gText_SomeonesPC + .4byte gText_LanettesPC + .4byte gText_PlayersPC + .4byte gText_LogOff gUnknown_0858BB80:: @ 858BB80 - .incbin "baserom.gba", 0x58bb80, 0x1c + .4byte gText_SlateportCity + .4byte gText_BattleFrontier + .4byte gText_SouthernIsland + .4byte gText_NavelRock + .4byte gText_BirthIsland + .4byte gText_FarawayIsland + .4byte gText_Exit gUnknown_0858BB9C:: @ 858BB9C .incbin "baserom.gba", 0x58bb9c, 0x10 diff --git a/data/shop.s b/data/shop.s index caa69304e..3036d55ac 100644 --- a/data/shop.s +++ b/data/shop.s @@ -6,25 +6,22 @@ .section .rodata gUnknown_08589A08:: @ 8589A08 -@ replacing .incbin "baserom.gba", 0x00589a08, 0x8 -.4byte BuyMenuTryMakePurchase -.4byte BuyMenuReturnToItemList + .4byte BuyMenuTryMakePurchase + .4byte BuyMenuReturnToItemList gUnknown_08589A10:: @ 8589A10 -@ replacing .incbin "baserom.gba", 0x00589a10, 0x18 -.4byte 0x85e93c7 -.4byte HandleShopMenuBuy -.4byte 0x85e93cb -.4byte HandleShopMenuSell -.4byte 0x85e93d0 -.4byte HandleShopMenuQuit + .4byte 0x85e93c7 + .4byte HandleShopMenuBuy + .4byte 0x85e93cb + .4byte HandleShopMenuSell + .4byte 0x85e93d0 + .4byte HandleShopMenuQuit gUnknown_08589A28:: @ 8589A28 -@ replacing .incbin "baserom.gba", 0x00589a28, 0x10 -.4byte 0x85e93c7 -.4byte HandleShopMenuBuy -.4byte 0x85e93d0 -.4byte HandleShopMenuQuit + .4byte 0x85e93c7 + .4byte HandleShopMenuBuy + .4byte 0x85e93d0 + .4byte HandleShopMenuQuit gUnknown_08589A38:: @ 8589A38 .incbin "baserom.gba", 0x589a38, 0x10 @@ -67,4 +64,3 @@ gUnknown_08589AD8:: @ 8589AD8 gUnknown_08589ADE:: @ 8589ADE .incbin "baserom.gba", 0x589ade, 0x6 - diff --git a/data/smokescreen.s b/data/smokescreen.s index 6f2478842..d92c972df 100644 --- a/data/smokescreen.s +++ b/data/smokescreen.s @@ -52,7 +52,7 @@ gUnknown_0831C688:: @ 831C688 spr_template 0xd6eb, 0xd6eb, gUnknown_0831C630, gUnknown_0831C678, NULL, gDummySpriteAffineAnimTable, sub_80753B4 .align 2 -gUnknown_0831C6A0:: @ 831C6A0 +gSpriteSheet_EnemyShadow:: @ 831C6A0 obj_tiles gUnknown_08D8FBC0, 0x0080, 0xd759 .align 2 @@ -60,5 +60,5 @@ gUnknown_0831C6A8:: @ 831C6A8 .byte 0x00, 0x40, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x00 .align 2 -gUnknown_0831C6B0:: @ 831C6B0 - spr_template 0xd759, 0xd6ff, gUnknown_0831C6A8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, sub_805EE48 +gSpriteTemplate_EnemyShadow:: @ 831C6B0 + spr_template 0xd759, 0xd6ff, gUnknown_0831C6A8, gDummySpriteAnimTable, NULL, gDummySpriteAffineAnimTable, SpriteCB_SetInvisible diff --git a/data/strings.s b/data/strings.s index 2b88c6d03..b858e2d52 100644 --- a/data/strings.s +++ b/data/strings.s @@ -1,8 +1,9 @@ + .include "asm/macros.inc" .include "constants/constants.inc" .section .rodata - + gExpandedPlaceholder_Empty:: @ 85E8218 .string "$" @@ -534,25 +535,25 @@ gUnknown_085E8CAC:: @ 85E8CAC gText_FlyToWhere:: @ 85E8CB4 .string "FLY to where?$" -gUnknown_085E8CC2:: @ 85E8CC2 +gMenuText_Use:: @ 85E8CC2 .string "USE$" -gUnknown_085E8CC6:: @ 85E8CC6 +gMenuText_Toss:: @ 85E8CC6 .string "TOSS$" -gUnknown_085E8CCB:: @ 85E8CCB +gMenuText_Register:: @ 85E8CCB .string "REGISTER$" -gUnknown_085E8CD4:: @ 85E8CD4 +gMenuText_Give:: @ 85E8CD4 .string "GIVE$" -gUnknown_085E8CD9:: @ 85E8CD9 +gMenuText_CheckTag:: @ 85E8CD9 .string "CHECK TAG$" -gText_Confirm:: @ 85E8CE3 +gMenuText_Confirm:: @ 85E8CE3 .string "CONFIRM$" -gUnknown_085E8CEB:: @ 85E8CEB +gMenuText_Walk:: @ 85E8CEB .string "WALK$" gText_Cancel:: @ 85E8CF0 @@ -561,7 +562,7 @@ gText_Cancel:: @ 85E8CF0 gText_Cancel2:: @ 85E8CF7 .string "CANCEL$" -gUnknown_085E8CFE:: @ 85E8CFE +gMenuText_Show:: @ 85E8CFE .string "SHOW$" gText_EmptyString2:: @ 85E8D03 @@ -582,13 +583,13 @@ gUnknown_085E8D15:: @ 85E8D15 gUnknown_085E8D1A:: @ 85E8D1A .string "STORE$" -gUnknown_085E8D20:: @ 85E8D20 +gMenuText_Check:: @ 85E8D20 .string "CHECK$" gText_None:: @ 85E8D26 .string "NONE$" -gUnknown_085E8D2B:: @ 85E8D2B +gMenuText_Deselect:: @ 85E8D2B .string "DESELECT$" gText_ThreeMarks:: @ 85E8D34 @@ -642,7 +643,7 @@ gText_GoBackPrevMenu:: @ 85E8D62 gText_WhatWouldYouLike:: @ 85E8D80 .string "What would you like to do?$" -gUnknown_085E8D9B:: @ 85E8D9B +gMenuText_Give2:: @ 85E8D9B .string "GIVE$" gText_xVar1:: @ 85E8DA0 @@ -1946,7 +1947,7 @@ gUnknown_085EB057:: @ 85EB057 gUnknown_085EB062:: @ 85EB062 .string "GREEN SHARD$" -gUnknown_085EB06E:: @ 85EB06E +gText_BattleFrontier:: @ 85EB06E .string "BATTLE FRONTIER$" gUnknown_085EB07E:: @ 85EB07E @@ -1985,46 +1986,46 @@ gText_Smart:: @ 85EB0F9 gText_Tough:: @ 85EB0FF .string "TOUGH$" -gUnknown_085EB105:: @ 85EB105 +gText_Normal:: @ 85EB105 .string "NORMAL$" -gUnknown_085EB10C:: @ 85EB10C +gText_Super:: @ 85EB10C .string "SUPER$" -gUnknown_085EB112:: @ 85EB112 +gText_Hyper:: @ 85EB112 .string "HYPER$" -gUnknown_085EB118:: @ 85EB118 +gText_Master:: @ 85EB118 .string "MASTER$" -gUnknown_085EB11F:: @ 85EB11F +gText_Cool2:: @ 85EB11F .string "COOL$" -gUnknown_085EB124:: @ 85EB124 +gText_Beauty2:: @ 85EB124 .string "BEAUTY$" -gUnknown_085EB12B:: @ 85EB12B +gText_Cute2:: @ 85EB12B .string "CUTE$" -gUnknown_085EB130:: @ 85EB130 +gText_Smart2:: @ 85EB130 .string "SMART$" -gUnknown_085EB136:: @ 85EB136 +gText_Tough2:: @ 85EB136 .string "TOUGH$" -gUnknown_085EB13C:: @ 85EB13C +gText_Items:: @ 85EB13C .string "ITEMS$" -gUnknown_085EB142:: @ 85EB142 +gText_Key_Items:: @ 85EB142 .string "KEY ITEMS$" -gUnknown_085EB14C:: @ 85EB14C +gText_Poke_Balls:: @ 85EB14C .string "POKé BALLS$" -gUnknown_085EB157:: @ 85EB157 +gText_TMs_Hms:: @ 85EB157 .string "TMs & HMs$" -gUnknown_085EB161:: @ 85EB161 +gText_Berries2:: @ 85EB161 .string "BERRIES$" gText_SomeonesPC:: @ 85EB169 @@ -2042,58 +2043,58 @@ gText_HallOfFame:: @ 85EB18B gText_LogOff:: @ 85EB198 .string "LOG OFF$" -gUnknown_085EB1A0:: @ 85EB1A0 +gText_Opponent:: @ 85EB1A0 .string "OPPONENT$" -gUnknown_085EB1A9:: @ 85EB1A9 +gText_Tourney_Tree:: @ 85EB1A9 .string "TOURNEY TREE$" -gUnknown_085EB1B6:: @ 85EB1B6 +gText_ReadyToStart:: @ 85EB1B6 .string "READY TO START$" -gUnknown_085EB1C5:: @ 85EB1C5 +gText_NormalRank:: @ 85EB1C5 .string "NORMAL RANK$" -gUnknown_085EB1D1:: @ 85EB1D1 +gText_SuperRank:: @ 85EB1D1 .string "SUPER RANK$" -gUnknown_085EB1DC:: @ 85EB1DC +gText_HyperRank:: @ 85EB1DC .string "HYPER RANK$" -gUnknown_085EB1E7:: @ 85EB1E7 +gText_MasterRank:: @ 85EB1E7 .string "MASTER RANK$" -gUnknown_085EB1F3:: @ 85EB1F3 +gText_Single2:: @ 85EB1F3 .string "SINGLE$" -gUnknown_085EB1FA:: @ 85EB1FA +gText_Double2:: @ 85EB1FA .string "DOUBLE$" -gUnknown_085EB201:: @ 85EB201 +gText_Multi:: @ 85EB201 .string "MULTI$" -gUnknown_085EB207:: @ 85EB207 +gText_MultiLink:: @ 85EB207 .string "MULTI-LINK$" -gUnknown_085EB212:: @ 85EB212 +gText_BattleBag:: @ 85EB212 .string "BATTLE BAG$" -gUnknown_085EB21D:: @ 85EB21D +gText_HeldItem:: @ 85EB21D .string "HELD ITEM$" -gUnknown_085EB227:: @ 85EB227 +gText_LinkContest:: @ 85EB227 .string "LINK CONTEST$" -gUnknown_085EB234:: @ 85EB234 +gText_AboutE_Mode:: @ 85EB234 .string "ABOUT E-MODE$" -gUnknown_085EB241:: @ 85EB241 +gText_AboutG_Mode:: @ 85EB241 .string "ABOUT G-MODE$" -gUnknown_085EB24E:: @ 85EB24E +gText_E_Mode:: @ 85EB24E .string "E-MODE$" -gUnknown_085EB255:: @ 85EB255 +gText_G_Mode:: @ 85EB255 .string "G-MODE$" gText_MenuOptionPokedex:: @ 85EB25C @@ -2138,16 +2139,16 @@ gUnknown_085EB29A:: @ 85EB29A gUnknown_085EB2A3:: @ 85EB2A3 .string "BLUE TENT$" -gUnknown_085EB2AD:: @ 85EB2AD +gText_SouthernIsland:: @ 85EB2AD .string "SOUTHERN ISLAND$" -gUnknown_085EB2BD:: @ 85EB2BD +gText_BirthIsland:: @ 85EB2BD .string "BIRTH ISLAND$" -gUnknown_085EB2CA:: @ 85EB2CA +gText_FarawayIsland:: @ 85EB2CA .string "FARAWAY ISLAND$" -gUnknown_085EB2D9:: @ 85EB2D9 +gText_NavelRock:: @ 85EB2D9 .string "NAVEL ROCK$" gUnknown_085EB2E4:: @ 85EB2E4 @@ -2477,22 +2478,22 @@ gUnknown_085EB77D:: @ 85EB77D gUnknown_085EB78A:: @ 85EB78A .string "EXCHANGE SERVICE$" -gUnknown_085EB79B:: @ 85EB79B +gText_LilycoveCity:: @ 85EB79B .string "LILYCOVE CITY$" -gUnknown_085EB7A9:: @ 85EB7A9 +gText_SlateportCity:: @ 85EB7A9 .string "SLATEPORT CITY$" -gUnknown_085EB7B8:: @ 85EB7B8 +gText_CaveOfOrigin:: @ 85EB7B8 .string "CAVE OF ORIGIN$" -gUnknown_085EB7C7:: @ 85EB7C7 +gText_MtPyre:: @ 85EB7C7 .string "MT. PYRE$" -gUnknown_085EB7D0:: @ 85EB7D0 +gText_SkyPillar:: @ 85EB7D0 .string "SKY PILLAR$" -gUnknown_085EB7DB:: @ 85EB7DB +gText_DontRemember:: @ 85EB7DB .string "Don’t remember$" gText_Exit:: @ 85EB7EA @@ -3563,25 +3564,25 @@ gText_BattleTower:: @ 85ED0D3 gText_WSlashStraightSlash:: @ 85ED0E0 .string "W/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_1}{COLOR DARK_GREY}{SHADOW LIGHT_GREY} STRAIGHT/{COLOR RED}{SHADOW LIGHT_RED}{STR_VAR_2}$" -gUnknown_085ED104:: @ 85ED104 +gText_BattleTower2:: @ 85ED104 .string "BATTLE TOWER$" -gUnknown_085ED111:: @ 85ED111 +gText_BattleDome:: @ 85ED111 .string "BATTLE DOME$" -gUnknown_085ED11D:: @ 85ED11D +gText_BattlePalace:: @ 85ED11D .string "BATTLE PALACE$" -gUnknown_085ED12B:: @ 85ED12B +gText_BattleFactory:: @ 85ED12B .string "BATTLE FACTORY$" -gUnknown_085ED13A:: @ 85ED13A +gText_BattleArena:: @ 85ED13A .string "BATTLE ARENA$" -gUnknown_085ED147:: @ 85ED147 +gText_BattlePike:: @ 85ED147 .string "BATTLE PIKE$" -gUnknown_085ED153:: @ 85ED153 +gText_BattlePyramid:: @ 85ED153 .string "BATTLE PYRAMID$" .align 2 diff --git a/data/text/contest_painting_descriptions.inc b/data/text/contest_painting_descriptions.inc new file mode 100644 index 000000000..ab6120f29 --- /dev/null +++ b/data/text/contest_painting_descriptions.inc @@ -0,0 +1,44 @@ +gContestPaintingCool1:: @ 827EA7F + .string "Nonstop supercool--\nthe inestimable {STR_VAR_1}$" + +gContestPaintingCool2:: @ 827EAA6 + .string "Hey, there!\nThe good-looking POKéMON {STR_VAR_1}$" + +gContestPaintingCool3:: @ 827EACE + .string "The marvelous, wonderful, and\nvery great {STR_VAR_1}$" + +gContestPaintingBeauty1:: @ 827EAFA + .string "This century’s last Venus--\nthe beautiful {STR_VAR_1}$" + +gContestPaintingBeauty2:: @ 827EB27 + .string "{STR_VAR_1}’s dazzling,\nglittering smile$" + +gContestPaintingBeauty3:: @ 827EB47 + .string "POKéMON CENTER’s super idol--\nthe incomparable {STR_VAR_1}$" + +gContestPaintingCute1:: @ 827EB79 + .string "The lovely and sweet {STR_VAR_1}$" + +gContestPaintingCute2:: @ 827EB91 + .string "The pretty {STR_VAR_1}’s\nwinning portrait$" + +gContestPaintingCute3:: @ 827EBB2 + .string "Give us a wink!\nThe cutie POKéMON {STR_VAR_1}$" + +gContestPaintingSmart1:: @ 827EBD7 + .string "The smartness maestro--\nthe wise POKéMON {STR_VAR_1}$" + +gContestPaintingSmart2:: @ 827EC03 + .string "{STR_VAR_1}--the one chosen\nabove all POKéMON$" + +gContestPaintingSmart3:: @ 827EC28 + .string "The excellent {STR_VAR_1}’s\nmoment of elegance$" + +gContestPaintingTough1:: @ 827EC4E + .string "The powerfully muscular\nspeedster {STR_VAR_1}$" + +gContestPaintingTough2:: @ 827EC73 + .string "The strong, stronger, and\nstrongest {STR_VAR_1}$" + +gContestPaintingTough3:: @ 827EC9A + .string "The mighty tough\nhyper POKéMON {STR_VAR_1}$" diff --git a/data/text/contest_rank_text.inc b/data/text/contest_rank_text.inc new file mode 100644 index 000000000..0751543d3 --- /dev/null +++ b/data/text/contest_rank_text.inc @@ -0,0 +1,14 @@ +gContestRankNormal:: @ 827EA1F + .string "NORMAL RANK$" + +gContestRankSuper:: @ 827EA2B + .string "SUPER RANK$" + +gContestRankHyper:: @ 827EA36 + .string "HYPER RANK$" + +gContestRankMaster:: @ 827EA41 + .string "MASTER RANK$" + +gContestLink:: @ 827EA4D + .string "LINK$" diff --git a/graphics/berry_blender/arrow.pal b/graphics/berry_blender/arrow.pal new file mode 100644 index 000000000..4c975292d --- /dev/null +++ b/graphics/berry_blender/arrow.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +255 255 255 +213 222 238 +180 197 230 +148 172 222 +115 148 205 +82 123 197 +49 98 189 +255 180 205 +255 115 98 +255 49 0 +205 65 65 +189 24 24 +148 16 16 +74 57 139 +8 0 82 diff --git a/graphics/berry_blender/arrow.png b/graphics/berry_blender/arrow.png new file mode 100644 index 000000000..a40948824 Binary files /dev/null and b/graphics/berry_blender/arrow.png differ diff --git a/graphics/berry_blender/center.pal b/graphics/berry_blender/center.pal new file mode 100644 index 000000000..606c527a3 --- /dev/null +++ b/graphics/berry_blender/center.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +255 255 255 +205 197 255 +172 164 222 +139 139 189 +106 106 156 +74 82 123 +41 57 90 +213 222 189 +180 189 156 +148 156 123 +115 123 90 +255 172 123 +246 115 82 +238 57 41 +156 24 0 diff --git a/graphics/berry_blender/center.png b/graphics/berry_blender/center.png new file mode 100644 index 000000000..1da3629d4 Binary files /dev/null and b/graphics/berry_blender/center.png differ diff --git a/graphics/berry_blender/center_map.bin b/graphics/berry_blender/center_map.bin new file mode 100644 index 000000000..ef28d5093 Binary files /dev/null and b/graphics/berry_blender/center_map.bin differ diff --git a/graphics/berry_blender/countdown_numbers.png b/graphics/berry_blender/countdown_numbers.png new file mode 100644 index 000000000..7884d0c07 Binary files /dev/null and b/graphics/berry_blender/countdown_numbers.png differ diff --git a/graphics/berry_blender/marubatsu.png b/graphics/berry_blender/marubatsu.png new file mode 100644 index 000000000..f927bbce9 Binary files /dev/null and b/graphics/berry_blender/marubatsu.png differ diff --git a/graphics/berry_blender/misc.pal b/graphics/berry_blender/misc.pal new file mode 100644 index 000000000..9c1db8d12 --- /dev/null +++ b/graphics/berry_blender/misc.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +0 0 0 +0 0 0 +255 213 0 +255 82 82 +98 255 255 +0 189 255 +98 255 98 +205 0 0 +255 0 0 +255 156 156 +0 0 0 +255 255 0 +255 255 148 +189 189 189 +255 255 255 diff --git a/graphics/berry_blender/outer.pal b/graphics/berry_blender/outer.pal new file mode 100644 index 000000000..c3b83cf16 --- /dev/null +++ b/graphics/berry_blender/outer.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +255 255 255 +213 222 238 +180 197 230 +148 172 222 +115 148 205 +82 123 197 +49 98 189 +255 180 205 +255 115 98 +255 49 0 +205 65 65 +189 24 24 +148 123 197 +74 57 139 +8 0 82 diff --git a/graphics/berry_blender/outer.png b/graphics/berry_blender/outer.png new file mode 100644 index 000000000..d8040b022 Binary files /dev/null and b/graphics/berry_blender/outer.png differ diff --git a/graphics/berry_blender/outer_map.bin b/graphics/berry_blender/outer_map.bin new file mode 100644 index 000000000..092e3997e Binary files /dev/null and b/graphics/berry_blender/outer_map.bin differ diff --git a/graphics/berry_blender/particles.png b/graphics/berry_blender/particles.png new file mode 100644 index 000000000..d0086b029 Binary files /dev/null and b/graphics/berry_blender/particles.png differ diff --git a/graphics/berry_blender/start.png b/graphics/berry_blender/start.png new file mode 100644 index 000000000..5c8d8d5d9 Binary files /dev/null and b/graphics/berry_blender/start.png differ diff --git a/graphics/misc/japanese_hof.pal b/graphics/misc/japanese_hof.pal new file mode 100644 index 000000000..f50aa5341 --- /dev/null +++ b/graphics/misc/japanese_hof.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +0 0 0 +131 238 197 +255 32 32 +115 222 180 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +0 0 0 +65 65 65 +255 255 255 diff --git a/graphics/misc/japanese_hof.png b/graphics/misc/japanese_hof.png new file mode 100644 index 000000000..6d88a48b2 Binary files /dev/null and b/graphics/misc/japanese_hof.png differ diff --git a/graphics/unknown/unknown_339514.pal b/graphics/unknown/unknown_339514.pal new file mode 100644 index 000000000..b87f25a6c --- /dev/null +++ b/graphics/unknown/unknown_339514.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +255 255 255 +213 222 238 +180 197 230 +148 172 222 +115 148 205 +82 123 197 +49 98 189 +255 230 205 +255 164 98 +255 106 0 +222 65 8 +189 24 24 +106 106 0 +222 65 8 +189 24 24 diff --git a/graphics_file_rules.mk b/graphics_file_rules.mk index def35bc4e..92c173933 100644 --- a/graphics_file_rules.mk +++ b/graphics_file_rules.mk @@ -287,6 +287,9 @@ graphics/title_screen/pokemon_logo.gbapal: graphics/title_screen/pokemon_logo.pa $(INTROGFXDIR)/copyright.4bpp: $(INTROGFXDIR)/copyright.png $(GFX) $< $@ -num_tiles 39 - + $(interfacedir)/pkmnjump_bg.4bpp: $(interfacedir)/pkmnjump_bg.png $(GFX) $< $@ -num_tiles 63 + +graphics/misc/japanese_hof.4bpp: graphics/misc/japanese_hof.png + $(GFX) $< $@ -num_tiles 29 diff --git a/include/battle.h b/include/battle.h index ace2bb4ad..4cf0d2e03 100644 --- a/include/battle.h +++ b/include/battle.h @@ -6,6 +6,7 @@ #include "battle_script_commands.h" #include "battle_2.h" #include "battle_ai_switch_items.h" +#include "battle_gfx_sfx_util.h" /* Banks are a name given to what could be called a 'battlerId' or 'monControllerId'. @@ -670,7 +671,7 @@ struct BattleStruct u8 fillerDC[0xDF-0xDC]; u8 field_DF; u8 mirrorMoveArrays[32]; - u16 castformPalette[4][16]; + u16 castformPalette[BATTLE_BANKS_COUNT][16]; u8 field_180; u8 field_181; u8 field_182; @@ -807,6 +808,18 @@ extern struct BattleStruct* gBattleStruct; #define B_ANIM_SUBSTITUTE_TO_MON 0x5 #define B_ANIM_MON_TO_SUBSTITUTE 0x6 +// status animation table +#define B_ANIM_STATUS_PSN 0x0 +#define B_ANIM_STATUS_CONFUSION 0x1 +#define B_ANIM_STATUS_BRN 0x2 +#define B_ANIM_STATUS_INFATUATION 0x3 +#define B_ANIM_STATUS_SLP 0x4 +#define B_ANIM_STATUS_PRZ 0x5 +#define B_ANIM_STATUS_FRZ 0x6 +#define B_ANIM_STATUS_CURSED 0x7 +#define B_ANIM_STATUS_NIGHTMARE 0x8 +#define B_ANIM_STATUS_WRAPPED 0x9 + #define GET_STAT_BUFF_ID(n)((n & 0xF)) // first four bits 0x1, 0x2, 0x4, 0x8 #define GET_STAT_BUFF_VALUE(n)(((n >> 4) & 7)) // 0x10, 0x20, 0x40 #define STAT_BUFF_NEGATIVE 0x80 // 0x80, the sign bit @@ -864,43 +877,6 @@ void AdjustFriendshipOnBattleFaint(u8 bank); void sub_80571DC(u8 bank, u8 arg1); u32 sub_805725C(u8 bank); -// battle 7 -void AllocateBattleSpritesData(void); -void FreeBattleSpritesData(void); -void AllocateMonSpritesGfx(void); -void FreeMonSpritesGfx(void); -void BattleMusicStop(void); -void sub_805E990(struct Pokemon *mon, u8 bank); -void sub_805EF14(void); -bool8 BattleInitAllSprites(u8 *state1, u8 *state2); -void sub_805E350(void); -bool8 BattleLoadAllHealthBoxesGfx(u8 state); -void LoadAndCreateEnemyShadowSprites(void); -void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species); -void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank); -void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank); -void BattleLoadSubstituteSpriteGfx(u8 bank, bool8 arg1); -void nullsub_24(u16 arg0); -void nullsub_25(u8 arg0); -void ClearTemporarySpeciesSpriteData(u8 bank, bool8 dontClearSubstitute); -void sub_805D714(struct Sprite *sprite); -void DecompressTrainerBackPic(u16 backPicId, u8 bank); -void DecompressTrainerFrontPic(u16 frontPicId, u8 bank); -void FreeTrainerFrontPicPalette(u16 frontPicId); -void sub_805D7AC(struct Sprite *sprite); -bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); -void sub_805EB9C(u8 arg0); -void sub_805E394(void); -void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move); -void DoStatusAnimation(bool8 isStatus2, u32 status); -void DoSpecialBattleAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId); -bool8 DoBattleAnimationFromTable(u8 active, u8 atkBank, u8 defBank, u8 tableId, u16 argument); -void CopyBattleSpriteInvisibility(u8 bank); -u16 ChooseMoveAndTargetInBattlePalace(void); -void LoadBattleBarGfx(u8 arg0); -bool8 mplay_80342A4(u8 bank); -void sub_805EEE0(u8 bank); - enum { BACK_PIC_BRENDAN, @@ -921,7 +897,7 @@ u8 GetBankByIdentity(u8 bank); struct BattleSpriteInfo { u16 invisible : 1; // 0x1 - u16 flag_x2 : 1; // 0x2 + u16 lowHpSong : 1; // 0x2 u16 behindSubstitute : 1; // 0x4 u16 flag_x8 : 1; // 0x8 u16 hpNumbersNoBars : 1; // 0x10 @@ -930,7 +906,7 @@ struct BattleSpriteInfo struct BattleAnimationInfo { - u16 field; // to fill up later + u16 animArg; // to fill up later u8 field_2; u8 field_3; u8 field_4; @@ -944,6 +920,12 @@ struct BattleAnimationInfo u8 field_9_x20 : 1; u8 field_9_x40 : 1; u8 field_9_x80 : 1; + u8 field_A; + u8 field_B; + u8 field_C; + u8 field_D; + u8 field_E; + u8 field_F; }; struct BattleHealthboxInfo @@ -966,7 +948,7 @@ struct BattleHealthboxInfo u8 animationState; u8 field_5; u8 field_6; - u8 field_7; + u8 shadowSpriteId; u8 field_8; u8 field_9; u8 field_A; @@ -1006,8 +988,11 @@ struct MonSpritesGfx void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon void* sprites[4]; struct SpriteTemplate templates[4]; - u8 field_74[0x100]; - u8 *fontPixels; + struct SpriteFrameImage field_74[4][4]; + u8 field_F4[0x80]; + u8 *barFontGfx; + void *field_178; + void *field_17C; }; extern struct BattleSpritesGfx* gMonSpritesGfx; diff --git a/include/battle_anim.h b/include/battle_anim.h index e912af6b1..c055e94fa 100644 --- a/include/battle_anim.h +++ b/include/battle_anim.h @@ -92,7 +92,11 @@ u8 sub_80A6D94(void); u8 sub_80A8364(u8); void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*spriteCallback)(struct Sprite*)); void oamt_add_pos2_onto_pos1(struct Sprite *sprite); -u8 sub_80A6138(u8 bank); +u8 GetBankSpriteDefault_Y(u8 bank); u8 sub_80A82E4(u8 bank); +u8 GetSubstituteSpriteDefault_Y(u8 bank); + +// battle_anim_80A9C70.s +void LaunchStatusAnimation(u8 bank, u8 statusAnimId); #endif // GUARD_BATTLE_ANIM_H diff --git a/include/battle_gfx_sfx_util.h b/include/battle_gfx_sfx_util.h new file mode 100644 index 000000000..313a29811 --- /dev/null +++ b/include/battle_gfx_sfx_util.h @@ -0,0 +1,50 @@ +#ifndef GUARD_BATTLE_GFX_SFX_UTIL +#define GUARD_BATTLE_GFX_SFX_UTIL + +void AllocateBattleSpritesData(void); +void FreeBattleSpritesData(void); +u16 ChooseMoveAndTargetInBattlePalace(void); +void sub_805D714(struct Sprite *sprite); +void sub_805D770(struct Sprite *sprite, bool8 arg1); +void sub_805D7AC(struct Sprite *sprite); +void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status); +bool8 TryHandleLaunchBattleTableAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId, u16 argument); +void InitAndLaunchSpecialAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId); +bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn); +bool8 mplay_80342A4(u8 bank); +void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank); +void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank); +void nullsub_23(void); +void nullsub_24(u16 species); +void DecompressTrainerFrontPic(u16 frontPicId, u8 bank); +void DecompressTrainerBackPic(u16 backPicId, u8 bank); +void nullsub_25(u8 arg0); +void FreeTrainerFrontPicPalette(u16 frontPicId); +void sub_805DFFC(void); +bool8 BattleLoadAllHealthBoxesGfx(u8 state); +void LoadBattleBarGfx(u8 arg0); +bool8 BattleInitAllSprites(u8 *state1, u8 *bank); +void ClearSpritesHealthboxAnimData(void); +void CopyAllBattleSpritesInvisibilities(void); +void CopyBattleSpriteInvisibility(u8 bank); +void HandleSpeciesGfxDataChange(u8 bankAtk, u8 bankDef, bool8 notTransform); +void BattleLoadSubstituteOrMonSpriteGfx(u8 bank, bool8 loadMonSprite); +void LoadBattleMonGfxAndAnimate(u8 bank, bool8 loadMonSprite, u8 spriteId); +void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move); +void ClearBehindSubstituteBit(u8 bank); +void HandleLowHpMusicChange(struct Pokemon *mon, u8 bank); +void BattleStopLowHpSound(void); +u8 GetMonHPBarLevel(struct Pokemon *mon); +void sub_805EAE8(void); +void sub_805EB9C(u8 affineMode); +void LoadAndCreateEnemyShadowSprites(void); +void SpriteCB_SetInvisible(struct Sprite *sprite); +void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species); +void EnemyShadowCallbackToSetInvisible(u8 bank); +void sub_805EF14(void); +void ClearTemporarySpeciesSpriteData(u8 bank, bool8 dontClearSubstitute); +void AllocateMonSpritesGfx(void); +void FreeMonSpritesGfx(void); +bool32 ShouldPlayNormalPokeCry(struct Pokemon *mon); + +#endif // GUARD_BATTLE_GFX_SFX_UTIL diff --git a/include/battle_interface.h b/include/battle_interface.h index aad30f7b3..b2d3b1b97 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -15,6 +15,15 @@ enum EXP_BAR }; +enum +{ + HP_BAR_EMPTY, + HP_BAR_RED, + HP_BAR_YELLOW, + HP_BAR_GREEN, + HP_BAR_FULL, +}; + #define TAG_HEALTHBOX_PLAYER1_TILE 0xD6FF #define TAG_HEALTHBOX_PLAYER2_TILE 0xD700 #define TAG_HEALTHBOX_OPPONENT1_TILE 0xD701 diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index a466abc04..ebfeabccc 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.h @@ -57,6 +57,6 @@ void HandleBattleWindow(u8 xStart, u8 yStart, u8 xEnd, u8 yEnd, u8 flags); bool8 UproarWakeUpCheck(u8 bank); extern void (* const gBattleScriptingCommandsTable[])(void); -extern const u8 gUnknown_0831C494[]; +extern const u8 gUnknown_0831C494[][4]; #endif // GUARD_BATTLE_SCRIPT_COMMANDS_H diff --git a/include/contest.h b/include/contest.h index 7dcde7da2..76fbaad3e 100644 --- a/include/contest.h +++ b/include/contest.h @@ -20,6 +20,12 @@ struct ContestStruct_field_18 { // unknown size u16 field_0; + u16 field_2; + u16 field_4; + u16 field_6; + u32 field_8; + u32 field_C; + u32 field_10; }; struct ContestResources diff --git a/include/decompress.h b/include/decompress.h index c3a771893..36be803e0 100644 --- a/include/decompress.h +++ b/include/decompress.h @@ -3,6 +3,8 @@ #include "sprite.h" +extern u8 gDecompressionBuffer[0x4000]; + void LZDecompressWram(const void *src, void *dest); void LZDecompressVram(const void *src, void *dest); diff --git a/include/hall_of_fame.h b/include/hall_of_fame.h index 62e84c39e..d35ecf268 100644 --- a/include/hall_of_fame.h +++ b/include/hall_of_fame.h @@ -1,9 +1,9 @@ #ifndef GUARD_HALL_OF_FAME_H #define GUARD_HALL_OF_FAME_H -void sub_8141F90(void); -void sub_8143648(u16 paletteTag, u8 arg1); -void sub_81428CC(void); -void sub_8143680(int, u8); +void CB2_DoHallOfFameScreen(void); +void CB2_DoHallOfFameScreenDontSaveData(void); +void CB2_DoHallOfFamePC(void); +void sub_8175280(void); #endif // GUARD_HALL_OF_FAME_H diff --git a/include/malloc.h b/include/malloc.h index f3a731797..003ee1f03 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -5,6 +5,12 @@ #define calloc(ct, sz) AllocZeroed((ct) * (sz)) #define free Free +#define FREE_AND_SET_NULL(ptr) \ +{ \ + free(ptr); \ + ptr = NULL; \ +} + extern u8 gHeap[]; void *Alloc(u32 size); void *AllocZeroed(u32 size); diff --git a/include/pokemon.h b/include/pokemon.h index 0c7d6ac40..69b9e71d5 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -612,8 +612,8 @@ u32 CanMonLearnTMHM(struct Pokemon *, u8); u32 CanSpeciesLearnTMHM(u16 species, u8 tm); u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves); void ClearBattleMonForms(void); -const u8 *pokemon_get_pal(struct Pokemon *mon); -const u8 *species_and_otid_get_pal(u16, u32, u32); +const u8 *GetMonFrontSpritePal(struct Pokemon *mon); +const u8 *GetFrontSpritePalFromSpeciesAndPersonality(u16, u32, u32); const struct CompressedSpritePalette *sub_80409C8(u16, u32, u32); bool8 IsOtherTrainer(u32, u8 *); void SetWildMonHeldItem(void); diff --git a/ld_script.txt b/ld_script.txt index c8d31c846..40f592e3a 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -62,7 +62,7 @@ SECTIONS { src/battle_script_commands.o(.text); asm/battle_5.o(.text); src/battle_controller_player.o(.text); - asm/battle_7.o(.text); + src/battle_gfx_sfx_util.o(.text); src/battle_controller_opponent.o(.text); src/battle_ai_switch_items.o(.text); src/battle_controller_link_opponent.o(.text); @@ -85,6 +85,7 @@ SECTIONS { src/load_save.o(.text); asm/load_save.o(.text); asm/trade.o(.text); + src/berry_blender.o(.text); asm/berry_blender.o(.text); src/play_time.o(.text); src/new_game.o(.text); @@ -214,7 +215,7 @@ SECTIONS { src/reset_save_heap.o(.text); asm/field_region_map.o(.text); asm/battle_anim_8170478.o(.text); - asm/hall_of_fame.o(.text); + src/hall_of_fame.o(.text); asm/credits.o(.text); src/lottery_corner.o(.text); src/diploma.o(.text); @@ -344,11 +345,11 @@ SECTIONS { src/util.o(.rodata); data/daycare.o(.rodata); src/egg_hatch.o(.rodata); - data/battle_7.o(.rodata); + src/battle_gfx_sfx_util.o(.rodata); src/battle_interface.o(.rodata); data/pokeball.o(.rodata); data/trade.o(.rodata); - data/berry_blender.o(.rodata); + src/berry_blender.o(.rodata); src/new_game.o(.rodata); data/rom4.o(.rodata); data/fieldmap.o(.rodata); @@ -435,7 +436,7 @@ SECTIONS { data/intro.o(.rodata); data/field_region_map.o(.rodata); data/battle_anim_8170478.o(.rodata); - data/hall_of_fame.o(.rodata); + src/hall_of_fame.o(.rodata); data/credits.o(.rodata); src/lottery_corner.o(.rodata); src/diploma.o(.rodata); diff --git a/src/battle_2.c b/src/battle_2.c index 24b43bdbd..e4ee624fb 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -4767,7 +4767,7 @@ static void HandleEndTurn_BattleWon(void) else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_x4000000 | BATTLE_TYPE_EREADER_TRAINER)) { - BattleMusicStop(); + BattleStopLowHpSound(); gBattlescriptCurrInstr = BattleScript_FrontierTrainerBattleWon; if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_3FE) @@ -4777,7 +4777,7 @@ static void HandleEndTurn_BattleWon(void) } else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && !(gBattleTypeFlags & BATTLE_TYPE_LINK)) { - BattleMusicStop(); + BattleStopLowHpSound(); gBattlescriptCurrInstr = BattleScript_LocalTrainerBattleWon; switch (gTrainers[gTrainerBattleOpponent_A].trainerClass) diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 968f6d49f..cb2ca0a4c 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -449,7 +449,7 @@ static void sub_8064C58(void) { FreeSpriteOamMatrix(&gSprites[gBankSpriteIds[gActiveBank]]); DestroySprite(&gSprites[gBankSpriteIds[gActiveBank]]); - sub_805EEE0(gActiveBank); + EnemyShadowCallbackToSetInvisible(gActiveBank); SetHealthboxSpriteInvisible(gHealthBoxesIds[gActiveBank]); LinkOpponentBufferExecCompleted(); } @@ -485,7 +485,7 @@ static void sub_8064D60(void) if (gSprites[gHealthBoxesIds[gActiveBank]].callback == SpriteCallbackDummy) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_8064DD0; } @@ -1164,7 +1164,7 @@ static void LinkOpponentHandleLoadMonSprite(void) gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(gActiveBank, 2), - sub_80A6138(gActiveBank), + GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; @@ -1198,7 +1198,7 @@ static void sub_8066494(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -1227,7 +1227,7 @@ static void LinkOpponentHandleReturnMonToBall(void) { FreeSpriteOamMatrix(&gSprites[gBankSpriteIds[gActiveBank]]); DestroySprite(&gSprites[gBankSpriteIds[gActiveBank]]); - sub_805EEE0(gActiveBank); + EnemyShadowCallbackToSetInvisible(gActiveBank); SetHealthboxSpriteInvisible(gHealthBoxesIds[gActiveBank]); LinkOpponentBufferExecCompleted(); } @@ -1239,7 +1239,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1247,7 +1247,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_OPPONENT_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_OPPONENT_MON); gBattleBankFunc[gActiveBank] = sub_8064C58; } break; @@ -1382,7 +1382,7 @@ static void LinkOpponentHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -1455,7 +1455,7 @@ static void LinkOpponentDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1474,7 +1474,7 @@ static void LinkOpponentDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -1483,7 +1483,7 @@ static void LinkOpponentDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; LinkOpponentBufferExecCompleted(); @@ -1586,7 +1586,7 @@ static void LinkOpponentHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -1698,7 +1698,7 @@ static void LinkOpponentHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -1850,7 +1850,7 @@ static void LinkOpponentHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) LinkOpponentBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 4a70a4dc1..79776c15d 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -312,7 +312,7 @@ static void CompleteOnHealthbarDone(void) } else { - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); LinkPartnerBufferExecCompleted(); } } @@ -373,7 +373,7 @@ static void sub_814B4E0(void) { CopyBattleSpriteInvisibility(gActiveBank); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_814B554; } @@ -399,7 +399,7 @@ static void sub_814B5A8(void) FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 0); UpdateHealthboxAttribute(gHealthBoxesIds[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], HEALTHBOX_ALL); sub_8076918(gActiveBank); @@ -1026,7 +1026,7 @@ static void SetLinkPartnerMonData(u8 monId) break; } - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); } static void LinkPartnerHandleSetRawMonData(void) @@ -1050,7 +1050,7 @@ static void LinkPartnerHandleLoadMonSprite(void) gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(gActiveBank, 2), - sub_80A6138(gActiveBank), + GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; @@ -1081,7 +1081,7 @@ static void sub_814CC98(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -1121,7 +1121,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1129,7 +1129,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); gBattleBankFunc[gActiveBank] = sub_814B3DC; } break; @@ -1201,7 +1201,7 @@ static void LinkPartnerHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -1209,7 +1209,7 @@ static void LinkPartnerHandleFaintAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER); gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; @@ -1277,7 +1277,7 @@ static void LinkPartnerDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1296,7 +1296,7 @@ static void LinkPartnerDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -1305,7 +1305,7 @@ static void LinkPartnerDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; LinkPartnerBufferExecCompleted(); @@ -1408,7 +1408,7 @@ static void LinkPartnerHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -1520,7 +1520,7 @@ static void LinkPartnerHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -1683,7 +1683,7 @@ static void LinkPartnerHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) LinkPartnerBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 7ffd9d64b..831f434b0 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -437,7 +437,7 @@ static void sub_805FB08(void) { FreeSpriteOamMatrix(&gSprites[gBankSpriteIds[gActiveBank]]); DestroySprite(&gSprites[gBankSpriteIds[gActiveBank]]); - sub_805EEE0(gActiveBank); + EnemyShadowCallbackToSetInvisible(gActiveBank); SetHealthboxSpriteInvisible(gHealthBoxesIds[gActiveBank]); OpponentBufferExecCompleted(); } @@ -473,7 +473,7 @@ static void sub_805FC10(void) if (gSprites[gHealthBoxesIds[gActiveBank]].callback == SpriteCallbackDummy) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_805FC80; } } @@ -1152,7 +1152,7 @@ static void OpponentHandleLoadMonSprite(void) gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(gActiveBank, 2), - sub_80A6138(gActiveBank), + GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; @@ -1187,7 +1187,7 @@ static void sub_80613DC(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gBankSpriteIds[bank]].data0 = bank; @@ -1217,7 +1217,7 @@ static void OpponentHandleReturnMonToBall(void) { FreeSpriteOamMatrix(&gSprites[gBankSpriteIds[gActiveBank]]); DestroySprite(&gSprites[gBankSpriteIds[gActiveBank]]); - sub_805EEE0(gActiveBank); + EnemyShadowCallbackToSetInvisible(gActiveBank); SetHealthboxSpriteInvisible(gHealthBoxesIds[gActiveBank]); OpponentBufferExecCompleted(); } @@ -1229,7 +1229,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1237,7 +1237,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_OPPONENT_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_OPPONENT_MON); gBattleBankFunc[gActiveBank] = sub_805FB08; } break; @@ -1415,7 +1415,7 @@ static void OpponentHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -1487,7 +1487,7 @@ static void OpponentDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1506,7 +1506,7 @@ static void OpponentDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -1515,7 +1515,7 @@ static void OpponentDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; OpponentBufferExecCompleted(); @@ -1731,7 +1731,7 @@ static void OpponentHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -1843,7 +1843,7 @@ static void OpponentHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -2000,7 +2000,7 @@ static void OpponentHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) OpponentBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 10d361cb9..91d3d55eb 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1008,10 +1008,10 @@ static void sub_805896C(void) FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); if (IsDoubleBattle()) - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]], gActiveBank ^ BIT_MON); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]], gActiveBank ^ BIT_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_9 = 3; gBattleBankFunc[gActiveBank] = sub_8058924; @@ -1107,7 +1107,7 @@ static void sub_8058EDC(void) FreeSpritePaletteByTag(0x27F9); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_8058FC0; } @@ -1119,7 +1119,7 @@ static void sub_8058FC0(void) && !IsCryPlayingOrClearCrySongs()) { m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlayerBufferExecCompleted(); } } @@ -1164,7 +1164,7 @@ static void CompleteOnHealthbarDone(void) } else { - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlayerBufferExecCompleted(); } } @@ -1305,7 +1305,7 @@ static void sub_8059544(u8 taskId) if (IsDoubleBattle() == TRUE && monIndex == gBattlePartyID[bank ^ BIT_MON]) bank ^= BIT_MON; - DoSpecialBattleAnimation(bank, bank, bank, B_ANIM_LVL_UP); + InitAndLaunchSpecialAnimation(bank, bank, bank, B_ANIM_LVL_UP); gTasks[taskId].func = sub_80595A4; } @@ -2193,7 +2193,7 @@ static void SetPlayerMonData(u8 monId) break; } - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); } static void PlayerHandleSetRawMonData(void) @@ -2238,7 +2238,7 @@ static void sub_805B258(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -2278,7 +2278,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -2286,7 +2286,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); gBattleBankFunc[gActiveBank] = sub_8059744; } break; @@ -2434,7 +2434,7 @@ static void PlayerHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -2442,7 +2442,7 @@ static void PlayerHandleFaintAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER); gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; @@ -2462,7 +2462,7 @@ static void PlayerHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gDoingBattleAnim = TRUE; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } @@ -2472,7 +2472,7 @@ static void PlayerHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gDoingBattleAnim = TRUE; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } @@ -2525,7 +2525,7 @@ static void PlayerDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -2544,7 +2544,7 @@ static void PlayerDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -2553,7 +2553,7 @@ static void PlayerDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; PlayerBufferExecCompleted(); @@ -2709,7 +2709,7 @@ static void PlayerHandleChoosePokemon(void) static void PlayerHandleCmd23(void) { - BattleMusicStop(); + BattleStopLowHpSound(); BeginNormalPaletteFade(-1, 2, 0, 16, 0); PlayerBufferExecCompleted(); } @@ -2788,7 +2788,7 @@ static void PlayerHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -2930,7 +2930,7 @@ static void PlayerHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -3088,7 +3088,7 @@ static void PlayerHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) PlayerBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index 34fd8a3eb..6ace9121c 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -327,7 +327,7 @@ static void CompleteOnHealthbarDone(void) } else { - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlayerPartnerBufferExecCompleted(); } } @@ -469,7 +469,7 @@ static void sub_81BB628(u8 taskId) if (IsDoubleBattle() == TRUE && monIndex == gBattlePartyID[bank ^ BIT_MON]) bank ^= BIT_MON; - DoSpecialBattleAnimation(bank, bank, bank, B_ANIM_LVL_UP); + InitAndLaunchSpecialAnimation(bank, bank, bank, B_ANIM_LVL_UP); gTasks[taskId].func = sub_81BB688; } @@ -560,7 +560,7 @@ static void sub_81BB92C(void) { CopyBattleSpriteInvisibility(gActiveBank); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_81BB9A0; } @@ -586,7 +586,7 @@ static void sub_81BB9F4(void) FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 0); UpdateHealthboxAttribute(gHealthBoxesIds[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], HEALTHBOX_ALL); sub_8076918(gActiveBank); @@ -1213,7 +1213,7 @@ static void SetPlayerPartnerMonData(u8 monId) break; } - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); } static void PlayerPartnerHandleSetRawMonData(void) @@ -1237,7 +1237,7 @@ static void PlayerPartnerHandleLoadMonSprite(void) gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(gActiveBank, 2), - sub_80A6138(gActiveBank), + GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; @@ -1268,7 +1268,7 @@ static void sub_81BD0E4(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -1308,7 +1308,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1316,7 +1316,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); gBattleBankFunc[gActiveBank] = sub_81BB828; } break; @@ -1395,7 +1395,7 @@ static void PlayerPartnerHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -1403,7 +1403,7 @@ static void PlayerPartnerHandleFaintAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, PAN_SIDE_PLAYER); gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; @@ -1470,7 +1470,7 @@ static void PlayerPartnerDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1489,7 +1489,7 @@ static void PlayerPartnerDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -1498,7 +1498,7 @@ static void PlayerPartnerDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; PlayerPartnerBufferExecCompleted(); @@ -1661,7 +1661,7 @@ static void PlayerPartnerHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -1773,7 +1773,7 @@ static void PlayerPartnerHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -1929,7 +1929,7 @@ static void PlayerPartnerHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) PlayerPartnerBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 0dc7631ce..914ad9c43 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -433,7 +433,7 @@ static void sub_8186D9C(void) { FreeSpriteOamMatrix(&gSprites[gBankSpriteIds[gActiveBank]]); DestroySprite(&gSprites[gBankSpriteIds[gActiveBank]]); - sub_805EEE0(gActiveBank); + EnemyShadowCallbackToSetInvisible(gActiveBank); SetHealthboxSpriteInvisible(gHealthBoxesIds[gActiveBank]); RecordedOpponentBufferExecCompleted(); } @@ -469,7 +469,7 @@ static void sub_8186EA4(void) if (gSprites[gHealthBoxesIds[gActiveBank]].callback == SpriteCallbackDummy) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_8186F14; } @@ -1149,7 +1149,7 @@ static void RecordedOpponentHandleLoadMonSprite(void) gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(gActiveBank, 2), - sub_80A6138(gActiveBank), + GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); @@ -1184,7 +1184,7 @@ static void sub_81885D8(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -1213,7 +1213,7 @@ static void RecordedOpponentHandleReturnMonToBall(void) { FreeSpriteOamMatrix(&gSprites[gBankSpriteIds[gActiveBank]]); DestroySprite(&gSprites[gBankSpriteIds[gActiveBank]]); - sub_805EEE0(gActiveBank); + EnemyShadowCallbackToSetInvisible(gActiveBank); SetHealthboxSpriteInvisible(gHealthBoxesIds[gActiveBank]); RecordedOpponentBufferExecCompleted(); } @@ -1225,7 +1225,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1233,7 +1233,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_OPPONENT_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_OPPONENT_MON); gBattleBankFunc[gActiveBank] = sub_8186D9C; } break; @@ -1314,7 +1314,7 @@ static void RecordedOpponentHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -1386,7 +1386,7 @@ static void RecordedOpponentDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1405,7 +1405,7 @@ static void RecordedOpponentDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -1414,7 +1414,7 @@ static void RecordedOpponentDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; RecordedOpponentBufferExecCompleted(); @@ -1530,7 +1530,7 @@ static void RecordedOpponentHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -1642,7 +1642,7 @@ static void RecordedOpponentHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -1794,7 +1794,7 @@ static void RecordedOpponentHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) RecordedOpponentBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index a3343a391..8db7b5626 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -272,9 +272,9 @@ static void sub_8189AA0(void) FreeSpriteTilesByTag(0x27F9); FreeSpritePaletteByTag(0x27F9); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); if (IsDoubleBattle()) - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]], gActiveBank ^ BIT_MON); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank ^ BIT_MON]], gActiveBank ^ BIT_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_9 = 3; gBattleBankFunc[gActiveBank] = sub_8189A58; @@ -397,7 +397,7 @@ static void CompleteOnHealthbarDone(void) } else { - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); RecordedPlayerBufferExecCompleted(); } } @@ -458,7 +458,7 @@ static void sub_818A2B4(void) { CopyBattleSpriteInvisibility(gActiveBank); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleBankFunc[gActiveBank] = sub_818A328; } @@ -484,7 +484,7 @@ static void sub_818A37C(void) FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); StartSpriteAnim(&gSprites[gBankSpriteIds[gActiveBank]], 0); UpdateHealthboxAttribute(gHealthBoxesIds[gActiveBank], &gPlayerParty[gBattlePartyID[gActiveBank]], HEALTHBOX_ALL); sub_8076918(gActiveBank); @@ -1111,7 +1111,7 @@ static void SetRecordedPlayerMonData(u8 monId) break; } - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); } static void RecordedPlayerHandleSetRawMonData(void) @@ -1135,7 +1135,7 @@ static void RecordedPlayerHandleLoadMonSprite(void) gBankSpriteIds[gActiveBank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(gActiveBank, 2), - sub_80A6138(gActiveBank), + GetBankSpriteDefault_Y(gActiveBank), sub_80A82E4(gActiveBank)); gSprites[gBankSpriteIds[gActiveBank]].pos2.x = -240; gSprites[gBankSpriteIds[gActiveBank]].data0 = gActiveBank; @@ -1166,7 +1166,7 @@ static void sub_818BA6C(u8 bank, bool8 dontClearSubstituteBit) gBankSpriteIds[bank] = CreateSprite( &gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -1206,7 +1206,7 @@ static void DoSwitchOutAnimation(void) { case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1214,7 +1214,7 @@ static void DoSwitchOutAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); gBattleBankFunc[gActiveBank] = sub_818A1B0; } break; @@ -1313,7 +1313,7 @@ static void RecordedPlayerHandleFaintAnimation(void) if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState == 0) { if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState++; } else @@ -1321,7 +1321,7 @@ static void RecordedPlayerHandleFaintAnimation(void) if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PlaySE12WithPanning(SE_POKE_DEAD, -64); gSprites[gBankSpriteIds[gActiveBank]].data1 = 0; gSprites[gBankSpriteIds[gActiveBank]].data2 = 5; @@ -1388,7 +1388,7 @@ static void RecordedPlayerDoMoveAnimation(void) && !gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8) { gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 1; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1407,7 +1407,7 @@ static void RecordedPlayerDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute && multihit < 2) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); gBattleSpritesDataPtr->bankData[gActiveBank].flag_x8 = 0; } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; @@ -1416,7 +1416,7 @@ static void RecordedPlayerDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; RecordedPlayerBufferExecCompleted(); @@ -1549,7 +1549,7 @@ static void RecordedPlayerHandleStatusAnimation(void) { if (!mplay_80342A4(gActiveBank)) { - DoStatusAnimation(gBattleBufferA[gActiveBank][1], + InitAndLaunchChosenStatusAnimation(gBattleBufferA[gActiveBank][1], gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8) | (gBattleBufferA[gActiveBank][4] << 16) | (gBattleBufferA[gActiveBank][5] << 24)); gBattleBankFunc[gActiveBank] = CompleteOnFinishedStatusAnimation; } @@ -1661,7 +1661,7 @@ static void RecordedPlayerHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -1813,7 +1813,7 @@ static void RecordedPlayerHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) RecordedPlayerBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 0c5b698cf..468a92610 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -413,7 +413,7 @@ static void SafariHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gDoingBattleAnim = TRUE; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } @@ -423,7 +423,7 @@ static void SafariHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gDoingBattleAnim = TRUE; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnSpecialAnimDone; } @@ -624,7 +624,7 @@ static void SafariHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -683,7 +683,7 @@ static void SafariHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) SafariBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index c2addd30c..ec052555a 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -369,7 +369,7 @@ static void sub_8168818(void) FreeSpritePaletteByTag(0x27F9); CreateTask(c3_0802FDF4, 10); - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); WallyBufferExecCompleted(); } @@ -387,7 +387,7 @@ static void CompleteOnHealthbarDone(void) } else { - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); WallyBufferExecCompleted(); } } @@ -1029,7 +1029,7 @@ static void SetWallyMonData(u8 monId) break; } - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); } static void WallyHandleSetRawMonData(void) @@ -1051,7 +1051,7 @@ static void WallyHandleReturnMonToBall(void) { if (gBattleBufferA[gActiveBank][1] == 0) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SWITCH_OUT_PLAYER_MON); gBattleBankFunc[gActiveBank] = sub_8168A20; } else @@ -1112,7 +1112,7 @@ static void WallyHandleSuccessBallThrowAnim(void) { gBattleSpritesDataPtr->animationData->ballThrowCaseId = BALL_3_SHAKES_SUCCESS; gDoingBattleAnim = TRUE; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnFinishedAnimation; } @@ -1122,7 +1122,7 @@ static void WallyHandleBallThrowAnim(void) gBattleSpritesDataPtr->animationData->ballThrowCaseId = ballThrowCaseId; gDoingBattleAnim = TRUE; - DoSpecialBattleAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, GetBankByIdentity(IDENTITY_OPPONENT_MON1), B_ANIM_SAFARI_BALL_THROW); gBattleBankFunc[gActiveBank] = CompleteOnFinishedAnimation; } @@ -1163,7 +1163,7 @@ static void WallyDoMoveAnimation(void) case 0: if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_SUBSTITUTE_TO_MON); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 1; break; @@ -1182,7 +1182,7 @@ static void WallyDoMoveAnimation(void) sub_805EB9C(1); if (gBattleSpritesDataPtr->bankData[gActiveBank].behindSubstitute) { - DoSpecialBattleAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); + InitAndLaunchSpecialAnimation(gActiveBank, gActiveBank, gActiveBank, B_ANIM_MON_TO_SUBSTITUTE); } gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 3; } @@ -1190,7 +1190,7 @@ static void WallyDoMoveAnimation(void) case 3: if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBank].specialAnimActive) { - sub_805E394(); + CopyAllBattleSpritesInvisibilities(); TrySetBehindSubstituteSpriteBit(gActiveBank, gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); gBattleSpritesDataPtr->healthBoxesData[gActiveBank].animationState = 0; WallyBufferExecCompleted(); @@ -1429,7 +1429,7 @@ static void WallyHandlePlayFanfareOrBGM(void) { if (gBattleBufferA[gActiveBank][3]) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(gBattleBufferA[gActiveBank][1] | (gBattleBufferA[gActiveBank][2] << 8)); } else @@ -1496,7 +1496,7 @@ static void sub_816AA80(u8 bank) sub_806A068(species, GetBankIdentity(bank)); gBankSpriteIds[bank] = CreateSprite(&gUnknown_0202499C, sub_80A5C6C(bank, 2), - sub_80A6138(bank), + GetBankSpriteDefault_Y(bank), sub_80A82E4(bank)); gSprites[gUnknown_03005D7C[bank]].data1 = gBankSpriteIds[bank]; @@ -1565,7 +1565,7 @@ static void WallyHandleBattleAnimation(void) u8 animationId = gBattleBufferA[gActiveBank][1]; u16 argument = gBattleBufferA[gActiveBank][2] | (gBattleBufferA[gActiveBank][3] << 8); - if (DoBattleAnimationFromTable(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) + if (TryHandleLaunchBattleTableAnimation(gActiveBank, gActiveBank, gActiveBank, animationId, argument)) WallyBufferExecCompleted(); else gBattleBankFunc[gActiveBank] = CompleteOnFinishedBattleAnimation; diff --git a/src/battle_dome_cards.c b/src/battle_dome_cards.c index e6c67b20e..9385417b4 100644 --- a/src/battle_dome_cards.c +++ b/src/battle_dome_cards.c @@ -119,7 +119,7 @@ static void sub_818D0C4(u16 species, u32 otId, u32 personality, u8 paletteSlot, if (paletteTag == 0xFFFF) { gUnknown_0203CCEC.paletteTag |= 0xFFFF; - LoadCompressedPalette(species_and_otid_get_pal(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20); + LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20); } else { @@ -146,7 +146,7 @@ static void sub_818D180(u16 species, u32 otId, u32 personality, u8 paletteSlot, { if (!isTrainer) { - LoadCompressedPalette(species_and_otid_get_pal(species, otId, personality), paletteSlot * 0x10, 0x20); + LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), paletteSlot * 0x10, 0x20); } else { diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c new file mode 100644 index 000000000..99a82f3ca --- /dev/null +++ b/src/battle_gfx_sfx_util.c @@ -0,0 +1,1299 @@ +#include "global.h" +#include "battle.h" +#include "battle_controllers.h" +#include "battle_ai_script_commands.h" +#include "battle_anim.h" +#include "battle_interface.h" +#include "main.h" +#include "malloc.h" +#include "rng.h" +#include "util.h" +#include "pokemon.h" +#include "moves.h" +#include "task.h" +#include "sprite.h" +#include "sound.h" +#include "m4a.h" +#include "species.h" +#include "decompress.h" +#include "data2.h" +#include "palette.h" +#include "blend_palette.h" +#include "contest.h" +#include "songs.h" + +extern u8 gBattleBufferA[BATTLE_BANKS_COUNT][0x200]; +extern u8 gActiveBank; +extern u8 gNoOfAllBanks; +extern u16 gUnknown_020243FC; +extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; +extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; +extern u8 gBanksByIdentity[BATTLE_BANKS_COUNT]; +extern u8 gBankSpriteIds[BATTLE_BANKS_COUNT]; +extern u8 gHealthBoxesIds[BATTLE_BANKS_COUNT]; +extern u8 gBattleMonForms[BATTLE_BANKS_COUNT]; +extern u32 gTransformedPersonalities[BATTLE_BANKS_COUNT]; +extern struct MusicPlayerInfo gMPlay_SE1; +extern struct MusicPlayerInfo gMPlay_SE2; +extern struct MusicPlayerInfo gMPlay_BGM; + +extern const struct BattleMove gBattleMoves[]; +extern const u8 gUnknown_0831C604[]; +extern const u8 * const gUnknown_082C9320[]; +extern const u8 * const gUnknown_082C937C[]; +extern const struct CompressedSpriteSheet gMonFrontPicTable[]; +extern const struct CompressedSpriteSheet gMonBackPicTable[]; +extern const struct CompressedSpriteSheet gTrainerFrontPicTable[]; +extern const struct CompressedSpriteSheet gTrainerBackPicTable[]; +extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; +extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; +extern const union AnimCmd* const * const gMonAnimationsSpriteAnimsPtrTable[]; +extern const struct SpriteTemplate gUnknown_08329D98[4]; +extern const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow; +extern const struct SpriteTemplate gSpriteTemplate_EnemyShadow; +extern const u8 gEnemyMonElevation[]; + +// graphics +extern const u32 gUnknown_08C093F0[]; +extern const u32 gSubstituteDollTilemap[]; +extern const u32 gSubstituteDollGfx[]; +extern const u16 gSubstituteDollPal[]; +extern const u8 gUnknown_08C1F1C8[]; +extern const u8 gUnknown_08C1F46C[]; +extern const u8 gUnknown_08C1F5E8[]; +extern const u8 gUnknown_08C1F76C[]; +extern const u8 gUnknown_08C1F8E8[]; +extern const u8 gUnknown_08C0237C[]; +extern const u16 gBattleInterface_BallStatusBarPal[]; +extern const u16 gBattleInterface_BallDisplayPal[]; + +extern u8 sub_80688F8(u8, u8 bank); +extern u8 pokemon_order_func(u8); // party menu +extern void sub_81B8C68(void); + +// this file's functions +static u8 sub_805D4A8(u16 move); +static u16 BattlePalaceGetTargetRetValue(void); +static void sub_805D7EC(struct Sprite *sprite); +static bool8 ShouldAnimBeDoneRegardlessOfSubsitute(u8 animId); +static void Task_ClearBitWhenBattleTableAnimDone(u8 taskId); +static void Task_ClearBitWhenSpecialAnimDone(u8 taskId); +static void ClearSpritesBankHealthboxAnimData(void); + +// const rom data +static const struct CompressedSpriteSheet gUnknown_0832C0D0 = +{ + gUnknown_08C1F1C8, 0x1000, TAG_HEALTHBOX_PLAYER1_TILE +}; + +static const struct CompressedSpriteSheet gUnknown_0832C0D8 = +{ + gUnknown_08C1F46C, 0x1000, TAG_HEALTHBOX_OPPONENT1_TILE +}; + +static const struct CompressedSpriteSheet gUnknown_0832C0E0[2] = +{ + {gUnknown_08C1F5E8, 0x800, TAG_HEALTHBOX_PLAYER1_TILE}, + {gUnknown_08C1F5E8, 0x800, TAG_HEALTHBOX_PLAYER2_TILE} +}; + +static const struct CompressedSpriteSheet gUnknown_0832C0F0[2] = +{ + {gUnknown_08C1F76C, 0x800, TAG_HEALTHBOX_OPPONENT1_TILE}, + {gUnknown_08C1F76C, 0x800, TAG_HEALTHBOX_OPPONENT2_TILE} +}; + +static const struct CompressedSpriteSheet gUnknown_0832C100 = +{ + gUnknown_08C1F8E8, 0x1000, TAG_HEALTHBOX_SAFARI_TILE +}; + +static const struct CompressedSpriteSheet gUnknown_0832C108[BATTLE_BANKS_COUNT] = +{ + {gUnknown_08C0237C, 0x0100, 0xd704}, + {gUnknown_08C0237C, 0x0120, 0xd705}, + {gUnknown_08C0237C, 0x0100, 0xd706}, + {gUnknown_08C0237C, 0x0120, 0xd707} +}; + +static const struct SpritePalette gUnknown_0832C128[2] = +{ + {gBattleInterface_BallStatusBarPal, TAG_HEALTHBOX_PAL}, + {gBattleInterface_BallDisplayPal, 0xd704} +}; + +// code +void AllocateBattleSpritesData(void) +{ + gBattleSpritesDataPtr = AllocZeroed(sizeof(struct BattleSpriteData)); + gBattleSpritesDataPtr->bankData = AllocZeroed(sizeof(struct BattleSpriteInfo) * BATTLE_BANKS_COUNT); + gBattleSpritesDataPtr->healthBoxesData = AllocZeroed(sizeof(struct BattleHealthboxInfo) * BATTLE_BANKS_COUNT); + gBattleSpritesDataPtr->animationData = AllocZeroed(sizeof(struct BattleAnimationInfo)); + gBattleSpritesDataPtr->battleBars = AllocZeroed(sizeof(struct BattleBarInfo) * BATTLE_BANKS_COUNT); +} + +void FreeBattleSpritesData(void) +{ + if (gBattleSpritesDataPtr == NULL) + return; + + FREE_AND_SET_NULL(gBattleSpritesDataPtr->battleBars); + FREE_AND_SET_NULL(gBattleSpritesDataPtr->animationData); + FREE_AND_SET_NULL(gBattleSpritesDataPtr->healthBoxesData); + FREE_AND_SET_NULL(gBattleSpritesDataPtr->bankData); + FREE_AND_SET_NULL(gBattleSpritesDataPtr); +} + +u16 ChooseMoveAndTargetInBattlePalace(void) +{ + s32 i, var1, var2; + s32 chosenMoveId = -1; + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBank][4]); + u8 unusableMovesBits = CheckMoveLimitations(gActiveBank, 0, 0xFF); + s32 percent = Random() % 100; + + i = (gBattleStruct->field_92 & gBitTable[gActiveBank]) ? 2 : 0; + var2 = i; + var1 = i + 2; + + for (; i < var1; i++) + { + if (gUnknown_0831C494[GetNatureFromPersonality(gBattleMons[gActiveBank].personality)][i] > percent) + break; + } + + percent = i - var2; + if (i == var1) + percent = 2; + + for (var2 = 0, i = 0; i < 4; i++) + { + if (moveInfo->moves[i] == MOVE_NONE) + break; + if (percent == sub_805D4A8(moveInfo->moves[i]) && moveInfo->currentPp[i] != 0) + var2 |= gBitTable[i]; + } + + if (var2 != 0) + { + gBattleStruct->field_92 &= 0xF; + gBattleStruct->field_92 |= (var2 << 4); + BattleAI_SetupAIData(var2); + chosenMoveId = BattleAI_ChooseMoveOrAction(); + } + + if (chosenMoveId == -1) + { + if (unusableMovesBits != 0xF) + { + var1 = 0, var2 = 0; + + for (i = 0; i < 4; i++) + { + if (sub_805D4A8(moveInfo->moves[i]) == 0 && !(gBitTable[i] & unusableMovesBits)) + var1 += 0x1; + if (sub_805D4A8(moveInfo->moves[i]) == 1 && !(gBitTable[i] & unusableMovesBits)) + var1 += 0x10; + if (sub_805D4A8(moveInfo->moves[i]) == 2 && !(gBitTable[i] & unusableMovesBits)) + var1 += 0x100; + } + + if ((var1 & 0xF) > 1) + var2++; + if ((var1 & 0xF0) > 0x1F) + var2++; + if ((var1 & 0xF0) > 0x1FF) + var2++; + + if (var2 > 1 || var2 == 0) + { + do + { + i = Random() % 4; + if (!(gBitTable[i] & unusableMovesBits)) + chosenMoveId = i; + } while (chosenMoveId == -1); + } + else + { + if ((var1 & 0xF) > 1) + var2 = 0; + if ((var1 & 0xF0) > 0x1F) + var2 = 1; + if ((var1 & 0xF0) > 0x1FF) + var2 = 2; + + do + { + i = Random() % 4; + if (!(gBitTable[i] & unusableMovesBits) && var2 == sub_805D4A8(moveInfo->moves[i])) + chosenMoveId = i; + } while (chosenMoveId == -1); + } + + if (Random() % 100 > 49) + { + gProtectStructs[gActiveBank].flag_x10 = 1; + return 0; + } + } + else + { + gProtectStructs[gActiveBank].flag_x10 = 1; + return 0; + } + } + + if (moveInfo->moves[chosenMoveId] == MOVE_CURSE) + { + if (moveInfo->monType1 != TYPE_GHOST && moveInfo->monType2 != TYPE_GHOST) + var1 = MOVE_TARGET_x10; + else + var1 = MOVE_TARGET_SELECTED; + } + else + { + var1 = gBattleMoves[moveInfo->moves[chosenMoveId]].target; + } + + if (var1 & MOVE_TARGET_x10) + chosenMoveId |= (gActiveBank << 8); + else if (var1 == MOVE_TARGET_SELECTED) + chosenMoveId |= (BattlePalaceGetTargetRetValue()); + else + chosenMoveId |= (GetBankByIdentity((GetBankIdentity(gActiveBank) & BIT_SIDE) ^ BIT_SIDE) << 8); + + return chosenMoveId; +} + +static u8 sub_805D4A8(u16 move) +{ + switch (gBattleMoves[move].target) + { + case MOVE_TARGET_SELECTED: + case MOVE_TARGET_USER: + case MOVE_TARGET_RANDOM: + case MOVE_TARGET_BOTH: + case MOVE_TARGET_FOES_AND_ALLY: + if (gBattleMoves[move].power == 0) + return 2; + else + return 0; + break; + case MOVE_TARGET_DEPENDS: + case MOVE_TARGET_OPPONENTS_FIELD: + return 2; + case MOVE_TARGET_x10: + return 1; + default: + return 0; + } +} + +static u16 BattlePalaceGetTargetRetValue(void) +{ + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + u8 opposing1, opposing2; + + if (GetBankSide(gActiveBank) == SIDE_PLAYER) + { + opposing1 = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + opposing2 = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + } + else + { + opposing1 = GetBankByIdentity(IDENTITY_PLAYER_MON1); + opposing2 = GetBankByIdentity(IDENTITY_PLAYER_MON2); + } + + if (gBattleMons[opposing1].hp == gBattleMons[opposing2].hp) + return (((gActiveBank & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8; + + switch (gUnknown_0831C604[GetNatureFromPersonality(gBattleMons[gActiveBank].personality)]) + { + case 0: + if (gBattleMons[opposing1].hp > gBattleMons[opposing2].hp) + return opposing1 << 8; + else + return opposing2 << 8; + case 1: + if (gBattleMons[opposing1].hp < gBattleMons[opposing2].hp) + return opposing1 << 8; + else + return opposing2 << 8; + case 2: + return (((gActiveBank & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8; + } + } + + return (gActiveBank ^ BIT_SIDE) << 8; +} + +void sub_805D714(struct Sprite *sprite) +{ + u8 spriteId = sprite->data1; + + if (!gSprites[spriteId].affineAnimEnded) + return; + if (gSprites[spriteId].invisible) + return; + + if (gSprites[spriteId].animPaused) + { + gSprites[spriteId].animPaused = 0; + } + else + { + if (gSprites[spriteId].animEnded) + sprite->callback = SpriteCallbackDummy; + } +} + +void sub_805D770(struct Sprite *sprite, bool8 arg1) +{ + sprite->animPaused = 1; + sprite->callback = SpriteCallbackDummy; + + if (!arg1) + StartSpriteAffineAnim(sprite, 1); + else + StartSpriteAffineAnim(sprite, 1); + + AnimateSprite(sprite); +} + +void sub_805D7AC(struct Sprite *sprite) +{ + if (!(gUnknown_020243FC & 1)) + { + sprite->pos2.x += sprite->data0; + if (sprite->pos2.x == 0) + { + if (sprite->pos2.y != 0) + sprite->callback = sub_805D7EC; + else + sprite->callback = SpriteCallbackDummy; + } + } +} + +static void sub_805D7EC(struct Sprite *sprite) +{ + sprite->pos2.y -= 2; + if (sprite->pos2.y == 0) + sprite->callback = SpriteCallbackDummy; +} + +void InitAndLaunchChosenStatusAnimation(bool8 isStatus2, u32 status) +{ + gBattleSpritesDataPtr->healthBoxesData[gActiveBank].statusAnimActive = 1; + if (!isStatus2) + { + if (status == STATUS_FREEZE) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_FRZ); + else if (status == STATUS_POISON || status & STATUS_TOXIC_POISON) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_PSN); + else if (status == STATUS_BURN) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_BRN); + else if (status & STATUS_SLEEP) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_SLP); + else if (status == STATUS_PARALYSIS) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_PRZ); + else // no animation + gBattleSpritesDataPtr->healthBoxesData[gActiveBank].statusAnimActive = 0; + } + else + { + if (status & STATUS2_INFATUATION) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_INFATUATION); + else if (status & STATUS2_CONFUSION) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_CONFUSION); + else if (status & STATUS2_CURSED) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_CURSED); + else if (status & STATUS2_NIGHTMARE) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_NIGHTMARE); + else if (status & STATUS2_WRAPPED) + LaunchStatusAnimation(gActiveBank, B_ANIM_STATUS_WRAPPED); + else // no animation + gBattleSpritesDataPtr->healthBoxesData[gActiveBank].statusAnimActive = 0; + } +} + +#define tBank data[0] + +bool8 TryHandleLaunchBattleTableAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId, u16 argument) +{ + u8 taskId; + + if (tableId == B_ANIM_CASTFORM_CHANGE && (argument & 0x80)) + { + gBattleMonForms[activeBank] = (argument & ~(0x80)); + return TRUE; + } + if (gBattleSpritesDataPtr->bankData[activeBank].behindSubstitute + && !ShouldAnimBeDoneRegardlessOfSubsitute(tableId)) + { + return TRUE; + } + if (gBattleSpritesDataPtr->bankData[activeBank].behindSubstitute + && tableId == B_ANIM_SUBSTITUTE_FADE + && gSprites[gBankSpriteIds[activeBank]].invisible) + { + LoadBattleMonGfxAndAnimate(activeBank, TRUE, gBankSpriteIds[activeBank]); + ClearBehindSubstituteBit(activeBank); + return TRUE; + } + + gAnimBankAttacker = atkBank; + gAnimBankTarget = defBank; + gBattleSpritesDataPtr->animationData->animArg = argument; + LaunchBattleAnimation(gUnknown_082C9320, tableId, FALSE); + taskId = CreateTask(Task_ClearBitWhenBattleTableAnimDone, 10); + gTasks[taskId].tBank = activeBank; + gBattleSpritesDataPtr->healthBoxesData[gTasks[taskId].tBank].animFromTableActive = 1; + + return FALSE; +} + +static void Task_ClearBitWhenBattleTableAnimDone(u8 taskId) +{ + gAnimScriptCallback(); + if (!gAnimScriptActive) + { + gBattleSpritesDataPtr->healthBoxesData[gTasks[taskId].tBank].animFromTableActive = 0; + DestroyTask(taskId); + } +} + +#undef tBank + +static bool8 ShouldAnimBeDoneRegardlessOfSubsitute(u8 animId) +{ + switch (animId) + { + case B_ANIM_SUBSTITUTE_FADE: + case B_ANIM_RAIN_CONTINUES: + case B_ANIM_SUN_CONTINUES: + case B_ANIM_SANDSTORM_CONTINUES: + case B_ANIM_HAIL_CONTINUES: + case B_ANIM_SNATCH_MOVE: + return TRUE; + default: + return FALSE; + } +} + +#define tBank data[0] + +void InitAndLaunchSpecialAnimation(u8 activeBank, u8 atkBank, u8 defBank, u8 tableId) +{ + u8 taskId; + + gAnimBankAttacker = atkBank; + gAnimBankTarget = defBank; + LaunchBattleAnimation(gUnknown_082C937C, tableId, FALSE); + taskId = CreateTask(Task_ClearBitWhenSpecialAnimDone, 10); + gTasks[taskId].tBank = activeBank; + gBattleSpritesDataPtr->healthBoxesData[gTasks[taskId].tBank].specialAnimActive = 1; +} + +static void Task_ClearBitWhenSpecialAnimDone(u8 taskId) +{ + gAnimScriptCallback(); + if (!gAnimScriptActive) + { + gBattleSpritesDataPtr->healthBoxesData[gTasks[taskId].tBank].specialAnimActive = 0; + DestroyTask(taskId); + } +} + +#undef tBank + +// great function to include newly added moves that don't have animation yet +bool8 IsMoveWithoutAnimation(u16 moveId, u8 animationTurn) +{ + return FALSE; +} + +bool8 mplay_80342A4(u8 bank) +{ + u8 zero = 0; + + if (IsSEPlaying()) + { + gBattleSpritesDataPtr->healthBoxesData[bank].field_8++; + if (gBattleSpritesDataPtr->healthBoxesData[gActiveBank].field_8 < 30) + return TRUE; + + m4aMPlayStop(&gMPlay_SE1); + m4aMPlayStop(&gMPlay_SE2); + } + if (zero == 0) + { + gBattleSpritesDataPtr->healthBoxesData[bank].field_8 = 0; + return FALSE; + } + + return TRUE; +} + +void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 bank) +{ + u32 monsPersonality, currentPersonality, otId; + u16 species; + u8 identity; + u16 paletteOffset; + const void *lzPaletteData; + + monsPersonality = GetMonData(mon, MON_DATA_PERSONALITY); + + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_NONE) + { + species = GetMonData(mon, MON_DATA_SPECIES); + currentPersonality = monsPersonality; + } + else + { + species = gBattleSpritesDataPtr->bankData[bank].transformSpecies; + currentPersonality = gTransformedPersonalities[bank]; + } + + otId = GetMonData(mon, MON_DATA_OT_ID); + identity = GetBankIdentity(bank); + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], + gMonSpritesGfxPtr->sprites[identity], + species, currentPersonality); + + paletteOffset = 0x100 + bank * 16; + + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_NONE) + lzPaletteData = GetMonFrontSpritePal(mon); + else + lzPaletteData = GetFrontSpritePalFromSpeciesAndPersonality(species, otId, monsPersonality); + + LZDecompressWram(lzPaletteData, gDecompressionBuffer); + LoadPalette(gDecompressionBuffer, paletteOffset, 0x20); + LoadPalette(gDecompressionBuffer, 0x80 + bank * 16, 0x20); + + if (species == SPECIES_CASTFORM) + { + paletteOffset = 0x100 + bank * 16; + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[0]); + LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[bank]], paletteOffset, 0x20); + } + + // transform's pink color + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies != SPECIES_NONE) + { + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + } +} + +void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 bank) +{ + u32 monsPersonality, currentPersonality, otId; + u16 species; + u8 identity; + u16 paletteOffset; + const void *lzPaletteData; + + monsPersonality = GetMonData(mon, MON_DATA_PERSONALITY); + + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_NONE) + { + species = GetMonData(mon, MON_DATA_SPECIES); + currentPersonality = monsPersonality; + } + else + { + species = gBattleSpritesDataPtr->bankData[bank].transformSpecies; + currentPersonality = gTransformedPersonalities[bank]; + } + + otId = GetMonData(mon, MON_DATA_OT_ID); + identity = GetBankIdentity(bank); + + if (sub_80688F8(1, bank) == 1 || gBattleSpritesDataPtr->bankData[bank].transformSpecies != SPECIES_NONE) + { + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], + gMonSpritesGfxPtr->sprites[identity], + species, currentPersonality); + } + else + { + HandleLoadSpecialPokePic(&gMonBackPicTable[species], + gMonSpritesGfxPtr->sprites[identity], + species, currentPersonality); + } + + paletteOffset = 0x100 + bank * 16; + + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies == SPECIES_NONE) + lzPaletteData = GetMonFrontSpritePal(mon); + else + lzPaletteData = GetFrontSpritePalFromSpeciesAndPersonality(species, otId, monsPersonality); + + LZDecompressWram(lzPaletteData, gDecompressionBuffer); + LoadPalette(gDecompressionBuffer, paletteOffset, 0x20); + LoadPalette(gDecompressionBuffer, 0x80 + bank * 16, 0x20); + + if (species == SPECIES_CASTFORM) + { + paletteOffset = 0x100 + bank * 16; + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[0]); + LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[bank]], paletteOffset, 0x20); + } + + // transform's pink color + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies != SPECIES_NONE) + { + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + } +} + +void nullsub_23(void) +{ +} + +void nullsub_24(u16 species) +{ +} + +void DecompressTrainerFrontPic(u16 frontPicId, u8 bank) +{ + u8 identity = GetBankIdentity(bank); + DecompressPicFromTable_2(&gTrainerFrontPicTable[frontPicId], + gMonSpritesGfxPtr->sprites[identity], + SPECIES_NONE); + LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[frontPicId]); +} + +void DecompressTrainerBackPic(u16 backPicId, u8 bank) +{ + u8 identity = GetBankIdentity(bank); + DecompressPicFromTable_2(&gTrainerBackPicTable[backPicId], + gMonSpritesGfxPtr->sprites[identity], + SPECIES_NONE); + LoadCompressedPalette(gTrainerBackPicPaletteTable[backPicId].data, + 0x100 + 16 * bank, 0x20); +} + +void nullsub_25(u8 arg0) +{ +} + +void FreeTrainerFrontPicPalette(u16 frontPicId) +{ + FreeSpritePaletteByTag(gTrainerFrontPicPaletteTable[frontPicId].tag); +} + +void sub_805DFFC(void) +{ + u8 numberOfBanks = 0; + u8 i; + + LoadSpritePalette(&gUnknown_0832C128[0]); + LoadSpritePalette(&gUnknown_0832C128[1]); + if (!IsDoubleBattle()) + { + LoadCompressedObjectPic(&gUnknown_0832C0D0); + LoadCompressedObjectPic(&gUnknown_0832C0D8); + numberOfBanks = 2; + } + else + { + LoadCompressedObjectPic(&gUnknown_0832C0E0[0]); + LoadCompressedObjectPic(&gUnknown_0832C0E0[1]); + LoadCompressedObjectPic(&gUnknown_0832C0F0[0]); + LoadCompressedObjectPic(&gUnknown_0832C0F0[1]); + numberOfBanks = 4; + } + for (i = 0; i < numberOfBanks; i++) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[i]]); +} + +bool8 BattleLoadAllHealthBoxesGfx(u8 state) +{ + bool8 retVal = FALSE; + + if (state != 0) + { + if (state == 1) + { + LoadSpritePalette(&gUnknown_0832C128[0]); + LoadSpritePalette(&gUnknown_0832C128[1]); + } + else if (!IsDoubleBattle()) + { + if (state == 2) + { + if (gBattleTypeFlags & BATTLE_TYPE_SAFARI) + LoadCompressedObjectPic(&gUnknown_0832C100); + else + LoadCompressedObjectPic(&gUnknown_0832C0D0); + } + else if (state == 3) + LoadCompressedObjectPic(&gUnknown_0832C0D8); + else if (state == 4) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[0]]); + else if (state == 5) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[1]]); + else + retVal = TRUE; + } + else + { + if (state == 2) + LoadCompressedObjectPic(&gUnknown_0832C0E0[0]); + else if (state == 3) + LoadCompressedObjectPic(&gUnknown_0832C0E0[1]); + else if (state == 4) + LoadCompressedObjectPic(&gUnknown_0832C0F0[0]); + else if (state == 5) + LoadCompressedObjectPic(&gUnknown_0832C0F0[1]); + else if (state == 6) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[0]]); + else if (state == 7) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[1]]); + else if (state == 8) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[2]]); + else if (state == 9) + LoadCompressedObjectPic(&gUnknown_0832C108[gBanksByIdentity[3]]); + else + retVal = TRUE; + } + } + + return retVal; +} + +void LoadBattleBarGfx(u8 arg0) +{ + LZDecompressWram(gUnknown_08C093F0, gMonSpritesGfxPtr->barFontGfx); +} + +bool8 BattleInitAllSprites(u8 *state1, u8 *bank) +{ + bool8 retVal = FALSE; + + switch (*state1) + { + case 0: + ClearSpritesBankHealthboxAnimData(); + (*state1)++; + break; + case 1: + if (!BattleLoadAllHealthBoxesGfx(*bank)) + { + (*bank)++; + } + else + { + *bank = 0; + (*state1)++; + } + break; + case 2: + (*state1)++; + break; + case 3: + if ((gBattleTypeFlags & BATTLE_TYPE_SAFARI) && *bank == 0) + gHealthBoxesIds[*bank] = CreateSafariPlayerHealthboxSprites(); + else + gHealthBoxesIds[*bank] = CreateBankHealthboxSprites(*bank); + + (*bank)++; + if (*bank == gNoOfAllBanks) + { + *bank = 0; + (*state1)++; + } + break; + case 4: + SetBankHealthboxSpritePos(*bank); + if (gBanksByIdentity[*bank] <= 1) + DummyBattleInterfaceFunc(gHealthBoxesIds[*bank], FALSE); + else + DummyBattleInterfaceFunc(gHealthBoxesIds[*bank], TRUE); + + (*bank)++; + if (*bank == gNoOfAllBanks) + { + *bank = 0; + (*state1)++; + } + break; + case 5: + if (GetBankSide(*bank) == SIDE_PLAYER) + { + if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI)) + UpdateHealthboxAttribute(gHealthBoxesIds[*bank], &gPlayerParty[gBattlePartyID[*bank]], HEALTHBOX_ALL); + } + else + { + UpdateHealthboxAttribute(gHealthBoxesIds[*bank], &gEnemyParty[gBattlePartyID[*bank]], HEALTHBOX_ALL); + } + SetHealthboxSpriteInvisible(gHealthBoxesIds[*bank]); + (*bank)++; + if (*bank == gNoOfAllBanks) + { + *bank = 0; + (*state1)++; + } + break; + case 6: + LoadAndCreateEnemyShadowSprites(); + sub_81B8C68(); + retVal = TRUE; + break; + } + + return retVal; +} + +void ClearSpritesHealthboxAnimData(void) +{ + memset(gBattleSpritesDataPtr->healthBoxesData, 0, sizeof(struct BattleHealthboxInfo) * BATTLE_BANKS_COUNT); + memset(gBattleSpritesDataPtr->animationData, 0, sizeof(struct BattleAnimationInfo)); +} + +static void ClearSpritesBankHealthboxAnimData(void) +{ + ClearSpritesHealthboxAnimData(); + memset(gBattleSpritesDataPtr->bankData, 0, sizeof(struct BattleSpriteInfo) * BATTLE_BANKS_COUNT); +} + +void CopyAllBattleSpritesInvisibilities(void) +{ + s32 i; + + for (i = 0; i < gNoOfAllBanks; i++) + gBattleSpritesDataPtr->bankData[i].invisible = gSprites[gBankSpriteIds[i]].invisible; +} + +void CopyBattleSpriteInvisibility(u8 bank) +{ + gBattleSpritesDataPtr->bankData[bank].invisible = gSprites[gBankSpriteIds[bank]].invisible; +} + +void HandleSpeciesGfxDataChange(u8 bankAtk, u8 bankDef, bool8 notTransform) +{ + u16 paletteOffset; + u32 personalityValue; + u32 otId; + u8 identity; + const u8 *lzPaletteData; + + if (notTransform) + { + StartSpriteAnim(&gSprites[gBankSpriteIds[bankAtk]], gBattleSpritesDataPtr->animationData->animArg); + paletteOffset = 0x100 + bankAtk * 16; + LoadPalette(gBattleStruct->castformPalette[gBattleSpritesDataPtr->animationData->animArg], paletteOffset, 32); + gBattleMonForms[bankAtk] = gBattleSpritesDataPtr->animationData->animArg; + if (gBattleSpritesDataPtr->bankData[bankAtk].transformSpecies != SPECIES_NONE) + { + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + } + gSprites[gBankSpriteIds[bankAtk]].pos1.y = GetBankSpriteDefault_Y(bankAtk); + } + else + { + const void *src; + void *dst; + u16 targetSpecies; + + if (IsContest()) + { + identity = 0; + targetSpecies = gContestResources->field_18->field_2; + personalityValue = gContestResources->field_18->field_8; + otId = gContestResources->field_18->field_C; + + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies], + gMonSpritesGfxPtr->sprites[0], + targetSpecies, + gContestResources->field_18->field_10); + } + else + { + identity = GetBankIdentity(bankAtk); + + if (GetBankSide(bankDef) == SIDE_OPPONENT) + targetSpecies = GetMonData(&gEnemyParty[gBattlePartyID[bankDef]], MON_DATA_SPECIES); + else + targetSpecies = GetMonData(&gPlayerParty[gBattlePartyID[bankDef]], MON_DATA_SPECIES); + + if (GetBankSide(bankAtk) == SIDE_PLAYER) + { + personalityValue = GetMonData(&gPlayerParty[gBattlePartyID[bankAtk]], MON_DATA_PERSONALITY); + otId = GetMonData(&gPlayerParty[gBattlePartyID[bankAtk]], MON_DATA_OT_ID); + + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies], + gMonSpritesGfxPtr->sprites[identity], + targetSpecies, + gTransformedPersonalities[bankAtk]); + } + else + { + personalityValue = GetMonData(&gEnemyParty[gBattlePartyID[bankAtk]], MON_DATA_PERSONALITY); + otId = GetMonData(&gEnemyParty[gBattlePartyID[bankAtk]], MON_DATA_OT_ID); + + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[targetSpecies], + gMonSpritesGfxPtr->sprites[identity], + targetSpecies, + gTransformedPersonalities[bankAtk]); + } + } + + src = gMonSpritesGfxPtr->sprites[identity]; + dst = (void *)(VRAM + 0x10000 + gSprites[gBankSpriteIds[bankAtk]].oam.tileNum * 32); + DmaCopy32(3, src, dst, 0x800); + paletteOffset = 0x100 + bankAtk * 16; + lzPaletteData = GetFrontSpritePalFromSpeciesAndPersonality(targetSpecies, otId, personalityValue); + LZDecompressWram(lzPaletteData, gDecompressionBuffer); + LoadPalette(gDecompressionBuffer, paletteOffset, 32); + + if (targetSpecies == SPECIES_CASTFORM) + { + gSprites[gBankSpriteIds[bankAtk]].anims = gMonAnimationsSpriteAnimsPtrTable[targetSpecies]; + LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[0]); + LoadPalette(gBattleStruct->castformPalette[0] + gBattleMonForms[bankDef] * 16, paletteOffset, 32); + } + + BlendPalette(paletteOffset, 16, 6, 0x7FFF); + CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32); + + if (!IsContest()) + { + gBattleSpritesDataPtr->bankData[bankAtk].transformSpecies = targetSpecies; + gBattleMonForms[bankAtk] = gBattleMonForms[bankDef]; + } + + gSprites[gBankSpriteIds[bankAtk]].pos1.y = GetBankSpriteDefault_Y(bankAtk); + StartSpriteAnim(&gSprites[gBankSpriteIds[bankAtk]], gBattleMonForms[bankAtk]); + } +} + +void BattleLoadSubstituteOrMonSpriteGfx(u8 bank, bool8 loadMonSprite) +{ + u8 identity; + s32 i; + u32 var; + const void *substitutePal; + + if (!loadMonSprite) + { + if (IsContest()) + identity = 0; + else + identity = GetBankIdentity(bank); + + if (IsContest()) + LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[identity]); + else if (GetBankSide(bank) != SIDE_PLAYER) + LZDecompressVram(gSubstituteDollGfx, gMonSpritesGfxPtr->sprites[identity]); + else + LZDecompressVram(gSubstituteDollTilemap, gMonSpritesGfxPtr->sprites[identity]); + + i = 1; + var = bank * 16; + substitutePal = gSubstituteDollPal; + for (; i < 4; i++) + { + register void *dmaSrc asm("r0") = gMonSpritesGfxPtr->sprites[identity]; + void *dmaDst = (i * 0x800) + dmaSrc; + u32 dmaSize = 0x800; + DmaCopy32(3, dmaSrc, dmaDst, dmaSize); + i++;i--; + } + + LoadCompressedPalette(substitutePal, 0x100 + var, 32); + } + else + { + if (!IsContest()) + { + if (GetBankSide(bank) != SIDE_PLAYER) + BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[bank]], bank); + else + BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[bank]], bank); + } + } +} + +void LoadBattleMonGfxAndAnimate(u8 bank, bool8 loadMonSprite, u8 spriteId) +{ + BattleLoadSubstituteOrMonSpriteGfx(bank, loadMonSprite); + StartSpriteAnim(&gSprites[spriteId], gBattleMonForms[bank]); + + if (!loadMonSprite) + gSprites[spriteId].pos1.y = GetSubstituteSpriteDefault_Y(bank); + else + gSprites[spriteId].pos1.y = GetBankSpriteDefault_Y(bank); +} + +void TrySetBehindSubstituteSpriteBit(u8 bank, u16 move) +{ + if (move == MOVE_SUBSTITUTE) + gBattleSpritesDataPtr->bankData[bank].behindSubstitute = 1; +} + +void ClearBehindSubstituteBit(u8 bank) +{ + gBattleSpritesDataPtr->bankData[bank].behindSubstitute = 0; +} + +void HandleLowHpMusicChange(struct Pokemon *mon, u8 bank) +{ + u16 hp = GetMonData(mon, MON_DATA_HP); + u16 maxHP = GetMonData(mon, MON_DATA_MAX_HP); + + if (GetHPBarLevel(hp, maxHP) == HP_BAR_RED) + { + if (!gBattleSpritesDataPtr->bankData[bank].lowHpSong) + { + if (!gBattleSpritesDataPtr->bankData[bank ^ BIT_MON].lowHpSong) + PlaySE(SE_HINSI); + gBattleSpritesDataPtr->bankData[bank].lowHpSong = 1; + } + } + else + { + gBattleSpritesDataPtr->bankData[bank].lowHpSong = 0; + if (!IsDoubleBattle()) + { + m4aSongNumStop(SE_HINSI); + return; + } + if (IsDoubleBattle() && !gBattleSpritesDataPtr->bankData[bank ^ BIT_MON].lowHpSong) + { + m4aSongNumStop(SE_HINSI); + return; + } + } +} + +void BattleStopLowHpSound(void) +{ + u8 playerBank = GetBankByIdentity(IDENTITY_PLAYER_MON1); + + gBattleSpritesDataPtr->bankData[playerBank].lowHpSong = 0; + if (IsDoubleBattle()) + gBattleSpritesDataPtr->bankData[playerBank ^ BIT_MON].lowHpSong = 0; + + m4aSongNumStop(SE_HINSI); +} + +u8 GetMonHPBarLevel(struct Pokemon *mon) +{ + u16 hp = GetMonData(mon, MON_DATA_HP); + u16 maxHP = GetMonData(mon, MON_DATA_MAX_HP); + + return GetHPBarLevel(hp, maxHP); +} + +void sub_805EAE8(void) +{ + if (gMain.inBattle) + { + u8 playerBank1 = GetBankByIdentity(IDENTITY_PLAYER_MON1); + u8 playerBank2 = GetBankByIdentity(IDENTITY_PLAYER_MON2); + u8 bank1PartyId = pokemon_order_func(gBattlePartyID[playerBank1]); + u8 bank2PartyId = pokemon_order_func(gBattlePartyID[playerBank2]); + + if (GetMonData(&gPlayerParty[bank1PartyId], MON_DATA_HP) != 0) + HandleLowHpMusicChange(&gPlayerParty[bank1PartyId], playerBank1); + if (IsDoubleBattle() && GetMonData(&gPlayerParty[bank2PartyId], MON_DATA_HP) != 0) + HandleLowHpMusicChange(&gPlayerParty[bank2PartyId], playerBank2); + } +} + +void sub_805EB9C(u8 affineMode) +{ + s32 i; + + for (i = 0; i < gNoOfAllBanks; i++) + { + if (IsBankSpritePresent(i)) + { + gSprites[gBankSpriteIds[i]].oam.affineMode = affineMode; + if (affineMode == 0) + { + gBattleSpritesDataPtr->healthBoxesData[i].field_6 = gSprites[gBankSpriteIds[i]].oam.matrixNum; + gSprites[gBankSpriteIds[i]].oam.matrixNum = 0; + } + else + { + gSprites[gBankSpriteIds[i]].oam.matrixNum = gBattleSpritesDataPtr->healthBoxesData[i].field_6; + } + } + } +} + +#define tBank data0 + +void LoadAndCreateEnemyShadowSprites(void) +{ + u8 bank; + + LoadCompressedObjectPic(&gSpriteSheet_EnemyShadow); + + bank = GetBankByIdentity(IDENTITY_OPPONENT_MON1); + gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, sub_80A5C6C(bank, 0), sub_80A5C6C(bank, 1) + 29, 0xC8); + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank; + + if (IsDoubleBattle()) + { + bank = GetBankByIdentity(IDENTITY_OPPONENT_MON2); + gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId = CreateSprite(&gSpriteTemplate_EnemyShadow, sub_80A5C6C(bank, 0), sub_80A5C6C(bank, 1) + 29, 0xC8); + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].data0 = bank; + } +} + +void SpriteCB_EnemyShadow(struct Sprite *shadowSprite) +{ + bool8 invisible = FALSE; + u8 bank = shadowSprite->tBank; + struct Sprite *bankSprite = &gSprites[gBankSpriteIds[bank]]; + + if (!bankSprite->inUse || !IsBankSpritePresent(bank)) + { + shadowSprite->callback = SpriteCB_SetInvisible; + return; + } + if (gAnimScriptActive || bankSprite->invisible) + invisible = TRUE; + else if (gBattleSpritesDataPtr->bankData[bank].transformSpecies != SPECIES_NONE + && gEnemyMonElevation[gBattleSpritesDataPtr->bankData[bank].transformSpecies] == 0) + invisible = TRUE; + + if (gBattleSpritesDataPtr->bankData[bank].behindSubstitute) + invisible = TRUE; + + shadowSprite->pos1.x = bankSprite->pos1.x; + shadowSprite->pos2.x = bankSprite->pos2.x; + shadowSprite->invisible = invisible; +} + +#undef tBank + +void SpriteCB_SetInvisible(struct Sprite *sprite) +{ + sprite->invisible = 1; +} + +void SetBankEnemyShadowSpriteCallback(u8 bank, u16 species) +{ + if (GetBankSide(bank) == SIDE_PLAYER) + return; + + if (gBattleSpritesDataPtr->bankData[bank].transformSpecies != SPECIES_NONE) + species = gBattleSpritesDataPtr->bankData[bank].transformSpecies; + + if (gEnemyMonElevation[species] != 0) + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].callback = SpriteCB_EnemyShadow; + else + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].callback = SpriteCB_SetInvisible; +} + +void EnemyShadowCallbackToSetInvisible(u8 bank) +{ + gSprites[gBattleSpritesDataPtr->healthBoxesData[bank].shadowSpriteId].callback = SpriteCB_SetInvisible; +} + +void sub_805EF14(void) +{ + u16 *vramPtr = (u16*)(VRAM + 0x240); + s32 i; + s32 j; + + for (i = 0; i < 9; i++) + { + for (j = 0; j < 16; j++) + { + if (!(*vramPtr & 0xF000)) + *vramPtr |= 0xF000; + if (!(*vramPtr & 0x0F00)) + *vramPtr |= 0x0F00; + if (!(*vramPtr & 0x00F0)) + *vramPtr |= 0x00F0; + if (!(*vramPtr & 0x000F)) + *vramPtr |= 0x000F; + vramPtr++; + } + } +} + +void ClearTemporarySpeciesSpriteData(u8 bank, bool8 dontClearSubstitute) +{ + gBattleSpritesDataPtr->bankData[bank].transformSpecies = SPECIES_NONE; + gBattleMonForms[bank] = 0; + if (!dontClearSubstitute) + ClearBehindSubstituteBit(bank); +} + +void AllocateMonSpritesGfx(void) +{ + u8 i = 0, j; + + gMonSpritesGfxPtr = NULL; + gMonSpritesGfxPtr = AllocZeroed(sizeof(*gMonSpritesGfxPtr)); + gMonSpritesGfxPtr->firstDecompressed = AllocZeroed(0x8000); + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + gMonSpritesGfxPtr->sprites[i] = gMonSpritesGfxPtr->firstDecompressed + (i * 0x2000); + *(gMonSpritesGfxPtr->templates + i) = gUnknown_08329D98[i]; + + for (j = 0; j < 4; j++) + { + gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites[i] + (j * 0x800); + gMonSpritesGfxPtr->field_74[i][j].size = 0x800; + } + + gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->field_74[i]; + } + + gMonSpritesGfxPtr->barFontGfx = AllocZeroed(0x1000); +} + +void FreeMonSpritesGfx(void) +{ + if (gMonSpritesGfxPtr == NULL) + return; + + if (gMonSpritesGfxPtr->field_17C != NULL) + FREE_AND_SET_NULL(gMonSpritesGfxPtr->field_17C); + if (gMonSpritesGfxPtr->field_178 != NULL) + FREE_AND_SET_NULL(gMonSpritesGfxPtr->field_178); + + FREE_AND_SET_NULL(gMonSpritesGfxPtr->barFontGfx); + FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed); + gMonSpritesGfxPtr->sprites[0] = NULL; + gMonSpritesGfxPtr->sprites[1] = NULL; + gMonSpritesGfxPtr->sprites[2] = NULL; + gMonSpritesGfxPtr->sprites[3] = NULL; + FREE_AND_SET_NULL(gMonSpritesGfxPtr); +} + +bool32 ShouldPlayNormalPokeCry(struct Pokemon *mon) +{ + s16 hp, maxHP; + s32 barLevel; + + if (GetMonData(mon, MON_DATA_STATUS) & (STATUS_ANY | STATUS_TOXIC_COUNTER)) + return FALSE; + + hp = GetMonData(mon, MON_DATA_HP); + maxHP = GetMonData(mon, MON_DATA_MAX_HP); + + barLevel = GetHPBarLevel(hp, maxHP); + if (barLevel <= HP_BAR_YELLOW) + return FALSE; + + return TRUE; +} diff --git a/src/battle_interface.c b/src/battle_interface.c index 5f582a366..240c64862 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1239,11 +1239,11 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent) } ConvertIntToDecimalStringN(text + 6, value, STR_CONV_MODE_RIGHT_ALIGN, 3); - RenderTextFont9(gMonSpritesGfxPtr->fontPixels, 9, text); + RenderTextFont9(gMonSpritesGfxPtr->barFontGfx, 9, text); for (i = 0; i < 3; i++) { - CpuCopy32(&gMonSpritesGfxPtr->fontPixels[i * 64 + 32], + CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[i * 64 + 32], (void*)((OBJ_VRAM0) + 32 * (gSprites[healthboxSpriteId].oam.tileNum + var + i)), 0x20); } @@ -1308,19 +1308,19 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 txtPtr = ConvertIntToDecimalStringN(text + 6, value, STR_CONV_MODE_RIGHT_ALIGN, 3); if (!maxOrCurrent) StringCopy(txtPtr, gText_Slash); - RenderTextFont9(gMonSpritesGfxPtr->fontPixels, 9, text); + RenderTextFont9(gMonSpritesGfxPtr->barFontGfx, 9, text); for (i = var; i < var + 3; i++) { if (i < 3) { - CpuCopy32(&gMonSpritesGfxPtr->fontPixels[((i - var) * 64) + 32], + CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[((i - var) * 64) + 32], (void*)((OBJ_VRAM0) + 32 * (1 + gSprites[r7].oam.tileNum + i)), 0x20); } else { - CpuCopy32(&gMonSpritesGfxPtr->fontPixels[((i - var) * 64) + 32], + CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[((i - var) * 64) + 32], (void*)((OBJ_VRAM0 + 0x20) + 32 * (i + gSprites[r7].oam.tileNum)), 0x20); } @@ -1328,7 +1328,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 if (maxOrCurrent == HP_CURRENT) { - CpuCopy32(&gMonSpritesGfxPtr->fontPixels[224], + CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[224], (void*)((OBJ_VRAM0) + ((gSprites[r7].oam.tileNum + 4) * 32)), 0x20); CpuFill32(0, (void*)((OBJ_VRAM0) + (gSprites[r7].oam.tileNum * 32)), 0x20); @@ -1350,15 +1350,15 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon) { u8 text[20]; s32 j, var2; - u8 *fontPixels; + u8 *barFontGfx; u8 i, var, nature, healthboxSpriteId_2; memcpy(text, sUnknown_0832C3C4, sizeof(sUnknown_0832C3C4)); - fontPixels = &gMonSpritesGfxPtr->fontPixels[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data6) * 384)]; + barFontGfx = &gMonSpritesGfxPtr->barFontGfx[0x520 + (GetBankIdentity(gSprites[healthboxSpriteId].data6) * 384)]; var = 5; nature = GetNature(mon); StringCopy(text + 6, gNatureNamePointers[nature]); - RenderTextFont9(fontPixels, 9, text); + RenderTextFont9(barFontGfx, 9, text); for (j = 6, i = 0; i < var; i++, j++) { @@ -1371,18 +1371,18 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon) else elementId = 43; - CpuCopy32(GetHealthboxElementGfxPtr(elementId), fontPixels + (i * 64), 0x20); + CpuCopy32(GetHealthboxElementGfxPtr(elementId), barFontGfx + (i * 64), 0x20); } for (j = 1; j < var + 1; j++) { var2 = (gSprites[healthboxSpriteId].oam.tileNum + (j - (j / 8 * 8)) + (j / 8 * 64)) * 32; - CpuCopy32(fontPixels, (void*)(OBJ_VRAM0) + (var2), 0x20); - fontPixels += 0x20; + CpuCopy32(barFontGfx, (void*)(OBJ_VRAM0) + (var2), 0x20); + barFontGfx += 0x20; var2 = (8 + gSprites[healthboxSpriteId].oam.tileNum + (j - (j / 8 * 8)) + (j / 8 * 64)) * 32; - CpuCopy32(fontPixels, (void*)(OBJ_VRAM0) + (var2), 0x20); - fontPixels += 0x20; + CpuCopy32(barFontGfx, (void*)(OBJ_VRAM0) + (var2), 0x20); + barFontGfx += 0x20; } healthboxSpriteId_2 = gSprites[healthboxSpriteId].data5; @@ -1390,20 +1390,20 @@ static void sub_80730D4(u8 healthboxSpriteId, struct Pokemon *mon) ConvertIntToDecimalStringN(text + 9, gBattleStruct->field_7B, STR_CONV_MODE_RIGHT_ALIGN, 2); text[5] = CHAR_SPACE; text[8] = CHAR_SLASH; - RenderTextFont9(gMonSpritesGfxPtr->fontPixels, 9, text); + RenderTextFont9(gMonSpritesGfxPtr->barFontGfx, 9, text); j = healthboxSpriteId_2; // needed to match for some reason for (j = 0; j < 5; j++) { if (j <= 1) { - CpuCopy32(&gMonSpritesGfxPtr->fontPixels[0x40 * j + 0x20], + CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[0x40 * j + 0x20], (void*)(OBJ_VRAM0) + (gSprites[healthboxSpriteId_2].oam.tileNum + 2 + j) * 32, 32); } else { - CpuCopy32(&gMonSpritesGfxPtr->fontPixels[0x40 * j + 0x20], + CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[0x40 * j + 0x20], (void*)(OBJ_VRAM0 + 0xC0) + (j + gSprites[healthboxSpriteId_2].oam.tileNum) * 32, 32); } @@ -2545,19 +2545,19 @@ u8 GetHPBarLevel(s16 hp, s16 maxhp) if (hp == maxhp) { - result = 4; + result = HP_BAR_FULL; } else { u8 fraction = GetScaledHPFraction(hp, maxhp, 48); if (fraction > 24) - result = 3; + result = HP_BAR_GREEN; else if (fraction > 9) - result = 2; + result = HP_BAR_YELLOW; else if (fraction > 0) - result = 1; + result = HP_BAR_RED; else - result = 0; + result = HP_BAR_EMPTY; } return result; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c6cec7f0d..91be4fd9d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1068,22 +1068,33 @@ static const u8 sBallCatchBonuses[] = 20, 15, 10, 15 // Ultra, Great, Poke, Safari }; -// could be a 2d array or a struct -const ALIGNED(4) u8 gUnknown_0831C494[] = +const ALIGNED(4) u8 gUnknown_0831C494[][4] = { - 0x3d, 0x44, 0x3d, 0x44, 0x14, 0x2d, 0x54, 0x5c, - 0x46, 0x55, 0x20, 0x5c, 0x26, 0x45, 0x46, 0x55, - 0x14, 0x5a, 0x46, 0x5c, 0x1e, 0x32, 0x20, 0x5a, - 0x38, 0x4e, 0x38, 0x4e, 0x19, 0x28, 0x4b, 0x5a, - 0x45, 0x4b, 0x1c, 0x53, 0x23, 0x2d, 0x1d, 0x23, - 0x3e, 0x48, 0x1e, 0x32, 0x3a, 0x5f, 0x58, 0x5e, - 0x22, 0x2d, 0x1d, 0x28, 0x23, 0x28, 0x23, 0x5f, - 0x38, 0x4e, 0x38, 0x4e, 0x23, 0x50, 0x22, 0x5e, - 0x2c, 0x5e, 0x22, 0x28, 0x38, 0x4e, 0x38, 0x4e, - 0x1e, 0x58, 0x1e, 0x58, 0x1e, 0x2b, 0x1b, 0x21, - 0x28, 0x5a, 0x19, 0x57, 0x12, 0x58, 0x5a, 0x5f, - 0x58, 0x5e, 0x16, 0x2a, 0x2a, 0x5c, 0x2a, 0x2f, - 0x38, 0x4e, 0x38, 0x4e + {0x3d, 0x44, 0x3d, 0x44}, + {0x14, 0x2d, 0x54, 0x5c}, + {0x46, 0x55, 0x20, 0x5c}, + {0x26, 0x45, 0x46, 0x55}, + {0x14, 0x5a, 0x46, 0x5c}, + {0x1e, 0x32, 0x20, 0x5a}, + {0x38, 0x4e, 0x38, 0x4e}, + {0x19, 0x28, 0x4b, 0x5a}, + {0x45, 0x4b, 0x1c, 0x53}, + {0x23, 0x2d, 0x1d, 0x23}, + {0x3e, 0x48, 0x1e, 0x32}, + {0x3a, 0x5f, 0x58, 0x5e}, + {0x22, 0x2d, 0x1d, 0x28}, + {0x23, 0x28, 0x23, 0x5f}, + {0x38, 0x4e, 0x38, 0x4e}, + {0x23, 0x50, 0x22, 0x5e}, + {0x2c, 0x5e, 0x22, 0x28}, + {0x38, 0x4e, 0x38, 0x4e}, + {0x1e, 0x58, 0x1e, 0x58}, + {0x1e, 0x2b, 0x1b, 0x21}, + {0x28, 0x5a, 0x19, 0x57}, + {0x12, 0x58, 0x5a, 0x5f}, + {0x58, 0x5e, 0x16, 0x2a}, + {0x2a, 0x5c, 0x2a, 0x2f}, + {0x38, 0x4e, 0x38, 0x4e} }; static const u8 sUnknown_0831C4F8[] = @@ -3533,7 +3544,7 @@ static void atk23_getexp(void) // music change in wild battle after fainting a poke if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp && !gBattleStruct->wildVictorySong) { - BattleMusicStop(); + BattleStopLowHpSound(); PlayBGM(0x161); gBattleStruct->wildVictorySong++; } @@ -3628,7 +3639,7 @@ static void atk23_getexp(void) if (gBattleBufferB[gActiveBank][0] == CONTROLLER_TWORETURNVALUES && gBattleBufferB[gActiveBank][1] == RET_VALUE_LEVELLED_UP) { if (gBattleTypeFlags & BATTLE_TYPE_TRAINER && gBattlePartyID[gActiveBank] == gBattleStruct->expGetterId) - sub_805E990(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); + HandleLowHpMusicChange(&gPlayerParty[gBattlePartyID[gActiveBank]], gActiveBank); PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, gActiveBank, gBattleStruct->expGetterId) diff --git a/src/berry_blender.c b/src/berry_blender.c index db50fe4c4..8e5a51845 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1,6 +1,8 @@ - -// Includes #include "global.h" +#include "bg.h" +#include "window.h" +#include "task.h" +#include "sprite.h" // Static type declarations @@ -11,8 +13,585 @@ IWRAM_DATA s16 gUnknown_03000DF8[6]; IWRAM_DATA s16 gUnknown_03000E04; IWRAM_DATA s16 gUnknown_03000E06; -// Static ROM declarations +// graphics +extern const u8 gBerryBlenderArrowTiles[]; +extern const u8 gBerryBlenderStartTiles[]; +extern const u8 gBerryBlenderMarubatsuTiles[]; +extern const u8 gBerryBlenderParticlesTiles[]; +extern const u8 gBerryBlenderCountdownNumbersTiles[]; +extern const u16 gBerryBlenderMiscPalette[]; +extern const u16 gBerryBlenderArrowPalette[]; + +void sub_8080EA4(u8 taskId); +void sub_8080FD0(u8 taskId); +void sub_80810F8(u8 taskId); +void sub_80833F8(struct Sprite *sprite); +void sub_8082F68(struct Sprite *sprite); +void sub_8083010(struct Sprite *sprite); +void sub_80830C0(struct Sprite *sprite); // .rodata +// TODO: make those static once the file is decompiled +const u16 sBlenderCenterPal[] = INCBIN_U16("graphics/berry_blender/center.gbapal"); +const u8 sBlenderCenterMap[] = INCBIN_U8("graphics/berry_blender/center_map.bin"); +const u16 sBlenderOuterPal[] = INCBIN_U16("graphics/berry_blender/outer.gbapal"); + +// unreferenced pals? +static const u16 sUnknownPal_0[] = INCBIN_U16("graphics/unknown/unknown_339514.gbapal"); +static const u16 sUnknownArray_1[224] = {0}; + +// unused text? +static const u8 sUnusedText_YesNo[] = _("YES\nNO"); +static const u8 sUnusedText_2[] = _("▶"); +static const u8 sUnusedText_Space[] = _(" "); +static const u8 sUnusedText_Terminating[] = _("Terminating."); +static const u8 sUnusedText_LinkPartnerNotFound[] = _("Link partner(s) not found.\nPlease try again.\p"); + +const u8 gText_BerryBlenderStart[] = _("Starting up the BERRY BLENDER.\pPlease select a BERRY from your BAG\nto put in the BERRY BLENDER.\p"); +const u8 gText_NewParagraph[] = _("\p"); +const u8 gText_WasMade[] = _(" was made!"); +static const u8 sText_Mister[] = _("MISTER"); +static const u8 sText_Laddie[] = _("LADDIE"); +static const u8 sText_Lassie[] = _("LASSIE"); +static const u8 sText_Master[] = _("MASTER"); +static const u8 sText_Dude[] = _("DUDE"); +static const u8 sText_Miss[] = _("MISS"); + +const u8* const sBlenderOpponentsNames[] = +{ + sText_Mister, + sText_Laddie, + sText_Lassie, + sText_Master, + sText_Dude, + sText_Miss +}; + +static const u8 sText_PressAToStart[] = _("Press the A Button to start."); +static const u8 sText_PleaseWaitAWhile[] = _("Please wait a while."); +const u8 sText_CommunicationStandby[] = _("Communication standby…"); +const u8 sText_WouldLikeToBlendAnotherBerry[] = _("Would you like to blend another BERRY?"); +const u8 sText_RunOutOfBerriesForBlending[] = _("You’ve run out of BERRIES for\nblending in the BERRY BLENDER.\p"); +const u8 sText_YourPokeblockCaseIsFull[] = _("Your {POKEBLOCK} CASE is full.\p"); +const u8 sText_HasNoBerriesToPut[] = _(" has no BERRIES to put in\nthe BERRY BLENDER."); +const u8 sText_ApostropheSPokeblockCaseIsFull[] = _("’s {POKEBLOCK} CASE is full.\p"); +const u8 sText_BlendingResults[] = _("RESULTS OF BLENDING"); +static const u8 sText_BerryUsed[] = _("BERRY USED"); +const u8 sText_SpaceBerry[] = _(" BERRY"); +const u8 sText_Time[] = _("Time:"); +const u8 sText_Min[] = _(" min. "); +const u8 sText_Sec[] = _(" sec."); +const u8 sText_MaximumSpeed[] = _("MAXIMUM SPEED"); +const u8 sText_RPM[] = _(" RPM"); +const u8 sText_Dot[] = _("."); +const u8 sText_NewLine[] = _("\n"); +static const u8 sText_Space[] = _(" "); +const u8 sText_Ranking[] = _("RANKING"); +const u8 sText_TheLevelIs[] = _("The level is "); +const u8 sText_TheFeelIs[] = _(", and the feel is "); +const u8 sText_Dot2[] = _("."); + +const struct BgTemplate gUnknown_08339974[3] = +{ + { + .bg = 0, + .charBaseIndex = 3, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0, + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 12, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0, + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 8, + .screenSize = 1, + .paletteMode = 1, + .priority = 0, + .baseTile = 0, + } +}; + +const struct WindowTemplate gUnknown_08339980[] = +{ + {0, 1, 6, 7, 2, 0xE, 0x28}, + {0, 0x16, 6, 7, 2, 0xE, 0x36}, + {0, 1, 0xC, 7, 2, 0xE, 0x44}, + {0, 0x16, 0xC, 7, 2, 0xE, 0x52}, + {0, 2, 0xF, 0x1B, 4, 0xE, 0x60}, + {0, 5, 3, 0x15, 0xE, 0xE, 0x60}, + DUMMY_WIN_TEMPLATE +}; + +const struct WindowTemplate gUnknown_083399B8 = +{ + 0, 0x15, 9, 5, 4, 0xE, 0xCC +}; + +const s8 gUnknown_083399C0[][2] = +{ + {-1, -1}, {1, -1}, {-1, 1}, {1, 1} +}; + +const u8 sBlenderSyncArrowsPos[][2] = +{ + {72, 32}, {168, 32}, {72, 128}, {168, 128} +}; + +const u8 gUnknown_083399D0[3][4] = +{ + {-1, 0, 1, -1}, {-1, 0, 1, 2}, {0, 1, 2, 3} +}; + +const u16 gUnknown_083399DC[] = {0, 0xC000, 0x4000, 0x8000}; +const u8 gUnknown_083399E4[] = {1, 1, 0}; +const u8 gUnknown_083399E7[] = {32, 224, 96, 160, 0}; + +const TaskFunc gUnknown_083399EC[] = +{ + sub_8080EA4, sub_8080FD0, sub_80810F8 +}; + +static const struct OamData sOamData_8216314 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sSpriteAnim_821631C[] = +{ + ANIMCMD_FRAME(16, 5, 1, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216324[] = +{ + ANIMCMD_FRAME(16, 5, .vFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821632C[] = +{ + ANIMCMD_FRAME(16, 5, .hFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216334[] = +{ + ANIMCMD_FRAME(16, 5, 0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821633C[] = +{ + ANIMCMD_FRAME(48, 2, 1, 1), + ANIMCMD_FRAME(32, 5, 1, 1), + ANIMCMD_FRAME(48, 3, 1, 1), + ANIMCMD_FRAME(16, 5, 1, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216350[] = +{ + ANIMCMD_FRAME(48, 2, .vFlip = TRUE), + ANIMCMD_FRAME(32, 5, .vFlip = TRUE), + ANIMCMD_FRAME(48, 3, .vFlip = TRUE), + ANIMCMD_FRAME(16, 5, .vFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216364[] = +{ + ANIMCMD_FRAME(48, 2, .hFlip = TRUE), + ANIMCMD_FRAME(32, 5, .hFlip = TRUE), + ANIMCMD_FRAME(48, 3, .hFlip = TRUE), + ANIMCMD_FRAME(16, 5, .hFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216378[] = +{ + ANIMCMD_FRAME(48, 2, 0, 0), + ANIMCMD_FRAME(32, 5, 0, 0), + ANIMCMD_FRAME(48, 3, 0, 0), + ANIMCMD_FRAME(16, 5, 0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821638C[] = +{ + ANIMCMD_FRAME(0, 5, 1, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216394[] = +{ + ANIMCMD_FRAME(0, 5, .vFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821639C[] = +{ + ANIMCMD_FRAME(0, 5, .hFlip = TRUE), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82163A4[] = +{ + ANIMCMD_FRAME(0, 5, 0, 0), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82163AC[] = +{ + sSpriteAnim_821631C, + sSpriteAnim_8216324, + sSpriteAnim_821632C, + sSpriteAnim_8216334, + sSpriteAnim_821633C, + sSpriteAnim_8216350, + sSpriteAnim_8216364, + sSpriteAnim_8216378, + sSpriteAnim_821638C, + sSpriteAnim_8216394, + sSpriteAnim_821639C, + sSpriteAnim_82163A4 +}; + +const struct SpriteSheet sSpriteSheet_BlenderArrow = +{ + gBerryBlenderArrowTiles, 0x800, 46545 +}; + +const struct SpritePalette sSpritePal_BlenderMisc = +{ + gBerryBlenderMiscPalette, 46546 +}; + +const struct SpritePalette sSpritePal_BlenderArrow = +{ + gBerryBlenderArrowPalette, 12312 +}; + +const struct SpriteTemplate sBlenderSyncArrow_SpriteTemplate = +{ + .tileTag = 46545, + .paletteTag = 12312, + .oam = &sOamData_8216314, + .anims = sSpriteAnimTable_82163AC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80833F8 +}; + +static const struct OamData sOamData_821640C = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sSpriteAnim_8216414[] = +{ + ANIMCMD_FRAME(0, 20), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821641C[] = +{ + ANIMCMD_FRAME(4, 20, 1, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216424[] = +{ + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(12, 4), + ANIMCMD_FRAME(8, 4), + ANIMCMD_FRAME(12, 4), + ANIMCMD_FRAME(8, 4), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821643C[] = +{ + ANIMCMD_FRAME(8, 4), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_8216444[] = +{ + sSpriteAnim_8216414, + sSpriteAnim_821641C, + sSpriteAnim_8216424, + sSpriteAnim_821643C, +}; + +const struct SpriteSheet gUnknown_08339B38 = +{ + gBerryBlenderMarubatsuTiles, 0x200, 48888 +}; + +const struct SpriteTemplate gUnknown_08339B40 = +{ + .tileTag = 48888, + .paletteTag = 46546, + .oam = &sOamData_821640C, + .anims = sSpriteAnimTable_8216444, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8082F68 +}; + +static const struct OamData sOamData_8216474 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sSpriteAnim_821647C[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(1, 4), + ANIMCMD_FRAME(3, 5), + ANIMCMD_FRAME(1, 4), + ANIMCMD_FRAME(0, 3), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216494[] = +{ + ANIMCMD_FRAME(0, 3), + ANIMCMD_FRAME(2, 4), + ANIMCMD_FRAME(4, 5), + ANIMCMD_FRAME(2, 4), + ANIMCMD_FRAME(0, 3), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82164AC[] = +{ + ANIMCMD_FRAME(0, 2), + ANIMCMD_FRAME(1, 2), + ANIMCMD_FRAME(2, 2), + ANIMCMD_FRAME(4, 4), + ANIMCMD_FRAME(3, 3), + ANIMCMD_FRAME(2, 2), + ANIMCMD_FRAME(1, 2), + ANIMCMD_FRAME(0, 2), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82164D0[] = +{ + ANIMCMD_FRAME(5, 5, 1, 1), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_82164D8[] = +{ + ANIMCMD_FRAME(6, 5, 1, 1), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_82164E0[] = +{ + sSpriteAnim_821647C, + sSpriteAnim_8216494, + sSpriteAnim_82164AC, + sSpriteAnim_82164D0, + sSpriteAnim_82164D8, +}; + +const struct SpriteSheet gUnknown_08339BD8 = +{ + gBerryBlenderParticlesTiles, 0xE0, 23456 +}; + +const struct SpriteTemplate gUnknown_08339BE0 = +{ + .tileTag = 23456, + .paletteTag = 46546, + .oam = &sOamData_8216474, + .anims = sSpriteAnimTable_82164E0, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + +static const struct OamData sOamData_8216514 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sSpriteAnim_821651C[] = +{ + ANIMCMD_FRAME(32, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8216524[] = +{ + ANIMCMD_FRAME(16, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_821652C[] = +{ + ANIMCMD_FRAME(0, 30), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_8216534[] = +{ + sSpriteAnim_821651C, + sSpriteAnim_8216524, + sSpriteAnim_821652C, +}; + +const struct SpriteSheet gUnknown_08339C24 = +{ + gBerryBlenderCountdownNumbersTiles, 0x600, 12345 +}; + +const struct SpriteTemplate gUnknown_08339C2C = +{ + .tileTag = 12345, + .paletteTag = 46546, + .oam = &sOamData_8216514, + .anims = sSpriteAnimTable_8216534, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_8083010 +}; + +static const struct OamData sOamData_8216560 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 3, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sSpriteAnim_8216568[] = +{ + ANIMCMD_FRAME(0, 30), + ANIMCMD_END +}; + +static const union AnimCmd *const sSpriteAnimTable_8216570[] = +{ + sSpriteAnim_8216568, +}; + +const struct SpriteSheet gUnknown_08339C58 = +{ + gBerryBlenderStartTiles, 0x400, 12346 +}; + +const struct SpriteTemplate gUnknown_08339C60 = +{ + .tileTag = 12346, + .paletteTag = 46546, + .oam = &sOamData_8216560, + .anims = sSpriteAnimTable_8216570, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80830C0 +}; + +const s16 gUnknown_08339C78[][5] = +{ + {-10, 20, 10, 2, 1}, + {250, 20, 10, -2, 1}, + {-10, 140, 10, 2, -1}, + {250, 140, 10, -2, -1}, +}; + +const u8 gUnknown_08339CA0[][3] = +{ + {4, 3, 2}, {0, 4, 3}, {1, 0, 4}, {2, 1, 0}, {3, 2, 1}, {0, 2, 3}, {1, 3, 4}, {2, 4, 0}, {3, 0, 1}, {4, 1, 2}, +}; + +const u8 gUnknown_08339CBE[] = {30, 31, 32, 33, 34}; + +const u8 gUnknown_08339CC3[] = {1, 1, 2, 3, 4}; + +const u8 gUnknown_08339CC8[] = {0x1C, 0x16, 0x13, 0x1A, 0x19, 0x0E, 0x0D, 0x0B, 0x07, 0x15}; + +static const u8 gUnknown_08339CD2[] = +{ + 0xfe, 0x02, 0x02, 0xce, 0xd0, 0x37, 0x44, 0x07, 0x1f, 0x0c, 0x10, + 0x00, 0xff, 0xfe, 0x91, 0x72, 0xce, 0xd0, 0x37, 0x44, 0x07, 0x1f, + 0x0c, 0x10, 0x00, 0xff, 0x06, 0x27, 0x02, 0xff, 0x00, 0x0c, 0x48, + 0x02, 0xff, 0x00, 0x01, 0x1f, 0x02, 0xff, 0x00, 0x16, 0x37, 0x02, + 0xff, 0x00, 0x0d, 0x50, 0x4b, 0x02, 0xff, 0x06, 0x06, 0x06, 0x06, + 0x05, 0x03, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x02 +}; + +const struct WindowTemplate gUnknown_08339D14[] = {0, 6, 4, 0x12, 0xB, 0xF, 8}; // .text diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index d9fd40b84..bc7177bd7 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -1,4 +1,1556 @@ #include "global.h" #include "hall_of_fame.h" +#include "task.h" +#include "palette.h" +#include "sprite.h" +#include "pokemon.h" +#include "text.h" +#include "malloc.h" +#include "gpu_regs.h" +#include "main.h" +#include "sound.h" +#include "songs.h" +#include "decompress.h" +#include "save.h" +#include "window.h" +#include "bg.h" +#include "species.h" +#include "game_stat.h" +#include "blend_palette.h" +#include "string_util.h" +#include "m4a.h" +#include "international_string_util.h" +#include "unknown_task.h" +#include "trig.h" +#include "rng.h" +#include "event_data.h" +struct HallofFameMon +{ + u32 tid; + u32 personality; + u16 species:9; + u16 lvl:7; + u8 nick[10]; +}; +struct HallofFameTeam +{ + struct HallofFameMon mon[6]; +}; + +struct HofGfx +{ + u16 state; + u8 field_2[16]; + u8 tilemap1[0x1000]; + u8 tilemap2[0x1000]; +}; + +static EWRAM_DATA struct HallofFameTeam *sHofMonPtr = NULL; +static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL; + +extern bool8 gHasHallOfFameRecords; +extern u32 gUnknown_0203BCD4; +extern u8 gDecompressionBuffer[]; +extern struct MusicPlayerInfo gMPlay_BGM; +extern MainCallback gGameContinueCallback; +extern u32 gDamagedSaveSectors; +extern u8 gReservedSpritePaletteCount; + +#define HALL_OF_FAME_MAX_TEAMS 50 + +// strings +extern const u8 gText_SavingDontTurnOffPower[]; +extern const u8 gText_LeagueChamp[]; +extern const u8 gText_HOFNumber[]; +extern const u8 gText_PickNextCancel[]; +extern const u8 gText_PickCancel[]; +extern const u8 gText_UnkCtrlF800Exit[]; +extern const u8 gText_HOFCorrupted[]; +extern const u8 gText_WelcomeToHOF[]; +extern const u8 gText_Number[]; +extern const u8 gText_Level[]; +extern const u8 gText_IDNumber[]; +extern const u8 gText_Name[]; +extern const u8 gText_MainMenuTime[]; + +// graphics +extern const u8 gContestConfetti_Gfx[]; +extern const u8 gContestConfetti_Pal[]; + +extern void sub_81973C4(u8, u8); +extern u16 AddTextPrinterParametrized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void ( *callback)(u16, struct TextPrinter *), u8 fgColor, u8 bgColor, u8 shadowColor); +extern void sub_8175620(void); +extern u8 TrySavingData(u8); +extern u8 sub_818D3E4(u16 species, u32 trainerId, u32 personality, u8 flags, s16 x, s16 y, u8, u16); +extern void sub_8197434(u8, u8); +extern u16 sub_818D97C(u8 playerGender, u8); +extern u16 sub_818D8AC(u16, u8, s16, s16, u8, u16); +extern const void* stdpal_get(u8); +extern void sub_80987D4(u8, u8, u16, u8); +extern u16 sub_818D820(u16); +extern u16 sub_818D8F0(u16); +extern u16 sub_818D7D8(u16 species, u32 trainerId, u32 personality, u8 arg3, s16 sp0, s16 sp1, u8 sp2, u16 sp3); +extern void sub_8198204(u8 *dst, const u8 *src, u8, u8, u8); +extern bool8 sub_80F9C30(void); +extern void sub_8198314(void); +extern void sub_8137C3C(void); +extern void sub_8198180(const u8 *src, u8, u8); +extern void sub_80F9BF4(u16, u16, u8); +extern void sub_81980F0(u8, u8, u8, u8, u16); +extern void sub_80F9BCC(u16, u16, u8); +extern bool8 sub_80F9C1C(void); +extern u16 SpeciesToPokedexNum(u16 species); +extern void dp13_810BB8C(void); +extern void sub_81971D0(void); +extern void sub_8197200(void); +extern void sub_8152254(void); +extern void sub_81525D0(u8); +extern void sub_8152438(u8, void*); +extern void sub_8152474(u8, u8, u8); +extern void sub_81522D4(void); +extern bool32 sub_81521C0(u8); +extern u8 sub_81524C4(const struct OamData *arg0, s16 arg1, s16 arg2, s16 arg3, s16 arg4, u8 arg5, s16 arg6); + +// this file's functions +static void ClearVramOamPltt_LoadHofPal(void); +static void sub_8174F70(void); +static void sub_8174FAC(void); +static bool8 sub_81751FC(void); +static void SetCallback2AfterHallOfFameDisplay(void); +static bool8 sub_8175024(void); +static void Task_Hof_InitMonData(u8 taskId); +static void Task_Hof_InitTeamSaveData(u8 taskId); +static void Task_Hof_SetMonDisplayTask(u8 taskId); +static void Task_Hof_TrySaveData(u8 taskId); +static void Task_Hof_WaitForFrames(u8 taskId); +static void Task_Hof_DisplayMon(u8 taskId); +static void Task_Hof_PrintMonInfoAfterAnimating(u8 taskId); +static void Task_Hof_TryDisplayAnotherMon(u8 taskId); +static void Task_Hof_PaletteFadeAndPrintWelcomeText(u8 taskId); +static void sub_8173DC0(u8 taskId); +static void sub_8173EA4(u8 taskId); +static void sub_8173EE4(u8 taskId); +static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId); +static void Task_Hof_ExitOnKeyPressed(u8 taskId); +static void Task_Hof_HandlePaletteOnExit(u8 taskId); +static void Task_Hof_HandleExit(u8 taskId); +static void Task_HofPC_CopySaveData(u8 taskId); +static void Task_HofPC_PrintDataIsCorrupted(u8 taskId); +static void Task_HofPC_DrawSpritesPrintText(u8 taskId); +static void Task_HofPC_PrintMonInfo(u8 taskId); +static void Task_HofPC_HandleInput(u8 taskId); +static void Task_HofPC_HandlePaletteOnExit(u8 taskId); +static void Task_HofPC_HandleExit(u8 taskId); +static void Task_HofPC_ExitOnButtonPress(u8 taskId); +static void SpriteCB_GetOnScreenAndAnimate(struct Sprite *sprite); +static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u8 unused2); +static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2); +static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2); +static void sub_8175364(u8 taskId); +static void sub_81751A4(struct Sprite* sprite); + +// const rom data +static const struct BgTemplate sHof_BgTemplates[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 0, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, +}; + +static const struct WindowTemplate sHof_WindowTemplate = {0, 2, 2, 0xE, 6, 0xE, 1}; + +static const u8 gUnknown_085E5388[] = {0, 1, 2, 0}; + +static const u8 gUnknown_085E538C[] = {0, 2, 3, 0, 4, 5, 0, 0}; + +static const struct CompressedSpriteSheet sHallOfFame_ConfettiSpriteSheet = +{ + gContestConfetti_Gfx, 0x220, 1001 +}; + +static const u8 sUnused0[8] = {}; + +static const struct CompressedSpritePalette sHallOfFame_ConfettiSpritePalette = +{ + gContestConfetti_Pal, 1001 +}; + +static const u8 sUnused1[8] = {}; + +static const s16 sHallOfFame_MonFullTeamPositions[6][4] = +{ + {120, 210, 120, 40}, + {326, 220, 56, 40}, + {-86, 220, 184, 40}, + {120, -62, 120, 88}, + {-70, -92, 200, 88}, + {310, -92, 40, 88} +}; + +static const s16 sHallOfFame_MonHalfTeamPositions[3][4] = +{ + {120, 234, 120, 64}, + {326, 244, 56, 64}, + {-86, 244, 184, 64} +}; + +static const struct OamData sOamData_85E53FC = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 0, + .tileNum = 0, + .priority = 0, + .paletteNum = 0, + .affineParam = 0, +}; + +static const union AnimCmd sSpriteAnim_85E5404[] = +{ + ANIMCMD_FRAME(0, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E540C[] = +{ + ANIMCMD_FRAME(1, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5414[] = +{ + ANIMCMD_FRAME(2, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E541C[] = +{ + ANIMCMD_FRAME(3, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5424[] = +{ + ANIMCMD_FRAME(4, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E542C[] = +{ + ANIMCMD_FRAME(5, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5434[] = +{ + ANIMCMD_FRAME(6, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E543C[] = +{ + ANIMCMD_FRAME(7, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5444[] = +{ + ANIMCMD_FRAME(8, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E544C[] = +{ + ANIMCMD_FRAME(9, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5454[] = +{ + ANIMCMD_FRAME(10, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E545C[] = +{ + ANIMCMD_FRAME(11, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5464[] = +{ + ANIMCMD_FRAME(12, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E546C[] = +{ + ANIMCMD_FRAME(13, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5474[] = +{ + ANIMCMD_FRAME(14, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E547C[] = +{ + ANIMCMD_FRAME(15, 30), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_85E5484[] = +{ + ANIMCMD_FRAME(16, 30), + ANIMCMD_END +}; + +static const union AnimCmd * const sSpriteAnimTable_85E548C[] = +{ + sSpriteAnim_85E5404, sSpriteAnim_85E540C, sSpriteAnim_85E5414, sSpriteAnim_85E541C, + sSpriteAnim_85E5424, sSpriteAnim_85E542C, sSpriteAnim_85E5434, sSpriteAnim_85E543C, + sSpriteAnim_85E5444, sSpriteAnim_85E544C, sSpriteAnim_85E5454, sSpriteAnim_85E545C, + sSpriteAnim_85E5464, sSpriteAnim_85E546C, sSpriteAnim_85E5474, sSpriteAnim_85E547C, + sSpriteAnim_85E5484 +}; + +static const struct SpriteTemplate sSpriteTemplate_85E54D0 = +{ + .tileTag = 1001, + .paletteTag = 1001, + .oam = &sOamData_85E53FC, + .anims = sSpriteAnimTable_85E548C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_81751A4 +}; + +static const u16 sHallOfFame_Pal[] = INCBIN_U16("graphics/misc/japanese_hof.gbapal"); + +static const u8 sHallOfFame_Gfx[] = INCBIN_U8("graphics/misc/japanese_hof.4bpp.lz"); + +static const struct HallofFameMon sDummyFameMon = +{ + 0x3EA03EA, 0, 0, 0, {0} +}; + +static const u8 sUnused2[6] = {2, 1, 3, 6, 4, 5}; + +// code +static void VBlankCB_HallOfFame(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +static void CB2_HallOfFame(void) +{ + RunTasks(); + RunTextPrinters(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); +} + +static bool8 InitHallOfFameScreen(void) +{ + switch (gMain.state) + { + case 0: + SetVBlankCallback(NULL); + ClearVramOamPltt_LoadHofPal(); + sHofGfxPtr = AllocZeroed(sizeof(*sHofGfxPtr)); + gMain.state = 1; + break; + case 1: + sub_8174F70(); + gMain.state++; + break; + case 2: + SetGpuReg(REG_OFFSET_BLDCNT, 0x3F42); + SetGpuReg(REG_OFFSET_BLDALPHA, 0x710); + SetGpuReg(REG_OFFSET_BLDY, 0); + sub_8174FAC(); + sHofGfxPtr->state = 0; + gMain.state++; + break; + case 3: + if (!sub_8175024()) + { + SetVBlankCallback(VBlankCB_HallOfFame); + BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); + gMain.state++; + } + break; + case 4: + UpdatePaletteFade(); + if (!gPaletteFade.active) + { + SetMainCallback2(CB2_HallOfFame); + PlayBGM(BGM_DENDOU); + return FALSE; + } + break; + } + return TRUE; +} + +#define tDontSaveData data[0] +#define tDisplayedMonId data[1] +#define tMonNumber data[2] +#define tFrameCount data[3] +#define tPlayerSpriteID data[4] +#define tMonSpriteId(i) data[i + 5] + +void CB2_DoHallOfFameScreen(void) +{ + if (!InitHallOfFameScreen()) + { + u8 taskId = CreateTask(Task_Hof_InitMonData, 0); + gTasks[taskId].tDontSaveData = FALSE; + sHofMonPtr = AllocZeroed(sizeof(*sHofMonPtr)); + } +} + +void CB2_DoHallOfFameScreenDontSaveData(void) +{ + if (!InitHallOfFameScreen()) + { + u8 taskId = CreateTask(Task_Hof_InitMonData, 0); + gTasks[taskId].tDontSaveData = TRUE; + sHofMonPtr = AllocZeroed(sizeof(*sHofMonPtr)); + } +} + +static void Task_Hof_InitMonData(u8 taskId) +{ + u16 i, j; + + gTasks[taskId].tMonNumber = 0; // valid pokes + + for (i = 0; i < 6; i++) + { + u8 nick[POKEMON_NAME_LENGTH + 2]; + if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES)) + { + sHofMonPtr->mon[i].species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); + sHofMonPtr->mon[i].tid = GetMonData(&gPlayerParty[i], MON_DATA_OT_ID); + sHofMonPtr->mon[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY); + sHofMonPtr->mon[i].lvl = GetMonData(&gPlayerParty[i], MON_DATA_LEVEL); + GetMonData(&gPlayerParty[i], MON_DATA_NICKNAME, nick); + for (j = 0; j < POKEMON_NAME_LENGTH; j++) + { + sHofMonPtr->mon[i].nick[j] = nick[j]; + } + gTasks[taskId].tMonNumber++; + } + else + { + sHofMonPtr->mon[i].species = 0; + sHofMonPtr->mon[i].tid = 0; + sHofMonPtr->mon[i].personality = 0; + sHofMonPtr->mon[i].lvl = 0; + sHofMonPtr->mon[i].nick[0] = EOS; + } + } + + gUnknown_0203BCD4 = 0; + gTasks[taskId].tDisplayedMonId = 0; + gTasks[taskId].tPlayerSpriteID = 0xFF; + + for (i = 0; i < 6; i++) + { + gTasks[taskId].tMonSpriteId(i) = 0xFF; + } + + if (gTasks[taskId].tDontSaveData) + gTasks[taskId].func = Task_Hof_SetMonDisplayTask; + else + gTasks[taskId].func = Task_Hof_InitTeamSaveData; +} + +static void Task_Hof_InitTeamSaveData(u8 taskId) +{ + u16 i; + struct HallofFameTeam* lastSavedTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + + if (!gHasHallOfFameRecords) + { + memset(gDecompressionBuffer, 0, 0x2000); + } + else + { + if (sub_81534D0(3) != TRUE) + memset(gDecompressionBuffer, 0, 0x2000); + } + + for (i = 0; i < HALL_OF_FAME_MAX_TEAMS; i++, lastSavedTeam++) + { + if (lastSavedTeam->mon[0].species == 0) + break; + } + if (i >= HALL_OF_FAME_MAX_TEAMS) + { + struct HallofFameTeam *afterTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + struct HallofFameTeam *beforeTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + afterTeam++; + for (i = 0; i < HALL_OF_FAME_MAX_TEAMS - 1; i++, beforeTeam++, afterTeam++) + { + *beforeTeam = *afterTeam; + } + lastSavedTeam--; + } + *lastSavedTeam = *sHofMonPtr; + + sub_81973C4(0, 0); + AddTextPrinterParametrized(0, 1, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); + CopyWindowToVram(0, 3); + gTasks[taskId].func = Task_Hof_TrySaveData; +} + +static void Task_Hof_TrySaveData(u8 taskId) +{ + gGameContinueCallback = CB2_DoHallOfFameScreenDontSaveData; + if (TrySavingData(3) == 0xFF && gDamagedSaveSectors != 0) + { + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(3); + FreeAllWindowBuffers(); + + if (sHofGfxPtr != NULL) + FREE_AND_SET_NULL(sHofGfxPtr); + if (sHofMonPtr != NULL) + FREE_AND_SET_NULL(sHofMonPtr); + + DestroyTask(taskId); + } + else + { + PlaySE(SE_SAVE); + gTasks[taskId].func = Task_Hof_WaitForFrames; + gTasks[taskId].tFrameCount = 32; + } +} + +static void Task_Hof_WaitForFrames(u8 taskId) +{ + if (gTasks[taskId].tFrameCount) + gTasks[taskId].tFrameCount--; + else + gTasks[taskId].func = Task_Hof_SetMonDisplayTask; +} + +static void Task_Hof_SetMonDisplayTask(u8 taskId) +{ + gTasks[taskId].func = Task_Hof_DisplayMon; +} + +#define tDestinationX data1 +#define tDestinationY data2 +#define tSpecies data7 + +static void Task_Hof_DisplayMon(u8 taskId) +{ + u8 spriteId; + s16 xPos, yPos, field4, field6; + + u16 currMonId = gTasks[taskId].tDisplayedMonId; + struct HallofFameMon* currMon = &sHofMonPtr->mon[currMonId]; + + if (gTasks[taskId].tMonNumber > 3) + { + xPos = sHallOfFame_MonFullTeamPositions[currMonId][0]; + yPos = sHallOfFame_MonFullTeamPositions[currMonId][1]; + field4 = sHallOfFame_MonFullTeamPositions[currMonId][2]; + field6 = sHallOfFame_MonFullTeamPositions[currMonId][3]; + } + else + { + xPos = sHallOfFame_MonHalfTeamPositions[currMonId][0]; + yPos = sHallOfFame_MonHalfTeamPositions[currMonId][1]; + field4 = sHallOfFame_MonHalfTeamPositions[currMonId][2]; + field6 = sHallOfFame_MonHalfTeamPositions[currMonId][3]; + } + + if (currMon->species == SPECIES_EGG) + field6 += 10; + + spriteId = sub_818D3E4(currMon->species, currMon->tid, currMon->personality, 1, xPos, yPos, currMonId, 0xFFFF); + gSprites[spriteId].tDestinationX = field4; + gSprites[spriteId].tDestinationY = field6; + gSprites[spriteId].data0 = 0; + gSprites[spriteId].tSpecies = currMon->species; + gSprites[spriteId].callback = SpriteCB_GetOnScreenAndAnimate; + gTasks[taskId].tMonSpriteId(currMonId) = spriteId; + sub_8197434(0, 1); + gTasks[taskId].func = Task_Hof_PrintMonInfoAfterAnimating; +} + +static void Task_Hof_PrintMonInfoAfterAnimating(u8 taskId) +{ + u16 currMonId = gTasks[taskId].tDisplayedMonId; + struct HallofFameMon* currMon = &sHofMonPtr->mon[currMonId]; + struct Sprite *monSprite = &gSprites[gTasks[taskId].tMonSpriteId(currMonId)]; + + if (monSprite->callback == SpriteCallbackDummy) + { + monSprite->oam.affineMode = 0; + HallOfFame_PrintMonInfo(currMon, 0, 14); + gTasks[taskId].tFrameCount = 120; + gTasks[taskId].func = Task_Hof_TryDisplayAnotherMon; + } +} + +static void Task_Hof_TryDisplayAnotherMon(u8 taskId) +{ + u16 currPokeID = gTasks[taskId].tDisplayedMonId; + struct HallofFameMon* currMon = &sHofMonPtr->mon[currPokeID]; + + if (gTasks[taskId].tFrameCount != 0) + { + gTasks[taskId].tFrameCount--; + } + else + { + gUnknown_0203BCD4 |= (0x10000 << gSprites[gTasks[taskId].tMonSpriteId(currPokeID)].oam.paletteNum); + if (gTasks[taskId].tDisplayedMonId <= 4 && currMon[1].species != SPECIES_NONE) // there is another pokemon to display + { + gTasks[taskId].tDisplayedMonId++; + BeginNormalPaletteFade(gUnknown_0203BCD4, 0, 12, 12, 0x63B0); + gSprites[gTasks[taskId].tMonSpriteId(currPokeID)].oam.priority = 1; + gTasks[taskId].func = Task_Hof_DisplayMon; + } + else + { + gTasks[taskId].func = Task_Hof_PaletteFadeAndPrintWelcomeText; + } + } +} + +static void Task_Hof_PaletteFadeAndPrintWelcomeText(u8 taskId) +{ + u16 i; + + BeginNormalPaletteFade(0xFFFF0000, 0, 0, 0, 0); + for (i = 0; i < 6; i++) + { + if (gTasks[taskId].tMonSpriteId(i) != 0xFF) + gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 0; + } + + HallOfFame_PrintWelcomeText(0, 15); + PlaySE(SE_DENDOU); + gTasks[taskId].tFrameCount = 400; + gTasks[taskId].func = sub_8173DC0; +} + +static void sub_8173DC0(u8 taskId) +{ + if (gTasks[taskId].tFrameCount != 0) + { + gTasks[taskId].tFrameCount--; + if ((gTasks[taskId].tFrameCount & 3) == 0 && gTasks[taskId].tFrameCount > 110) + sub_81751FC(); + } + else + { + u16 i; + for (i = 0; i < 6; i++) + { + if (gTasks[taskId].tMonSpriteId(i) != 0xFF) + gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1; + } + BeginNormalPaletteFade(gUnknown_0203BCD4, 0, 12, 12, 0x63B0); + FillWindowPixelBuffer(0, 0); + CopyWindowToVram(0, 3); + gTasks[taskId].tFrameCount = 7; + gTasks[taskId].func = sub_8173EA4; + } +} + +static void sub_8173EA4(u8 taskId) +{ + if (gTasks[taskId].tFrameCount >= 16) + { + gTasks[taskId].func = sub_8173EE4; + } + else + { + gTasks[taskId].tFrameCount++; + SetGpuReg(REG_OFFSET_BLDALPHA, gTasks[taskId].tFrameCount * 256); + } +} + +static void sub_8173EE4(u8 taskId) +{ + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(3); + gTasks[taskId].tPlayerSpriteID = sub_818D8AC(sub_818D97C(gSaveBlock2Ptr->playerGender, 1), 1, 120, 72, 6, 0xFFFF); + AddWindow(&sHof_WindowTemplate); + sub_80987D4(1, gSaveBlock2Ptr->optionsWindowFrameType, 0x21D, 0xD0); + LoadPalette(stdpal_get(1), 0xE0, 0x20); + gTasks[taskId].tFrameCount = 120; + gTasks[taskId].func = Task_Hof_WaitAndPrintPlayerInfo; +} + +static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId) +{ + if (gTasks[taskId].tFrameCount != 0) + { + gTasks[taskId].tFrameCount--; + } + else if (gSprites[gTasks[taskId].tPlayerSpriteID].pos1.x != 192) + { + gSprites[gTasks[taskId].tPlayerSpriteID].pos1.x++; + } + else + { + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); + HallOfFame_PrintPlayerInfo(1, 2); + sub_81973C4(0, 0); + AddTextPrinterParametrized(0, 1, gText_LeagueChamp, 0, NULL, 2, 1, 3); + CopyWindowToVram(0, 3); + gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; + } +} + +static void Task_Hof_ExitOnKeyPressed(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON) + { + FadeOutBGM(4); + gTasks[taskId].func = Task_Hof_HandlePaletteOnExit; + } +} + +static void Task_Hof_HandlePaletteOnExit(u8 taskId) +{ + CpuCopy16(gPlttBufferFaded, gPlttBufferUnfaded, 0x400); + BeginNormalPaletteFade(-1, 8, 0, 0x10, 0); + gTasks[taskId].func = Task_Hof_HandleExit; +} + +static void Task_Hof_HandleExit(u8 taskId) +{ + if (!gPaletteFade.active) + { + s32 i; + + for (i = 0; i < 6; i++) + { + u8 spriteId = gTasks[taskId].tMonSpriteId(i); + if (spriteId != 0xFF) + { + FreeOamMatrix(gSprites[spriteId].oam.matrixNum); + sub_818D820(spriteId); + } + } + + sub_818D8F0(gTasks[taskId].tPlayerSpriteID); + HideBg(0); + HideBg(1); + HideBg(3); + FreeAllWindowBuffers(); + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(3); + ResetBgsAndClearDma3BusyFlags(0); + DestroyTask(taskId); + + if (sHofGfxPtr != NULL) + FREE_AND_SET_NULL(sHofGfxPtr); + if (sHofMonPtr != NULL) + FREE_AND_SET_NULL(sHofMonPtr); + + SetCallback2AfterHallOfFameDisplay(); + } +} + +static void SetCallback2AfterHallOfFameDisplay(void) +{ + SetMainCallback2(sub_8175620); +} + +#undef tDontSaveData +#undef tDisplayedPoke +#undef tMonNumber +#undef tFrameCount +#undef tPlayerSpriteID +#undef tMonSpriteId + +#define tCurrTeamNo data[0] +#define tCurrPageNo data[1] +#define tCurrMonId data[2] +#define tMonNo data[4] +#define tMonSpriteId(i) data[i + 5] + +void CB2_DoHallOfFamePC(void) +{ + switch (gMain.state) + { + case 0: + default: + SetVBlankCallback(NULL); + ClearVramOamPltt_LoadHofPal(); + sHofGfxPtr = AllocZeroed(sizeof(*sHofGfxPtr)); + gMain.state = 1; + break; + case 1: + sub_8174F70(); + gMain.state++; + break; + case 2: + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + sub_8174FAC(); + gMain.state++; + break; + case 3: + if (!sub_8175024()) + { + struct HallofFameTeam *fameTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + fameTeam->mon[0] = sDummyFameMon; + sub_80F9BCC(0, 0, 0); + SetVBlankCallback(VBlankCB_HallOfFame); + gMain.state++; + } + break; + case 4: + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); + if (!sub_80F9C1C()) + gMain.state++; + break; + case 5: + { + u8 taskId, i; + + SetGpuReg(REG_OFFSET_BLDCNT, 0x3F42); + SetGpuReg(REG_OFFSET_BLDALPHA, 0x710); + SetGpuReg(REG_OFFSET_BLDY, 0); + taskId = CreateTask(Task_HofPC_CopySaveData, 0); + + for (i = 0; i < 6; i++) + { + gTasks[taskId].tMonSpriteId(i) = 0xFF; + } + + sHofMonPtr = AllocZeroed(0x2000); + SetMainCallback2(CB2_HallOfFame); + } + break; + } +} + +static void Task_HofPC_CopySaveData(u8 taskId) +{ + sub_81980F0(0, 0x1E, 0, 0xC, 0x226); + if (sub_81534D0(3) != 1) + { + gTasks[taskId].func = Task_HofPC_PrintDataIsCorrupted; + } + else + { + u16 i; + struct HallofFameTeam* savedTeams; + + CpuCopy16(gDecompressionBuffer, sHofMonPtr, 0x2000); + savedTeams = sHofMonPtr; + for (i = 0; i < HALL_OF_FAME_MAX_TEAMS; i++, savedTeams++) + { + if (savedTeams->mon[0].species == SPECIES_NONE) + break; + } + + if (i < HALL_OF_FAME_MAX_TEAMS) + gTasks[taskId].tCurrTeamNo = i - 1; + else + gTasks[taskId].tCurrTeamNo = HALL_OF_FAME_MAX_TEAMS - 1; + + gTasks[taskId].tCurrPageNo = GetGameStat(GAME_STAT_ENTERED_HOF); + + gTasks[taskId].func = Task_HofPC_DrawSpritesPrintText; + } +} + +static void Task_HofPC_DrawSpritesPrintText(u8 taskId) +{ + struct HallofFameTeam* savedTeams = sHofMonPtr; + struct HallofFameMon* currMon; + u16 i; + + for (i = 0; i < gTasks[taskId].tCurrTeamNo; i++) + savedTeams++; + + currMon = &savedTeams->mon[0]; + gUnknown_0203BCD4 = 0; + gTasks[taskId].tCurrMonId = 0; + gTasks[taskId].tMonNo = 0; + + for (i = 0; i < 6; i++, currMon++) + { + if (currMon->species != 0) + gTasks[taskId].tMonNo++; + } + + currMon = &savedTeams->mon[0]; + + for (i = 0; i < 6; i++, currMon++) + { + if (currMon->species != 0) + { + u16 spriteId; + s16 posX, posY; + + if (gTasks[taskId].tMonNo > 3) + { + posX = sHallOfFame_MonFullTeamPositions[i][2]; + posY = sHallOfFame_MonFullTeamPositions[i][3]; + } + else + { + posX = sHallOfFame_MonHalfTeamPositions[i][2]; + posY = sHallOfFame_MonHalfTeamPositions[i][3]; + } + + if (currMon->species == SPECIES_EGG) + posY += 10; + + spriteId = sub_818D7D8(currMon->species, currMon->tid, currMon->personality, 1, posX, posY, i, 0xFFFF); + gSprites[spriteId].oam.priority = 1; + gTasks[taskId].tMonSpriteId(i) = spriteId; + } + else + { + gTasks[taskId].tMonSpriteId(i) = 0xFF; + } + } + + BlendPalettes(0xFFFF0000, 0xC, 0x63B0); + + ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tCurrPageNo, STR_CONV_MODE_RIGHT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_HOFNumber); + + if (gTasks[taskId].tCurrTeamNo <= 0) + sub_8198204(gStringVar4, gText_PickCancel, 0, 0, 1); + else + sub_8198204(gStringVar4, gText_PickNextCancel, 0, 0, 1); + + gTasks[taskId].func = Task_HofPC_PrintMonInfo; +} + +static void Task_HofPC_PrintMonInfo(u8 taskId) +{ + struct HallofFameTeam* savedTeams = sHofMonPtr; + struct HallofFameMon* currMon; + u16 i; + u16 currMonID; + + for (i = 0; i < gTasks[taskId].tCurrTeamNo; i++) + savedTeams++; + + for (i = 0; i < 6; i++) + { + u16 spriteId = gTasks[taskId].tMonSpriteId(i); + if (spriteId != 0xFF) + gSprites[spriteId].oam.priority = 1; + } + + currMonID = gTasks[taskId].tMonSpriteId(gTasks[taskId].tCurrMonId); + gSprites[currMonID].oam.priority = 0; + gUnknown_0203BCD4 = (0x10000 << gSprites[currMonID].oam.paletteNum) ^ 0xFFFF0000; + BlendPalettesUnfaded(gUnknown_0203BCD4, 0xC, 0x63B0); + + currMon = &savedTeams->mon[gTasks[taskId].tCurrMonId]; + if (currMon->species != SPECIES_EGG) + { + StopCryAndClearCrySongs(); + PlayCry1(currMon->species, 0); + } + HallOfFame_PrintMonInfo(currMon, 0, 14); + + gTasks[taskId].func = Task_HofPC_HandleInput; +} + +static void Task_HofPC_HandleInput(u8 taskId) +{ + u16 i; + + if (gMain.newKeys & A_BUTTON) + { + if (gTasks[taskId].tCurrTeamNo != 0) // prepare another team to view + { + gTasks[taskId].tCurrTeamNo--; + for (i = 0; i < 6; i++) + { + u8 spriteId = gTasks[taskId].tMonSpriteId(i); + if (spriteId != 0xFF) + { + sub_818D820(spriteId); + gTasks[taskId].tMonSpriteId(i) = 0xFF; + } + } + if (gTasks[taskId].tCurrPageNo != 0) + gTasks[taskId].tCurrPageNo--; + gTasks[taskId].func = Task_HofPC_DrawSpritesPrintText; + } + else // no more teams to view, turn off hall of fame PC + { + if (IsCryPlayingOrClearCrySongs()) + { + StopCryAndClearCrySongs(); + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + } + gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; + } + } + else if (gMain.newKeys & B_BUTTON) // turn off hall of fame PC + { + if (IsCryPlayingOrClearCrySongs()) + { + StopCryAndClearCrySongs(); + m4aMPlayVolumeControl(&gMPlay_BGM, 0xFFFF, 0x100); + } + gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; + } + else if (gMain.newKeys & DPAD_UP && gTasks[taskId].tCurrMonId != 0) // change mon -1 + { + gTasks[taskId].tCurrMonId--; + gTasks[taskId].func = Task_HofPC_PrintMonInfo; + } + else if (gMain.newKeys & DPAD_DOWN && gTasks[taskId].tCurrMonId < gTasks[taskId].tMonNo - 1) // change mon +1 + { + gTasks[taskId].tCurrMonId++; + gTasks[taskId].func = Task_HofPC_PrintMonInfo; + } +} + +static void Task_HofPC_HandlePaletteOnExit(u8 taskId) +{ + struct HallofFameTeam* fameTeam; + + CpuCopy16(gPlttBufferFaded, gPlttBufferUnfaded, 0x400); + fameTeam = (struct HallofFameTeam*)(gDecompressionBuffer); + fameTeam->mon[0] = sDummyFameMon; + sub_80F9BF4(0, 0, 0); + gTasks[taskId].func = Task_HofPC_HandleExit; +} + +static void Task_HofPC_HandleExit(u8 taskId) +{ + if (!sub_80F9C30()) + { + u8 i; + + for (i = 0; i < 6; i++) + { + u16 spriteId = gTasks[taskId].tMonSpriteId(i); + if (spriteId != 0xFF) + { + sub_818D820(spriteId); + gTasks[taskId].tMonSpriteId(i) = 0xFF; + } + } + + HideBg(0); + HideBg(1); + HideBg(3); + sub_8198314(); + FreeAllWindowBuffers(); + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(3); + ResetBgsAndClearDma3BusyFlags(0); + DestroyTask(taskId); + + if (sHofGfxPtr != NULL) + FREE_AND_SET_NULL(sHofGfxPtr); + if (sHofMonPtr != NULL) + FREE_AND_SET_NULL(sHofMonPtr); + + sub_8137C3C(); + } +} + +static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) +{ + sub_8198180(gText_UnkCtrlF800Exit, 8, 1); + sub_81973C4(0, 0); + AddTextPrinterParametrized(0, 1, gText_HOFCorrupted, 0, NULL, 2, 1, 3); + CopyWindowToVram(0, 3); + gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; +} + +static void Task_HofPC_ExitOnButtonPress(u8 taskId) +{ + if (gMain.newKeys & A_BUTTON) + gTasks[taskId].func = Task_HofPC_HandlePaletteOnExit; +} + +#undef tCurrTeamNo +#undef tCurrPageNo +#undef tCurrMonId +#undef tMonNo +#undef tMonSpriteId + +static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2) +{ + FillWindowPixelBuffer(0, 0); + PutWindowTilemap(0); + box_print(0, 1, GetStringCenterAlignXOffset(1, gText_WelcomeToHOF, 0xD0), 1, gUnknown_085E5388, 0, gText_WelcomeToHOF); + CopyWindowToVram(0, 3); +} + +static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u8 unused2) +{ + u8 text[30]; + u8 *stringPtr; + s32 dexNumber; + s32 width; + + FillWindowPixelBuffer(0, 0); + PutWindowTilemap(0); + + // dex number + if (currMon->species != SPECIES_EGG) + { + stringPtr = StringCopy(text, gText_Number); + dexNumber = SpeciesToPokedexNum(currMon->species); + if (dexNumber != 0xFFFF) + { + stringPtr[0] = (dexNumber / 100) + CHAR_0; + stringPtr++; + dexNumber %= 100; + stringPtr[0] = (dexNumber / 10) + CHAR_0; + stringPtr++; + stringPtr[0] = (dexNumber % 10) + CHAR_0; + stringPtr++; + } + else + { + *(stringPtr)++ = CHAR_QUESTION_MARK; + *(stringPtr)++ = CHAR_QUESTION_MARK; + *(stringPtr)++ = CHAR_QUESTION_MARK; + } + stringPtr[0] = EOS; + box_print(0, 1, 0x10, 1, gUnknown_085E5388, -1, text); + } + + // nick, species names, gender and level + memcpy(text, currMon->nick, POKEMON_NAME_LENGTH); + text[POKEMON_NAME_LENGTH] = EOS; + if (currMon->species == SPECIES_EGG) + { + width = GetStringCenterAlignXOffset(1, text, 0xD0); + box_print(0, 1, width, 1, gUnknown_085E5388, -1, text); + CopyWindowToVram(0, 3); + } + else + { + width = GetStringRightAlignXOffset(1, text, 0x80); + box_print(0, 1, width, 1, gUnknown_085E5388, -1, text); + + text[0] = CHAR_SLASH; + stringPtr = StringCopy(text + 1, gSpeciesNames[currMon->species]); + + if (currMon->species != SPECIES_NIDORAN_M && currMon->species != SPECIES_NIDORAN_F) + { + switch (GetGenderFromSpeciesAndPersonality(currMon->species, currMon->personality)) + { + case MON_MALE: + stringPtr[0] = CHAR_MALE; + stringPtr++; + break; + case MON_FEMALE: + stringPtr[0] = CHAR_FEMALE; + stringPtr++; + break; + } + } + + stringPtr[0] = EOS; + box_print(0, 1, 0x80, 1, gUnknown_085E5388, -1, text); + + stringPtr = StringCopy(text, gText_Level); + ConvertIntToDecimalStringN(stringPtr, currMon->lvl, STR_CONV_MODE_LEFT_ALIGN, 3); + box_print(0, 1, 0x24, 0x11, gUnknown_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, gUnknown_085E5388, -1, text); + + CopyWindowToVram(0, 3); + } +} + +static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) +{ + u8 text[20]; + u32 width; + u16 trainerId; + + FillWindowPixelBuffer(1, 0x11); + PutWindowTilemap(1); + SetWindowBorderStyle(1, FALSE, 0x21D, 0xD); + box_print(1, 1, 0, 1, gUnknown_085E538C, -1, gText_Name); + + width = GetStringRightAlignXOffset(1, gSaveBlock2Ptr->playerName, 0x70); + box_print(1, 1, width, 1, gUnknown_085E538C, -1, gSaveBlock2Ptr->playerName); + + trainerId = (gSaveBlock2Ptr->playerTrainerId[0]) | (gSaveBlock2Ptr->playerTrainerId[1] << 8); + box_print(1, 1, 0, 0x11, gUnknown_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; + text[3] = (trainerId % 100) / 10 + CHAR_0; + text[4] = (trainerId % 10) / 1 + CHAR_0; + text[5] = EOS; + width = GetStringRightAlignXOffset(1, text, 0x70); + box_print(1, 1, width, 0x11, gUnknown_085E538C, -1, text); + + box_print(1, 1, 0, 0x21, gUnknown_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; + + if (text[0] == CHAR_0) + text[0] = CHAR_SPACE; + if (text[0] == CHAR_SPACE && text[1] == CHAR_0) + text[8] = CHAR_SPACE; + + text[3] = CHAR_COLON; + text[4] = (gSaveBlock2Ptr->playTimeMinutes % 100) / 10 + CHAR_0; + text[5] = (gSaveBlock2Ptr->playTimeMinutes % 10) + CHAR_0; + text[6] = EOS; + + width = GetStringRightAlignXOffset(1, text, 0x70); + box_print(1, 1, width, 0x21, gUnknown_085E538C, -1, text); + + CopyWindowToVram(1, 3); +} + +static void ClearVramOamPltt_LoadHofPal(void) +{ + u32 vramOffset, oamOffset, plttOffset; + u32 vramSize, oamSize, plttSize; + + vramOffset = (VRAM); + vramSize = VRAM_SIZE; + while (TRUE) + { + DmaFill16(3, 0, vramOffset, 0x1000); + vramOffset += 0x1000; + vramSize -= 0x1000; + if (vramSize <= 0x1000) + { + DmaFill16(3, 0, vramOffset, vramSize); + break; + } + } + + oamOffset = OAM; + oamSize = OAM_SIZE; + DmaFill32(3, 0, oamOffset, oamSize); + + plttOffset = PLTT; + plttSize = PLTT_SIZE; + DmaFill16(3, 0, plttOffset, plttSize); + + ResetPaletteFade(); + LoadPalette(sHallOfFame_Pal, 0, 0x20); +} + +static void sub_8174F70(void) +{ + remove_some_task(); + ResetTasks(); + ResetSpriteData(); + reset_temp_tile_data_buffers(); + dp13_810BB8C(); + FreeAllSpritePalettes(); + gReservedSpritePaletteCount = 8; + LoadCompressedObjectPic(&sHallOfFame_ConfettiSpriteSheet); + LoadCompressedObjectPalette(&sHallOfFame_ConfettiSpritePalette); +} + +static void sub_8174FAC(void) +{ + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, sHof_BgTemplates, ARRAY_COUNT(sHof_BgTemplates)); + SetBgTilemapBuffer(1, sHofGfxPtr->tilemap1); + SetBgTilemapBuffer(3, sHofGfxPtr->tilemap2); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); +} + +static bool8 sub_8175024(void) +{ + switch (sHofGfxPtr->state) + { + case 0: + decompress_and_copy_tile_data_to_vram(1, sHallOfFame_Gfx, 0, 0, 0); + break; + case 1: + if (free_temp_tile_data_buffers_if_possible()) + return TRUE; + break; + case 2: + FillBgTilemapBufferRect_Palette0(1, 1, 0, 0, 0x20, 2); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 3, 0x20, 0xB); + FillBgTilemapBufferRect_Palette0(1, 1, 0, 0xE, 0x20, 6); + FillBgTilemapBufferRect_Palette0(3, 2, 0, 0, 0x20, 0x20); + + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(3); + break; + case 3: + sub_81971D0(); + sub_8197200(); + break; + case 4: + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON); + ShowBg(0); + ShowBg(1); + ShowBg(3); + sHofGfxPtr->state = 0; + return FALSE; + } + + sHofGfxPtr->state++; + return TRUE; +} + +static void SpriteCB_GetOnScreenAndAnimate(struct Sprite *sprite) +{ + if (sprite->pos1.x != sprite->tDestinationX + || sprite->pos1.y != sprite->tDestinationY) + { + if (sprite->pos1.x < sprite->tDestinationX) + sprite->pos1.x += 15; + if (sprite->pos1.x > sprite->tDestinationX) + sprite->pos1.x -= 15; + + if (sprite->pos1.y < sprite->tDestinationY) + sprite->pos1.y += 10; + if (sprite->pos1.y > sprite->tDestinationY) + sprite->pos1.y -= 10; + } + else + { + s16 species = sprite->tSpecies; + + if (species == SPECIES_EGG) + DoMonFrontSpriteAnimation(sprite, species, TRUE, 3); + else + DoMonFrontSpriteAnimation(sprite, species, FALSE, 3); + } +} + +#undef tDestinationX +#undef tDestinationY +#undef tSpecies + +static void sub_81751A4(struct Sprite* sprite) +{ + if (sprite->pos2.y > 120) + { + DestroySprite(sprite); + } + else + { + u16 rand; + u8 tableID; + + sprite->pos2.y++; + sprite->pos2.y += sprite->data1; + + tableID = sprite->data0; + rand = (Random() % 4) + 8; + sprite->pos2.x = rand * gSineTable[tableID] / 256; + + sprite->data0 += 4; + } +} + +static bool8 sub_81751FC(void) +{ + u8 spriteID; + struct Sprite* sprite; + + s16 posX = Random() % 240; + s16 posY = -(Random() % 8); + + spriteID = CreateSprite(&sSpriteTemplate_85E54D0, posX, posY, 0); + sprite = &gSprites[spriteID]; + + StartSpriteAnim(sprite, Random() % 17); + + if (Random() & 3) + sprite->data1 = 0; + else + sprite->data1 = 1; + + return FALSE; +} + +void sub_8175280(void) +{ + u8 taskId; + + gSpecialVar_0x8004 = 180; + taskId = CreateTask(sub_8175364, 0); + if (taskId != 0xFF) + { + gTasks[taskId].data[1] = gSpecialVar_0x8004; + gSpecialVar_0x8005 = taskId; + } +} + +static void sub_81752C0(void) +{ + u8 taskId; + + if ((taskId = FindTaskIdByFunc(sub_8175364)) != 0xFF) + DestroyTask(taskId); + + sub_8152254(); + FreeSpriteTilesByTag(0x3E9); + FreeSpritePaletteByTag(0x3E9); +} + +struct UnknownStruct912B4 +{ + s16 field_0; + s16 field_2; + s16 field_4; + s16 field_6; + s16 field_8; + s16 field_A; + s16 field_C; + s16 field_E; + s16 field_10; + s16 field_12; + s16 field_14; + s16 field_16; + s16 field_18; + s16 field_1A; + s16 field_1C; + s16 field_1E; + s16 field_20; + s16 field_22; + s16 field_24; + s16 field_26; + s16 field_28; +}; + +static void sub_81752F4(struct UnknownStruct912B4 *unkStruct) +{ + if (unkStruct->field_E > 110) + { + gTasks[unkStruct->field_28].data[15]--; + sub_81525D0(unkStruct->field_16); + } + else + { + u8 var; + s32 rand; + + unkStruct->field_E++; + unkStruct->field_E += unkStruct->field_1C; + + var = unkStruct->field_1A; + rand = Random(); + rand &= 3; + rand += 8; + unkStruct->field_C = (rand) * ((gSineTable[var])) / 256; + + unkStruct->field_1A += 4; + } +} + +static void sub_8175364(u8 taskId) +{ + u32 var = 0; + u16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + if (!sub_81521C0(0x40)) + { + DestroyTask(taskId); + gSpecialVar_0x8004 = var; + gSpecialVar_0x8005 = 0xFFFF; + } + LoadCompressedObjectPic(&sHallOfFame_ConfettiSpriteSheet); + LoadCompressedObjectPalette(&sHallOfFame_ConfettiSpritePalette); + data[0]++; + break; + case 1: + if (data[1] != 0 && data[1] % 3 == 0) + { + var = sub_81524C4(&sOamData_85E53FC, 0x3E9, 0x3E9, Random() % 240, -(Random() % 8), Random() % 0x11, var); + if (var != 0xFF) + { + sub_8152438(var, sub_81752F4); + if ((Random() & 3) == 0) + sub_8152474(var, 1, 1); + sub_8152474(var, 7, taskId); + data[15]++; + } + } + sub_81522D4(); + if (data[1] != 0) + data[1]--; + else if (data[15] == 0) + data[0] = 0xFF; + break; + case 0xFF: + sub_81752C0(); + gSpecialVar_0x8004 = var; + gSpecialVar_0x8005 = 0xFFFF; + break; + } +} diff --git a/src/pokemon_3.c b/src/pokemon_3.c index 27da8b18e..01dfc954a 100644 --- a/src/pokemon_3.c +++ b/src/pokemon_3.c @@ -1234,12 +1234,12 @@ static void sub_806E6CC(u8 taskId) DestroyTask(taskId); } -const u8 *pokemon_get_pal(struct Pokemon *mon) +const u8 *GetMonFrontSpritePal(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0); u32 otId = GetMonData(mon, MON_DATA_OT_ID, 0); u32 personality = GetMonData(mon, MON_DATA_PERSONALITY, 0); - return species_and_otid_get_pal(species, otId, personality); + return GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality); } // Extracts the upper 16 bits of a 32-bit number @@ -1248,7 +1248,7 @@ const u8 *pokemon_get_pal(struct Pokemon *mon) // Extracts the lower 16 bits of a 32-bit number #define LOHALF(n) ((n) & 0xFFFF) -const u8 *species_and_otid_get_pal(u16 species, u32 otId, u32 personality) +const u8 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32 personality) { u32 shinyValue; diff --git a/src/reshow_battle_screen.c b/src/reshow_battle_screen.c index 002f4f069..3177a8946 100644 --- a/src/reshow_battle_screen.c +++ b/src/reshow_battle_screen.c @@ -37,8 +37,8 @@ extern const union AnimCmd * const * const gMonAnimationsSpriteAnimsPtrTable[]; extern void dp12_8087EA4(void); extern void trs_config(void); extern bool8 IsDoubleBattle(void); -extern u8 sub_80A614C(u8 bank); -extern u8 sub_80A6138(u8 bank); +extern u8 GetSubstituteSpriteDefault_Y(u8 bank); +extern u8 GetBankSpriteDefault_Y(u8 bank); extern u8 sub_80A82E4(u8 bank); extern void sub_806A068(u16 species, u8 bankIdentity); extern void sub_806A12C(u16 backPicId, u8 bankIdentity); @@ -104,7 +104,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void) gReservedSpritePaletteCount = 4; break; case 5: - sub_805E350(); + ClearSpritesHealthboxAnimData(); break; case 6: if (BattleLoadAllHealthBoxesGfx(gBattleScripting.reshowHelperState)) @@ -217,7 +217,7 @@ static bool8 LoadBankSpriteGfx(u8 bank) if (!gBattleSpritesDataPtr->bankData[bank].behindSubstitute) BattleLoadOpponentMonSpriteGfx(&gEnemyParty[gBattlePartyID[bank]], bank); else - BattleLoadSubstituteSpriteGfx(bank, FALSE); + BattleLoadSubstituteOrMonSpriteGfx(bank, FALSE); } else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0) DecompressTrainerBackPic(gSaveBlock2Ptr->playerGender, bank); @@ -226,7 +226,7 @@ static bool8 LoadBankSpriteGfx(u8 bank) else if (!gBattleSpritesDataPtr->bankData[bank].behindSubstitute) BattleLoadPlayerMonSpriteGfx(&gPlayerParty[gBattlePartyID[bank]], bank); else - BattleLoadSubstituteSpriteGfx(bank, FALSE); + BattleLoadSubstituteOrMonSpriteGfx(bank, FALSE); gBattleScripting.reshowHelperState = 0; } @@ -250,9 +250,9 @@ static void CreateBankSprite(u8 bank) u8 posY; if (gBattleSpritesDataPtr->bankData[bank].behindSubstitute) - posY = sub_80A614C(bank); + posY = GetSubstituteSpriteDefault_Y(bank); else - posY = sub_80A6138(bank); + posY = GetBankSpriteDefault_Y(bank); if (GetBankSide(bank) != SIDE_PLAYER) { diff --git a/sym_ewram.txt b/sym_ewram.txt index 52d24a9ab..176620c2e 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1404,11 +1404,7 @@ gUnknown_0203BCD0: @ 203BCD0 gUnknown_0203BCD4: @ 203BCD4 .space 0x4 -gUnknown_0203BCD8: @ 203BCD8 - .space 0x4 - -gUnknown_0203BCDC: @ 203BCDC - .space 0x4 + .include "src/hall_of_fame.o" gUnknown_0203BCE0: @ 203BCE0 .space 0x2 @@ -1416,7 +1412,7 @@ gUnknown_0203BCE0: @ 203BCE0 gUnknown_0203BCE2: @ 203BCE2 .space 0x2 -gUnknown_0203BCE4: @ 203BCE4 +gHasHallOfFameRecords: @ 203BCE4 .space 0x1 gUnknown_0203BCE5: @ 203BCE5