From 2c47580c0610ab441209fa98740e024d952ab1b0 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sun, 29 Sep 2024 15:46:34 -0700 Subject: [PATCH] more functions decomped --- asm/code_80718D8.s | 1260 --------------------------------- asm/code_8077274.s | 267 ------- include/structs/str_pokemon.h | 3 +- ld_script.txt | 1 - src/code_80718D8.c | 733 ++++++++++++++++++- src/status.c | 99 ++- sym_ewram.txt | 6 +- 7 files changed, 831 insertions(+), 1538 deletions(-) delete mode 100644 asm/code_8077274.s diff --git a/asm/code_80718D8.s b/asm/code_80718D8.s index 0bd90c10..76ddef32 100644 --- a/asm/code_80718D8.s +++ b/asm/code_80718D8.s @@ -5,1266 +5,6 @@ .text - thumb_func_start sub_8071DA4 -sub_8071DA4: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xD4 - str r0, [sp, 0xB4] - ldr r2, _08071E44 - ldr r1, [r2] - ldrb r0, [r1, 0xD] - cmp r0, 0 - bne _08071DBE - b _08071FE2 -_08071DBE: - movs r0, 0 - strb r0, [r1, 0xD] - ldr r0, [r2] - ldrb r0, [r0, 0x10] - cmp r0, 0 - beq _08071DCC - b _08071FE2 -_08071DCC: - ldr r0, [sp, 0xB4] - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _08071DE2 - mov r0, sp - bl sub_80457DC - mov r0, sp - str r0, [sp, 0xB4] -_08071DE2: - movs r4, 0 -_08071DE4: - movs r5, 0 - ldr r0, _08071E44 - ldr r0, [r0] - lsls r1, r4, 2 - ldr r2, _08071E48 - adds r0, r2 - adds r0, r1 - ldr r0, [r0] - mov r8, r0 - movs r0, 0 - str r0, [sp, 0xB8] - movs r1, 0 - movs r2, 0 - str r1, [sp, 0xBC] - str r2, [sp, 0xC0] - movs r0, 0 - movs r1, 0 - str r0, [sp, 0xC4] - str r1, [sp, 0xC8] - adds r1, r4, 0x1 - str r1, [sp, 0xCC] - mov r2, r8 - cmp r2, 0 - bne _08071E16 - b _08071FDA -_08071E16: - mov r0, r8 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _08071E24 - b _08071FDA -_08071E24: - mov r0, r8 - ldr r6, [r0, 0x70] - movs r1, 0xE - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _08071E32 - b _08071FDA -_08071E32: - adds r1, r6, 0 - adds r1, 0xF9 - ldrb r0, [r1] - cmp r0, 0 - beq _08071E4C - add r2, sp, 0xB8 - ldrb r2, [r2] - strb r2, [r1] - b _08071FCA - .align 2, 0 -_08071E44: .4byte gDungeon -_08071E48: .4byte 0x000135cc -_08071E4C: - movs r1, 0xFE - lsls r1, 1 - adds r0, r6, r1 - ldr r0, [r0] - mov r10, r0 - cmp r0, 0 - beq _08071EB6 - ldrb r0, [r6, 0x7] - cmp r0, 0 - beq _08071E68 - ldrb r1, [r6, 0x9] - add r0, sp, 0x74 - bl GetAvailTacticsforLvl_Bool -_08071E68: - movs r0, 0x10 - ldrsh r2, [r6, r0] - str r2, [sp, 0xB8] - ldrb r1, [r6, 0x14] - str r1, [sp, 0xBC] - ldrb r2, [r6, 0x15] - str r2, [sp, 0xC0] - ldrb r0, [r6, 0x16] - str r0, [sp, 0xC4] - ldrb r1, [r6, 0x17] - str r1, [sp, 0xC8] - ldrb r0, [r6, 0x9] - cmp r0, 0x64 - beq _08071EB6 - ldr r0, [r6, 0x18] - add r0, r10 - str r0, [r6, 0x18] - mov r2, r10 - ldr r0, _08071EE8 - str r2, [r0] - ldr r0, _08071EEC - adds r1, r6, 0 - movs r2, 0 - bl SetMessageArgument_2 - ldr r0, _08071EF0 - ldr r2, [r0] - ldr r0, [sp, 0xB4] - mov r1, r8 - bl sub_80522F4 - ldr r0, [sp, 0xB4] - mov r1, r8 - movs r2, 0x1 - movs r3, 0x1 - bl sub_80723D0 - lsls r0, 24 - lsrs r5, r0, 24 -_08071EB6: - ldr r1, _08071EF4 - adds r0, r6, r1 - ldrb r0, [r0] - adds r4, 0x1 - str r4, [sp, 0xCC] - cmp r0, 0 - beq _08071F3A - movs r2, 0x2 - ldrsh r0, [r6, r2] - add r1, sp, 0x8C - movs r2, 0 - movs r3, 0 - bl sub_808E400 - adds r7, r0, 0 - add r0, sp, 0x8C - mov r9, r0 - cmp r7, 0 - beq _08071F38 - adds r0, r7, 0 - bl DungeonRandInt - adds r4, r0, 0 - movs r1, 0 - b _08071F02 - .align 2, 0 -_08071EE8: .4byte gFormatData_202DE30 -_08071EEC: .4byte gAvailablePokemonNames -_08071EF0: .4byte gUnknown_80F9E64 -_08071EF4: .4byte 0x00000149 -_08071EF8: - adds r4, 0x1 - cmp r4, r7 - blt _08071F00 - movs r4, 0 -_08071F00: - adds r1, 0x1 -_08071F02: - cmp r1, r7 - bge _08071F38 - lsls r0, r4, 1 - mov r2, r9 - adds r5, r2, r0 - movs r2, 0 - ldrsh r0, [r5, r2] - str r1, [sp, 0xD0] - bl sub_803D930 - lsls r0, 24 - ldr r1, [sp, 0xD0] - cmp r0, 0 - beq _08071EF8 - movs r2, 0 - ldrsh r0, [r5, r2] - bl GetSpriteData - ldr r1, [sp, 0xD0] - cmp r0, 0 - beq _08071EF8 - movs r0, 0 - ldrsh r2, [r5, r0] - ldr r0, [sp, 0xB4] - mov r1, r8 - bl sub_8072B78 -_08071F38: - movs r5, 0 -_08071F3A: - cmp r5, 0 - beq _08071F7A - ldrb r0, [r6, 0x6] - cmp r0, 0 - bne _08071F7A - movs r1, 0x10 - ldrsh r0, [r6, r1] - ldr r2, [sp, 0xB8] - subs r0, r2 - ldr r1, _08071FF4 - str r0, [r1] - ldrb r0, [r6, 0x14] - ldr r2, [sp, 0xBC] - subs r0, r2 - str r0, [r1, 0x4] - ldrb r0, [r6, 0x16] - ldr r1, [sp, 0xC4] - subs r0, r1 - ldr r2, _08071FF4 - str r0, [r2, 0x8] - ldrb r0, [r6, 0x15] - ldr r1, [sp, 0xC0] - subs r0, r1 - str r0, [r2, 0xC] - ldrb r0, [r6, 0x17] - ldr r2, [sp, 0xC8] - subs r0, r2 - ldr r1, _08071FF4 - str r0, [r1, 0x10] - mov r0, r8 - bl sub_807218C -_08071F7A: - mov r2, r10 - cmp r2, 0 - beq _08071FCA - ldrb r0, [r6, 0x7] - cmp r0, 0 - beq _08071FCA - ldrb r1, [r6, 0x9] - add r0, sp, 0x80 - bl GetAvailTacticsforLvl_Bool - movs r4, 0 - add r7, sp, 0x74 - add r5, sp, 0x80 -_08071F94: - adds r0, r7, r4 - ldrb r0, [r0] - cmp r0, 0 - bne _08071FC4 - adds r0, r5, r4 - ldrb r0, [r0] - cmp r0, 0x1 - bne _08071FC4 - ldr r0, _08071FF8 - mov r1, r8 - movs r2, 0 - bl SetMessageArgument - lsls r1, r4, 24 - lsrs r1, 24 - ldr r0, _08071FFC - bl CopyTacticsNameToBuffer - ldr r0, _08072000 - ldr r2, [r0] - ldr r0, [sp, 0xB4] - mov r1, r8 - bl sub_80522F4 -_08071FC4: - adds r4, 0x1 - cmp r4, 0xB - ble _08071F94 -_08071FCA: - movs r1, 0xFE - lsls r1, 1 - adds r0, r6, r1 - movs r1, 0 - str r1, [r0] - ldr r2, _08072004 - adds r0, r6, r2 - strb r1, [r0] -_08071FDA: - ldr r4, [sp, 0xCC] - cmp r4, 0x13 - bgt _08071FE2 - b _08071DE4 -_08071FE2: - add sp, 0xD4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08071FF4: .4byte gFormatData_202DE30 -_08071FF8: .4byte gAvailablePokemonNames -_08071FFC: .4byte gFormatItems -_08072000: .4byte gUnknown_80FF730 -_08072004: .4byte 0x00000149 - thumb_func_end sub_8071DA4 - - thumb_func_start sub_8072008 -sub_8072008: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x38 - mov r9, r0 - mov r8, r1 - adds r4, r2, 0 - ldr r0, [sp, 0x58] - lsls r3, 24 - lsrs r3, 24 - mov r10, r3 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - mov r0, r8 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _08072036 - b _08072162 -_08072036: - movs r0, 0 - str r0, [sp, 0x28] - mov r1, r8 - ldr r5, [r1, 0x70] - ldrb r0, [r5, 0x7] - cmp r0, 0 - beq _0807204C - add r0, sp, 0xC - ldrb r1, [r5, 0x9] - bl GetAvailTacticsforLvl_Bool -_0807204C: - movs r0, 0x10 - ldrsh r2, [r5, r0] - str r2, [sp, 0x2C] - ldrb r6, [r5, 0x14] - ldrb r7, [r5, 0x15] - ldrb r1, [r5, 0x16] - str r1, [sp, 0x30] - ldrb r2, [r5, 0x17] - str r2, [sp, 0x34] - adds r0, r5, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x4A - beq _0807206C - cmp r0, 0x47 - bne _08072070 -_0807206C: - movs r0, 0x1 - b _08072072 -_08072070: - movs r0, 0 -_08072072: - cmp r0, 0 - bne _080720E6 - ldrb r0, [r5, 0x9] - adds r2, r0, r4 - cmp r2, 0x63 - ble _08072080 - movs r2, 0x64 -_08072080: - cmp r2, r0 - beq _080720E6 - movs r0, 0x2 - ldrsh r1, [r5, r0] - mov r0, sp - bl GetPokemonLevelData - ldr r0, [sp] - str r0, [r5, 0x18] - mov r0, r9 - mov r1, r8 - mov r2, r10 - ldr r3, [sp, 0x24] - bl sub_80723D0 - ldr r1, [sp, 0x28] - orrs r1, r0 - lsls r0, r1, 24 - lsrs r0, 24 - str r0, [sp, 0x28] - cmp r0, 0 - beq _080720E6 - ldrb r0, [r5, 0x6] - cmp r0, 0 - bne _080720E6 - ldr r1, _08072174 - movs r2, 0x10 - ldrsh r0, [r5, r2] - ldr r2, [sp, 0x2C] - subs r0, r2 - str r0, [r1] - ldrb r0, [r5, 0x14] - subs r0, r6 - str r0, [r1, 0x4] - ldrb r0, [r5, 0x16] - ldr r2, [sp, 0x30] - subs r0, r2 - str r0, [r1, 0x8] - ldrb r0, [r5, 0x15] - subs r0, r7 - str r0, [r1, 0xC] - ldrb r0, [r5, 0x17] - ldr r2, [sp, 0x34] - subs r0, r2 - str r0, [r1, 0x10] - mov r0, r10 - cmp r0, 0 - beq _080720E6 - mov r0, r8 - bl sub_807218C -_080720E6: - ldrb r0, [r5, 0x7] - cmp r0, 0 - beq _08072130 - add r4, sp, 0x18 - ldrb r1, [r5, 0x9] - adds r0, r4, 0 - bl GetAvailTacticsforLvl_Bool - movs r6, 0 - add r7, sp, 0xC -_080720FA: - adds r0, r7, r6 - ldrb r0, [r0] - cmp r0, 0 - bne _0807212A - adds r0, r4, r6 - ldrb r0, [r0] - cmp r0, 0x1 - bne _0807212A - ldr r0, _08072178 - mov r1, r8 - movs r2, 0 - bl SetMessageArgument - lsls r1, r6, 24 - lsrs r1, 24 - ldr r0, _0807217C - bl CopyTacticsNameToBuffer - ldr r0, _08072180 - ldr r2, [r0] - mov r0, r9 - mov r1, r8 - bl sub_80522F4 -_0807212A: - adds r6, 0x1 - cmp r6, 0xB - ble _080720FA -_08072130: - movs r1, 0xFE - lsls r1, 1 - adds r0, r5, r1 - movs r1, 0 - str r1, [r0] - ldr r2, _08072184 - adds r0, r5, r2 - strb r1, [r0] - ldr r0, [sp, 0x28] - cmp r0, 0 - bne _08072162 - mov r1, r10 - cmp r1, 0 - beq _08072162 - ldr r0, _08072178 - mov r1, r8 - movs r2, 0 - bl SetMessageArgument - ldr r0, _08072188 - ldr r2, [r0] - mov r0, r9 - mov r1, r8 - bl sub_80522F4 -_08072162: - add sp, 0x38 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08072174: .4byte gFormatData_202DE30 -_08072178: .4byte gAvailablePokemonNames -_0807217C: .4byte gFormatItems -_08072180: .4byte gUnknown_80FF730 -_08072184: .4byte 0x00000149 -_08072188: .4byte gUnknown_80F9B74 - thumb_func_end sub_8072008 - - thumb_func_start sub_807218C -sub_807218C: - push {r4-r6,lr} - sub sp, 0x190 - adds r4, r0, 0 - movs r6, 0 - ldr r5, [r4, 0x70] - movs r1, 0 - bl sub_806A2BC - ldr r0, _080721C8 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument_2 - adds r0, r4, 0 - bl sub_8070BC0 - lsls r0, 24 - cmp r0, 0 - beq _08072200 - movs r3, 0 - movs r0, 0x2 - ldrsh r1, [r5, r0] - adds r0, r5, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x4A - bne _080721CC - movs r1, 0xD2 - lsls r1, 1 - b _080721EC - .align 2, 0 -_080721C8: .4byte gAvailablePokemonNames -_080721CC: - cmp r0, 0x47 - bne _080721D8 - ldr r1, _080721D4 - b _080721EC - .align 2, 0 -_080721D4: .4byte 0x000001a5 -_080721D8: - cmp r0, 0x41 - bne _080721EC - ldr r0, _080721F8 - ldr r0, [r0] - ldr r2, _080721FC - adds r0, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080721EC - movs r3, 0x1 -_080721EC: - mov r0, sp - movs r2, 0x3 - bl sub_806A3D4 - b _0807220A - .align 2, 0 -_080721F8: .4byte gDungeon -_080721FC: .4byte 0x0000065c -_08072200: - ldr r0, _08072308 - ldr r1, [r0] - mov r0, sp - bl strcpy -_0807220A: - movs r0, 0 - mov r1, sp - movs r2, 0x1 - bl PrintFieldMessage - mov r0, sp - movs r1, 0 - strb r1, [r0] - ldr r4, _0807230C - ldr r0, [r4] - cmp r0, 0 - ble _0807222E - ldr r0, _08072310 - ldr r1, [r0] - mov r0, sp - bl strcat - adds r6, 0x1 -_0807222E: - ldr r0, [r4, 0x4] - cmp r0, 0 - ble _0807225A - ldr r0, _08072314 - adds r1, r6, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _0807224E - ldr r0, _08072318 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - mov r0, sp - bl strcat -_0807224E: - ldr r0, _0807231C - ldr r1, [r0] - mov r0, sp - bl strcat - adds r6, 0x1 -_0807225A: - ldr r0, _0807230C - ldr r0, [r0, 0x8] - cmp r0, 0 - ble _08072288 - ldr r0, _08072314 - adds r1, r6, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _0807227C - ldr r0, _08072318 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - mov r0, sp - bl strcat -_0807227C: - ldr r0, _08072320 - ldr r1, [r0] - mov r0, sp - bl strcat - adds r6, 0x1 -_08072288: - ldr r0, _0807230C - ldr r0, [r0, 0xC] - cmp r0, 0 - ble _080722B6 - ldr r0, _08072314 - adds r1, r6, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080722AA - ldr r0, _08072318 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - mov r0, sp - bl strcat -_080722AA: - ldr r0, _08072324 - ldr r1, [r0] - mov r0, sp - bl strcat - adds r6, 0x1 -_080722B6: - ldr r0, _0807230C - ldr r0, [r0, 0x10] - cmp r0, 0 - ble _080722E2 - ldr r0, _08072314 - adds r1, r6, r0 - ldrb r0, [r1] - cmp r0, 0 - beq _080722D8 - ldr r0, _08072318 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r0 - ldr r1, [r1] - mov r0, sp - bl strcat -_080722D8: - ldr r0, _08072328 - ldr r1, [r0] - mov r0, sp - bl strcat -_080722E2: - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - beq _080722F4 - movs r0, 0 - mov r1, sp - movs r2, 0x1 - bl PrintFieldMessage -_080722F4: - bl GetLeader - movs r1, 0 - bl sub_806A2BC - add sp, 0x190 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_08072308: .4byte gUnknown_80FCF18 -_0807230C: .4byte gFormatData_202DE30 -_08072310: .4byte gUnknown_80F9ACC -_08072314: .4byte gUnknown_8107010 -_08072318: .4byte gUnknown_8107018 -_0807231C: .4byte gUnknown_80F9AEC -_08072320: .4byte gUnknown_80F9B10 -_08072324: .4byte gUnknown_80F9B34 -_08072328: .4byte gUnknown_80F9B58 - thumb_func_end sub_807218C - - thumb_func_start LevelDownTarget -LevelDownTarget: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - mov r8, r0 - adds r5, r1, 0 - adds r7, r2, 0 - adds r0, r5, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _080723B6 - movs r6, 0 - ldr r4, [r5, 0x70] - adds r0, r4, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x4A - beq _08072358 - cmp r0, 0x47 - bne _0807235C -_08072358: - movs r0, 0x1 - b _0807235E -_0807235C: - movs r0, 0 -_0807235E: - cmp r0, 0 - bne _0807238C - ldrb r0, [r4, 0x9] - subs r2, r0, r7 - cmp r2, 0 - bgt _0807236C - movs r2, 0x1 -_0807236C: - cmp r2, r0 - beq _0807238C - movs r0, 0x2 - ldrsh r1, [r4, r0] - mov r0, sp - bl GetPokemonLevelData - ldr r0, [sp] - str r0, [r4, 0x18] - mov r0, r8 - adds r1, r5, 0 - bl sub_80725A4 - orrs r6, r0 - lsls r0, r6, 24 - lsrs r6, r0, 24 -_0807238C: - movs r1, 0xFE - lsls r1, 1 - adds r0, r4, r1 - movs r1, 0 - str r1, [r0] - ldr r2, _080723C4 - adds r0, r4, r2 - strb r1, [r0] - cmp r6, 0 - bne _080723B6 - ldr r0, _080723C8 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument - ldr r0, _080723CC - ldr r2, [r0] - mov r0, r8 - adds r1, r5, 0 - bl sub_80522F4 -_080723B6: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080723C4: .4byte 0x00000149 -_080723C8: .4byte gAvailablePokemonNames -_080723CC: .4byte gUnknown_80F9B94 - thumb_func_end LevelDownTarget - - thumb_func_start sub_80723D0 -sub_80723D0: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r0, [sp, 0xC] - mov r10, r1 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x10] - lsls r3, 24 - lsrs r3, 24 - str r3, [sp, 0x14] - movs r0, 0 - str r0, [sp, 0x18] - mov r0, r10 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - beq _08072422 - mov r1, r10 - ldr r5, [r1, 0x70] - movs r0, 0x2 - ldrsh r3, [r5, r0] - str r3, [sp, 0x1C] - ldr r1, [r5, 0x18] - str r1, [sp, 0x20] - adds r0, r5, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x4A - beq _08072418 - cmp r0, 0x47 - bne _0807241C -_08072418: - movs r0, 0x1 - b _0807241E -_0807241C: - movs r0, 0 -_0807241E: - cmp r0, 0 - beq _08072426 -_08072422: - movs r0, 0 - b _08072576 -_08072426: - ldrb r0, [r5, 0x9] - adds r0, 0x1 - mov r8, r0 - mov r9, sp - b _0807255A -_08072430: - mov r3, r8 - strb r3, [r5, 0x9] - ldr r0, [sp, 0x20] - str r0, [r5, 0x18] - ldr r1, [sp, 0x10] - cmp r1, 0 - beq _080724A4 - ldrb r0, [r5, 0x6] - cmp r0, 0 - bne _08072480 - mov r0, r10 - movs r1, 0 - bl sub_806A2BC - ldr r3, [sp, 0x18] - cmp r3, 0 - bne _08072456 - bl sub_8083D58 -_08072456: - ldr r0, _08072474 - mov r1, r8 - str r1, [r0] - ldr r0, _08072478 - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument_2 - ldr r0, _0807247C - ldr r1, [r0] - mov r0, r10 - bl sub_80528F4 - b _080724A4 - .align 2, 0 -_08072474: .4byte gFormatData_202DE30 -_08072478: .4byte gAvailablePokemonNames -_0807247C: .4byte gUnknown_80F9E80 -_08072480: - ldr r3, [sp, 0x18] - cmp r3, 0 - bne _0807248A - bl sub_8083D58 -_0807248A: - ldr r0, _08072588 - mov r1, r8 - str r1, [r0] - ldr r0, _0807258C - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument_2 - ldr r0, _08072590 - ldr r1, [r0] - mov r0, r10 - bl sub_805239C -_080724A4: - movs r3, 0x1 - str r3, [sp, 0x18] - mov r1, r9 - ldrh r0, [r1, 0x4] - ldrh r3, [r5, 0x10] - adds r0, r3 - movs r2, 0 - strh r0, [r5, 0x10] - ldrh r1, [r1, 0x4] - ldrh r3, [r5, 0xE] - adds r1, r3 - strh r1, [r5, 0xE] - lsls r0, 16 - ldr r1, _08072594 - cmp r0, r1 - ble _080724C8 - ldr r0, _08072598 - strh r0, [r5, 0x10] -_080724C8: - movs r0, 0xE - ldrsh r1, [r5, r0] - ldrh r2, [r5, 0x10] - movs r3, 0x10 - ldrsh r0, [r5, r3] - cmp r1, r0 - blt _080724D8 - strh r2, [r5, 0xE] -_080724D8: - ldr r7, _0807259C - ldrb r4, [r5, 0x14] - str r4, [r7] - ldrb r1, [r5, 0x15] - str r1, [r7, 0x4] - ldr r6, _080725A0 - ldrb r2, [r5, 0x16] - str r2, [r6] - ldrb r0, [r5, 0x17] - mov r12, r0 - mov r3, r9 - ldrb r0, [r3, 0x6] - adds r4, r0 - str r4, [r7] - ldrb r0, [r3, 0x7] - adds r1, r0 - str r1, [r7, 0x4] - ldrb r0, [r3, 0x8] - adds r2, r0 - str r2, [r6] - ldrb r0, [r3, 0x9] - mov r1, r12 - adds r3, r1, r0 - str r3, [r6, 0x4] - cmp r4, 0xFE - ble _08072510 - movs r3, 0xFF - str r3, [r7] -_08072510: - ldr r0, [r7, 0x4] - cmp r0, 0xFE - ble _0807251A - movs r0, 0xFF - str r0, [r7, 0x4] -_0807251A: - ldr r0, [r6] - cmp r0, 0xFE - ble _08072524 - movs r1, 0xFF - str r1, [r6] -_08072524: - ldr r0, [r6, 0x4] - cmp r0, 0xFE - ble _0807252E - movs r3, 0xFF - str r3, [r6, 0x4] -_0807252E: - mov r0, r10 - bl LoadIQSkills - mov r0, r10 - bl sub_8079764 - ldr r0, [r7] - strb r0, [r5, 0x14] - ldr r0, [r7, 0x4] - strb r0, [r5, 0x15] - ldr r0, [r6] - strb r0, [r5, 0x16] - ldr r0, [r6, 0x4] - strb r0, [r5, 0x17] - ldr r0, [sp, 0xC] - mov r1, r10 - ldr r2, [sp, 0x10] - ldr r3, [sp, 0x14] - bl sub_8072778 - movs r0, 0x1 - add r8, r0 -_0807255A: - mov r1, r8 - cmp r1, 0x64 - bgt _08072574 - mov r0, sp - ldr r1, [sp, 0x1C] - mov r2, r8 - bl GetPokemonLevelData - ldr r0, [sp] - ldr r3, [sp, 0x20] - cmp r0, r3 - bgt _08072574 - b _08072430 -_08072574: - ldr r0, [sp, 0x18] -_08072576: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08072588: .4byte gFormatData_202DE30 -_0807258C: .4byte gAvailablePokemonNames -_08072590: .4byte gUnknown_80F9E80 -_08072594: .4byte 0x03e60000 -_08072598: .4byte 0x000003e7 -_0807259C: .4byte gUnknown_202F31C -_080725A0: .4byte gUnknown_202F324 - thumb_func_end sub_80723D0 - - thumb_func_start sub_80725A4 -sub_80725A4: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x24 - str r0, [sp, 0xC] - str r1, [sp, 0x10] - adds r0, r1, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _080725C2 - b _0807272E -_080725C2: - ldr r0, [sp, 0x10] - ldr r5, [r0, 0x70] - movs r2, 0x2 - ldrsh r1, [r5, r2] - str r1, [sp, 0x18] - ldr r3, [r5, 0x18] - str r3, [sp, 0x1C] - ldrb r0, [r5, 0x9] - str r0, [sp, 0x20] - adds r0, r5, 0 - adds r0, 0x40 - ldrb r0, [r0] - cmp r0, 0x4A - beq _080725E2 - cmp r0, 0x47 - bne _080725E6 -_080725E2: - movs r0, 0x1 - b _080725E8 -_080725E6: - movs r0, 0 -_080725E8: - cmp r0, 0 - beq _080725EE - b _0807272E -_080725EE: - movs r1, 0x1 - mov r8, r1 - b _080725F8 -_080725F4: - movs r2, 0x1 - add r8, r2 -_080725F8: - ldrb r3, [r5, 0x9] - cmp r8, r3 - bge _08072610 - mov r0, sp - ldr r1, [sp, 0x18] - mov r2, r8 - bl GetPokemonLevelData - ldr r0, [sp] - ldr r1, [sp, 0x1C] - cmp r0, r1 - blt _080725F4 -_08072610: - mov r2, r8 - subs r2, 0x1 - str r2, [sp, 0x14] - ldrb r3, [r5, 0x9] - mov r8, r3 - cmp r8, r2 - ble _08072710 - mov r9, sp - movs r0, 0x1 - mov r10, r0 -_08072624: - mov r4, r8 - adds r4, 0x1 - mov r1, r8 - cmp r1, 0x63 - bgt _08072640 - mov r0, sp - ldr r1, [sp, 0x18] - adds r2, r4, 0 - bl GetPokemonLevelData - ldr r0, [sp] - subs r0, 0x1 - str r0, [r5, 0x18] - b _08072644 -_08072640: - ldr r2, [sp, 0x1C] - str r2, [r5, 0x18] -_08072644: - ldr r3, [sp, 0x20] - cmp r3, r8 - ble _08072704 - mov r0, sp - ldr r1, [sp, 0x18] - adds r2, r4, 0 - bl GetPokemonLevelData - mov r0, r8 - strb r0, [r5, 0x9] - ldrh r0, [r5, 0x10] - mov r2, r9 - ldrh r1, [r2, 0x4] - subs r0, r1 - strh r0, [r5, 0x10] - ldrh r0, [r5, 0xE] - ldrh r1, [r2, 0x4] - subs r0, r1 - strh r0, [r5, 0xE] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - bgt _08072676 - mov r3, r10 - strh r3, [r5, 0xE] -_08072676: - movs r1, 0x10 - ldrsh r0, [r5, r1] - cmp r0, 0x1 - bgt _08072682 - mov r2, r10 - strh r2, [r5, 0x10] -_08072682: - movs r3, 0xE - ldrsh r1, [r5, r3] - ldrh r2, [r5, 0x10] - movs r3, 0x10 - ldrsh r0, [r5, r3] - cmp r1, r0 - blt _08072692 - strh r2, [r5, 0xE] -_08072692: - ldr r7, _08072734 - ldrb r4, [r5, 0x14] - str r4, [r7] - ldrb r1, [r5, 0x15] - str r1, [r7, 0x4] - ldr r6, _08072738 - ldrb r2, [r5, 0x16] - str r2, [r6] - ldrb r0, [r5, 0x17] - mov r12, r0 - mov r3, r9 - ldrb r0, [r3, 0x6] - subs r4, r0 - str r4, [r7] - ldrb r0, [r3, 0x7] - subs r1, r0 - str r1, [r7, 0x4] - ldrb r0, [r3, 0x8] - subs r2, r0 - str r2, [r6] - ldrb r0, [r3, 0x9] - mov r1, r12 - subs r3, r1, r0 - str r3, [r6, 0x4] - cmp r4, 0x1 - bgt _080726CA - mov r2, r10 - str r2, [r7] -_080726CA: - ldr r0, [r7, 0x4] - cmp r0, 0x1 - bgt _080726D4 - mov r3, r10 - str r3, [r7, 0x4] -_080726D4: - ldr r0, [r6] - cmp r0, 0x1 - bgt _080726DE - mov r0, r10 - str r0, [r6] -_080726DE: - ldr r0, [r6, 0x4] - cmp r0, 0x1 - bgt _080726E8 - mov r1, r10 - str r1, [r6, 0x4] -_080726E8: - ldr r0, [sp, 0x10] - bl LoadIQSkills - ldr r0, [sp, 0x10] - bl sub_8079764 - ldr r0, [r7] - strb r0, [r5, 0x14] - ldr r0, [r7, 0x4] - strb r0, [r5, 0x15] - ldr r0, [r6] - strb r0, [r5, 0x16] - ldr r0, [r6, 0x4] - strb r0, [r5, 0x17] -_08072704: - movs r2, 0x1 - negs r2, r2 - add r8, r2 - ldr r3, [sp, 0x14] - cmp r8, r3 - bgt _08072624 -_08072710: - ldr r0, _0807273C - adds r1, r5, 0 - movs r2, 0 - bl SetMessageArgument_2 - ldrb r1, [r5, 0x9] - ldr r0, [sp, 0x20] - cmp r1, r0 - bne _08072744 - ldr r0, _08072740 - ldr r2, [r0] - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x10] - bl sub_80522F4 -_0807272E: - movs r0, 0 - b _08072760 - .align 2, 0 -_08072734: .4byte gUnknown_202F31C -_08072738: .4byte gUnknown_202F324 -_0807273C: .4byte gAvailablePokemonNames -_08072740: .4byte gUnknown_80F9EEC -_08072744: - ldr r0, _08072770 - str r1, [r0] - movs r1, 0xD3 - lsls r1, 1 - ldr r0, [sp, 0x10] - bl sub_80421C0 - ldr r0, _08072774 - ldr r2, [r0] - ldr r0, [sp, 0xC] - ldr r1, [sp, 0x10] - bl sub_80522F4 - movs r0, 0x1 -_08072760: - add sp, 0x24 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08072770: .4byte gFormatData_202DE30 -_08072774: .4byte gUnknown_80F9EC8 - thumb_func_end sub_80725A4 - thumb_func_start sub_8072778 sub_8072778: push {r4-r7,lr} diff --git a/asm/code_8077274.s b/asm/code_8077274.s deleted file mode 100644 index 4b80e097..00000000 --- a/asm/code_8077274.s +++ /dev/null @@ -1,267 +0,0 @@ - #include "asm/constants/gba_constants.inc" - #include "asm/macros.inc" - - .syntax unified - - .text - - thumb_func_start sub_8078B5C -sub_8078B5C: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x28 - mov r9, r0 - adds r6, r1, 0 - mov r10, r2 - str r3, [sp, 0x1C] - ldr r0, [sp, 0x48] - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r6, 0 - bl EntityExists - lsls r0, 24 - cmp r0, 0 - bne _08078B86 - b _08078D78 -_08078B86: - ldr r7, [r6, 0x70] - ldrb r0, [r7, 0x7] - cmp r0, 0 - bne _08078BB8 - adds r0, r6, 0 - movs r1, 0x1B - bl HasHeldItem - lsls r0, 24 - cmp r0, 0 - beq _08078BB8 - mov r0, r8 - cmp r0, 0 - bne _08078BA4 - b _08078D78 -_08078BA4: - ldr r0, _08078BB4 - ldr r2, [r0] - mov r0, r9 - adds r1, r6, 0 - bl sub_80522F4 - b _08078D78 - .align 2, 0 -_08078BB4: .4byte gUnknown_80FBEA0 -_08078BB8: - movs r5, 0 - ldr r1, [sp, 0x1C] - cmp r1, 0 - beq _08078BE8 - movs r1, 0x9E - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - bl FixedPointToInt - adds r4, r0, 0 - movs r1, 0xA0 - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - bl FixedPointToInt - cmp r4, r0 - blt _08078BE0 - movs r5, 0x1 -_08078BE0: - ldr r0, _08078C8C - cmp r10, r0 - bne _08078BE8 - movs r5, 0x1 -_08078BE8: - cmp r5, 0 - beq _08078CC0 - movs r0, 0xA0 - lsls r0, 1 - adds r5, r7, r0 - ldr r1, [r5] - str r1, [sp, 0x20] - subs r0, 0x4 - adds r0, r7 - mov r10, r0 - ldr r0, [r0] - bl FixedPointToInt - adds r4, r0, 0 - ldr r0, [r5] - bl FixedPointToInt - movs r1, 0 - str r1, [sp, 0x24] - cmp r4, r0 - bne _08078C16 - movs r0, 0x1 - str r0, [sp, 0x24] -_08078C16: - mov r0, sp - ldr r1, [sp, 0x1C] - bl IntToFixedPoint - ldr r2, [sp] - ldr r1, [r5] - add r0, sp, 0x4 - bl FixedPoint_Add - ldr r4, [sp, 0x4] - str r4, [r5] - add r0, sp, 0x8 - movs r1, 0xC8 - bl IntToFixedPoint - ldr r2, [sp, 0x8] - add r0, sp, 0xC - adds r1, r4, 0 - bl FixedPoint_Min - ldr r0, [sp, 0xC] - str r0, [r5] - mov r1, r10 - str r0, [r1] - ldr r0, [sp, 0x24] - cmp r0, 0 - bne _08078C5E - mov r1, r8 - cmp r1, 0 - beq _08078C5E - ldr r0, _08078C90 - ldr r2, [r0] - mov r0, r9 - adds r1, r6, 0 - bl sub_80522F4 -_08078C5E: - ldr r0, [sp, 0x20] - bl FixedPointToInt - adds r4, r0, 0 - movs r1, 0xA0 - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - bl FixedPointToInt - cmp r4, r0 - bne _08078C9C - ldr r0, _08078C94 - adds r1, r6, 0 - movs r2, 0 - bl SetMessageArgument - mov r0, r8 - cmp r0, 0 - beq _08078D72 - ldr r0, _08078C98 - b _08078D4E - .align 2, 0 -_08078C8C: .4byte 0x000003e7 -_08078C90: .4byte gUnknown_80FBE64 -_08078C94: .4byte gAvailablePokemonNames -_08078C98: .4byte gUnknown_80FBDF0 -_08078C9C: - adds r0, r6, 0 - bl sub_8041DB0 - ldr r0, _08078CB8 - adds r1, r6, 0 - movs r2, 0 - bl SetMessageArgument - mov r1, r8 - cmp r1, 0 - beq _08078D72 - ldr r0, _08078CBC - b _08078D4E - .align 2, 0 -_08078CB8: .4byte gAvailablePokemonNames -_08078CBC: .4byte gUnknown_80FBDC4 -_08078CC0: - movs r0, 0x9E - lsls r0, 1 - adds r5, r7, r0 - ldr r4, [r5] - add r0, sp, 0x10 - mov r1, r10 - bl IntToFixedPoint - ldr r2, [sp, 0x10] - ldr r1, [r5] - add r0, sp, 0x14 - bl FixedPoint_Add - ldr r1, [sp, 0x14] - str r1, [r5] - movs r0, 0xA0 - lsls r0, 1 - adds r7, r0 - ldr r2, [r7] - add r0, sp, 0x18 - bl FixedPoint_Min - ldr r0, [sp, 0x18] - str r0, [r5] - ldr r0, _08078D28 - cmp r10, r0 - bne _08078CFA - ldr r0, [r7] - str r0, [r5] -_08078CFA: - adds r0, r6, 0 - bl nullsub_85 - ldr r0, _08078D2C - adds r1, r6, 0 - movs r2, 0 - bl SetMessageArgument - adds r0, r4, 0 - bl FixedPointToInt - adds r4, r0, 0 - ldr r0, [r5] - bl FixedPointToInt - cmp r4, r0 - bne _08078D34 - mov r1, r8 - cmp r1, 0 - beq _08078D72 - ldr r0, _08078D30 - b _08078D4E - .align 2, 0 -_08078D28: .4byte 0x000003e7 -_08078D2C: .4byte gAvailablePokemonNames -_08078D30: .4byte gUnknown_80FBE14 -_08078D34: - ldr r0, [r5] - bl FixedPointToInt - adds r4, r0, 0 - ldr r0, [r7] - bl FixedPointToInt - cmp r4, r0 - blt _08078D60 - mov r0, r8 - cmp r0, 0 - beq _08078D72 - ldr r0, _08078D5C -_08078D4E: - ldr r2, [r0] - mov r0, r9 - adds r1, r6, 0 - bl sub_80522F4 - b _08078D72 - .align 2, 0 -_08078D5C: .4byte gUnknown_80FBE64 -_08078D60: - mov r1, r8 - cmp r1, 0 - beq _08078D72 - ldr r0, _08078D88 - ldr r2, [r0] - mov r0, r9 - adds r1, r6, 0 - bl sub_80522F4 -_08078D72: - adds r0, r6, 0 - bl EntityUpdateStatusSprites -_08078D78: - add sp, 0x28 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08078D88: .4byte gUnknown_80FBE84 - thumb_func_end sub_8078B5C - - .align 2,0 diff --git a/include/structs/str_pokemon.h b/include/structs/str_pokemon.h index aa01421a..ec30e81b 100644 --- a/include/structs/str_pokemon.h +++ b/include/structs/str_pokemon.h @@ -148,8 +148,7 @@ typedef struct MonsterDataEntry typedef struct LevelData { /* 0x0 */ s32 expRequired; - /* 0x4 */ u8 gainHP; - /* 0x5 */ u8 gainUnused; + /* 0x4 */ u16 gainHP; /* 0x6 */ u8 gainAtt; /* 0x7 */ u8 gainSPAtt; /* 0x8 */ u8 gainDef; diff --git a/ld_script.txt b/ld_script.txt index 783e507a..cad5fe6e 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -273,7 +273,6 @@ SECTIONS { src/dungeon_ai.o(.text); src/move_effects_target.o(.text); src/status.o(.text); - asm/code_8077274.o(.text); src/code_8077274_1.o(.text); asm/code_8077274_1.o(.text); src/dungeon_ai_movement.o(.text); diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 3b5740b1..2523fdfe 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -1,11 +1,17 @@ #include "global.h" +#include "constants/tactic.h" +#include "dungeon_capabilities.h" +#include "dungeon_pokemon_attributes.h" +#include "dungeon_leader.h" #include "code_8045A00.h" +#include "code_8077274_1.h" #include "constants/dungeon.h" #include "dungeon_map_access.h" #include "dungeon_random.h" #include "dungeon_util.h" #include "dungeon.h" -#include "structs/str_dungeon.h" +#include "pokemon_3.h" +#include "status_checks_1.h" struct unkStruct_806B7F8 { @@ -18,13 +24,47 @@ struct unkStruct_806B7F8 u8 unk10; }; +EWRAM_DATA s32 gUnknown_202F31C[2] = {0, 0}; +EWRAM_DATA s32 gUnknown_202F324[2] = {0, 0}; + + +extern s32 gFormatData_202DE30[5]; extern u8 gAvailablePokemonNames[]; +extern u8 gFormatItems[]; + extern s16 gUnknown_80F4DA6; extern s16 gUnknown_80F4DA8; extern s16 gUnknown_80F4DAA; extern s16 gUnknown_80F4DAC; + +extern u8 *gUnknown_80F9ACC[]; +extern u8 *gUnknown_80F9AEC[]; +extern u8 *gUnknown_80F9B10[]; +extern u8 *gUnknown_80F9B34[]; +extern u8 *gUnknown_80F9B58[]; +extern u8 *gUnknown_80F9B74[]; +extern u8 *gUnknown_80F9B94[]; +extern u8 *gUnknown_80F9E64[]; +extern u8 *gUnknown_80F9E80[]; +extern u8 *gUnknown_80F9EC8[]; +extern u8 *gUnknown_80F9EEC[]; +extern u8 *gUnknown_80FCF18[]; extern u8 *gUnknown_80FED68[]; +extern u8 *gUnknown_80FF730[]; +extern u8 gUnknown_8107010[8]; +extern u8 *gUnknown_8107018[3]; +extern void sub_80421C0(Entity *pokemon, u16 r1); +void sub_80528F4(Entity *, u8 *); +void sub_8083D58(void); +void sub_8072778(Entity *, Entity *, u8, u8); +bool8 sub_80725A4(Entity *, Entity *); +void GetAvailTacticsforLvl_Bool(u8 *tacticsBuffer, s32 pokeLevel); +bool8 sub_80723D0(Entity *, Entity *, u8, u8); +void sub_807218C(Entity *); +void sub_806A2BC(Entity *, u32); +void sub_806A3D4(u8 *, s32, s32, s32); +extern void PrintFieldMessage(u32, u8 *, u32); extern Entity* sub_806B7F8(struct unkStruct_806B7F8 *, bool8); extern void sub_805239C(struct Entity *r0, const char r1[]); extern void sub_8042920(struct Entity *r0); @@ -32,6 +72,8 @@ extern s16 sub_803D970(u32); extern s32 sub_803DA20(s32 param_1); extern bool8 sub_806AA0C(s32, u32); extern bool8 sub_8083660(struct Position *param_1); +extern void sub_80522F4(Entity *pokemon, Entity *r1, const u8[]); +void GetPokemonLevelData(LevelData* a1, s32 _id, s32 level); // TODO: change to s32 void sub_8071B48(void) { @@ -151,3 +193,692 @@ void sub_8071D4C(Entity *pokemon, Entity *target, s32 exp) } } } + +// https://decomp.me/scratch/Wcmvb - (98.45% matching - Seth) +NAKED +void sub_8071DA4(Entity *entity) +{ + asm_unified( +" push {r4-r7,lr}\n" +" mov r7, r10\n" +" mov r6, r9\n" +" mov r5, r8\n" +" push {r5-r7}\n" +" sub sp, 0xD4\n" +" str r0, [sp, 0xB4]\n" +" ldr r2, _08071E44\n" +" ldr r1, [r2]\n" +" ldrb r0, [r1, 0xD]\n" +" cmp r0, 0\n" +" bne _08071DBE\n" +" b _08071FE2\n" +"_08071DBE:\n" +" movs r0, 0\n" +" strb r0, [r1, 0xD]\n" +" ldr r0, [r2]\n" +" ldrb r0, [r0, 0x10]\n" +" cmp r0, 0\n" +" beq _08071DCC\n" +" b _08071FE2\n" +"_08071DCC:\n" +" ldr r0, [sp, 0xB4]\n" +" bl EntityExists\n" +" lsls r0, 24\n" +" cmp r0, 0\n" +" bne _08071DE2\n" +" mov r0, sp\n" +" bl sub_80457DC\n" +" mov r0, sp\n" +" str r0, [sp, 0xB4]\n" +"_08071DE2:\n" +" movs r4, 0\n" +"_08071DE4:\n" +" movs r5, 0\n" +" ldr r0, _08071E44\n" +" ldr r0, [r0]\n" +" lsls r1, r4, 2\n" +" ldr r2, _08071E48\n" +" adds r0, r2\n" +" adds r0, r1\n" +" ldr r0, [r0]\n" +" mov r8, r0\n" +" movs r0, 0\n" +" str r0, [sp, 0xB8]\n" +" movs r1, 0\n" +" movs r2, 0\n" +" str r1, [sp, 0xBC]\n" +" str r2, [sp, 0xC0]\n" +" movs r0, 0\n" +" movs r1, 0\n" +" str r0, [sp, 0xC4]\n" +" str r1, [sp, 0xC8]\n" +" adds r1, r4, 0x1\n" +" str r1, [sp, 0xCC]\n" +" mov r2, r8\n" +" cmp r2, 0\n" +" bne _08071E16\n" +" b _08071FDA\n" +"_08071E16:\n" +" mov r0, r8\n" +" bl EntityExists\n" +" lsls r0, 24\n" +" cmp r0, 0\n" +" bne _08071E24\n" +" b _08071FDA\n" +"_08071E24:\n" +" mov r0, r8\n" +" ldr r6, [r0, 0x70]\n" +" movs r1, 0xE\n" +" ldrsh r0, [r6, r1]\n" +" cmp r0, 0\n" +" bne _08071E32\n" +" b _08071FDA\n" +"_08071E32:\n" +" adds r1, r6, 0\n" +" adds r1, 0xF9\n" +" ldrb r0, [r1]\n" +" cmp r0, 0\n" +" beq _08071E4C\n" +" add r2, sp, 0xB8\n" +" ldrb r2, [r2]\n" +" strb r2, [r1]\n" +" b _08071FCA\n" +" .align 2, 0\n" +"_08071E44: .4byte gDungeon\n" +"_08071E48: .4byte 0x000135cc\n" +"_08071E4C:\n" +" movs r1, 0xFE\n" +" lsls r1, 1\n" +" adds r0, r6, r1\n" +" ldr r0, [r0]\n" +" mov r10, r0\n" +" cmp r0, 0\n" +" beq _08071EB6\n" +" ldrb r0, [r6, 0x7]\n" +" cmp r0, 0\n" +" beq _08071E68\n" +" ldrb r1, [r6, 0x9]\n" +" add r0, sp, 0x74\n" +" bl GetAvailTacticsforLvl_Bool\n" +"_08071E68:\n" +" movs r0, 0x10\n" +" ldrsh r2, [r6, r0]\n" +" str r2, [sp, 0xB8]\n" +" ldrb r1, [r6, 0x14]\n" +" str r1, [sp, 0xBC]\n" +" ldrb r2, [r6, 0x15]\n" +" str r2, [sp, 0xC0]\n" +" ldrb r0, [r6, 0x16]\n" +" str r0, [sp, 0xC4]\n" +" ldrb r1, [r6, 0x17]\n" +" str r1, [sp, 0xC8]\n" +" ldrb r0, [r6, 0x9]\n" +" cmp r0, 0x64\n" +" beq _08071EB6\n" +" ldr r0, [r6, 0x18]\n" +" add r0, r10\n" +" str r0, [r6, 0x18]\n" +" mov r2, r10\n" +" ldr r0, _08071EE8\n" +" str r2, [r0]\n" +" ldr r0, _08071EEC\n" +" adds r1, r6, 0\n" +" movs r2, 0\n" +" bl SetMessageArgument_2\n" +" ldr r0, _08071EF0\n" +" ldr r2, [r0]\n" +" ldr r0, [sp, 0xB4]\n" +" mov r1, r8\n" +" bl sub_80522F4\n" +" ldr r0, [sp, 0xB4]\n" +" mov r1, r8\n" +" movs r2, 0x1\n" +" movs r3, 0x1\n" +" bl sub_80723D0\n" +" lsls r0, 24\n" +" lsrs r5, r0, 24\n" +"_08071EB6:\n" +" ldr r1, _08071EF4\n" +" adds r0, r6, r1\n" +" ldrb r0, [r0]\n" +" adds r4, 0x1\n" +" str r4, [sp, 0xCC]\n" +" cmp r0, 0\n" +" beq _08071F3A\n" +" movs r2, 0x2\n" +" ldrsh r0, [r6, r2]\n" +" add r1, sp, 0x8C\n" +" movs r2, 0\n" +" movs r3, 0\n" +" bl sub_808E400\n" +" adds r7, r0, 0\n" +" add r0, sp, 0x8C\n" +" mov r9, r0\n" +" cmp r7, 0\n" +" beq _08071F38\n" +" adds r0, r7, 0\n" +" bl DungeonRandInt\n" +" adds r4, r0, 0\n" +" movs r1, 0\n" +" b _08071F02\n" +" .align 2, 0\n" +"_08071EE8: .4byte gFormatData_202DE30\n" +"_08071EEC: .4byte gAvailablePokemonNames\n" +"_08071EF0: .4byte gUnknown_80F9E64\n" +"_08071EF4: .4byte 0x00000149\n" +"_08071EF8:\n" +" adds r4, 0x1\n" +" cmp r4, r7\n" +" blt _08071F00\n" +" movs r4, 0\n" +"_08071F00:\n" +" adds r1, 0x1\n" +"_08071F02:\n" +" cmp r1, r7\n" +" bge _08071F38\n" +" lsls r0, r4, 1\n" +" mov r2, r9\n" +" adds r5, r2, r0\n" +" movs r2, 0\n" +" ldrsh r0, [r5, r2]\n" +" str r1, [sp, 0xD0]\n" +" bl sub_803D930\n" +" lsls r0, 24\n" +" ldr r1, [sp, 0xD0]\n" +" cmp r0, 0\n" +" beq _08071EF8\n" +" movs r2, 0\n" +" ldrsh r0, [r5, r2]\n" +" bl GetSpriteData\n" +" ldr r1, [sp, 0xD0]\n" +" cmp r0, 0\n" +" beq _08071EF8\n" +" movs r0, 0\n" +" ldrsh r2, [r5, r0]\n" +" ldr r0, [sp, 0xB4]\n" +" mov r1, r8\n" +" bl sub_8072B78\n" +"_08071F38:\n" +" movs r5, 0\n" +"_08071F3A:\n" +" cmp r5, 0\n" +" beq _08071F7A\n" +" ldrb r0, [r6, 0x6]\n" +" cmp r0, 0\n" +" bne _08071F7A\n" +" movs r1, 0x10\n" +" ldrsh r0, [r6, r1]\n" +" ldr r2, [sp, 0xB8]\n" +" subs r0, r2\n" +" ldr r1, _08071FF4\n" +" str r0, [r1]\n" +" ldrb r0, [r6, 0x14]\n" +" ldr r2, [sp, 0xBC]\n" +" subs r0, r2\n" +" str r0, [r1, 0x4]\n" +" ldrb r0, [r6, 0x16]\n" +" ldr r1, [sp, 0xC4]\n" +" subs r0, r1\n" +" ldr r2, _08071FF4\n" +" str r0, [r2, 0x8]\n" +" ldrb r0, [r6, 0x15]\n" +" ldr r1, [sp, 0xC0]\n" +" subs r0, r1\n" +" str r0, [r2, 0xC]\n" +" ldrb r0, [r6, 0x17]\n" +" ldr r2, [sp, 0xC8]\n" +" subs r0, r2\n" +" ldr r1, _08071FF4\n" +" str r0, [r1, 0x10]\n" +" mov r0, r8\n" +" bl sub_807218C\n" +"_08071F7A:\n" +" mov r2, r10\n" +" cmp r2, 0\n" +" beq _08071FCA\n" +" ldrb r0, [r6, 0x7]\n" +" cmp r0, 0\n" +" beq _08071FCA\n" +" ldrb r1, [r6, 0x9]\n" +" add r0, sp, 0x80\n" +" bl GetAvailTacticsforLvl_Bool\n" +" movs r4, 0\n" +" add r7, sp, 0x74\n" +" add r5, sp, 0x80\n" +"_08071F94:\n" +" adds r0, r7, r4\n" +" ldrb r0, [r0]\n" +" cmp r0, 0\n" +" bne _08071FC4\n" +" adds r0, r5, r4\n" +" ldrb r0, [r0]\n" +" cmp r0, 0x1\n" +" bne _08071FC4\n" +" ldr r0, _08071FF8\n" +" mov r1, r8\n" +" movs r2, 0\n" +" bl SetMessageArgument\n" +" lsls r1, r4, 24\n" +" lsrs r1, 24\n" +" ldr r0, _08071FFC\n" +" bl CopyTacticsNameToBuffer\n" +" ldr r0, _08072000\n" +" ldr r2, [r0]\n" +" ldr r0, [sp, 0xB4]\n" +" mov r1, r8\n" +" bl sub_80522F4\n" +"_08071FC4:\n" +" adds r4, 0x1\n" +" cmp r4, 0xB\n" +" ble _08071F94\n" +"_08071FCA:\n" +" movs r1, 0xFE\n" +" lsls r1, 1\n" +" adds r0, r6, r1\n" +" movs r1, 0\n" +" str r1, [r0]\n" +" ldr r2, _08072004\n" +" adds r0, r6, r2\n" +" strb r1, [r0]\n" +"_08071FDA:\n" +" ldr r4, [sp, 0xCC]\n" +" cmp r4, 0x13\n" +" bgt _08071FE2\n" +" b _08071DE4\n" +"_08071FE2:\n" +" add sp, 0xD4\n" +" pop {r3-r5}\n" +" mov r8, r3\n" +" mov r9, r4\n" +" mov r10, r5\n" +" pop {r4-r7}\n" +" pop {r0}\n" +" bx r0\n" +" .align 2, 0\n" +"_08071FF4: .4byte gFormatData_202DE30\n" +"_08071FF8: .4byte gAvailablePokemonNames\n" +"_08071FFC: .4byte gFormatItems\n" +"_08072000: .4byte gUnknown_80FF730\n" +"_08072004: .4byte 0x00000149"); +} + +void sub_8072008(Entity *pokemon, Entity *target, s32 level, u8 param_4, u8 param_5) +{ + bool8 flag; + s32 newLevel; + EntityInfo *info; + s32 tacticIndex; + LevelData leveldata; + u8 tacticsBuffer1 [NUM_TACTICS]; + u8 tacticsBuffer2 [NUM_TACTICS]; + s32 maxHP; + u32 atk[2]; + u32 def[2]; + + if (EntityExists(target)) { + flag = 0; + info = target->info; + if (info->isTeamLeader) { + GetAvailTacticsforLvl_Bool(tacticsBuffer1,info->level); + } + maxHP = info->maxHPStat; + atk[0] = info->atk; + atk[1] = info->spAtk; + def[0] = info->def; + def[1] = info->spDef; + if (!IsClientOrTeamBase(info->joinedAt.joinedAt)) { + newLevel = info->level + level; + if (99 < newLevel) { + newLevel = 100; + } + if (newLevel != info->level) { + GetPokemonLevelData(&leveldata,info->id,newLevel); + info->exp = leveldata.expRequired; + flag |= (sub_80723D0(pokemon,target,param_4,param_5)); + if ((flag != 0) && (!info->isNotTeamMember)) { + gFormatData_202DE30[0] = info->maxHPStat - maxHP; + gFormatData_202DE30[1] = info->atk - atk[0]; + gFormatData_202DE30[2] = info->def - def[0]; + gFormatData_202DE30[3] = info->spAtk - atk[1]; + gFormatData_202DE30[4] = info->spDef - def[1]; + if (param_4 != 0) { + sub_807218C(target); + } + } + } + } + if (info->isTeamLeader) { + GetAvailTacticsforLvl_Bool(tacticsBuffer2,info->level); + for(tacticIndex = 0; tacticIndex < NUM_TACTICS; tacticIndex++) + { + if ((tacticsBuffer1[tacticIndex] == 0) && (tacticsBuffer2[tacticIndex] == 1)) { + SetMessageArgument(gAvailablePokemonNames,target,0); + CopyTacticsNameToBuffer(gFormatItems,tacticIndex); + sub_80522F4(pokemon,target,*gUnknown_80FF730); + } + } + } + info->expGainedInTurn = 0; + info->unk149 = 0; + if ((flag == 0) && (param_4 != 0)) { + SetMessageArgument(gAvailablePokemonNames,target,0); + sub_80522F4(pokemon,target,*gUnknown_80F9B74); + } + } +} + +void sub_807218C(Entity *pokemon) +{ + EntityInfo *info; + u8 buffer [400]; + s32 r1; + s32 r6; + s32 r3; + + r6 = 0; + info = pokemon->info; + + sub_806A2BC(pokemon, 0); + SetMessageArgument_2(gAvailablePokemonNames, info, 0); + if(sub_8070BC0(pokemon)) + { + r3 = 0; + r1 = info->id; + if(info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON) + { + r1 = 0x1A4; + } + else if(info->joinedAt.joinedAt == DUNGEON_RESCUE_TEAM_BASE) + { + r1 = 0x1A5; + } + else if(info->joinedAt.joinedAt == DUNGEON_JOIN_LOCATION_PARTNER) + { + if(gDungeon->unk65C == 0) + r3 = 1; + } + sub_806A3D4(buffer, r1, 3, r3); + } + else + { + strcpy(buffer, *gUnknown_80FCF18); + } + PrintFieldMessage(0, buffer, 1); + buffer[0] = 0; + + + if(gFormatData_202DE30[0]> 0) + { + strcat(buffer, *gUnknown_80F9ACC); + r6++; + } + + if(gFormatData_202DE30[1]> 0) + { + if(gUnknown_8107010[r6] != 0) + strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); + strcat(buffer, *gUnknown_80F9AEC); + r6++; + } + if(gFormatData_202DE30[2]> 0) + { + if(gUnknown_8107010[r6] != 0) + strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); + strcat(buffer, *gUnknown_80F9B10); + r6++; + } + if(gFormatData_202DE30[3]> 0) + { + if(gUnknown_8107010[r6] != 0) + strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); + strcat(buffer, *gUnknown_80F9B34); + r6++; + } + if(gFormatData_202DE30[4]> 0) + { + if(gUnknown_8107010[r6] != 0) + strcat(buffer, gUnknown_8107018[gUnknown_8107010[r6]]); + strcat(buffer, *gUnknown_80F9B58); + } + + if(buffer[0]) + PrintFieldMessage(0, buffer, 1); + + sub_806A2BC(GetLeader(), 0); +} + +void LevelDownTarget(Entity *pokemon, Entity *target, u32 level) +{ + EntityInfo *info; + u8 flag; + s32 newLevel; + LevelData leveldata; + + if(EntityExists(target)) + { + flag = FALSE; + info = target->info; + if(!IsClientOrTeamBase(info->joinedAt.joinedAt)) + { + newLevel = info->level - level; + if(newLevel <= 0) + newLevel = 1; + + if(newLevel != info->level) + { + GetPokemonLevelData(&leveldata, info->id, newLevel); + info->exp = leveldata.expRequired; + flag |= sub_80725A4(pokemon, target); + } + } + info->expGainedInTurn = 0; + info->unk149 = 0; + + if(!flag) + { + SetMessageArgument(gAvailablePokemonNames, target, 0); + sub_80522F4(pokemon, target, *gUnknown_80F9B94); + } + } +} + +bool8 sub_80723D0(Entity *pokemon, Entity *target, u8 param_3, u8 param_4) +{ + EntityInfo *info; + LevelData leveldata; + bool8 flag = FALSE; + s32 id; + s32 level; + s32 exp; + + if(!EntityExists(target)) return FALSE; + info = target->info; + id = info->id; + exp = info->exp; + + + if(IsClientOrTeamBase(info->joinedAt.joinedAt)) + return FALSE; + + for(level = info->level + 1; level <= 100; level++) + { + GetPokemonLevelData(&leveldata, id, level); + if(leveldata.expRequired > exp) break; + + info->level = level; + info->exp = exp; + + if(param_3) + { + if(!info->isNotTeamMember) + { + sub_806A2BC(target, 0); + if(!flag) + sub_8083D58(); + gFormatData_202DE30[0] = level; + + SetMessageArgument_2(gAvailablePokemonNames, info, 0); + sub_80528F4(target, *gUnknown_80F9E80); + } + else + { + if(!flag) + sub_8083D58(); + gFormatData_202DE30[0] = level; + SetMessageArgument_2(gAvailablePokemonNames, info, 0); + sub_805239C(target, *gUnknown_80F9E80); + } + } + flag = TRUE; + + info->maxHPStat += leveldata.gainHP; + info->HP += leveldata.gainHP; + + if(info->maxHPStat > 0x3E6) + info->maxHPStat = 0x3E7; + + if(info->HP >= info->maxHPStat) + { + info->HP = info->maxHPStat; + } + + gUnknown_202F31C[0] = info->atk; + gUnknown_202F31C[1] = info->spAtk; + gUnknown_202F324[0] = info->def; + gUnknown_202F324[1] = info->spDef; + + gUnknown_202F31C[0] += leveldata.gainAtt; + gUnknown_202F31C[1] += leveldata.gainSPAtt; + gUnknown_202F324[0] += leveldata.gainDef; + gUnknown_202F324[1] += leveldata.gainSPDef; + + if(gUnknown_202F31C[0] > 0xFE) + gUnknown_202F31C[0] = 0xFF; + if(gUnknown_202F31C[1] > 0xFE) + gUnknown_202F31C[1] = 0xFF; + if(gUnknown_202F324[0] > 0xFE) + gUnknown_202F324[0] = 0xFF; + if(gUnknown_202F324[1] > 0xFE) + gUnknown_202F324[1] = 0xFF; + + + LoadIQSkills(target); + sub_8079764(target); + + info->atk = gUnknown_202F31C[0]; + info->spAtk = gUnknown_202F31C[1]; + info->def = gUnknown_202F324[0]; + info->spDef = gUnknown_202F324[1]; + + sub_8072778(pokemon, target, param_3, param_4); + } + + return flag; +} + +bool8 sub_80725A4(Entity *pokemon, Entity *target) +{ + EntityInfo *info; + LevelData leveldata; + s32 level; + s32 levelMax; + s32 id; + s32 exp; + s32 oldLevel; + + + if(!EntityExists(target)) return FALSE; + info = target->info; + id = info->id; + exp = info->exp; + oldLevel = info->level; + + + if(IsClientOrTeamBase(info->joinedAt.joinedAt)) return FALSE; + + for(level = 1; level < info->level; level++) + { + GetPokemonLevelData(&leveldata, id, level); + if(leveldata.expRequired >= exp) break; + } + + levelMax = level - 1; + + for(level = info->level; level > levelMax; level--) + { + if(level < 100) + { + GetPokemonLevelData(&leveldata, id, level + 1); + info->exp = leveldata.expRequired - 1; + } + else + { + info->exp = exp; + } + + if(oldLevel > level) + { + GetPokemonLevelData(&leveldata, id, level + 1); + + info->level = level; + + info->maxHPStat -= leveldata.gainHP; + info->HP -= leveldata.gainHP; + + if(info->HP <= 1) + info->HP = 1; + + if(info->maxHPStat <= 1) + info->maxHPStat = 1; + + if(info->HP >= info->maxHPStat) + { + info->HP = info->maxHPStat; + } + + gUnknown_202F31C[0] = info->atk; + gUnknown_202F31C[1] = info->spAtk; + gUnknown_202F324[0] = info->def; + gUnknown_202F324[1] = info->spDef; + + gUnknown_202F31C[0] -= leveldata.gainAtt; + gUnknown_202F31C[1] -= leveldata.gainSPAtt; + gUnknown_202F324[0] -= leveldata.gainDef; + gUnknown_202F324[1] -= leveldata.gainSPDef; + + if(gUnknown_202F31C[0] <= 1) + gUnknown_202F31C[0] = 1; + if(gUnknown_202F31C[1] <= 1) + gUnknown_202F31C[1] = 1; + if(gUnknown_202F324[0] <= 1) + gUnknown_202F324[0] = 1; + if(gUnknown_202F324[1] <= 1) + gUnknown_202F324[1] = 1; + + + LoadIQSkills(target); + sub_8079764(target); + + info->atk = gUnknown_202F31C[0]; + info->spAtk = gUnknown_202F31C[1]; + info->def = gUnknown_202F324[0]; + info->spDef = gUnknown_202F324[1]; + } + } + + + SetMessageArgument_2(gAvailablePokemonNames, info, 0); + + if(info->level != oldLevel) + { + gFormatData_202DE30[0] = info->level; + sub_80421C0(target, 0xD3 << 1); + sub_80522F4(pokemon, target, *gUnknown_80F9EC8); // $m0 dropped to Level $d0! + return TRUE; + } + else + { + sub_80522F4(pokemon, target, *gUnknown_80F9EEC); // $m0's level didn't drop! + return FALSE; + } +} diff --git a/src/status.c b/src/status.c index 4be7b775..4d343e9d 100644 --- a/src/status.c +++ b/src/status.c @@ -129,6 +129,12 @@ extern u8 *gUnknown_80FBBD4[]; extern u8 *gUnknown_80FBBB8[]; extern u8 *gUnknown_80FBB94[]; extern s16 gUnknown_80F4EF4[]; +extern u8 *gUnknown_80FBE84[]; +extern u8 *gUnknown_80FBEA0[]; +extern u8 *gUnknown_80FBE64[]; +extern u8 *gUnknown_80FBDF0[]; +extern u8 *gUnknown_80FBDC4[]; +extern u8 *gUnknown_80FBE14[]; extern s32 gFormatData_202DE30[10]; @@ -152,11 +158,12 @@ extern void nullsub_81(Entity *); extern void nullsub_82(Entity *); extern void nullsub_83(Entity *); extern void nullsub_84(Entity *); - -extern void sub_8041D9C(Entity *); +extern void nullsub_85(Entity *); extern void sub_803F580(u32); extern void sub_8040A84(void); +extern void sub_8041D9C(Entity *); +extern void sub_8041DB0(Entity *pokemon); extern void sub_8041CA8(Entity *); extern void sub_8041C94(Entity *); extern bool8 sub_8045888(Entity *r0); @@ -1275,3 +1282,91 @@ void sub_8078A58(struct Entity *pokemon, struct Entity *target, s32 param_3, s32 EntityUpdateStatusSprites(target); } + +void sub_8078B5C(Entity *pokemon, Entity *target, u32 param_3, s32 param_4, bool8 displayMessage) +{ + bool8 bVar1; + FixedPoint uVar7; + FixedPoint *bellyPtr; + EntityInfo *targetInfo; + FixedPoint *puVar8; + FixedPoint sp_0x0; + FixedPoint sp_0x4; + FixedPoint sp_0x8; + FixedPoint sp_0x10; + FixedPoint sp_0x14; + FixedPoint sp_0x18; + FixedPoint sp_0x20; + u32 sp_0x24; + + if (!EntityExists(target)) { + return; + } + targetInfo = target->info; + if ((!targetInfo->isTeamLeader) && (HasHeldItem(target,0x1b))) { + if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBEA0); + return; + } + bVar1 = FALSE; + if (param_4 != 0) { + if(FixedPointToInt(targetInfo->belly) >= FixedPointToInt(targetInfo->maxBelly)) + { + bVar1 = TRUE; + } + if (param_3 == 999) + { + bVar1 = TRUE; + } + } + if (bVar1) { + bellyPtr = &targetInfo->maxBelly; + sp_0x20 = *bellyPtr; + sp_0x24 = (FixedPointToInt(targetInfo->belly) == FixedPointToInt(*bellyPtr)); + sp_0x0 = IntToFixedPoint(param_4); + sp_0x4 = FixedPoint_Add(*bellyPtr,sp_0x0); + *bellyPtr = sp_0x4; + sp_0x8 = IntToFixedPoint(200); + *bellyPtr = FixedPoint_Min(sp_0x4,sp_0x8); + targetInfo->belly = *bellyPtr; + if ((sp_0x24 == 0) && (displayMessage)) { + sub_80522F4(pokemon,target,*gUnknown_80FBE64); + } + if (FixedPointToInt(sp_0x20) == FixedPointToInt(targetInfo->maxBelly)) { + SetMessageArgument(gAvailablePokemonNames,target,0); + if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBDF0); + } + else { + sub_8041DB0(target); + SetMessageArgument(gAvailablePokemonNames,target,0); + if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBDC4); + } + } + else { + bellyPtr = &targetInfo->belly; + uVar7 = *bellyPtr; + sp_0x10 = IntToFixedPoint(param_3); + sp_0x14 = FixedPoint_Add(*bellyPtr,sp_0x10); + *bellyPtr = sp_0x14; + puVar8 = &targetInfo->maxBelly; + sp_0x18 = FixedPoint_Min(sp_0x14,*puVar8); + *bellyPtr = sp_0x18; + if (param_3 == 999) { + *bellyPtr = *puVar8; + } + nullsub_85(target); + SetMessageArgument(gAvailablePokemonNames,target,0); + if (FixedPointToInt(uVar7) == FixedPointToInt(*bellyPtr)) { + if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBE14); + } + else { + if (FixedPointToInt(*bellyPtr) >= FixedPointToInt(*puVar8)) { + if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBE64); + } + else + { + if (displayMessage) sub_80522F4(pokemon,target,*gUnknown_80FBE84); + } + } + } + EntityUpdateStatusSprites(target); +} diff --git a/sym_ewram.txt b/sym_ewram.txt index b80e3263..d17364d4 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -488,11 +488,7 @@ gUnknown_202F310: /* 202F310 (sub_8067A80 - sub_8068310) */ .space 0x4 .include "src/dungeon_movement.o" - -gUnknown_202F31C: /* 202F31C (sub_80723D0 - sub_80725A4) */ - .space 0x8 -gUnknown_202F324: /* 202F324 (sub_80723D0 - sub_80725A4) */ - .space 0x8 + .include "src/code_80718D8.o" gUnknown_202F32C: /* 202F32C (xxx_dungeon_8042F6C - sub_8072CF4) */ .space 0x1