diff --git a/asm/code_803C1D0.s b/asm/code_803C1D0.s index f97a9750d..8ab514987 100644 --- a/asm/code_803C1D0.s +++ b/asm/code_803C1D0.s @@ -5,287 +5,6 @@ .text - thumb_func_start sub_803C1D0 -sub_803C1D0: - push {lr} - lsls r1, 24 - lsrs r1, 24 - bl sub_803C1B4 - adds r1, r0, 0 - lsrs r0, r1, 31 - adds r0, r1, r0 - asrs r1, r0, 1 - lsls r0, r1, 24 - lsrs r0, 24 - cmp r0, 0x6 - bls _0803C1EC - movs r0, 0x6 -_0803C1EC: - pop {r1} - bx r1 - thumb_func_end sub_803C1D0 - - thumb_func_start sub_803C1F0 -sub_803C1F0: - lsls r0, 24 - ldr r1, _0803C1FC - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - bx lr - .align 2, 0 -_0803C1FC: .4byte gUnknown_80E8BF8 - thumb_func_end sub_803C1F0 - - thumb_func_start GetDungeonTeamRankPts -GetDungeonTeamRankPts: - push {lr} - lsls r1, 24 - lsrs r1, 24 - bl sub_803C1B4 - ldr r1, _0803C218 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - pop {r1} - bx r1 - .align 2, 0 -_0803C218: .4byte gUnknown_80E80A0 - thumb_func_end GetDungeonTeamRankPts - - thumb_func_start sub_803C21C -sub_803C21C: - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - adds r4, r1, 0 - adds r0, r6, 0x4 - ldrb r1, [r6, 0x1] - bl sub_803C1D0 - lsls r0, 24 - lsrs r2, r0, 24 - movs r0, 0 - str r0, [r4, 0x18] - movs r3, 0 - movs r1, 0x2 - adds r0, r4, 0 - adds r0, 0x1E -_0803C23E: - strb r3, [r0] - subs r0, 0x1 - subs r1, 0x1 - cmp r1, 0 - bge _0803C23E - adds r0, r4, 0 - adds r0, 0x20 - movs r1, 0 - strb r1, [r0] - movs r1, 0xA - strb r1, [r4, 0x1F] - ldrb r1, [r6, 0x11] - adds r3, r0, 0 - cmp r1, 0x9 - bhi _0803C354 - lsls r0, r1, 2 - ldr r1, _0803C268 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_0803C268: .4byte _0803C26C - .align 2, 0 -_0803C26C: - .4byte _0803C294 - .4byte _0803C2A2 - .4byte _0803C2B4 - .4byte _0803C2BE - .4byte _0803C354 - .4byte _0803C2E0 - .4byte _0803C2EE - .4byte _0803C300 - .4byte _0803C30A - .4byte _0803C34A -_0803C294: - movs r0, 0 - strb r0, [r4, 0x16] - adds r1, r2, 0x1 - movs r0, 0x64 - muls r0, r1 - str r0, [r4, 0x18] - b _0803C358 -_0803C2A2: - movs r0, 0x1 - strb r0, [r4, 0x16] - adds r1, r2, 0x1 - movs r0, 0x64 - muls r0, r1 - str r0, [r4, 0x18] - ldrb r0, [r6, 0x12] - strb r0, [r4, 0x1C] - b _0803C358 -_0803C2B4: - movs r0, 0x2 - strb r0, [r4, 0x16] - ldrb r0, [r6, 0x12] - strb r0, [r4, 0x1C] - b _0803C358 -_0803C2BE: - movs r0, 0x3 - strb r0, [r4, 0x16] - ldrb r0, [r6, 0x12] - strb r0, [r4, 0x1C] - adds r5, r6, 0x4 - adds r7, r4, 0 - adds r7, 0x1D -_0803C2CC: - ldrb r1, [r6, 0x1] - adds r0, r5, 0 - adds r2, r7, 0 - bl sub_803C37C - ldrb r0, [r4, 0x1C] - ldrb r1, [r4, 0x1D] - cmp r0, r1 - beq _0803C2CC - b _0803C35A -_0803C2E0: - movs r0, 0 - strb r0, [r4, 0x16] - adds r1, r2, 0x1 - movs r0, 0xC8 - muls r0, r1 - str r0, [r4, 0x18] - b _0803C358 -_0803C2EE: - movs r0, 0x1 - strb r0, [r4, 0x16] - adds r1, r2, 0x1 - movs r0, 0xC8 - muls r0, r1 - str r0, [r4, 0x18] - ldrb r0, [r6, 0x12] - strb r0, [r4, 0x1C] - b _0803C358 -_0803C300: - movs r0, 0x2 - strb r0, [r4, 0x16] - ldrb r0, [r6, 0x12] - strb r0, [r4, 0x1C] - b _0803C358 -_0803C30A: - movs r0, 0x3 - strb r0, [r4, 0x16] - ldrb r0, [r6, 0x12] - strb r0, [r4, 0x1C] - adds r5, r6, 0x4 - adds r7, r4, 0 - adds r7, 0x1D - movs r0, 0x1E - adds r0, r4 - mov r8, r0 -_0803C31E: - ldrb r1, [r6, 0x1] - adds r0, r5, 0 - adds r2, r7, 0 - bl sub_803C37C - ldrb r0, [r4, 0x1C] - ldrb r1, [r4, 0x1D] - cmp r0, r1 - beq _0803C31E -_0803C330: - ldrb r1, [r6, 0x1] - adds r0, r5, 0 - mov r2, r8 - bl sub_803C37C - ldrb r0, [r4, 0x1C] - ldrb r1, [r4, 0x1E] - cmp r0, r1 - beq _0803C330 - ldrb r0, [r4, 0x1D] - cmp r0, r1 - beq _0803C330 - b _0803C35A -_0803C34A: - movs r0, 0x4 - strb r0, [r4, 0x16] - ldrb r0, [r6, 0x13] - strb r0, [r3] - b _0803C358 -_0803C354: - movs r0, 0x5 - strb r0, [r4, 0x16] -_0803C358: - adds r5, r6, 0x4 -_0803C35A: - movs r0, 0xC - ldrsh r1, [r6, r0] - adds r0, r4, 0 - bl CopyYellowMonsterNametoBuffer - ldrh r0, [r6, 0xC] - strh r0, [r4, 0x14] - ldrb r1, [r6, 0x1] - adds r0, r5, 0 - bl GetDungeonTeamRankPts - str r0, [r4, 0x24] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_803C21C - - thumb_func_start sub_803C37C -sub_803C37C: - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r0, 0 - mov r8, r2 - lsls r1, 24 - lsrs r1, 24 - bl sub_803C1B4 - adds r7, r0, 0 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_8090910 -_0803C398: - movs r5, 0 - adds r0, r6, 0 - adds r1, r7, 0 - bl sub_8090910 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xEA - bne _0803C3BA - movs r0, 0 - movs r1, 0x47 - movs r2, 0x1 - bl GetScriptVarArrayValue - negs r1, r0 - orrs r1, r0 - lsrs r5, r1, 31 -_0803C3BA: - cmp r4, 0xEB - bne _0803C3CE - movs r0, 0 - movs r1, 0x47 - movs r2, 0 - bl GetScriptVarArrayValue - cmp r0, 0 - beq _0803C3CE - movs r5, 0x1 -_0803C3CE: - cmp r5, 0 - bne _0803C398 - mov r0, r8 - strb r4, [r0] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_803C37C - thumb_func_start sub_803C3E0 sub_803C3E0: push {r4-r7,lr} diff --git a/asm/code_8099360.s b/asm/code_8099360.s index 5acfafb4a..df6619244 100644 --- a/asm/code_8099360.s +++ b/asm/code_8099360.s @@ -5,65 +5,6 @@ .text - thumb_func_start sub_8099690 -sub_8099690: - push {r4-r6,lr} - adds r4, r0, 0 - ldr r0, _080996BC - ldr r1, _080996C0 - bl OpenFileAndGetFileDataPtr - adds r6, r0, 0 - cmp r4, 0x1 - beq _080996CC - cmp r4, 0x2 - beq _080996D4 - ldr r0, _080996C4 - ldr r0, [r0] - ldrb r0, [r0, 0xB] - ldr r4, _080996C8 - cmp r0, 0 - beq _080996D6 - movs r0, 0x80 - lsls r0, 1 - adds r4, r0 - b _080996D6 - .align 2, 0 -_080996BC: .4byte gUnknown_8116028 -_080996C0: .4byte gSystemFileArchive -_080996C4: .4byte gGameOptionsRef -_080996C8: .4byte gFontPalette + 0x40 -_080996CC: - ldr r4, _080996D0 - b _080996D6 - .align 2, 0 -_080996D0: .4byte gFontPalette + 0x180 -_080996D4: - ldr r4, _08099704 -_080996D6: - movs r0, 0xF0 - adds r1, r4, 0 - movs r2, 0x10 - bl sub_800388C - adds r5, r4, 0 - movs r4, 0 -_080996E4: - adds r0, r4, 0 - adds r0, 0xF0 - adds r1, r5, 0 - adds r5, 0x4 - bl nullsub_5 - adds r4, 0x1 - cmp r4, 0xF - ble _080996E4 - adds r0, r6, 0 - bl CloseFile - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_08099704: .4byte gFontPalette + 0x1C0 - thumb_func_end sub_8099690 - thumb_func_start sub_8099708 sub_8099708: push {lr} diff --git a/asm/code_80A59DC.s b/asm/code_80A59DC.s new file mode 100644 index 000000000..3066a05df --- /dev/null +++ b/asm/code_80A59DC.s @@ -0,0 +1,615 @@ + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start sub_80A59DC +sub_80A59DC: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x58 + ldr r7, _080A5A34 + ldr r0, [r7] + cmp r0, 0 + bne _080A59F0 + b _080A5E5A +_080A59F0: + mov r9, sp + mov r0, sp + bl sub_809D248 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0 + bne _080A5A04 + str r0, [sp] + str r0, [sp, 0x4] +_080A5A04: + ldr r0, _080A5A38 + mov r8, r0 + ldr r3, [r0] + adds r0, r3, 0 + adds r0, 0xE4 + movs r1, 0 + ldrsh r0, [r0, r1] + mov r6, r8 + cmp r0, 0xAB + bne _080A5A1A + b _080A5BBE +_080A5A1A: + cmp r0, 0xAB + bgt _080A5A46 + cmp r0, 0xA3 + bgt _080A5A3C + cmp r0, 0xA2 + bge _080A5A76 + cmp r0, 0x4 + bne _080A5A2C + b _080A5D76 +_080A5A2C: + cmp r0, 0xA1 + bne _080A5A32 + b _080A5E28 +_080A5A32: + b _080A5E46 + .align 2, 0 +_080A5A34: .4byte gGroundMapDungeon_3001B70 +_080A5A38: .4byte gGroundMapAction +_080A5A3C: + cmp r0, 0xA8 + beq _080A5AF4 + cmp r0, 0xAA + beq _080A5AF4 + b _080A5E46 +_080A5A46: + cmp r0, 0xB0 + bne _080A5A4C + b _080A5C76 +_080A5A4C: + cmp r0, 0xB0 + bgt _080A5A5E + cmp r0, 0xAE + bne _080A5A56 + b _080A5B58 +_080A5A56: + cmp r0, 0xAF + bne _080A5A5C + b _080A5BD8 +_080A5A5C: + b _080A5E46 +_080A5A5E: + cmp r0, 0xDF + beq _080A5A76 + cmp r0, 0xDF + bgt _080A5A6E + cmp r0, 0xBA + bne _080A5A6C + b _080A5D18 +_080A5A6C: + b _080A5E46 +_080A5A6E: + cmp r0, 0xE0 + bne _080A5A74 + b _080A5DDA +_080A5A74: + b _080A5E46 +_080A5A76: + ldr r3, [r6] + adds r2, r3, 0 + adds r2, 0xF4 + ldr r1, [r2] + adds r0, r1, 0x2 + str r0, [r2] + adds r4, r3, 0 + adds r4, 0xFC + cmp r0, 0 + bge _080A5A8C + adds r0, r1, 0x5 +_080A5A8C: + asrs r1, r0, 2 + ldr r0, [r4] + adds r0, r1 + str r0, [r4] + ldr r0, [r2] + movs r1, 0x3 + ands r0, r1 + str r0, [r2] + ldr r5, _080A5AF0 + ldr r0, [r5] + adds r2, r3, 0 + adds r2, 0xF8 + movs r1, 0 + bl sub_80A4580 + ldr r0, [sp] + str r0, [sp, 0x8] + ldr r0, [r6] + adds r0, 0xFC + ldr r1, [sp, 0x4] + ldr r0, [r0] + adds r1, r0 + add r4, sp, 0x8 + str r1, [r4, 0x4] + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A456C + ldr r0, [sp] + str r0, [sp, 0x8] + ldr r0, [r6] + adds r0, 0xFC + ldr r1, [sp, 0x4] + ldr r0, [r0] + subs r1, r0 + str r1, [r4, 0x4] + ldr r0, [r5] + movs r1, 0x1 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + b _080A5DD0 + .align 2, 0 +_080A5AF0: .4byte gGroundMapDungeon_3001B70 +_080A5AF4: + ldr r2, [r6] + adds r3, r2, 0 + adds r3, 0xF0 + adds r0, r2, 0 + adds r0, 0xE8 + ldr r1, [r3] + ldr r0, [r0] + adds r1, r0 + str r1, [r3] + adds r2, 0xF8 + cmp r1, 0 + bge _080A5B0E + adds r1, 0x7 +_080A5B0E: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r1, [r3] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5B20 + adds r0, r1, 0x7 +_080A5B20: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r3] + ldr r5, _080A5B54 + ldr r0, [r5] + movs r1, 0 + bl sub_80A4580 + ldr r0, [r6] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x10] + ldr r0, [sp, 0x4] + add r4, sp, 0x10 + str r0, [r4, 0x4] + ldr r0, [r5] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r5] + movs r1, 0 + b _080A5DD2 + .align 2, 0 +_080A5B54: .4byte gGroundMapDungeon_3001B70 +_080A5B58: + adds r4, r3, 0 + adds r4, 0xF0 + adds r0, r3, 0 + adds r0, 0xE8 + ldr r1, [r4] + ldr r0, [r0] + adds r1, r0 + str r1, [r4] + adds r2, r3, 0 + adds r2, 0xF8 + cmp r1, 0 + bge _080A5B72 + adds r1, 0x7 +_080A5B72: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r1, [r4] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5B84 + adds r0, r1, 0x7 +_080A5B84: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r4] + ldr r0, [r7] + movs r1, 0 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x18] + ldr r0, [sp, 0x4] + add r4, sp, 0x18 + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A456C + b _080A5DCE +_080A5BBE: + ldr r0, [sp] + ldr r1, [sp, 0x4] + str r0, [sp, 0x20] + str r1, [sp, 0x24] + ldr r0, [r7] + add r4, sp, 0x20 + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + b _080A5DD2 +_080A5BD8: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r3, [r0] + adds r4, r3, 0 + adds r4, 0xF0 + adds r1, r3, 0 + adds r1, 0xE8 + ldr r0, [r4] + ldr r1, [r1] + adds r0, r1 + str r0, [r4] + adds r5, r3, 0 + adds r5, 0xF4 + adds r1, r3, 0 + adds r1, 0xEC + ldr r0, [r5] + ldr r1, [r1] + adds r0, r1 + str r0, [r5] + adds r2, r3, 0 + adds r2, 0xF8 + ldr r1, [r4] + cmp r1, 0 + bge _080A5C12 + adds r1, 0x7 +_080A5C12: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + adds r3, 0xFC + ldr r1, [r5] + cmp r1, 0 + bge _080A5C24 + adds r1, 0x7 +_080A5C24: + asrs r1, 3 + ldr r0, [r3] + adds r0, r1 + str r0, [r3] + ldr r1, [r4] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5C36 + adds r0, r1, 0x7 +_080A5C36: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r4] + ldr r1, [r5] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5C48 + adds r0, r1, 0x7 +_080A5C48: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r5] + ldr r0, [r7] + movs r1, 0 + bl sub_80A4580 + mov r1, r8 + ldr r2, [r1] + adds r1, r2, 0 + adds r1, 0xF8 + ldr r0, [sp] + ldr r1, [r1] + adds r0, r1 + str r0, [sp, 0x28] + adds r2, 0xFC + mov r1, r9 + ldr r0, [r1, 0x4] + ldr r1, [r2] + adds r0, r1 + add r4, sp, 0x28 + b _080A5DC2 +_080A5C76: + adds r4, r3, 0 + adds r4, 0xF0 + adds r1, r3, 0 + adds r1, 0xE8 + ldr r0, [r4] + ldr r1, [r1] + adds r0, r1 + str r0, [r4] + adds r5, r3, 0 + adds r5, 0xF4 + adds r1, r3, 0 + adds r1, 0xEC + ldr r0, [r5] + ldr r1, [r1] + adds r0, r1 + str r0, [r5] + adds r6, r3, 0 + adds r6, 0xF8 + ldr r1, [r4] + cmp r1, 0 + bge _080A5CA2 + adds r1, 0x7 +_080A5CA2: + asrs r1, 3 + ldr r0, [r6] + adds r0, r1 + str r0, [r6] + adds r2, r3, 0 + adds r2, 0xFC + ldr r1, [r5] + cmp r1, 0 + bge _080A5CB6 + adds r1, 0x7 +_080A5CB6: + asrs r1, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r1, [r4] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5CC8 + adds r0, r1, 0x7 +_080A5CC8: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r4] + ldr r1, [r5] + adds r0, r1, 0 + cmp r1, 0 + bge _080A5CDA + adds r0, r1, 0x7 +_080A5CDA: + asrs r0, 3 + lsls r0, 3 + subs r0, r1, r0 + str r0, [r5] + ldr r0, [r7] + movs r1, 0 + adds r2, r6, 0 + bl sub_80A4580 + mov r0, r8 + ldr r2, [r0] + adds r1, r2, 0 + adds r1, 0xF8 + ldr r0, [sp] + ldr r1, [r1] + adds r0, r1 + str r0, [sp, 0x30] + adds r2, 0xFC + ldr r0, [sp, 0x4] + ldr r1, [r2] + adds r0, r1 + add r4, sp, 0x30 + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + b _080A5DD2 +_080A5D18: + ldr r0, [r7] + movs r1, 0x1 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xF0 + ldr r4, [r3] + adds r0, r4, 0x1 + str r0, [r3] + adds r2, r1, 0 + adds r2, 0xF8 + cmp r0, 0 + bge _080A5D3A + adds r0, r4, 0x4 +_080A5D3A: + asrs r1, r0, 2 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0x3 + ands r0, r1 + str r0, [r3] + ldr r0, [r7] + movs r1, 0x1 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x38] + ldr r0, [sp, 0x4] + add r4, sp, 0x38 + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0 + adds r2, r4, 0 + bl sub_80A4580 + ldr r0, [r7] + movs r1, 0 + b _080A5DD2 +_080A5D76: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xF0 + ldr r4, [r3] + adds r0, r4, 0x1 + str r0, [r3] + adds r2, r1, 0 + adds r2, 0xF8 + cmp r0, 0 + bge _080A5D98 + adds r0, 0x7 +_080A5D98: + asrs r1, r0, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0x7 + ands r0, r1 + str r0, [r3] + ldr r0, [r7] + movs r1, 0x1 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r1, [sp] + ldr r0, [r0] + adds r1, r0 + str r1, [sp, 0x40] + ldr r0, [sp, 0x4] + add r4, sp, 0x40 +_080A5DC2: + str r0, [r4, 0x4] + ldr r0, [r7] + movs r1, 0x1 + adds r2, r4, 0 + bl sub_80A4580 +_080A5DCE: + ldr r0, [r7] +_080A5DD0: + movs r1, 0x1 +_080A5DD2: + adds r2, r4, 0 + bl sub_80A456C + b _080A5E52 +_080A5DDA: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + mov r0, r8 + ldr r1, [r0] + adds r3, r1, 0 + adds r3, 0xF0 + ldr r4, [r3] + adds r0, r4, 0x1 + str r0, [r3] + adds r2, r1, 0 + adds r2, 0xF8 + cmp r0, 0 + bge _080A5DFC + adds r0, 0x7 +_080A5DFC: + asrs r1, r0, 3 + ldr r0, [r2] + adds r0, r1 + str r0, [r2] + ldr r0, [r3] + movs r1, 0x7 + ands r0, r1 + str r0, [r3] + ldr r0, [r7] + movs r1, 0x1 + bl sub_80A4580 + mov r1, r8 + ldr r0, [r1] + adds r0, 0xF8 + ldr r0, [r0] + str r0, [sp, 0x48] + ldr r0, [sp, 0x4] + add r2, sp, 0x48 + str r0, [r2, 0x4] + ldr r0, [r7] + b _080A5E3E +_080A5E28: + ldr r0, [r7] + movs r1, 0 + mov r2, sp + bl sub_80A456C + movs r0, 0 + movs r1, 0 + str r0, [sp, 0x50] + str r1, [sp, 0x54] + ldr r0, [r7] + add r2, sp, 0x50 +_080A5E3E: + movs r1, 0x1 + bl sub_80A456C + b _080A5E52 +_080A5E46: + ldr r0, _080A5E6C + ldr r0, [r0] + movs r1, 0 + mov r2, sp + bl sub_80A456C +_080A5E52: + ldr r0, _080A5E6C + ldr r0, [r0] + bl sub_80A4764 +_080A5E5A: + bl sub_80A60D8 + add sp, 0x58 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_080A5E6C: .4byte gGroundMapDungeon_3001B70 + thumb_func_end sub_80A59DC + + .align 2,0 diff --git a/asm/ground_effect.s b/asm/ground_effect.s index 2e460d240..1c501e18b 100644 --- a/asm/ground_effect.s +++ b/asm/ground_effect.s @@ -5,208 +5,6 @@ .text - thumb_func_start AllocGroundEffects -AllocGroundEffects: - push {r4,r5,lr} - ldr r4, _080ACBCC - movs r0, 0xE2 - lsls r0, 5 - movs r1, 0x6 - bl MemoryAlloc - str r0, [r4] - adds r1, r0, 0 - ldr r0, _080ACBD0 - adds r5, r0, 0 - movs r4, 0xE2 - lsls r4, 1 - movs r2, 0x80 - lsls r2, 9 - adds r3, r2, 0 -_080ACBB0: - ldrh r0, [r1, 0x6] - orrs r0, r5 - strh r0, [r1, 0x6] - adds r0, r2, 0 - adds r2, r3 - asrs r0, 16 - adds r1, r4 - cmp r0, 0xF - ble _080ACBB0 - bl DeleteGroundEffects - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080ACBCC: .4byte gGroundEffects -_080ACBD0: .4byte 0x0000ffff - thumb_func_end AllocGroundEffects - - thumb_func_start DeleteGroundEffects -DeleteGroundEffects: - push {r4-r6,lr} - ldr r0, _080ACC0C - ldr r4, [r0] - movs r1, 0 - movs r6, 0x1 - negs r6, r6 - movs r5, 0x80 - lsls r5, 9 -_080ACBE4: - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, r6 - beq _080ACBF2 - adds r0, r1, 0 - bl GroundEffect_Delete -_080ACBF2: - adds r0, r5, 0 - movs r1, 0x80 - lsls r1, 9 - adds r5, r1 - asrs r1, r0, 16 - movs r2, 0xE2 - lsls r2, 1 - adds r4, r2 - cmp r1, 0xF - ble _080ACBE4 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080ACC0C: .4byte gGroundEffects - thumb_func_end DeleteGroundEffects - - thumb_func_start FreeGroundEffects -FreeGroundEffects: - push {r4,lr} - bl DeleteGroundEffects - ldr r4, _080ACC28 - ldr r0, [r4] - bl MemoryFree - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080ACC28: .4byte gGroundEffects - thumb_func_end FreeGroundEffects - - thumb_func_start GroundEffect_Select -GroundEffect_Select: - push {r4-r7,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r7, r1, 16 - lsls r2, 24 - asrs r6, r2, 24 - ldr r1, _080ACC90 - adds r0, r4, 0 - bl GetGroundScript - adds r5, r0, 0 - ldr r1, _080ACC94 - str r6, [sp] - movs r0, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl Log - lsls r1, r7, 3 - ldr r0, [r5, 0x4] - adds r0, r1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r0, [r0, 0x4] - adds r0, r1 - ldr r5, [r0, 0x14] - ldr r0, [r0, 0x10] - cmp r0, 0 - ble _080ACC86 - adds r4, r0, 0 -_080ACC70: - movs r0, 0x1 - negs r0, r0 - adds r1, r5, 0 - adds r2, r7, 0 - adds r3, r6, 0 - bl GroundEffect_Add - subs r4, 0x1 - adds r5, 0xC - cmp r4, 0 - bne _080ACC70 -_080ACC86: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ACC90: .4byte gUnknown_8118610 -_080ACC94: .4byte gUnknown_811861C - thumb_func_end GroundEffect_Select - - thumb_func_start GroundEffect_Cancel -GroundEffect_Cancel: - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 24 - asrs r5, r1, 24 - ldr r1, _080ACD00 - movs r0, 0 - adds r2, r7, 0 - bl Log - movs r1, 0 - ldr r0, _080ACD04 - ldr r4, [r0] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - movs r6, 0x80 - lsls r6, 9 -_080ACCC0: - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, r8 - beq _080ACCE2 - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, r7 - bne _080ACCE2 - cmp r5, 0 - blt _080ACCDC - movs r0, 0xA - ldrsb r0, [r4, r0] - cmp r0, r5 - bne _080ACCE2 -_080ACCDC: - adds r0, r1, 0 - bl GroundEffect_Delete -_080ACCE2: - adds r0, r6, 0 - movs r1, 0x80 - lsls r1, 9 - adds r6, r1 - asrs r1, r0, 16 - movs r2, 0xE2 - lsls r2, 1 - adds r4, r2 - cmp r1, 0xF - ble _080ACCC0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ACD00: .4byte gUnknown_8118640 -_080ACD04: .4byte gGroundEffects - thumb_func_end GroundEffect_Cancel - thumb_func_start GroundEffect_CancelBlank GroundEffect_CancelBlank: push {r4-r7,lr} diff --git a/asm/ground_event.s b/asm/ground_event.s index 29a6b5650..6ee3de9e3 100644 --- a/asm/ground_event.s +++ b/asm/ground_event.s @@ -5,203 +5,6 @@ .text - thumb_func_start AllocGroundEvents -AllocGroundEvents: - push {r4,lr} - ldr r4, _080AD9C8 - movs r0, 0x80 - lsls r0, 3 - movs r1, 0x6 - bl MemoryAlloc - str r0, [r4] - adds r1, r0, 0 - ldr r0, _080AD9CC - adds r4, r0, 0 - movs r2, 0x80 - lsls r2, 9 - adds r3, r2, 0 -_080AD9AC: - ldrh r0, [r1, 0x2] - orrs r0, r4 - strh r0, [r1, 0x2] - adds r0, r2, 0 - adds r2, r3 - asrs r0, 16 - adds r1, 0x20 - cmp r0, 0x1F - ble _080AD9AC - bl DeleteGroundEvents - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080AD9C8: .4byte gGroundEvents -_080AD9CC: .4byte 0x0000ffff - thumb_func_end AllocGroundEvents - - thumb_func_start DeleteGroundEvents -DeleteGroundEvents: - push {r4-r6,lr} - ldr r0, _080ADA04 - ldr r4, [r0] - movs r1, 0 - movs r6, 0x1 - negs r6, r6 - movs r5, 0x80 - lsls r5, 9 -_080AD9E0: - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, r6 - beq _080AD9EE - adds r0, r1, 0 - bl GroundEvent_Delete -_080AD9EE: - adds r0, r5, 0 - movs r1, 0x80 - lsls r1, 9 - adds r5, r1 - asrs r1, r0, 16 - adds r4, 0x20 - cmp r1, 0x1F - ble _080AD9E0 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080ADA04: .4byte gGroundEvents - thumb_func_end DeleteGroundEvents - - thumb_func_start FreeGroundEvents -FreeGroundEvents: - push {r4,lr} - bl DeleteGroundEvents - ldr r4, _080ADA20 - ldr r0, [r4] - bl MemoryFree - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080ADA20: .4byte gGroundEvents - thumb_func_end FreeGroundEvents - - thumb_func_start GroundEvent_Select -GroundEvent_Select: - push {r4-r7,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r7, r1, 16 - lsls r2, 24 - asrs r6, r2, 24 - ldr r1, _080ADA88 - adds r0, r4, 0 - bl GetGroundScript - adds r5, r0, 0 - ldr r1, _080ADA8C - str r6, [sp] - movs r0, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl Log - lsls r1, r7, 3 - ldr r0, [r5, 0x4] - adds r0, r1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r0, [r0, 0x4] - adds r0, r1 - ldr r5, [r0, 0x1C] - ldr r0, [r0, 0x18] - cmp r0, 0 - ble _080ADA7E - adds r4, r0, 0 -_080ADA68: - movs r0, 0x1 - negs r0, r0 - adds r1, r5, 0 - adds r2, r7, 0 - adds r3, r6, 0 - bl GroundEvent_Add - subs r4, 0x1 - adds r5, 0xC - cmp r4, 0 - bne _080ADA68 -_080ADA7E: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ADA88: .4byte gUnknown_81187DC -_080ADA8C: .4byte gGroundEventSelectText - thumb_func_end GroundEvent_Select - - thumb_func_start GroundEvent_Cancel -GroundEvent_Cancel: - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 24 - asrs r5, r1, 24 - ldr r1, _080ADAF8 - movs r0, 0 - adds r2, r7, 0 - adds r3, r5, 0 - bl Log - movs r1, 0 - ldr r0, _080ADAFC - ldr r4, [r0] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - movs r6, 0x80 - lsls r6, 9 -_080ADABA: - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, r8 - beq _080ADADC - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r0, r7 - bne _080ADADC - cmp r5, 0 - blt _080ADAD6 - movs r0, 0x6 - ldrsb r0, [r4, r0] - cmp r0, r5 - bne _080ADADC -_080ADAD6: - adds r0, r1, 0 - bl GroundEvent_Delete -_080ADADC: - adds r0, r6, 0 - movs r1, 0x80 - lsls r1, 9 - adds r6, r1 - asrs r1, r0, 16 - adds r4, 0x20 - cmp r1, 0x1F - ble _080ADABA - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ADAF8: .4byte gGroundEventCancelText -_080ADAFC: .4byte gGroundEvents - thumb_func_end GroundEvent_Cancel - thumb_func_start GroundEvent_Add GroundEvent_Add: push {r4-r7,lr} diff --git a/asm/ground_lives.s b/asm/ground_lives.s index 2b94740ca..6cf22d761 100644 --- a/asm/ground_lives.s +++ b/asm/ground_lives.s @@ -5,271 +5,6 @@ .text - thumb_func_start AllocGroundLives -AllocGroundLives: - push {r4,r5,lr} - ldr r4, _080A7860 - movs r0, 0xCE - lsls r0, 2 - movs r1, 0x6 - bl MemoryAlloc - str r0, [r4] - ldr r4, _080A7864 - movs r0, 0xBA - lsls r0, 6 - movs r1, 0x6 - bl MemoryAlloc - str r0, [r4] - adds r1, r0, 0 - ldr r0, _080A7868 - adds r5, r0, 0 - movs r4, 0xF8 - lsls r4, 1 - movs r2, 0x80 - lsls r2, 9 - adds r3, r2, 0 -_080A7826: - ldrh r0, [r1, 0x2] - orrs r0, r5 - strh r0, [r1, 0x2] - adds r0, r2, 0 - adds r2, r3 - asrs r0, 16 - adds r1, r4 - cmp r0, 0x17 - ble _080A7826 - ldr r4, _080A7860 - ldr r1, [r4] - movs r0, 0xCB - lsls r0, 2 - adds r1, r0 - movs r0, 0 - movs r2, 0x19 - bl GetFunctionScript - ldr r0, [r4] - movs r1, 0xCC - lsls r1, 2 - adds r0, r1 - movs r1, 0x1 - strh r1, [r0] - bl DeleteGroundLives - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080A7860: .4byte gGroundLivesMeta -_080A7864: .4byte gGroundLives -_080A7868: .4byte 0x0000ffff - thumb_func_end AllocGroundLives - - thumb_func_start DeleteGroundLives -DeleteGroundLives: - push {r4-r6,lr} - ldr r0, _080A78E8 - ldr r4, [r0] - movs r1, 0 - movs r6, 0x1 - negs r6, r6 - movs r5, 0x80 - lsls r5, 9 -_080A787C: - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, r6 - beq _080A788A - adds r0, r1, 0 - bl GroundLives_Delete -_080A788A: - adds r0, r5, 0 - movs r1, 0x80 - lsls r1, 9 - adds r5, r1 - asrs r1, r0, 16 - movs r2, 0xF8 - lsls r2, 1 - adds r4, r2 - cmp r1, 0x17 - ble _080A787C - ldr r3, _080A78EC - ldr r0, [r3] - movs r2, 0x1 - negs r2, r2 - str r2, [r0, 0x24] - adds r0, 0x28 - movs r1, 0xFF - strb r1, [r0] - movs r5, 0 - movs r4, 0 - movs r1, 0x2 -_080A78B4: - ldr r0, [r3] - adds r0, r4 - str r2, [r0, 0x8] - str r5, [r0] - str r5, [r0, 0x4] - adds r4, 0xC - subs r1, 0x1 - cmp r1, 0 - bge _080A78B4 - ldr r4, _080A78EC - movs r2, 0 - movs r3, 0x2C - movs r1, 0x3F -_080A78CE: - ldr r0, [r4] - adds r0, r3 - str r2, [r0] - str r2, [r0, 0x4] - str r2, [r0, 0x8] - adds r3, 0xC - subs r1, 0x1 - cmp r1, 0 - bge _080A78CE - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080A78E8: .4byte gGroundLives -_080A78EC: .4byte gGroundLivesMeta - thumb_func_end DeleteGroundLives - - thumb_func_start FreeGroundLives -FreeGroundLives: - push {r4,r5,lr} - bl DeleteGroundLives - ldr r4, _080A7914 - ldr r0, [r4] - bl MemoryFree - movs r5, 0 - str r5, [r4] - ldr r4, _080A7918 - ldr r0, [r4] - bl MemoryFree - str r5, [r4] - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080A7914: .4byte gGroundLives -_080A7918: .4byte gGroundLivesMeta - thumb_func_end FreeGroundLives - - thumb_func_start GroundLives_Select -GroundLives_Select: - push {r4-r7,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r7, r1, 16 - lsls r2, 24 - asrs r6, r2, 24 - ldr r1, _080A7980 - adds r0, r4, 0 - bl GetGroundScript - adds r5, r0, 0 - ldr r1, _080A7984 - str r6, [sp] - movs r0, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl Log - lsls r1, r7, 3 - ldr r0, [r5, 0x4] - adds r0, r1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r0, [r0, 0x4] - adds r0, r1 - ldr r5, [r0, 0x4] - ldr r0, [r0] - cmp r0, 0 - ble _080A7976 - adds r4, r0, 0 -_080A7960: - movs r0, 0x1 - negs r0, r0 - adds r1, r5, 0 - adds r2, r7, 0 - adds r3, r6, 0 - bl GroundLives_Add - subs r4, 0x1 - adds r5, 0x18 - cmp r4, 0 - bne _080A7960 -_080A7976: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080A7980: .4byte gUnknown_811808C -_080A7984: .4byte gUnknown_8118098 - thumb_func_end GroundLives_Select - - thumb_func_start GroundLives_Cancel -GroundLives_Cancel: - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 24 - asrs r5, r1, 24 - ldr r1, _080A79F4 - movs r0, 0 - adds r2, r7, 0 - adds r3, r5, 0 - bl Log - movs r1, 0 - ldr r0, _080A79F8 - ldr r4, [r0] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - movs r6, 0x80 - lsls r6, 9 -_080A79B2: - movs r2, 0x2 - ldrsh r0, [r4, r2] - cmp r0, r8 - beq _080A79D4 - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r0, r7 - bne _080A79D4 - cmp r5, 0 - blt _080A79CE - movs r0, 0x6 - ldrsb r0, [r4, r0] - cmp r0, r5 - bne _080A79D4 -_080A79CE: - adds r0, r1, 0 - bl GroundLives_Delete -_080A79D4: - adds r0, r6, 0 - movs r1, 0x80 - lsls r1, 9 - adds r6, r1 - asrs r1, r0, 16 - movs r2, 0xF8 - lsls r2, 1 - adds r4, r2 - cmp r1, 0x17 - ble _080A79B2 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080A79F4: .4byte gUnknown_81180BC -_080A79F8: .4byte gGroundLives - thumb_func_end GroundLives_Cancel - thumb_func_start GroundLives_CancelBlank_1 GroundLives_CancelBlank_1: push {r4-r7,lr} diff --git a/asm/ground_map_1.s b/asm/ground_map_1.s index e25073566..a0dab581d 100644 --- a/asm/ground_map_1.s +++ b/asm/ground_map_1.s @@ -1542,706 +1542,4 @@ _080A592C: bx r1 thumb_func_end sub_80A58C8 - thumb_func_start sub_80A5934 -sub_80A5934: - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, _080A5958 - ldr r0, [r0] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80A4660 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_080A5958: .4byte gGroundMapDungeon_3001B70 - thumb_func_end sub_80A5934 - - thumb_func_start sub_80A595C -sub_80A595C: - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - adds r3, r2, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, _080A5980 - ldr r0, [r0] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80A46C0 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .align 2, 0 -_080A5980: .4byte gGroundMapDungeon_3001B70 - thumb_func_end sub_80A595C - - thumb_func_start sub_80A5984 -sub_80A5984: - push {lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, _080A599C - ldr r0, [r0] - adds r1, r3, 0 - bl sub_80A4720 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .align 2, 0 -_080A599C: .4byte gGroundMapDungeon_3001B70 - thumb_func_end sub_80A5984 - - thumb_func_start sub_80A59A0 -sub_80A59A0: - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - lsls r3, r2, 16 - lsrs r3, 16 - ldr r0, _080A59BC - ldr r0, [r0] - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_80A4740 - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080A59BC: .4byte gGroundMapDungeon_3001B70 - thumb_func_end sub_80A59A0 - - thumb_func_start GroundMap_Action -GroundMap_Action: - push {lr} - bl nullsub_123 - ldr r0, _080A59D4 - ldr r0, [r0] - ldr r1, _080A59D8 - bl HandleAction - pop {r0} - bx r0 - .align 2, 0 -_080A59D4: .4byte gGroundMapAction -_080A59D8: .4byte gUnknown_8117770 - thumb_func_end GroundMap_Action - - thumb_func_start sub_80A59DC -sub_80A59DC: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x58 - ldr r7, _080A5A34 - ldr r0, [r7] - cmp r0, 0 - bne _080A59F0 - b _080A5E5A -_080A59F0: - mov r9, sp - mov r0, sp - bl sub_809D248 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _080A5A04 - str r0, [sp] - str r0, [sp, 0x4] -_080A5A04: - ldr r0, _080A5A38 - mov r8, r0 - ldr r3, [r0] - adds r0, r3, 0 - adds r0, 0xE4 - movs r1, 0 - ldrsh r0, [r0, r1] - mov r6, r8 - cmp r0, 0xAB - bne _080A5A1A - b _080A5BBE -_080A5A1A: - cmp r0, 0xAB - bgt _080A5A46 - cmp r0, 0xA3 - bgt _080A5A3C - cmp r0, 0xA2 - bge _080A5A76 - cmp r0, 0x4 - bne _080A5A2C - b _080A5D76 -_080A5A2C: - cmp r0, 0xA1 - bne _080A5A32 - b _080A5E28 -_080A5A32: - b _080A5E46 - .align 2, 0 -_080A5A34: .4byte gGroundMapDungeon_3001B70 -_080A5A38: .4byte gGroundMapAction -_080A5A3C: - cmp r0, 0xA8 - beq _080A5AF4 - cmp r0, 0xAA - beq _080A5AF4 - b _080A5E46 -_080A5A46: - cmp r0, 0xB0 - bne _080A5A4C - b _080A5C76 -_080A5A4C: - cmp r0, 0xB0 - bgt _080A5A5E - cmp r0, 0xAE - bne _080A5A56 - b _080A5B58 -_080A5A56: - cmp r0, 0xAF - bne _080A5A5C - b _080A5BD8 -_080A5A5C: - b _080A5E46 -_080A5A5E: - cmp r0, 0xDF - beq _080A5A76 - cmp r0, 0xDF - bgt _080A5A6E - cmp r0, 0xBA - bne _080A5A6C - b _080A5D18 -_080A5A6C: - b _080A5E46 -_080A5A6E: - cmp r0, 0xE0 - bne _080A5A74 - b _080A5DDA -_080A5A74: - b _080A5E46 -_080A5A76: - ldr r3, [r6] - adds r2, r3, 0 - adds r2, 0xF4 - ldr r1, [r2] - adds r0, r1, 0x2 - str r0, [r2] - adds r4, r3, 0 - adds r4, 0xFC - cmp r0, 0 - bge _080A5A8C - adds r0, r1, 0x5 -_080A5A8C: - asrs r1, r0, 2 - ldr r0, [r4] - adds r0, r1 - str r0, [r4] - ldr r0, [r2] - movs r1, 0x3 - ands r0, r1 - str r0, [r2] - ldr r5, _080A5AF0 - ldr r0, [r5] - adds r2, r3, 0 - adds r2, 0xF8 - movs r1, 0 - bl sub_80A4580 - ldr r0, [sp] - str r0, [sp, 0x8] - ldr r0, [r6] - adds r0, 0xFC - ldr r1, [sp, 0x4] - ldr r0, [r0] - adds r1, r0 - add r4, sp, 0x8 - str r1, [r4, 0x4] - ldr r0, [r5] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r5] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A456C - ldr r0, [sp] - str r0, [sp, 0x8] - ldr r0, [r6] - adds r0, 0xFC - ldr r1, [sp, 0x4] - ldr r0, [r0] - subs r1, r0 - str r1, [r4, 0x4] - ldr r0, [r5] - movs r1, 0x1 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r5] - b _080A5DD0 - .align 2, 0 -_080A5AF0: .4byte gGroundMapDungeon_3001B70 -_080A5AF4: - ldr r2, [r6] - adds r3, r2, 0 - adds r3, 0xF0 - adds r0, r2, 0 - adds r0, 0xE8 - ldr r1, [r3] - ldr r0, [r0] - adds r1, r0 - str r1, [r3] - adds r2, 0xF8 - cmp r1, 0 - bge _080A5B0E - adds r1, 0x7 -_080A5B0E: - asrs r1, 3 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - ldr r1, [r3] - adds r0, r1, 0 - cmp r1, 0 - bge _080A5B20 - adds r0, r1, 0x7 -_080A5B20: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - str r0, [r3] - ldr r5, _080A5B54 - ldr r0, [r5] - movs r1, 0 - bl sub_80A4580 - ldr r0, [r6] - adds r0, 0xF8 - ldr r1, [sp] - ldr r0, [r0] - adds r1, r0 - str r1, [sp, 0x10] - ldr r0, [sp, 0x4] - add r4, sp, 0x10 - str r0, [r4, 0x4] - ldr r0, [r5] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r5] - movs r1, 0 - b _080A5DD2 - .align 2, 0 -_080A5B54: .4byte gGroundMapDungeon_3001B70 -_080A5B58: - adds r4, r3, 0 - adds r4, 0xF0 - adds r0, r3, 0 - adds r0, 0xE8 - ldr r1, [r4] - ldr r0, [r0] - adds r1, r0 - str r1, [r4] - adds r2, r3, 0 - adds r2, 0xF8 - cmp r1, 0 - bge _080A5B72 - adds r1, 0x7 -_080A5B72: - asrs r1, 3 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - ldr r1, [r4] - adds r0, r1, 0 - cmp r1, 0 - bge _080A5B84 - adds r0, r1, 0x7 -_080A5B84: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - str r0, [r4] - ldr r0, [r7] - movs r1, 0 - bl sub_80A4580 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xF8 - ldr r1, [sp] - ldr r0, [r0] - adds r1, r0 - str r1, [sp, 0x18] - ldr r0, [sp, 0x4] - add r4, sp, 0x18 - str r0, [r4, 0x4] - ldr r0, [r7] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r7] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A456C - b _080A5DCE -_080A5BBE: - ldr r0, [sp] - ldr r1, [sp, 0x4] - str r0, [sp, 0x20] - str r1, [sp, 0x24] - ldr r0, [r7] - add r4, sp, 0x20 - movs r1, 0 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r7] - movs r1, 0 - b _080A5DD2 -_080A5BD8: - ldr r0, [r7] - movs r1, 0 - mov r2, sp - bl sub_80A456C - mov r0, r8 - ldr r3, [r0] - adds r4, r3, 0 - adds r4, 0xF0 - adds r1, r3, 0 - adds r1, 0xE8 - ldr r0, [r4] - ldr r1, [r1] - adds r0, r1 - str r0, [r4] - adds r5, r3, 0 - adds r5, 0xF4 - adds r1, r3, 0 - adds r1, 0xEC - ldr r0, [r5] - ldr r1, [r1] - adds r0, r1 - str r0, [r5] - adds r2, r3, 0 - adds r2, 0xF8 - ldr r1, [r4] - cmp r1, 0 - bge _080A5C12 - adds r1, 0x7 -_080A5C12: - asrs r1, 3 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - adds r3, 0xFC - ldr r1, [r5] - cmp r1, 0 - bge _080A5C24 - adds r1, 0x7 -_080A5C24: - asrs r1, 3 - ldr r0, [r3] - adds r0, r1 - str r0, [r3] - ldr r1, [r4] - adds r0, r1, 0 - cmp r1, 0 - bge _080A5C36 - adds r0, r1, 0x7 -_080A5C36: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - str r0, [r4] - ldr r1, [r5] - adds r0, r1, 0 - cmp r1, 0 - bge _080A5C48 - adds r0, r1, 0x7 -_080A5C48: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - str r0, [r5] - ldr r0, [r7] - movs r1, 0 - bl sub_80A4580 - mov r1, r8 - ldr r2, [r1] - adds r1, r2, 0 - adds r1, 0xF8 - ldr r0, [sp] - ldr r1, [r1] - adds r0, r1 - str r0, [sp, 0x28] - adds r2, 0xFC - mov r1, r9 - ldr r0, [r1, 0x4] - ldr r1, [r2] - adds r0, r1 - add r4, sp, 0x28 - b _080A5DC2 -_080A5C76: - adds r4, r3, 0 - adds r4, 0xF0 - adds r1, r3, 0 - adds r1, 0xE8 - ldr r0, [r4] - ldr r1, [r1] - adds r0, r1 - str r0, [r4] - adds r5, r3, 0 - adds r5, 0xF4 - adds r1, r3, 0 - adds r1, 0xEC - ldr r0, [r5] - ldr r1, [r1] - adds r0, r1 - str r0, [r5] - adds r6, r3, 0 - adds r6, 0xF8 - ldr r1, [r4] - cmp r1, 0 - bge _080A5CA2 - adds r1, 0x7 -_080A5CA2: - asrs r1, 3 - ldr r0, [r6] - adds r0, r1 - str r0, [r6] - adds r2, r3, 0 - adds r2, 0xFC - ldr r1, [r5] - cmp r1, 0 - bge _080A5CB6 - adds r1, 0x7 -_080A5CB6: - asrs r1, 3 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - ldr r1, [r4] - adds r0, r1, 0 - cmp r1, 0 - bge _080A5CC8 - adds r0, r1, 0x7 -_080A5CC8: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - str r0, [r4] - ldr r1, [r5] - adds r0, r1, 0 - cmp r1, 0 - bge _080A5CDA - adds r0, r1, 0x7 -_080A5CDA: - asrs r0, 3 - lsls r0, 3 - subs r0, r1, r0 - str r0, [r5] - ldr r0, [r7] - movs r1, 0 - adds r2, r6, 0 - bl sub_80A4580 - mov r0, r8 - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0xF8 - ldr r0, [sp] - ldr r1, [r1] - adds r0, r1 - str r0, [sp, 0x30] - adds r2, 0xFC - ldr r0, [sp, 0x4] - ldr r1, [r2] - adds r0, r1 - add r4, sp, 0x30 - str r0, [r4, 0x4] - ldr r0, [r7] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r7] - movs r1, 0 - b _080A5DD2 -_080A5D18: - ldr r0, [r7] - movs r1, 0x1 - mov r2, sp - bl sub_80A456C - mov r0, r8 - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0xF0 - ldr r4, [r3] - adds r0, r4, 0x1 - str r0, [r3] - adds r2, r1, 0 - adds r2, 0xF8 - cmp r0, 0 - bge _080A5D3A - adds r0, r4, 0x4 -_080A5D3A: - asrs r1, r0, 2 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - ldr r0, [r3] - movs r1, 0x3 - ands r0, r1 - str r0, [r3] - ldr r0, [r7] - movs r1, 0x1 - bl sub_80A4580 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xF8 - ldr r1, [sp] - ldr r0, [r0] - adds r1, r0 - str r1, [sp, 0x38] - ldr r0, [sp, 0x4] - add r4, sp, 0x38 - str r0, [r4, 0x4] - ldr r0, [r7] - movs r1, 0 - adds r2, r4, 0 - bl sub_80A4580 - ldr r0, [r7] - movs r1, 0 - b _080A5DD2 -_080A5D76: - ldr r0, [r7] - movs r1, 0 - mov r2, sp - bl sub_80A456C - mov r0, r8 - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0xF0 - ldr r4, [r3] - adds r0, r4, 0x1 - str r0, [r3] - adds r2, r1, 0 - adds r2, 0xF8 - cmp r0, 0 - bge _080A5D98 - adds r0, 0x7 -_080A5D98: - asrs r1, r0, 3 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - ldr r0, [r3] - movs r1, 0x7 - ands r0, r1 - str r0, [r3] - ldr r0, [r7] - movs r1, 0x1 - bl sub_80A4580 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xF8 - ldr r1, [sp] - ldr r0, [r0] - adds r1, r0 - str r1, [sp, 0x40] - ldr r0, [sp, 0x4] - add r4, sp, 0x40 -_080A5DC2: - str r0, [r4, 0x4] - ldr r0, [r7] - movs r1, 0x1 - adds r2, r4, 0 - bl sub_80A4580 -_080A5DCE: - ldr r0, [r7] -_080A5DD0: - movs r1, 0x1 -_080A5DD2: - adds r2, r4, 0 - bl sub_80A456C - b _080A5E52 -_080A5DDA: - ldr r0, [r7] - movs r1, 0 - mov r2, sp - bl sub_80A456C - mov r0, r8 - ldr r1, [r0] - adds r3, r1, 0 - adds r3, 0xF0 - ldr r4, [r3] - adds r0, r4, 0x1 - str r0, [r3] - adds r2, r1, 0 - adds r2, 0xF8 - cmp r0, 0 - bge _080A5DFC - adds r0, 0x7 -_080A5DFC: - asrs r1, r0, 3 - ldr r0, [r2] - adds r0, r1 - str r0, [r2] - ldr r0, [r3] - movs r1, 0x7 - ands r0, r1 - str r0, [r3] - ldr r0, [r7] - movs r1, 0x1 - bl sub_80A4580 - mov r1, r8 - ldr r0, [r1] - adds r0, 0xF8 - ldr r0, [r0] - str r0, [sp, 0x48] - ldr r0, [sp, 0x4] - add r2, sp, 0x48 - str r0, [r2, 0x4] - ldr r0, [r7] - b _080A5E3E -_080A5E28: - ldr r0, [r7] - movs r1, 0 - mov r2, sp - bl sub_80A456C - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x50] - str r1, [sp, 0x54] - ldr r0, [r7] - add r2, sp, 0x50 -_080A5E3E: - movs r1, 0x1 - bl sub_80A456C - b _080A5E52 -_080A5E46: - ldr r0, _080A5E6C - ldr r0, [r0] - movs r1, 0 - mov r2, sp - bl sub_80A456C -_080A5E52: - ldr r0, _080A5E6C - ldr r0, [r0] - bl sub_80A4764 -_080A5E5A: - bl sub_80A60D8 - add sp, 0x58 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080A5E6C: .4byte gGroundMapDungeon_3001B70 - thumb_func_end sub_80A59DC - .align 2,0 diff --git a/asm/ground_object.s b/asm/ground_object.s index a29dfb014..127ae7d22 100644 --- a/asm/ground_object.s +++ b/asm/ground_object.s @@ -5,308 +5,6 @@ .text - thumb_func_start AllocGroundObjects -AllocGroundObjects: - push {r4,r5,lr} - ldr r4, _080ABB90 - movs r0, 0xE2 - lsls r0, 5 - movs r1, 0x6 - bl MemoryAlloc - str r0, [r4] - adds r1, r0, 0 - ldr r0, _080ABB94 - adds r5, r0, 0 - movs r4, 0xE2 - lsls r4, 1 - movs r2, 0x80 - lsls r2, 9 - adds r3, r2, 0 -_080ABB74: - ldrh r0, [r1, 0x6] - orrs r0, r5 - strh r0, [r1, 0x6] - adds r0, r2, 0 - adds r2, r3 - asrs r0, 16 - adds r1, r4 - cmp r0, 0xF - ble _080ABB74 - bl DeleteGroundObjects - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_080ABB90: .4byte gGroundObjects -_080ABB94: .4byte 0x0000ffff - thumb_func_end AllocGroundObjects - - thumb_func_start DeleteGroundObjects -DeleteGroundObjects: - push {r4-r6,lr} - ldr r0, _080ABBD0 - ldr r4, [r0] - movs r1, 0 - movs r6, 0x1 - negs r6, r6 - movs r5, 0x80 - lsls r5, 9 -_080ABBA8: - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, r6 - beq _080ABBB6 - adds r0, r1, 0 - bl GroundObject_Delete -_080ABBB6: - adds r0, r5, 0 - movs r1, 0x80 - lsls r1, 9 - adds r5, r1 - asrs r1, r0, 16 - movs r2, 0xE2 - lsls r2, 1 - adds r4, r2 - cmp r1, 0xF - ble _080ABBA8 - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_080ABBD0: .4byte gGroundObjects - thumb_func_end DeleteGroundObjects - - thumb_func_start FreeGroundObjects -FreeGroundObjects: - push {r4,lr} - bl DeleteGroundObjects - ldr r4, _080ABBEC - ldr r0, [r4] - bl MemoryFree - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080ABBEC: .4byte gGroundObjects - thumb_func_end FreeGroundObjects - - thumb_func_start GroundObject_Select -GroundObject_Select: - push {r4-r7,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r4, 16 - asrs r4, 16 - lsls r1, 16 - asrs r7, r1, 16 - lsls r2, 24 - asrs r6, r2, 24 - ldr r1, _080ABC54 - adds r0, r4, 0 - bl GetGroundScript - adds r5, r0, 0 - ldr r1, _080ABC58 - str r6, [sp] - movs r0, 0 - adds r2, r4, 0 - adds r3, r7, 0 - bl Log - lsls r1, r7, 3 - ldr r0, [r5, 0x4] - adds r0, r1 - lsls r1, r6, 2 - adds r1, r6 - lsls r1, 3 - ldr r0, [r0, 0x4] - adds r0, r1 - ldr r5, [r0, 0xC] - ldr r0, [r0, 0x8] - cmp r0, 0 - ble _080ABC4A - adds r4, r0, 0 -_080ABC34: - movs r0, 0x1 - negs r0, r0 - adds r1, r5, 0 - adds r2, r7, 0 - adds r3, r6, 0 - bl GroundObject_Add - subs r4, 0x1 - adds r5, 0x18 - cmp r4, 0 - bne _080ABC34 -_080ABC4A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ABC54: .4byte gUnknown_81183E4 -_080ABC58: .4byte gUnknown_81183F0 - thumb_func_end GroundObject_Select - - thumb_func_start GroundObject_Cancel -GroundObject_Cancel: - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - asrs r7, r0, 16 - lsls r1, 24 - asrs r5, r1, 24 - ldr r1, _080ABCC4 - movs r0, 0 - adds r2, r7, 0 - bl Log - movs r1, 0 - ldr r0, _080ABCC8 - ldr r4, [r0] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - movs r6, 0x80 - lsls r6, 9 -_080ABC84: - movs r2, 0x6 - ldrsh r0, [r4, r2] - cmp r0, r8 - beq _080ABCA6 - movs r2, 0x8 - ldrsh r0, [r4, r2] - cmp r0, r7 - bne _080ABCA6 - cmp r5, 0 - blt _080ABCA0 - movs r0, 0xA - ldrsb r0, [r4, r0] - cmp r0, r5 - bne _080ABCA6 -_080ABCA0: - adds r0, r1, 0 - bl GroundObject_Delete -_080ABCA6: - adds r0, r6, 0 - movs r1, 0x80 - lsls r1, 9 - adds r6, r1 - asrs r1, r0, 16 - movs r2, 0xE2 - lsls r2, 1 - adds r4, r2 - cmp r1, 0xF - ble _080ABC84 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ABCC4: .4byte gUnknown_8118414 -_080ABCC8: .4byte gGroundObjects - thumb_func_end GroundObject_Cancel - - thumb_func_start GroundObject_CancelBlank -GroundObject_CancelBlank: - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - ldr r1, _080ABD40 - movs r0, 0 - bl Log - movs r6, 0 - ldr r0, _080ABD44 - ldr r4, [r0] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - movs r1, 0x92 - lsls r1, 1 - adds r5, r4, r1 - mov r7, sp -_080ABCF0: - movs r1, 0x6 - ldrsh r0, [r4, r1] - cmp r0, r8 - beq _080ABD20 - ldr r0, [r5] - ldr r1, [r4, 0x14] - adds r0, r1 - str r0, [sp] - ldr r0, [r5, 0x4] - ldr r1, [r4, 0x18] - adds r0, r1 - str r0, [r7, 0x4] - movs r1, 0xA2 - lsls r1, 1 - adds r0, r4, r1 - mov r1, sp - bl IsOnscreen_80A675C - lsls r0, 24 - cmp r0, 0 - bne _080ABD20 - adds r0, r6, 0 - bl GroundObject_Delete -_080ABD20: - adds r0, r6, 0x1 - lsls r0, 16 - asrs r6, r0, 16 - movs r0, 0xE2 - lsls r0, 1 - adds r5, r0 - adds r4, r0 - cmp r6, 0xF - ble _080ABCF0 - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_080ABD40: .4byte gUnknown_811842C -_080ABD44: .4byte gGroundObjects - thumb_func_end GroundObject_CancelBlank - - thumb_func_start sub_80ABD48 -sub_80ABD48: - push {r4-r7,lr} - lsls r0, 16 - asrs r4, r0, 16 - movs r3, 0 - ldr r0, _080ABD6C - ldr r1, [r0] - movs r6, 0xE2 - lsls r6, 1 - movs r2, 0x80 - lsls r2, 9 - adds r5, r2, 0 -_080ABD5E: - movs r7, 0x6 - ldrsh r0, [r1, r7] - cmp r0, r4 - bne _080ABD70 - adds r0, r3, 0 - b _080ABD80 - .align 2, 0 -_080ABD6C: .4byte gGroundObjects -_080ABD70: - adds r0, r2, 0 - adds r2, r5 - asrs r3, r0, 16 - adds r1, r6 - cmp r3, 0xF - ble _080ABD5E - movs r0, 0x1 - negs r0, r0 -_080ABD80: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80ABD48 - thumb_func_start GroundObject_Add GroundObject_Add: push {r4-r7,lr} diff --git a/data/data.s b/data/data.s index 30c0fdce9..5e438e6bd 100644 --- a/data/data.s +++ b/data/data.s @@ -1,588 +1,6 @@ .section .rodata .align 2, 0 -@ event_flag.c -.string "pksdir0\0" - - .align 2, 0 - .global gLocalScriptVarInfo -gLocalScriptVarInfo: - .2byte 5, 7, 0, 0, 1, 0; .4byte gUnknown_80B6D88 - .2byte 5, 7, 2, 0, 1, 0; .4byte gUnknown_80B6D80 - .2byte 5, 7, 4, 0, 1, 0; .4byte gUnknown_80B6D78 - .2byte 5, 7, 6, 0, 1, 0; .4byte gUnknown_80B6D70 - -gUnknown_80B6D70: - .string "LOCAL3\0" - .align 2, 0 - -gUnknown_80B6D78: - .string "LOCAL2\0" - .align 2, 0 - -gUnknown_80B6D80: - .string "LOCAL1\0" - .align 2, 0 - -gUnknown_80B6D88: - .string "LOCAL0\0" - .align 2, 0 - - .global gUnknown_80B6D90 -gUnknown_80B6D90: @ 80B6D90 - .4byte gUnknown_80B7144 - .byte 0x00, 0x00, 0x00, 0x00 - .4byte gUnknown_80B713C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7134 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B712C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7124 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B711C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7114 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B710C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7104 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70FC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70F4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70EC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70E4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70DC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70D4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70CC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70C4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70BC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70B4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70AC - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B70A4 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B709C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7094 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B708C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7084 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B707C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7074 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B706C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7064 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B705C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7054 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B704C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7044 - .byte 0x02, 0x00, 0x00, 0x00 - .4byte gUnknown_80B703C - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B7034 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B702C - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7024 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B701C - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7014 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B700C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B7004 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FFC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FF4 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FEC - .byte 0x02, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FE4 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FDC - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FD4 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FCC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FC4 - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FBC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FB4 - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FAC - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6FA4 - .byte 0x03, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F9C - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F94 - .byte 0x01, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F8C - .byte 0x02, 0x00, 0x00, 0x00 - .4byte gUnknown_80B6F84 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B6F78 - .byte 0xff, 0xff, 0xff, 0xff - .4byte gUnknown_80B6F68 - .byte 0xff, 0xff, 0xff, 0xff - - .global gUnknown_80B6F68 - gUnknown_80B6F68: - .string "DEBUG GROUND\0" - .align 2,0 - .global gUnknown_80B6F78 - gUnknown_80B6F78: - .string "NEXT DAY\0" - .align 2,0 - .global gUnknown_80B6F84 - gUnknown_80B6F84: - .string "R00E01A\0" - .align 2,0 - .global gUnknown_80B6F8C - gUnknown_80B6F8C: - .string "S09E01C\0" - .align 2,0 - .global gUnknown_80B6F94 - gUnknown_80B6F94: - .string "S09E01B\0" - .align 2,0 - .global gUnknown_80B6F9C - gUnknown_80B6F9C: - .string "S09E01A\0" - .align 2,0 - .global gUnknown_80B6FA4 - gUnknown_80B6FA4: - .string "S08E01B\0" - .align 2,0 - .global gUnknown_80B6FAC - gUnknown_80B6FAC: - .string "S08E01A\0" - .align 2,0 - .global gUnknown_80B6FB4 - gUnknown_80B6FB4: - .string "S07E01B\0" - .align 2,0 - .global gUnknown_80B6FBC - gUnknown_80B6FBC: - .string "S07E01A\0" - .align 2,0 - .global gUnknown_80B6FC4 - gUnknown_80B6FC4: - .string "S06E01C\0" - .align 2,0 - .global gUnknown_80B6FCC - gUnknown_80B6FCC: - .string "S06E01B\0" - .align 2,0 - .global gUnknown_80B6FD4 - gUnknown_80B6FD4: - .string "S06E01A\0" - .align 2,0 - .global gUnknown_80B6FDC - gUnknown_80B6FDC: - .string "S05E01B\0" - .align 2,0 - .global gUnknown_80B6FE4 - gUnknown_80B6FE4: - .string "S05E01A\0" - .align 2,0 - .global gUnknown_80B6FEC - gUnknown_80B6FEC: - .string "S04E01F\0" - .align 2,0 - .global gUnknown_80B6FF4 - gUnknown_80B6FF4: - .string "S04E01E\0" - .align 2,0 - .global gUnknown_80B6FFC - gUnknown_80B6FFC: - .string "S04E01D\0" - .align 2,0 - .global gUnknown_80B7004 - gUnknown_80B7004: - .string "S04E01C\0" - .align 2,0 - .global gUnknown_80B700C - gUnknown_80B700C: - .string "S04E01B\0" - .align 2,0 - .global gUnknown_80B7014 - gUnknown_80B7014: - .string "S04E01A\0" - .align 2,0 - .global gUnknown_80B701C - gUnknown_80B701C: - .string "S03E01B\0" - .align 2,0 - .global gUnknown_80B7024 - gUnknown_80B7024: - .string "S03E01A\0" - .align 2,0 - .global gUnknown_80B702C - gUnknown_80B702C: - .string "S02E02B\0" - .align 2,0 - .global gUnknown_80B7034 - gUnknown_80B7034: - .string "S02E02A\0" - .align 2,0 - .global gUnknown_80B703C - gUnknown_80B703C: - .string "S02E01A\0" - .align 2,0 - .global gUnknown_80B7044 - gUnknown_80B7044: - .string "S01E02B\0" - .align 2,0 - .global gUnknown_80B704C - gUnknown_80B704C: - .string "S01E02A\0" - .align 2,0 - .global gUnknown_80B7054 - gUnknown_80B7054: - .string "S01E01B\0" - .align 2,0 - .global gUnknown_80B705C - gUnknown_80B705C: - .string "S01E01A\0" - .align 2,0 - .global gUnknown_80B7064 - gUnknown_80B7064: - .string "S00E01A\0" - .align 2,0 - .global gUnknown_80B706C - gUnknown_80B706C: - .string "M02END\0" - .align 2,0 - .global gUnknown_80B7074 - gUnknown_80B7074: - .string "M02E02H\0" - .align 2,0 - .global gUnknown_80B707C - gUnknown_80B707C: - .string "M02E02G\0" - .align 2,0 - .global gUnknown_80B7084 - gUnknown_80B7084: - .string "M02E02F\0" - .align 2,0 - .global gUnknown_80B708C - gUnknown_80B708C: - .string "M02E02E\0" - .align 2,0 - .global gUnknown_80B7094 - gUnknown_80B7094: - .string "M02E02D\0" - .align 2,0 - .global gUnknown_80B709C - gUnknown_80B709C: - .string "M02E02C\0" - .align 2,0 - .global gUnknown_80B70A4 - gUnknown_80B70A4: - .string "M02E02B\0" - .align 2,0 - .global gUnknown_80B70AC - gUnknown_80B70AC: - .string "M02E02A\0" - .align 2,0 - .global gUnknown_80B70B4 - gUnknown_80B70B4: - .string "M02E01A\0" - .align 2,0 - .global gUnknown_80B70BC - gUnknown_80B70BC: - .string "M01END\0" - .align 2,0 - .global gUnknown_80B70C4 - gUnknown_80B70C4: - .string "M01E10A\0" - .align 2,0 - .global gUnknown_80B70CC - gUnknown_80B70CC: - .string "M01E09A\0" - .align 2,0 - .global gUnknown_80B70D4 - gUnknown_80B70D4: - .string "M01E08B\0" - .align 2,0 - .global gUnknown_80B70DC - gUnknown_80B70DC: - .string "M01E08A\0" - .align 2,0 - .global gUnknown_80B70E4 - gUnknown_80B70E4: - .string "M01E07B\0" - .align 2,0 - .global gUnknown_80B70EC - gUnknown_80B70EC: - .string "M01E07A\0" - .align 2,0 - .global gUnknown_80B70F4 - gUnknown_80B70F4: - .string "M01E06A\0" - .align 2,0 - .global gUnknown_80B70FC - gUnknown_80B70FC: - .string "M01E05B\0" - .align 2,0 - .global gUnknown_80B7104 - gUnknown_80B7104: - .string "M01E05A\0" - .align 2,0 - .global gUnknown_80B710C - gUnknown_80B710C: - .string "M01E04B\0" - .align 2,0 - .global gUnknown_80B7114 - gUnknown_80B7114: - .string "M01E04A\0" - .align 2,0 - .global gUnknown_80B711C - gUnknown_80B711C: - .string "M01E03A\0" - .align 2,0 - .global gUnknown_80B7124 - gUnknown_80B7124: - .string "M01E02B\0" - .align 2,0 - .global gUnknown_80B712C - gUnknown_80B712C: - .string "M01E02A\0" - .align 2,0 - .global gUnknown_80B7134 - gUnknown_80B7134: - .string "M01E01A\0" - .align 2,0 - .global gUnknown_80B713C - gUnknown_80B713C: - .string "M00E01A\0" - .align 2,0 - - .global gUnknown_80B7144 -gUnknown_80B7144: @ 80B7144 - .string "NONE\0" - .align 2,0 - - .global gUnknown_80B714C -gUnknown_80B714C: @ 80B714C - .4byte TwoOneText - .4byte TwoOneText - .4byte OneTwoSevenText - .4byte FourText - .4byte FiveText - .4byte SixText - .4byte TwoTwoEightText - .4byte ThreeText - .4byte NineText - .4byte EndText - - .global EndText - EndText: - .string "END\0" - - .global NineText - NineText: - .string "9\0" - .align 2,0 - - .global ThreeText - ThreeText: - .string "3\0" - .align 2,0 - - .global TwoTwoEightText - TwoTwoEightText: - .string "2-2 8\0" - .align 2,0 - - .global SixText - SixText: - .string "6\0" - .align 2,0 - - .global FiveText - FiveText: - .string "5\0" - .align 2,0 - - .global FourText - FourText: - .string "4\0" - .align 2,0 - - .global OneTwoSevenText - OneTwoSevenText: - .string "1-2 7\0" - .align 2,0 - - .global TwoOneText - TwoOneText: - .string "2-1\0" - .align 2,0 - - .global gUnknown_80B71A0 -gUnknown_80B71A0: @ 80B71A0 - .4byte CISTART_text - .4byte CECONTINUE_text - .4byte CNLAST_text - .4byte CWEND_text - - .global CWEND_text - CWEND_text: - .string "{COLOR RED_W}END{RESET}\0" - .align 2,0 - - .global CNLAST_text - CNLAST_text: - .string "{COLOR YELLOW_N}LAST{RESET}\0" - .align 2,0 - - .global CECONTINUE_text - CECONTINUE_text: - .string "{COLOR GENDER_COLOR}CONTINUE{RESET}\0" - .align 2,0 - - .global CISTART_text - CISTART_text: - .string "{COLOR GREEN_I}START{RESET}\0" - .align 2,0 - - .global gGroundEnterLookupTable -gGroundEnterLookupTable: @ 80B71E4 - @ [struct unkEventStruct] - .2byte 105, 1 - .2byte 106, 2 - .2byte 107, 3 - .2byte 108, 4 - .2byte 109, 5 - .2byte 110, 6 - .2byte 111, 7 - .2byte 112, 8 - .2byte 113, 9 - .2byte 114, 10 - .2byte 115, 11 - .2byte 116, 12 - .2byte 117, 13 - .2byte 118, 14 - .2byte 119, 15 - .2byte 120, 16 - .2byte 121, 17 - .2byte 122, 18 - .2byte 123, 19 - .2byte 124, 20 - .2byte 125, 21 - .2byte 126, 22 - .2byte 127, 23 - .2byte 128, 24 - .2byte 129, 25 - .2byte 130, 26 - .2byte 131, 27 - .2byte 132, 28 - .2byte 133, 29 - .2byte 134, 30 - .2byte 135, 31 - .2byte 136, 32 - .2byte 137, 33 - .2byte 138, 34 - .2byte 139, 35 - .2byte 140, 36 - .2byte 141, 37 - .2byte 142, 38 - .2byte 143, 39 - .2byte 144, 40 - .2byte 145, 41 - .2byte 146, 42 - .2byte 147, 43 - .2byte 148, 44 - .2byte 149, 45 - .2byte 150, 46 - .2byte 151, 47 - .2byte 152, 48 - .2byte 153, 49 - .2byte 154, 50 - .2byte 155, 51 - .2byte 156, 52 - .2byte 157, 53 - .2byte 158, 54 - .2byte 159, 55 - .2byte 160, 56 - .2byte 161, 57 - .2byte -1, 0 - - .global gUnknown_80B72CC -gUnknown_80B72CC: @ 80B72CC - .string "SCENARIO CALC [%3d] %4d %4d -> %4d %4d\0" - .align 2,0 - - .global EventFlagFile_Text - EventFlagFile_Text: - .string "../main/event_flag.c\0" - .align 2,0 - - .global FlagCalc_Text - FlagCalc_Text: - .string "_FlagCalc\0" - .align 2,0 - - .global gUnknown_80B7318 -gUnknown_80B7318: @ 80B7318 - .4byte EventFlagFile_Text - .byte 0x51, 0x05, 0x00, 0x00 - .4byte FlagCalc_Text - - .global gUnknown_80B7324 -gUnknown_80B7324: @ 80B7324 - .string "event flag expansion error %d\0" - .align 2,0 - - .global FlagJudge_Text - FlagJudge_Text: - .string "_FlagJudge\0" - .align 2,0 - - .global gUnknown_80B7350 -gUnknown_80B7350: @ 80B7350 - .4byte EventFlagFile_Text - .byte 0x7C, 0x05, 0x00, 0x00 - .4byte FlagJudge_Text - - .global gUnknown_80B735C -gUnknown_80B735C: @ 80B735C - .string "event flag rule error %d\0" - .align 2,0 - - .global gUnknown_80B7378 -gUnknown_80B7378: @ 80B7378 - .string "error number\0" - .align 2,0 - - .global gUnknown_80B7388 -gUnknown_80B7388: @ 80B7388 - .string "1-1\0" @ code.c .string "pksdir0\0" @@ -1005,22 +423,3 @@ gUnknown_80B7DF8: @ ??? .string "pksdir0\0" .fill 28, 1, 0 - -@ code_8002774.s -.string "pksdir0\0" - .fill 8, 1, 0 - - .global gVectorDirections -gVectorDirections: @ R=080B7E3C | B=0208772C - .4byte 0, 1 @N - .4byte 1, 1 @NE - .4byte 1, 0 @E - .4byte 1, -1 @SE - .4byte 0, -1 @S - .4byte -1, -1 @SW - .4byte -1, 0 @W - .4byte -1, 1 @NW - -@ ??? -.string "pksdir0\0" - diff --git a/data/ground_sbin.s b/data/ground_sbin.s index 613b10146..c6ce864b0 100644 --- a/data/ground_sbin.s +++ b/data/ground_sbin.s @@ -1,14 +1,7 @@ .section .rodata - .global gGroundFileArchive -gGroundFileArchive: @ 9890000 -@ replacing .incbin "baserom.gba", 0x1890000, 0x5D0000 -.string "pksdir0\0" -.incbin "baserom.gba", 0x1890008, 0x4 -.4byte gUnknown_9890018 -.string "pksdir0\0" -.global gUnknown_9890018 -gUnknown_9890018: +.global gGroundFiles +gGroundFiles: .4byte gUnknown_9892C68 .4byte gUnknown_9892C78 .4byte gUnknown_9892C60 diff --git a/data/pksdir_5.s b/data/pksdir_5.s new file mode 100644 index 000000000..a3bfe01ae --- /dev/null +++ b/data/pksdir_5.s @@ -0,0 +1,9 @@ + .section .rodata + + .align 2, 0 + + +@ ??? +.string "pksdir0\0" + .align 2, 0 + diff --git a/data/titlemenu_sbin.s b/data/titlemenu_sbin.s index 423bd64ca..dabe4fc6e 100644 --- a/data/titlemenu_sbin.s +++ b/data/titlemenu_sbin.s @@ -1,125 +1,5 @@ .section .rodata - .global gTitleMenuFileArchive -gTitleMenuFileArchive: @ 8380000 -@ replacing .incbin "baserom.gba", 0x380000, 0x22E74 -.string "pksdir0\0" -.incbin "baserom.gba", 0x380008, 0x4 -.4byte gUnknown_8380018 -.string "pksdir0\0" -.global gUnknown_8380018 -gUnknown_8380018: -.4byte gUnknown_8380190 -.4byte gUnknown_83801A0 -.4byte gUnknown_8380188 -.4byte gUnknown_8380AB8 -.4byte gUnknown_838017C -.4byte gUnknown_8382884 -.4byte gUnknown_8380174 -.4byte gUnknown_8382C04 -.4byte gUnknown_838016C -.4byte gUnknown_8384914 -.4byte gUnknown_8380164 -.4byte gUnknown_8384C9C -.4byte gUnknown_8380158 -.4byte gUnknown_8388AD0 -.4byte gUnknown_8380150 -.4byte gUnknown_8388E50 -.4byte gUnknown_8380144 -.4byte gUnknown_838CF98 -.4byte gUnknown_838013C -.4byte gUnknown_838D318 -.4byte gUnknown_8380130 -.4byte gUnknown_8391C48 -.4byte gUnknown_8380128 -.4byte gUnknown_8391FC8 -.4byte gUnknown_8380120 -.4byte gUnknown_83923A0 -.4byte gUnknown_8380114 -.4byte gUnknown_8392638 -.4byte gUnknown_8380108 -.4byte gUnknown_8392B88 -.4byte gUnknown_8380100 -.4byte gUnknown_8398A9C -.4byte gUnknown_83800F8 -.4byte gUnknown_8399F84 -.4byte gUnknown_83800F0 -.4byte gUnknown_839A304 -.4byte gUnknown_83800E4 -.4byte gUnknown_839B584 -.4byte gUnknown_83800D8 -.4byte gUnknown_839B814 -.4byte gUnknown_83800D0 -.4byte gUnknown_83A1574 -.4byte gUnknown_83800C8 -.4byte gUnknown_83A2AF4 -.global gUnknown_83800C8 -gUnknown_83800C8: -.incbin "baserom.gba", 0x3800C8, 0x8 -.global gUnknown_83800D0 -gUnknown_83800D0: -.incbin "baserom.gba", 0x3800D0, 0x8 -.global gUnknown_83800D8 -gUnknown_83800D8: -.incbin "baserom.gba", 0x3800D8, 0xC -.global gUnknown_83800E4 -gUnknown_83800E4: -.incbin "baserom.gba", 0x3800E4, 0xC -.global gUnknown_83800F0 -gUnknown_83800F0: -.incbin "baserom.gba", 0x3800F0, 0x8 -.global gUnknown_83800F8 -gUnknown_83800F8: -.incbin "baserom.gba", 0x3800F8, 0x8 -.global gUnknown_8380100 -gUnknown_8380100: -.incbin "baserom.gba", 0x380100, 0x8 -.global gUnknown_8380108 -gUnknown_8380108: -.incbin "baserom.gba", 0x380108, 0xC -.global gUnknown_8380114 -gUnknown_8380114: -.incbin "baserom.gba", 0x380114, 0xC -.global gUnknown_8380120 -gUnknown_8380120: -.incbin "baserom.gba", 0x380120, 0x8 -.global gUnknown_8380128 -gUnknown_8380128: -.incbin "baserom.gba", 0x380128, 0x8 -.global gUnknown_8380130 -gUnknown_8380130: -.incbin "baserom.gba", 0x380130, 0xC -.global gUnknown_838013C -gUnknown_838013C: -.incbin "baserom.gba", 0x38013C, 0x8 -.global gUnknown_8380144 -gUnknown_8380144: -.incbin "baserom.gba", 0x380144, 0xC -.global gUnknown_8380150 -gUnknown_8380150: -.incbin "baserom.gba", 0x380150, 0x8 -.global gUnknown_8380158 -gUnknown_8380158: -.incbin "baserom.gba", 0x380158, 0xC -.global gUnknown_8380164 -gUnknown_8380164: -.incbin "baserom.gba", 0x380164, 0x8 -.global gUnknown_838016C -gUnknown_838016C: -.incbin "baserom.gba", 0x38016C, 0x8 -.global gUnknown_8380174 -gUnknown_8380174: -.incbin "baserom.gba", 0x380174, 0x8 -.global gUnknown_838017C -gUnknown_838017C: -.incbin "baserom.gba", 0x38017C, 0xC -.global gUnknown_8380188 -gUnknown_8380188: -.incbin "baserom.gba", 0x380188, 0x8 -.global gUnknown_8380190 -gUnknown_8380190: -.incbin "baserom.gba", 0x380190, 0x8 -.string "pksdir0\0" .global gUnknown_83801A0 gUnknown_83801A0: .string "SIRO" diff --git a/include/code_803C1D0.h b/include/code_803C1D0.h index 35bc31b59..d6d76a016 100644 --- a/include/code_803C1D0.h +++ b/include/code_803C1D0.h @@ -5,7 +5,7 @@ // code_803C1D0.s extern u8 sub_803C1D0(DungeonLocation *, u8); -extern u8 *sub_803C1F0(u8); +extern u8 *GetMissionRankText(u8); extern void sub_803C21C(WonderMail *, unkStruct_802F204 *); -#endif // GUARD_CODE_803C1D0_H \ No newline at end of file +#endif // GUARD_CODE_803C1D0_H diff --git a/include/dungeon_move.h b/include/dungeon_move.h index fc68e057e..8da10c6f8 100644 --- a/include/dungeon_move.h +++ b/include/dungeon_move.h @@ -22,7 +22,7 @@ extern s32 gUnknown_202F224; extern s32 gMetronomeCalledArrayId; void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, s32 itemId, bool32 isLinkedMove); -bool32 HandleRegularDamagingMove(Entity *attacker, Entity *target, Move *move, s32 itemId); +bool8 HandleRegularDamagingMove(Entity *attacker, Entity *target, Move *move, s32 itemId); s32 HandleDamagingMove(Entity *attacker, Entity *target, Move *move, s24_8 modifier, s32 itemId); s32 sub_80556BC(Entity *attacker, Entity *target, u8 moveType, Move *move, s24_8 modifier, s32 itemId); s32 sub_8055864(Entity *attacker, Entity *target, Move *move, s32 param_4, s32 itemId); diff --git a/include/ground_script.h b/include/ground_script.h index 393cc9444..56eb57076 100644 --- a/include/ground_script.h +++ b/include/ground_script.h @@ -115,8 +115,18 @@ typedef struct GroundMapAction { // size: 0x110 /* 0x00 */ Action action; - /* 0xE4 */ u16 groundMapId; - /* .... */ u8 fillE8[0x110 - 0xE6]; + /* 0xE4 */ s16 groundMapId; + u16 fillE6; + u32 unkE8; + u32 unkEC; + u32 unkF0; + u32 unkF4; + u32 unkF8; + u32 unkFC; + u32 unk100; + u32 unk104; + u32 unk108; + u32 unk10C; } GroundMapAction; typedef struct ScriptRef diff --git a/include/move_orb_actions_1.h b/include/move_orb_actions_1.h new file mode 100644 index 000000000..2b9548570 --- /dev/null +++ b/include/move_orb_actions_1.h @@ -0,0 +1,83 @@ +#ifndef GUARD_MOVE_ORB_ACTIONS_1_H +#define GUARD_MOVE_ORB_ACTIONS_1_H + +#include "structs/dungeon_entity.h" + +bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 YawnMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4); +bool8 BasicSleepMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4); +bool8 NightmareMoveAction(Entity * pokemon, Entity *target, Move *move, s32 param_4); +bool8 MorningSunMoveAction(Entity * pokemon,Entity * target, Move *move, s32 param_4); +bool8 VitalThrowMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4); +bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4); +bool8 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4); +bool8 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PainSplitMoveAction(Entity *attacker, Entity *target, Move *move, s32 param_4); +bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 StringShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4); +bool8 ScreechMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4); +bool32 WeatherBallMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 FakeTearsMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4); +bool8 SpiteMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4); +bool8 FocusEnergyMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4); +bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MirrorMoveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MementoMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FlatterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 WillOWispMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ReturnMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4); +bool8 GrudgeMoveAction(Entity *pokemon, Entity * target, Move *move, s32 param_4); +bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 ReversalMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4); +bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HazeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); + + +#endif /* ifndef GUARD_MOVE_ORB_ACTIONS_1_H */ diff --git a/include/move_orb_actions_2.h b/include/move_orb_actions_2.h new file mode 100644 index 000000000..5c3073e3c --- /dev/null +++ b/include/move_orb_actions_2.h @@ -0,0 +1,74 @@ +#ifndef GUARD_MOVE_ORB_ACTIONS_2_H +#define GUARD_MOVE_ORB_ACTIONS_2_H + +#include "structs/dungeon_entity.h" + +bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AbsorbMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DoubleEdgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_80595EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TwisterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TwineedleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8059A2C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HornDrillMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool32 EarthquakeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 UproarMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PsychUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ConversionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, s32 param_4, u32 param_5); +bool8 SonicboomMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ExplosionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 WaterSpoutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +void sub_80783C4(Entity * pokemon, Entity * target, bool8 param_3); +bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MoonlightMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SolarBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 WarpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FlyMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DiveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); + +#endif /* ifndef GUARD_MOVE_ORB_ACTIONS_2_H */ + diff --git a/include/move_orb_actions_3.h b/include/move_orb_actions_3.h new file mode 100644 index 000000000..19d41c9e2 --- /dev/null +++ b/include/move_orb_actions_3.h @@ -0,0 +1,65 @@ +#ifndef GUARD_MOVE_ORB_ACTIONS_3_H +#define GUARD_MOVE_ORB_ACTIONS_3_H + +#include "structs/dungeon_entity.h" + +bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TriAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TrickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TripleKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805A568(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SecretPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805AC90(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BeatUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 CrushClawMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BlazeKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PresentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 EruptionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 GlareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PoisonTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RoarMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805B17C(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 WrapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MagnitudeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TailGlowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PerishSongMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BellyDrumMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4,u8 param_5); +bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4,u8 param_5); +bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4, u32 param_5); +bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HandleColorChange(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TransformMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SplashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 LightScreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 RestMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MudWaterSportMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 IngrainMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MagicCoatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SpikesMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 BounceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AssistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805AAD0(Entity *pokemon, Entity *target, Move *move, s32 param_4); + +#endif /* ifndef GUARD_MOVE_ORB_ACTIONS_3_H */ diff --git a/include/status_actions.h b/include/move_orb_actions_4.h similarity index 67% rename from include/status_actions.h rename to include/move_orb_actions_4.h index 74add8fdd..d0020cbc6 100644 --- a/include/status_actions.h +++ b/include/move_orb_actions_4.h @@ -1,7 +1,6 @@ -#ifndef GUARD_STATUS_ACTIONS_H -#define GUARD_STATUS_ACTIONS_H +#ifndef GUARD_MOVE_ORB_ACTIONS_4_H +#define GUARD_MOVE_ORB_ACTIONS_4_H -#include "constants/move.h" #include "structs/dungeon_entity.h" bool8 DreamEaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); @@ -43,13 +42,25 @@ bool8 ShockerOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) bool8 sub_805C208(Entity *pokemon, Entity *target, Move *move, u32 param_4); bool8 sub_805C288(Entity *pokemon, Entity *target, Move *move, s32 param_4); bool8 OneRoomOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4); -bool8 sub_805C3DC(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 ItemizeOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 HurlOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 MobileOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 StairsOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 LongtossOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -bool8 PierceOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MistBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DestinyBondMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FalseSwipeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HiddenPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 AttractMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MimicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 FrustrationMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 LeechSeedMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MetalClawMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4, s32 param_5); +bool8 InvisifyOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 CalmMindMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 DefenseCurlMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 SnatchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MetronomeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ReboundOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 sub_805B314(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 ProtectMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MirrorCoatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); + + +#endif /* ifndef MOVE_ORB_ACTIONS_4_H */ -#endif diff --git a/include/move_orb_actions_5.h b/include/move_orb_actions_5.h new file mode 100644 index 000000000..d32c6b383 --- /dev/null +++ b/include/move_orb_actions_5.h @@ -0,0 +1,15 @@ +#ifndef GUARD_MOVE_ORB_ACTIONS_5_H +#define GUARD_MOVE_ORB_ACTIONS_5_H + +#include "structs/dungeon_entity.h" + +bool8 FillInOrbAction(Entity *pokemon,Entity *target, Move *move, s32 param_4); +bool8 ItemizeOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 HurlOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 MobileOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 StairsOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 LongtossOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 PierceOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); + +#endif /* ifndef MOVE_ORB_ACTIONS_5_H */ diff --git a/include/structs/str_wonder_mail.h b/include/structs/str_wonder_mail.h index 04f2bbd61..2cbe34fae 100644 --- a/include/structs/str_wonder_mail.h +++ b/include/structs/str_wonder_mail.h @@ -33,7 +33,7 @@ typedef struct unkStruct_802F204 /* 0x0 */ u8 clientName[POKEMON_NAME_LENGTH]; /* 0xA */ u8 name2[POKEMON_NAME_LENGTH]; // target name? /* 0x14 */ s16 clientSpecies; - u8 unk16; + u8 rewardType; /* 0x18 */ s32 moneyReward; /* 0x1C */ u8 itemRewards[MAX_ITEM_REWARDS]; /* 0x1F */ u8 quantity; diff --git a/ld_script.txt b/ld_script.txt index 907f33151..169605b53 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -344,6 +344,8 @@ SECTIONS { asm/code_80A26CC_1.o(.text); src/ground_map.o(.text); asm/ground_map_1.o(.text); + src/ground_map_1.o(.text); + asm/code_80A59DC.o(.text); src/ground_map_2.o(.text); src/ground_sprite.o(.text); asm/ground_sprite.o(.text); @@ -424,7 +426,10 @@ SECTIONS { ALIGN(4) { src/main_loops.o(.rodata); + src/event_flag.o(.rodata); data/data.o(.rodata); + src/code_8002774.o(.rodata); + data/pksdir_5.o(.rodata); src/memory.o(.rodata); data/data1.o(.rodata); src/random.o(.rodata); @@ -895,6 +900,7 @@ SECTIONS { titlemenu_sbin_section 0x8380000 : ALIGN(4) { + src/titlemenu_sbin.o(.rodata); data/titlemenu_sbin.o(.rodata); } > ROM =0 @@ -927,6 +933,7 @@ SECTIONS { ground_sbin_section : ALIGN(4) { + src/ground_sbin.o(.rodata); data/ground_sbin.o(.rodata); } > ROM =0 diff --git a/src/blow_away.c b/src/blow_away.c index bc03a7bf3..69b2184c5 100644 --- a/src/blow_away.c +++ b/src/blow_away.c @@ -29,9 +29,6 @@ void sub_804EB30(); bool8 ExposeTrap(s32 x, s32 y); -void ShowWholeRevealedDungeonMap(); -void sub_8049ED4(); -void sub_806A5B8(Entity *); u8 sub_8045888(Entity *); void sub_807EC28(u32); u8 sub_8044B28(void); diff --git a/src/code_8002774.c b/src/code_8002774.c index 6a47f936b..dbfe9f892 100644 --- a/src/code_8002774.c +++ b/src/code_8002774.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "code_8002774.h" #include "constants/direction.h" #include "structs/str_position.h" @@ -11,7 +12,18 @@ struct S u8 x0[UNK_STRUCT_ARR_COUNT]; }; -extern const PixelPos gVectorDirections[8]; +const u8 sUnknown_8002774[] = {0, 0, 0, 0, 0, 0, 0, 0}; + +const PixelPos gVectorDirections[NUM_DIRECTIONS] = { + {0, 1}, // N + {1, 1}, // NE + {1, 0}, // E + {1, -1}, // SE + {0, -1}, // S + {-1, -1}, // SW + {-1, 0}, // W + {-1, 1}, // NW +}; static s8 VecDirection4Radial(PixelPos *pixelPos); diff --git a/src/code_803C1B4.c b/src/code_803C1B4.c index 9a2c89a9a..1ba27ca1f 100644 --- a/src/code_803C1B4.c +++ b/src/code_803C1B4.c @@ -1,11 +1,18 @@ #include "global.h" +#include "structs/str_wonder_mail.h" #include "dungeon.h" +#include "event_flag.h" +#include "pokemon.h" -u32 sub_803C1B4(DungeonLocation *dungeon, u8 r1) +extern u8 *gMissionRankText[]; +extern s32 gUnknown_80E80A0[]; +void sub_803C37C(DungeonLocation *, u8, u8 *); + +s32 sub_803C1B4(DungeonLocation *dungeon, u8 missionType) { s32 temp; temp = sub_80908D8(dungeon); - if(r1 == 2) + if(missionType == 2) { temp += 2; } @@ -14,3 +21,117 @@ u32 sub_803C1B4(DungeonLocation *dungeon, u8 r1) return temp; } +u8 sub_803C1D0(struct DungeonLocation *dungeon, u8 missionType) +{ + s32 a = sub_803C1B4(dungeon, missionType); + a /= 2; + if ((u8)a >= 7) { + a = 6; + return a; + } + return a; +} + +u8 *GetMissionRankText(u8 index) +{ + return gMissionRankText[index]; +} + +u32 GetDungeonTeamRankPts(DungeonLocation *dungeon, u8 r1) +{ + u32 index = sub_803C1B4(dungeon, r1); + return gUnknown_80E80A0[index]; +} + +void sub_803C21C(WonderMail *param_1, unkStruct_802F204 *param_2) +{ + int index; + u32 uVar2; + + uVar2 = sub_803C1D0(¶m_1->unk4.dungeon,param_1->missionType); + param_2->moneyReward = 0; + + for(index = 0; index < MAX_ITEM_REWARDS; index++) + { + param_2->itemRewards[index] = ITEM_NOTHING; + } + param_2->friendAreaReward = 0; + param_2->quantity = 10; + switch(param_1->rewardType) { + case MONEY: + param_2->rewardType = 0; + param_2->moneyReward = (uVar2 + 1) * 100; + break; + case MONEY_EXTRA: + param_2->rewardType = 1; + param_2->moneyReward = (uVar2 + 1) * 100; + param_2->itemRewards[0] = param_1->itemReward; + break; + case ITEM: + param_2->rewardType = 2; + param_2->itemRewards[0] = param_1->itemReward; + break; + case ITEM_EXTRA: + param_2->rewardType = 3; + param_2->itemRewards[0] = param_1->itemReward; + do { + sub_803C37C(¶m_1->unk4.dungeon,param_1->missionType,¶m_2->itemRewards[1]); + } while (param_2->itemRewards[0] == param_2->itemRewards[1]); + break; + case MONEY1: + param_2->rewardType = 0; + param_2->moneyReward = (uVar2 + 1) * 200; + break; + case MONEY1_EXTRA: + param_2->rewardType = 1; + param_2->moneyReward = (uVar2 + 1) * 200; + param_2->itemRewards[0] = param_1->itemReward; + break; + case ITEM1: // ITEM1 + param_2->rewardType = 2; + param_2->itemRewards[0] = param_1->itemReward; + break; + case ITEM1_EXTRA: + param_2->rewardType = 3; + param_2->itemRewards[0] = param_1->itemReward; + do { + sub_803C37C(¶m_1->unk4.dungeon,param_1->missionType,¶m_2->itemRewards[1]); + } while (param_2->itemRewards[0] == param_2->itemRewards[1]); + do { + do { + sub_803C37C(¶m_1->unk4.dungeon,param_1->missionType,¶m_2->itemRewards[2]); + } while (param_2->itemRewards[0] == param_2->itemRewards[2]); + } while (param_2->itemRewards[1] == param_2->itemRewards[2]); + break; + case FRIEND_AREA: + param_2->rewardType = 4; + param_2->friendAreaReward = param_1->friendAreaReward; + break; + default: + param_2->rewardType = 5; + break; + } + CopyYellowMonsterNametoBuffer(param_2->clientName, param_1->clientSpecies); + param_2->clientSpecies = param_1->clientSpecies; + param_2->teamRankPtsReward = GetDungeonTeamRankPts(¶m_1->unk4.dungeon,param_1->missionType); +} + +void sub_803C37C(DungeonLocation *location, u8 r1, u8 *itemReward) { + s32 r7; + bool8 flag; + u8 r4; + + r7 = sub_803C1B4(location, r1); + sub_8090910(location, r7); + + do { + flag = FALSE; + r4 = sub_8090910(location, r7); + if(r4 == ITEM_WEAVILE_FIG) + flag = GetScriptVarArrayValue(0, EVENT_B01P01, 1) ? TRUE : FALSE; + if(r4 == ITEM_MIME_JR_FIG) + if(GetScriptVarArrayValue(0, EVENT_B01P01, 0)) flag = TRUE; + } while(flag != FALSE); + + *itemReward = r4; +} diff --git a/src/code_8041AD0.c b/src/code_8041AD0.c index cb89cd754..e7929a8e8 100644 --- a/src/code_8041AD0.c +++ b/src/code_8041AD0.c @@ -55,10 +55,7 @@ extern void sub_80429A0(Entity *); void sub_8042B34(s32 a0, s32 a1, s32 a2); extern bool8 sub_8042CC0(void); extern void sub_8042D7C(void); -extern u8 GetFloorType(void); extern bool8 sub_8045888(Entity *); -extern s32 sub_80416E0(PixelPos*, u32, bool8); -extern u32 sub_8041764(unkStruct_80416E0 *, bool8); extern u32 sub_800E49C(); extern void sub_800F15C(s32); extern void sub_800EF40(u8 r0, u8 r1); diff --git a/src/code_8066D04.c b/src/code_8066D04.c index c3cf50ab5..1250f4c2b 100644 --- a/src/code_8066D04.c +++ b/src/code_8066D04.c @@ -39,24 +39,16 @@ #include "trap.h" extern void sub_8071DA4(Entity *); -extern void sub_806A1B0(Entity *); extern void sub_8057588(Entity * pokemon, u8 param_2); -extern bool8 sub_806A58C(s16 a0); -extern bool8 sub_806A564(s16 r0); -extern void sub_8045C08(u8 *buffer, Item *item); extern bool8 sub_8045888(Entity *); extern Item *sub_8044D90(Entity *, s32, u32); -void sub_8045BF8(u8 *, Item *); u8 sub_8048D50(); -void sub_8044DF0(); void sub_8042208(Entity *pokemon, u8 r1); void sub_803E708(); void sub_80479B8(); extern void sub_807AB38(Entity *, u32); extern Entity * sub_8044DA4(Entity *param_1,int param_2); -extern void sub_806A6E8(Entity *); extern void sub_8044DF0(Entity *, u32, u32); -extern bool32 sub_8055A00(Entity *attacker, s32 firstMoveId, s32 var_34, s32 itemId, s32 arg_0); extern bool8 sub_8044B28(void); Entity *sub_806773C(Entity *entity); void sub_8067558(Entity *entity, Entity *targetEntity, s32 a2); @@ -64,8 +56,6 @@ void sub_8067794(Entity *entity, Entity *targetEntity, s32 a2); extern void sub_807EF84(void); extern void sub_80845E0(Entity *entity); extern void sub_8084448(Entity *entity); -extern void sub_806A3D4(u8 *dst, s32 _a1, s32 id, bool32 _a3); -extern Entity * sub_80696A8(Entity *target); void HandlePickUpPlayerAction(Entity *entity) { diff --git a/src/code_80718D8.c b/src/code_80718D8.c index 0a90e9544..4e0b9ccce 100644 --- a/src/code_80718D8.c +++ b/src/code_80718D8.c @@ -8,6 +8,7 @@ #include "code_8077274_1.h" #include "constants/dungeon.h" #include "dungeon_map_access.h" +#include "dungeon_misc.h" #include "dungeon_random.h" #include "dungeon_util.h" #include "dungeon.h" @@ -30,18 +31,14 @@ EWRAM_DATA s32 gUnknown_202F31C[2] = {0, 0}; EWRAM_DATA s32 gUnknown_202F324[2] = {0, 0}; extern void ResetMonEntityData(EntityInfo *, u32); -void sub_8069E0C(Entity *pokemon); void sub_8042A44(Entity *r0); void sub_8083D78(void); -extern bool8 sub_803D930(u32); 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 bool8 sub_803D930(u32); extern void sub_8072B78(Entity *pokemon, Entity *target, s16 id); diff --git a/src/code_8073CF0.c b/src/code_8073CF0.c index 925c1ab8f..85f77acde 100644 --- a/src/code_8073CF0.c +++ b/src/code_8073CF0.c @@ -33,7 +33,6 @@ #include "dungeon_strings.h" extern bool8 sub_8044B28(void); -extern void sub_8075708(Entity *entity); extern void DealDamageToEntity(Entity *, s32, u32, u32); extern void sub_805229C(void); extern void sub_807E8F0(Entity *); diff --git a/src/code_8099360.c b/src/code_8099360.c index 022804d9b..9365f79fe 100644 --- a/src/code_8099360.c +++ b/src/code_8099360.c @@ -1,4 +1,7 @@ #include "global.h" +#include "bg_palette_buffer.h" +#include "code_8009804.h" +#include "game_options.h" #include "code_800558C.h" #include "code_80A26CC.h" #include "def_filearchives.h" @@ -348,3 +351,41 @@ void sub_809965C(void) sub_800388C(0x1f0, temp->data, 0x10); CloseFile(temp); } + +extern const u8 gUnknown_8116028[]; + +void sub_8099690(u32 param_1) +{ + OpenedFile *temp; + RGB *pal; + RGB *var2; + u8 gender; + + s32 index; + + temp = OpenFileAndGetFileDataPtr(gUnknown_8116028, &gSystemFileArchive); + + switch(param_1) + { + default: + gender = gGameOptionsRef->playerGender; + pal = &gFontPalette[0x10]; + if(gender != 0) + pal += 0x40; + break; + case 1: + pal = &gFontPalette[0x60]; + break; + case 2: + pal = &gFontPalette[0x70]; + break; + } + + sub_800388C(0xF0, (u8 *)pal, 0x10); + var2 = pal; + for(index = 0; index < 0x10; index++) + { + nullsub_5(index + 0xF0, var2++); + } + CloseFile(temp); +} diff --git a/src/code_809A560.c b/src/code_809A560.c index 1faf272a8..5c95cbd48 100644 --- a/src/code_809A560.c +++ b/src/code_809A560.c @@ -41,7 +41,6 @@ extern u16 gUnknown_20399DE; extern bool8 sub_802FCF0(void); u8 ScriptPrintText_809B2B8(struct unkStruct_3001B64_unkC *, s32, s32, const char *); bool8 IsTextboxOpen_809B40C(struct unkStruct_3001B64_unkC *); -extern void sub_801416C(s32, s32); extern void ResetTextbox_809B294(void); extern s32 sub_803B168(void); extern void sub_803B1BC(void); diff --git a/src/data/event_flag.h b/src/data/event_flag.h new file mode 100644 index 000000000..5bcf98f0d --- /dev/null +++ b/src/data/event_flag.h @@ -0,0 +1,181 @@ +struct LocalScriptVarInfo +{ + s16 unk0; + s16 unk2; + s16 unk4; + s16 unk6; + s16 unk8; + s16 unkA; + const u8 *text; +}; + +const struct LocalScriptVarInfo sLocalScriptVarInfo[4] = { + 5, 7, 0, 0, 1, 0, "LOCAL0", + 5, 7, 2, 0, 1, 0, "LOCAL1", + 5, 7, 4, 0, 1, 0, "LOCAL2", + 5, 7, 6, 0, 1, 0, "LOCAL3", +}; + +struct unkStruct_80B6D90 +{ + const u8 *text; + s32 num; +}; + +const u8 gUnknown_80B7144[]; + +const struct unkStruct_80B6D90 gUnknown_80B6D90[59] = { + {gUnknown_80B7144, 0}, + {"M00E01A", -1}, + {"M01E01A", -1}, + {"M01E02A", -1}, + {"M01E02B", -1}, + {"M01E03A", -1}, + {"M01E04A", -1}, + {"M01E04B", -1}, + {"M01E05A", -1}, + {"M01E05B", -1}, + {"M01E06A", -1}, + {"M01E07A", -1}, + {"M01E07B", -1}, + {"M01E08A", -1}, + {"M01E08B", -1}, + {"M01E09A", -1}, + {"M01E10A", -1}, + {"M01END", -1}, + {"M02E01A", -1}, + {"M02E02A", -1}, + {"M02E02B", -1}, + {"M02E02C", -1}, + {"M02E02D", -1}, + {"M02E02E", -1}, + {"M02E02F", -1}, + {"M02E02G", -1}, + {"M02E02H", -1}, + {"M02END", -1}, + {"S00E01A", -1}, + {"S01E01A", 1}, + {"S01E01B", 1}, + {"S01E02A", 1}, + {"S01E02B", 2}, + {"S02E01A", -1}, + {"S02E02A", -1}, + {"S02E02B", 3}, + {"S03E01A", 1}, + {"S03E01B", 3}, + {"S04E01A", 1}, + {"S04E01B", 1}, + {"S04E01C", 1}, + {"S04E01D", 1}, + {"S04E01E", 1}, + {"S04E01F", 2}, + {"S05E01A", 1}, + {"S05E01B", 3}, + {"S06E01A", 1}, + {"S06E01B", 1}, + {"S06E01C", 3}, + {"S07E01A", 1}, + {"S07E01B", 3}, + {"S08E01A", 1}, + {"S08E01B", 3}, + {"S09E01A", 1}, + {"S09E01B",1}, + {"S09E01C", 2}, + {"R00E01A", -1}, + {"NEXT DAY", -1}, + {"DEBUG GROUND", -1}, +}; + +ALIGNED(4) const u8 gUnknown_80B7144[] = "NONE"; + +const u8 *const gUnknown_80B714C[10] = { + "2-1", + "2-1", + "1-2 7", + "4", + "5", + "6", + "2-2 8", + "3", + "9", + "END", +}; + +const u8 *const gUnknown_80B71A0[4] = { + _("{COLOR GREEN_I}START{RESET}"), + _("{COLOR GENDER_COLOR}CONTINUE{RESET}"), + _("{COLOR YELLOW_N}LAST{RESET}"), + _("{COLOR RED_W}END{RESET}"), +}; + +struct GroundEventTableEntry +{ + // size: 0x4 + s16 groundEnterId; + u8 value; // Seems like friend area number +}; + +const struct GroundEventTableEntry gGroundEnterLookupTable[58] = { + {105, 1 }, + {106, 2 }, + {107, 3 }, + {108, 4 }, + {109, 5 }, + {110, 6 }, + {111, 7 }, + {112, 8 }, + {113, 9 }, + {114, 10}, + {115, 11}, + {116, 12}, + {117, 13}, + {118, 14}, + {119, 15}, + {120, 16}, + {121, 17}, + {122, 18}, + {123, 19}, + {124, 20}, + {125, 21}, + {126, 22}, + {127, 23}, + {128, 24}, + {129, 25}, + {130, 26}, + {131, 27}, + {132, 28}, + {133, 29}, + {134, 30}, + { 135, 31}, + { 136, 32}, + { 137, 33}, + { 138, 34}, + { 139, 35}, + { 140, 36}, + { 141, 37}, + { 142, 38}, + { 143, 39}, + { 144, 40}, + { 145, 41}, + { 146, 42}, + { 147, 43}, + { 148, 44}, + { 149, 45}, + { 150, 46}, + { 151, 47}, + { 152, 48}, + { 153, 49}, + { 154, 50}, + { 155, 51}, + { 156, 52}, + { 157, 53}, + { 158, 54}, + { 159, 55}, + { 160, 56}, + { 161, 57}, + { -1, 0}, +}; + +ALIGNED(4) const u8 gScenarioCalcLogString[] = "SCENARIO CALC [%3d] %4d %4d -> %4d %4d"; + +ALIGNED(4) const u8 EventFlagFile_Text[] = "../main/event_flag.c"; diff --git a/src/data/pokemon_mail.h b/src/data/pokemon_mail.h index 7f6814d4c..b4f9bcd2a 100644 --- a/src/data/pokemon_mail.h +++ b/src/data/pokemon_mail.h @@ -1,3 +1,5 @@ +#include "rescue_team_info.h" + static const u8 * const sUnknown_80E8B94[7] = { _(" "), _("{ENVELOPE_CLOSED}"), @@ -16,7 +18,7 @@ static const u8 * const sUnknown_80E8BCC[4] = { }; // Used in sub_803C1F0 for some reason -const u8 * const gUnknown_80E8BF8[7] = { +const u8 * const gMissionRankText[MAX_TEAM_RANKS] = { _("{COLOR DEFAULT}E{RESET}"), _("{COLOR GREEN}D{RESET}"), _("{COLOR GREEN}C{RESET}"), diff --git a/src/dungeon_config.c b/src/dungeon_config.c index a0b596cc1..18e5fec07 100644 --- a/src/dungeon_config.c +++ b/src/dungeon_config.c @@ -7,115 +7,11 @@ #include "constants/monster.h" #include "constants/dungeon_action.h" #include "constants/move_id.h" - -// TODO: move these to header files -extern bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 YawnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 NightmareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PainSplitMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WhirlpoolMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FakeTearsMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SpiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FlatterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WillOWispMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ReturnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GigaDrainMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ReversalMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SmellingSaltMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AbsorbMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DoubleEdgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_80595EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TwisterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TwineedleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8059A2C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HornDrillMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TriAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TrickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TripleKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805A568(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SecretPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805AC90(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BeatUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CrushClawMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BlazeKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PresentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EruptionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GlareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RoarMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805B17C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WrapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MagnitudeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MistBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DestinyBondMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FalseSwipeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HiddenPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AttractMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MimicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FrustrationMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LeechSeedMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DreamEaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LusterPurgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DragonRageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HandleRegularDamagingMove(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); +#include "dungeon_move.h" +#include "move_orb_actions_1.h" +#include "move_orb_actions_2.h" +#include "move_orb_actions_3.h" +#include "move_orb_actions_4.h" // Huge list of various config variables for dungeon moves/music/abilities/items/etc. All in one file, because these are scattered all around the codebase with only one pksdir present. diff --git a/src/dungeon_move.c b/src/dungeon_move.c index ed7fb698b..32062016c 100644 --- a/src/dungeon_move.c +++ b/src/dungeon_move.c @@ -31,12 +31,16 @@ #include "dungeon_util.h" #include "math.h" #include "move_effects_target.h" +#include "move_orb_actions_1.h" +#include "move_orb_actions_2.h" +#include "move_orb_actions_3.h" +#include "move_orb_actions_4.h" +#include "move_orb_actions_5.h" #include "move_util.h" #include "moves.h" #include "position_util.h" #include "sprite.h" #include "status.h" -#include "status_actions.h" #include "weather.h" #include "targeting_flags.h" #include "text_util.h" @@ -62,243 +66,14 @@ extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2); extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *); extern Entity *sub_80696A8(Entity *a0); extern Entity *GetMonsterAtPos(DungeonPos *pos); -extern Entity *sub_80696FC(Entity *); -extern Entity *sub_806977C(Entity *); extern void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct); -extern void MarkLastUsedMonMove(Entity *entity, Move *move); -extern s32 sub_8057070(Move *move); -extern bool8 MoveRequiresCharging(Entity* pokemon,u16 param_2); extern s32 sub_800ED20(u16 param_1); -extern bool32 EarthquakeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); extern void sub_8042930(Entity *r0); extern void sub_8041B48(Entity *pokemon); extern void sub_8041BA8(Entity *pokemon); extern void sub_8042950(Entity *r0); -extern void sub_80421C0(Entity *pokemon, u16 r1); -extern bool8 IronTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 YawnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 NightmareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PainSplitMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TormentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WhirlpoolMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FakeTearsMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SpiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SmokescreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FlatterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WillOWispMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ReturnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4); -extern bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4); -extern bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GigaDrainMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ReversalMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SmellingSaltMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AbsorbMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DoubleEdgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_80595EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 OneShotOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TwisterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TwineedleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8059A2C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HornDrillMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TriAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TrickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TripleKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805A568(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FocusEnergyMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SecretPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805AC90(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BeatUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CrushClawMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BlazeKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PresentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EruptionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GlareMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PoisonTailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RoarMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805B17C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WrapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MagnitudeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MistBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DestinyBondMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FalseSwipeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HiddenPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AttractMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MimicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FrustrationMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LeechSeedMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DreamEaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LusterPurgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DragonRageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5); -extern bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5); + extern void SetShopkeeperAggression(Entity *, Entity *); -extern bool8 MoveCausesPaused(Move *move); -extern void sub_8069F9C(Entity *pokemon,Entity * target,Move *move); -extern void sub_806A120(Entity *pokemon,Entity * target,Move *move); -extern bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5); -extern bool8 MetalClawMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5); -extern bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5); -extern bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SonicboomMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BasicSleepMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TailGlowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CalmMindMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DefenseCurlMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ScreechMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SolarBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 UproarMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 LightScreenMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805768C(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MementoMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MoonlightMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RestMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TrapperOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RazorWindMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FocusPunchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MagicCoatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MorningSunMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MudWaterSportMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 IngrainMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SpikesMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HazeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WarpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 VitalThrowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 FlyMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BounceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DiveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DigMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 GrudgeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 AssistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805AAD0(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 sub_805B314(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ProtectMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ExplosionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WaterSpoutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 InvisifyOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MirrorCoatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PerishSongMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 WeatherBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BellyDrumMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 BubbleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 StringShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 TransformMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SplashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ReboundOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MirrorMoveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 ConversionMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SnatchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 HandleColorChange(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 PsychUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 MetronomeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); extern const s32 gUnknown_8106A50; extern const s32 gUnknown_8106A4C; @@ -1586,7 +1361,7 @@ void UseMoveAgainstTargets(Entity **targetsArray, Entity *attacker, Move *move, } } -bool32 HandleRegularDamagingMove(Entity *attacker, Entity *target, Move *move, s32 itemId) +bool8 HandleRegularDamagingMove(Entity *attacker, Entity *target, Move *move, s32 itemId) { return (HandleDamagingMove(attacker, target, move, IntToF248_2(1), itemId) != 0); } diff --git a/src/dungeon_move_util.c b/src/dungeon_move_util.c index 9bc5b5fe7..c8907f3ef 100644 --- a/src/dungeon_move_util.c +++ b/src/dungeon_move_util.c @@ -36,7 +36,7 @@ #include "position_util.h" #include "sprite.h" #include "status.h" -#include "status_actions.h" +#include "move_orb_actions_4.h" #include "weather.h" #include "targeting_flags.h" #include "text_util.h" @@ -45,9 +45,6 @@ extern void sub_80429C8(Entity *r0); extern bool8 sub_8045888(Entity *r0); extern void HandleDealingDamage(Entity *attacker, Entity *target, struct DamageStruct *dmgStruct, bool32 isFalseSwipe, bool32 giveExp, s16 arg4, bool32 arg8, s32 argC); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, struct DamageStruct *dmgStruct, s24_8, u16, u32); -extern s16 sub_8057600(Move *move, s32 itemID); -extern void sub_803ED30(s32, Entity *r0, u8, s32); -extern void sub_8042238(Entity *pokemon, Entity *target); extern void sub_806A1E8(Entity *pokemon); extern bool8 sub_8044B28(void); extern void sub_804178C(u32); @@ -60,21 +57,8 @@ extern void sub_800EF10(u16 r0); extern s32 sub_800E710(s16 a0, u16 a1); extern void sub_800E3AC(s32 a0, DungeonPos *pos, s32 a2); extern void sub_8041168(Entity *entity, Entity *entity2, Move *,DungeonPos *); -extern Entity *sub_80696A8(Entity *a0); extern Entity *GetMonsterAtPos(DungeonPos *pos); -extern Entity *sub_80696FC(Entity *); -extern Entity *sub_806977C(Entity *); -extern void sub_806F2BC(Entity *attacker, Entity *target, u8 moveType, s32 a2, struct DamageStruct *dmgStruct); -extern void MarkLastUsedMonMove(Entity *entity, Move *move); -extern s32 sub_8057070(Move *move); -extern bool8 MoveRequiresCharging(Entity* pokemon,u16 param_2); extern s32 sub_800ED20(u16 param_1); -extern bool32 EarthquakeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4); -extern void sub_8042930(Entity *r0); -extern void sub_8041B48(Entity *pokemon); -extern void sub_8041BA8(Entity *pokemon); -extern void sub_8042950(Entity *r0); -extern void sub_80421C0(Entity *pokemon, u16 r1); extern s16 sub_8094828(u16, u8); struct UnkStruct_sub_800E308_1 { diff --git a/src/event_flag.c b/src/event_flag.c index 7b9e324c1..a981958d2 100644 --- a/src/event_flag.c +++ b/src/event_flag.c @@ -1,4 +1,5 @@ #include "global.h" +#include "globaldata.h" #include "constants/friend_area.h" #include "constants/item.h" #include "items.h" @@ -16,32 +17,7 @@ EWRAM_DATA u8 gScriptVarBuffer[0x400] = {0}; // NDS=020876DC -struct GroundEventTableEntry -{ - // size: 0x4 - s16 groundEnterId; - u8 value; // Seems like friend area number -}; - -extern struct GroundEventTableEntry gGroundEnterLookupTable[58]; - -struct unkStruct_80B6D90 -{ - u8 *text; - s32 num; -}; -extern struct unkStruct_80B6D90 gUnknown_80B6D90[]; - -extern u8 gUnknown_80B7144[]; -extern u8 *gUnknown_80B714C[]; -extern u8 *gUnknown_80B71A0[]; -extern u8 gUnknown_80B72CC[]; -extern DebugLocation gUnknown_80B7318; -extern u8 gUnknown_80B7324[]; -extern DebugLocation gUnknown_80B7350; -extern u8 gUnknown_80B735C[]; -extern u8 gUnknown_80B7378[]; -extern u8 gUnknown_80B7388[]; +#include "data/event_flag.h" extern bool8 GetScriptMode(void); extern bool8 HasCompletedAllMazes(void); @@ -123,7 +99,7 @@ void ThoroughlyResetScriptVars(void) } #if (GAME_VERSION == VERSION_RED) -void sub_8001564(void) +UNUSED void sub_8001564(void) { nullsub_128(); } @@ -487,7 +463,7 @@ void ScenarioCalc(s16 param_1,s32 param_2,s32 param_3) param_1_s32 = param_1; GetScriptVarScenario(param_1_s32,&local_18,&local_14); - Log(6,gUnknown_80B72CC,param_1_s32,local_18,local_14,param_2,param_3); // SCENARIO CALC [%3d] %4d %4d -> %4d %4d + Log(6,gScenarioCalcLogString,param_1_s32,local_18,local_14,param_2,param_3); // SCENARIO CALC [%3d] %4d %4d -> %4d %4d if ((param_1_s32 == 3) && ((param_2 != local_18 || (param_3 != local_14)))) { SetScriptVarValue(NULL,CLEAR_COUNT,0); } @@ -674,6 +650,14 @@ void sub_8001D88(void) } } +ALIGNED(4) static const u8 sFlagCalc_Text[] = "_FlagCalc"; + +static const DebugLocation sFlagCalcDebugLocation = { + EventFlagFile_Text, + 0x551, + sFlagCalc_Text +}; + // arm9.bin::0200EC08 s32 _FlagCalc(s32 param_1, s32 param_2, enum FlagCalcOperation operation) { @@ -703,10 +687,18 @@ s32 _FlagCalc(s32 param_1, s32 param_2, enum FlagCalcOperation operation) case CALC_RANDOM: return OtherRandInt(param_2); default: - FatalError(&gUnknown_80B7318,gUnknown_80B7324, operation); // event flag expansion error %d + FatalError(&sFlagCalcDebugLocation,"event flag expansion error %d", operation); // event flag expansion error %d } } +ALIGNED(4) static const u8 sFlagJudge_Text[] = "_FlagJudge"; + +static const DebugLocation sFlagJudgeDebugLocation = { + EventFlagFile_Text, + 0x57C, + sFlagJudge_Text +}; + // arm9.bin::0200EAE4 bool8 _FlagJudge(s32 param_1, s32 param_2, enum FlagJudgeOperation operation) { @@ -734,7 +726,7 @@ bool8 _FlagJudge(s32 param_1, s32 param_2, enum FlagJudgeOperation operation) case JUDGE_BIT_SET: return param_1 >> (param_2) & 1; default: - FatalError(&gUnknown_80B7350,gUnknown_80B735C, operation); // event flag rule error %d + FatalError(&sFlagJudgeDebugLocation,"event flag rule error %d", operation); // event flag rule error %d } } @@ -812,30 +804,30 @@ UNUSED s32 sub_8002354(u32 param_1) } } -UNUSED u8 *sub_8002374(u32 param_1) +UNUSED const u8 *sub_8002374(u32 param_1) { if (param_1 < 0x3b) { return gUnknown_80B6D90[param_1].text; } else { - return gUnknown_80B7378; // error number + return "error number"; // error number } } -UNUSED u8 *sub_8002394(u32 param_1) +UNUSED const u8 *sub_8002394(u32 param_1) { if (param_1 - 0x12 < 9) { return gUnknown_80B714C[param_1 - 0x12]; } else if (param_1 == 0xf) { - return gUnknown_80B7388; // 1-1 + return "1-1"; // 1-1 } else { return gUnknown_80B7144; // NONE } } -UNUSED u8 *sub_80023C4(u32 param_1) +UNUSED const u8 *sub_80023C4(u32 param_1) { if (param_1 < 4) { return gUnknown_80B71A0[param_1]; // CISTART, CECONTINUE, CNLAST, CWEND @@ -921,7 +913,7 @@ u8 sub_8002658(s16 param_1) { short sVar1; s32 param_1_s32; - struct GroundEventTableEntry *ptr; + const struct GroundEventTableEntry *ptr; param_1_s32 = param_1; @@ -942,7 +934,7 @@ u8 sub_8002658(s16 param_1) // arm9.bin::0200E5E8 s16 sub_8002694(u8 param_1) { - struct GroundEventTableEntry *puVar2 = gGroundEnterLookupTable; + const struct GroundEventTableEntry *puVar2 = gGroundEnterLookupTable; while (puVar2->groundEnterId != -1) { if (puVar2->value == param_1) { diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 5346f9835..8ec5e3ba1 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -1174,7 +1174,7 @@ void sub_8032828(void) monName = GetMonSpecies(MONSTER_PELIPPER); strcpy(gUnknown_203B33C->unk53C.clientName, monName); gUnknown_203B33C->unk53C.clientSpecies = 0; - gUnknown_203B33C->unk53C.unk16 = 2; + gUnknown_203B33C->unk53C.rewardType = 2; gUnknown_203B33C->unk53C.moneyReward = 0; mail = GetMailatIndex(GetMailIndex(6, gUnknown_203B33C->unk420)); // ABSOLUTELY GENIUS diff --git a/src/ground_effect.c b/src/ground_effect.c index 71b0f71d1..337a74de3 100644 --- a/src/ground_effect.c +++ b/src/ground_effect.c @@ -1,3 +1,110 @@ #include "global.h" +#include "ground_script.h" +#include "debug.h" +#include "memory.h" + +void DeleteGroundEffects(void); + +// size must be 0x1c4 +typedef struct GroundEffect { + u8 fill0[6]; + s16 unk6; + s16 unk8; + s8 unkA; + u8 fillB[0x1c4 - 0xB]; +} GroundEffect; + +IWRAM_INIT GroundEffect* gGroundEffects = NULL; // size 16 array +void GroundEffect_Delete(s32); +const struct GroundScriptHeader *GetGroundScript(s16 a0, DebugLocation *); +extern DebugLocation gUnknown_8118610; +extern u8 gUnknown_811861C[]; +extern u8 gUnknown_8118640[]; +s16 GroundEffect_Add(s32 id, const GroundEffectData*, s32 group, s32 sector); + +void AllocGroundEffects() +{ + s32 index; + GroundEffect* current; + + gGroundEffects = MemoryAlloc(16 * sizeof(GroundEffect), 6); + current = gGroundEffects; + for (index = 0; index < 16; index = (s16) (index + 0x1), current++) { + current->unk6 = -1; + } + DeleteGroundEffects(); +} + + +void DeleteGroundEffects(void) +{ + s32 index; + GroundEffect* current; + + current = gGroundEffects; + for (index = 0; index < 16; index = (s16) (index + 0x1), current++) { + if(current->unk6 != -1) + GroundEffect_Delete(index); + } +} + +void FreeGroundEffects(void) +{ + DeleteGroundEffects(); + MemoryFree(gGroundEffects); + gGroundEffects = NULL; +} + +void GroundEffect_Select(s32 scriptID, s32 group, s32 sector) +{ + const struct GroundScriptHeader *scriptPtr; + const struct GroundScriptSector *sectorPtr; + const struct GroundScriptGroup *groupPtr; + + s32 i; + s32 size; + const GroundEffectData *effectData; + s32 sector_s32; + s32 group_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + group_s32 = (s16)group; + sector_s32 = (s8)sector; + scriptPtr = GetGroundScript(scriptID_s32, &gUnknown_8118610); + Log('\0',gUnknown_811861C, scriptID_s32, group_s32, sector_s32); + + groupPtr = &scriptPtr->groups[group_s32]; + sectorPtr = &groupPtr->sectors[sector_s32]; + effectData = sectorPtr->effects; + + size = sectorPtr->nEffects; + for (i = 0; i < size; i++, effectData++) + { + GroundEffect_Add(-1,effectData,group_s32,sector_s32); + } +} + +void GroundEffect_Cancel(s32 scriptID, s32 sector) +{ + s32 index; + GroundEffect *ptr; + s32 sector_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + sector_s32 = (s8) sector; + + + Log('\0',gUnknown_8118640, scriptID_s32); + + index = 0; + ptr = &gGroundEffects[0]; + for(; index < 0x10; index = (s16)(index + 1), ptr++) + { + if((ptr->unk6 != -1) && (ptr->unk8 == scriptID_s32)) + if(sector_s32 < 0 || ptr->unkA == sector_s32) + GroundEffect_Delete(index); + } +} -IWRAM_INIT void *gGroundEffects = NULL; diff --git a/src/ground_event.c b/src/ground_event.c index 88e328de0..cfa6596e8 100644 --- a/src/ground_event.c +++ b/src/ground_event.c @@ -1,3 +1,107 @@ #include "global.h" +#include "ground_script.h" +#include "debug.h" +#include "memory.h" + +typedef struct GroundEvent +{ + s16 unk0; + s16 unk2; + s16 unk4; // scriptID + s8 unk6; // sector + u8 unk7[0x20 - 0x7]; +} GroundEvent; + +IWRAM_INIT GroundEvent *gGroundEvents = NULL; + +void DeleteGroundEvents(void); +void GroundEvent_Delete(s32); +const struct GroundScriptHeader *GetGroundScript(s16 a0, DebugLocation *); +s16 GroundEvent_Add(s32 id, const GroundEventData*, s32 group, s32 sector); +extern DebugLocation gUnknown_81187DC; +extern u8 gGroundEventSelectText[]; +extern u8 gGroundEventCancelText[]; + +void AllocGroundEvents(void) { + s32 ind; + GroundEvent *ptr; + gGroundEvents = MemoryAlloc(sizeof(GroundEvent) * 0x20, 0x6); + + for(ind = 0, ptr = &gGroundEvents[ind]; ind < 0x20; ind = (s16)(ind + 1), ptr++) + { + ptr->unk2 |= -1; + } + DeleteGroundEvents(); +} + +void DeleteGroundEvents(void) { + s32 v1; + GroundEvent* current; + + current = &gGroundEvents[0]; + for (v1 = 0; v1 < 0x20; v1 = (s16) (v1 + 0x1), current++) { + if(current->unk2 != -1) + GroundEvent_Delete(v1); + } +} + +void FreeGroundEvents(void) +{ + DeleteGroundEvents(); + MemoryFree(gGroundEvents); + gGroundEvents = NULL; +} + +void GroundEvent_Select(s32 scriptID, s32 group, s32 sector) +{ + const struct GroundScriptHeader *scriptPtr; + const struct GroundScriptSector *sectorPtr; + const struct GroundScriptGroup *groupPtr; + + s32 i; + s32 size; + const GroundEventData *eventData; + s32 sector_s32; + s32 group_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + group_s32 = (s16)group; + sector_s32 = (s8)sector; + scriptPtr = GetGroundScript(scriptID_s32, &gUnknown_81187DC); + Log('\0',gGroundEventSelectText, scriptID_s32, group_s32, sector_s32); + + groupPtr = &scriptPtr->groups[group_s32]; + sectorPtr = &groupPtr->sectors[sector_s32]; + eventData = sectorPtr->events; + + size = sectorPtr->nEvents; + for (i = 0; i < size; i++, eventData++) + { + GroundEvent_Add(-1,eventData,group_s32,sector_s32); + } +} + +void GroundEvent_Cancel(s32 scriptID, s32 sector) +{ + s32 index; + GroundEvent *ptr; + s32 sector_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + sector_s32 = (s8) sector; + + + Log('\0',gGroundEventCancelText, scriptID_s32, sector_s32); + + index = 0; + ptr = &gGroundEvents[0]; + for(; index < 0x20; index = (s16)(index + 1), ptr++) + { + if((ptr->unk2 != -1) && (ptr->unk4 == scriptID_s32)) + if(sector_s32 < 0 || ptr->unk6 == sector_s32) + GroundEvent_Delete(index); + } +} -IWRAM_INIT void *gGroundEvents = NULL; diff --git a/src/ground_lives.c b/src/ground_lives.c index 6f03b8fe7..f9742880b 100644 --- a/src/ground_lives.c +++ b/src/ground_lives.c @@ -1,4 +1,164 @@ #include "global.h" +#include "ground_script.h" +#include "memory.h" -IWRAM_INIT void *gGroundLivesMeta = NULL; -IWRAM_INIT void *gGroundLives = NULL; +struct GroundLivesMeta_Sub1 +{ + // size: 0xC + u32 unk0; + u32 unk4; + u32 unk8; +}; + +struct unkStruct_3001B80 +{ + // size: 0x338 + struct GroundLivesMeta_Sub1 unk0[3]; + u32 unk24; + u8 unk28; + struct GroundLivesMeta_Sub1 unk2C[0x40]; + ScriptInfoSmall unk32C; +}; +IWRAM_INIT struct unkStruct_3001B80 *gGroundLivesMeta = NULL; + +struct unkStruct_3001B84_sub +{ + // size: 0x1F0 + u16 unk0; + s16 unk2; + s16 unk4; + s8 unk6; + u8 unk8[0x1F0 - 0x8]; +}; + +struct unkStruct_3001B84 +{ + struct unkStruct_3001B84_sub array[0x18]; +}; + +IWRAM_INIT struct unkStruct_3001B84 *gGroundLives = NULL; + +extern void DeleteGroundLives(void); +void GroundLives_Delete(s32); +s16 GroundLives_Add(s32 id, const GroundLivesData*, s32 group, s32 sector); +const struct GroundScriptHeader *GetGroundScript(s16 a0, DebugLocation *); +extern DebugLocation gUnknown_811808C; +extern u8 gUnknown_8118098[]; +extern u8 gUnknown_81180BC[]; + +void AllocGroundLives(void) +{ + s32 index; + struct unkStruct_3001B84_sub *ptr; + + gGroundLivesMeta = MemoryAlloc(sizeof(struct unkStruct_3001B80),6); + gGroundLives = MemoryAlloc(sizeof(struct unkStruct_3001B84),6); + + for(index = 0, ptr = &gGroundLives->array[index]; index < 0x18; index = (s16)(index + 1), ptr++) + { + ptr->unk2 = -1; + } + GetFunctionScript(0,&gGroundLivesMeta->unk32C,0x19); + gGroundLivesMeta->unk32C.state = 1; + DeleteGroundLives(); +} + + +void DeleteGroundLives(void) +{ + int index; + struct unkStruct_3001B84_sub *iVar4; + struct GroundLivesMeta_Sub1 *ptr; + + + iVar4 = &gGroundLives->array[0]; + for(index = 0; index < 0x18; index = (s16)(index + 1), iVar4++) + { + if (iVar4->unk2 != -1) { + GroundLives_Delete(index); + } + } + + gGroundLivesMeta->unk24 = -1; + gGroundLivesMeta->unk28 = -1; + + + for(index = 0; index < 3; ptr++, index++) + { + ptr = &gGroundLivesMeta->unk0[index]; + ptr->unk8 = -1; + ptr->unk0 = 0; + ptr->unk4 = 0; + } + + + for(index = 0; index < 0x40; ptr++, index++) + { + ptr = &gGroundLivesMeta->unk2C[index]; + ptr->unk0 = 0; + ptr->unk4 = 0; + ptr->unk8 = 0; + } +} + +void FreeGroundLives(void) +{ + DeleteGroundLives(); + MemoryFree(gGroundLives); + gGroundLives = NULL; + MemoryFree(gGroundLivesMeta); + gGroundLivesMeta = NULL; +} + +void GroundLives_Select(s32 scriptID, s32 group, s32 sector) +{ + const struct GroundScriptHeader *scriptPtr; + const struct GroundScriptSector *sectorPtr; + const struct GroundScriptGroup *groupPtr; + + s32 i; + s32 size; + const GroundLivesData *livesData; + s32 sector_s32; + s32 group_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + group_s32 = (s16)group; + sector_s32 = (s8)sector; + scriptPtr = GetGroundScript(scriptID_s32, &gUnknown_811808C); + Log('\0',gUnknown_8118098, scriptID_s32, group_s32, sector_s32); + + groupPtr = &scriptPtr->groups[group_s32]; + sectorPtr = &groupPtr->sectors[sector_s32]; + livesData = sectorPtr->lives; + + size = sectorPtr->nLives; + for (i = 0; i < size; i++, livesData++) + { + GroundLives_Add(-1,livesData,group_s32,sector_s32); + } +} + +void GroundLives_Cancel(s32 scriptID, s32 sector) +{ + s32 index; + struct unkStruct_3001B84_sub *ptr; + s32 sector_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + sector_s32 = (s8) sector; + + + Log('\0',gUnknown_81180BC, scriptID_s32, sector_s32); + + index = 0; + ptr = &gGroundLives->array[0]; + for(; index < 0x18; index = (s16)(index + 1), ptr++) + { + if((ptr->unk2 != -1) && (ptr->unk4 == scriptID_s32)) + if(sector_s32 < 0 || ptr->unk6 == sector_s32) + GroundLives_Delete(index); + } +} diff --git a/src/ground_map_1.c b/src/ground_map_1.c new file mode 100644 index 000000000..b1cb8c905 --- /dev/null +++ b/src/ground_map_1.c @@ -0,0 +1,42 @@ +#include "global.h" +#include "ground_map.h" +#include "ground_map_2.h" +#include "ground_script.h" + +extern GroundMapAction *gGroundMapAction; +extern DebugLocation gUnknown_8117770; + +extern s16 HandleAction(Action *action, DebugLocation *debug); +extern void sub_80A4740(void *, s32, s32 *, u32); +extern u32 sub_80A4720(void *, s32, s32 *); +extern u8 sub_80A46C0(unkStruct_3001B70 *, u32, s32, s32); +extern u8 sub_80A4660(unkStruct_3001B70 *, u32, s32, s32); + +u8 sub_80A5934(s32 param_1, s32 param_2, s32 param_3) +{ + u32 param_1_u32 = (u8)param_1; + return sub_80A4660(gGroundMapDungeon_3001B70, param_1_u32, param_2, param_3); +} + +u8 sub_80A595C(s32 param_1, s32 param_2, s32 param_3) +{ + u32 param_1_u32 = (u8)param_1; + return sub_80A46C0(gGroundMapDungeon_3001B70, param_1_u32, param_2, param_3); +} + +u16 sub_80A5984(s32 param_1, s32 *param_2) +{ + return sub_80A4720(gGroundMapDungeon_3001B70, param_1, param_2); +} + +void sub_80A59A0(s32 param_1, s32 *param_2, u32 param_3) +{ + u32 param_3_u32 = (u16)param_3; + sub_80A4740(gGroundMapDungeon_3001B70, param_1, param_2, param_3_u32); +} + +void GroundMap_Action(void) +{ + nullsub_123(); + HandleAction((Action *)gGroundMapAction, &gUnknown_8117770); +} diff --git a/src/ground_object.c b/src/ground_object.c index d52fae479..3711a764a 100644 --- a/src/ground_object.c +++ b/src/ground_object.c @@ -1,3 +1,161 @@ #include "global.h" +#include "ground_script.h" +#include "memory.h" -IWRAM_INIT void *gGroundObjects = NULL; +typedef struct GroundObject { + // size: 0x1C4 + u8 unk0[4]; + s16 unk4; + s16 unk6; // kind + s16 unk8; // scriptID / group + s8 unkA; // sector + u8 fillB[0x14 - 0xB]; + u32 unk14; + u32 unk18; + u8 fill1C[0x38 - 0x1C]; + Action unk38; + u8 unk11C[0x124 - 0x11C]; + u32 unk124[2]; + u8 unk12C[0x144 - 0x12C]; + u8 unk144[0x1C4 - 0x144]; +} GroundObject; + +IWRAM_INIT GroundObject *gGroundObjects = NULL; + +void DeleteGroundObjects(void); +void GroundObject_Delete(s32); + +extern u8 gUnknown_811842C[]; +extern u8 gUnknown_8118414[]; +extern u8 gUnknown_81183F0[]; +s16 GroundObject_Add(s32 id, const GroundObjectData*, s32 group, s32 sector); +extern DebugLocation gUnknown_81183E4; +const struct GroundScriptHeader *GetGroundScript(s16 a0, DebugLocation *); +bool8 IsOnscreen_80A675C(u8 *, u32 *); + +void AllocGroundObjects(void) +{ + + GroundObject *ptr; + s32 index; + + gGroundObjects = MemoryAlloc(sizeof(GroundObject) * 0x10, 6); + + for(index = 0, ptr = &gGroundObjects[index]; index < 0x10; index = (s16)(index + 1), ptr++) + { + ptr->unk6 |= -1; + } + DeleteGroundObjects(); +} + +void DeleteGroundObjects(void) +{ + GroundObject *ptr; + s32 index; + + ptr = &gGroundObjects[0]; + for(index = 0; index < 0x10; index = (s16)(index + 1), ptr++) + { + if(ptr->unk6 != -1) + GroundObject_Delete(index); + } +} + +void FreeGroundObjects(void) +{ + DeleteGroundObjects(); + MemoryFree(gGroundObjects); + gGroundObjects = NULL; +} + +void GroundObject_Select(s32 scriptID, s32 group, s32 sector) +{ + const struct GroundScriptHeader *scriptPtr; + const struct GroundScriptSector *sectorPtr; + const struct GroundScriptGroup *groupPtr; + + s32 i; + s32 size; + const GroundObjectData *objectData; + s32 sector_s32; + s32 group_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + group_s32 = (s16)group; + sector_s32 = (s8)sector; + scriptPtr = GetGroundScript(scriptID_s32, &gUnknown_81183E4); + Log('\0',gUnknown_81183F0, scriptID_s32, group_s32, sector_s32); + + groupPtr = &scriptPtr->groups[group_s32]; + sectorPtr = &groupPtr->sectors[sector_s32]; + objectData = sectorPtr->objects; + + size = sectorPtr->nObjects; + for (i = 0; i < size; i++, objectData++) + { + GroundObject_Add(-1,objectData,group_s32,sector_s32); + } +} + +void GroundObject_Cancel(s32 scriptID, s32 sector) +{ + s32 index; + GroundObject *ptr; + s32 sector_s32; + s32 scriptID_s32; + + scriptID_s32 = (s16)scriptID; + sector_s32 = (s8) sector; + + + Log('\0',gUnknown_8118414, scriptID_s32); + + index = 0; + ptr = &gGroundObjects[0]; + for(; index < 0x10; index = (s16)(index + 1), ptr++) + { + if((ptr->unk6 != -1) && (ptr->unk8 == scriptID_s32)) + if(sector_s32 < 0 || ptr->unkA == sector_s32) + GroundObject_Delete(index); + } +} + +void GroundObject_CancelBlank(void) +{ + s32 index; + GroundObject *ptr; + u32 stack[2]; + + Log('\0',gUnknown_811842C); + + index = 0; + ptr = &gGroundObjects[0]; + for(; index < 0x10; index = (s16)(index + 1), ptr++) + { + if(ptr->unk6 != -1) + { + stack[0] = ptr->unk124[0] + ptr->unk14; + stack[1] = ptr->unk124[1] + ptr->unk18; + if(!IsOnscreen_80A675C(ptr->unk144, stack)) + GroundObject_Delete(index); + } + } +} + +s32 sub_80ABD48(s32 r0) +{ + s32 index; + GroundObject *ptr; + + s32 r0_s32 = (s16)r0; + + index = 0; + ptr = &gGroundObjects[0]; + for(; index < 0x10; index = (s16)(index + 1), ptr++) + { + if(ptr->unk6 == r0_s32) return index; + } + + return -1; +} diff --git a/src/ground_sbin.c b/src/ground_sbin.c new file mode 100644 index 000000000..6aebf6cc6 --- /dev/null +++ b/src/ground_sbin.c @@ -0,0 +1,14 @@ +#include "global.h" +#include "file_system.h" + +#define GROUND_FILES_COUNT 0x2A5 + +extern const File gGroundFiles[GROUND_FILES_COUNT]; + +const FileArchive gGroundFileArchive = { + .magic = "pksdir0", + .count = GROUND_FILES_COUNT, + .entries = gGroundFiles, +}; + +UNUSED static const char sPksDir2[] = "pksdir0"; diff --git a/src/ground_script.c b/src/ground_script.c index 8ea4017e3..382405751 100644 --- a/src/ground_script.c +++ b/src/ground_script.c @@ -42,15 +42,15 @@ void GroundMap_Select(s16); -void GroundMap_SelectDungeon(s16, DungeonLocation*, u8); +void GroundMap_SelectDungeon(s32, DungeonLocation*, u32); void GroundMap_GetStationScript(ScriptInfoSmall *out, s16, s32, s32); void GroundLives_ExecuteScript(s32, s16 *, ScriptInfoSmall *); void GroundObject_ExecuteScript(s32, s16 *, ScriptInfoSmall *); void GroundEffect_ExecuteScript(s32, s16 *, ScriptInfoSmall *); -void GroundLives_Select(s16, s32 group, s32 sector); -void GroundObject_Select(s16, s32 group, s32 sector); -void GroundEffect_Select(s16, s32 group, s32 sector); -void GroundEvent_Select(s16, s32 group, s32 sector); +void GroundLives_Select(s32, s32 group, s32 sector); +void GroundObject_Select(s32, s32 group, s32 sector); +void GroundEffect_Select(s32, s32 group, s32 sector); +void GroundEvent_Select(s32, s32 group, s32 sector); void GroundLives_Cancel(s32 group, s32 sector); void GroundObject_Cancel(s32 group, s32 sector); void GroundEffect_Cancel(s32 group, s32 sector); @@ -91,7 +91,7 @@ bool8 sub_809AEEC(const char*); bool8 sub_809AF2C(const char*); bool8 sub_809AF6C(s16, const char*); void sub_809AFC8(bool8, s32, s32, const char*); -u32 sub_809B028(); +u32 sub_809B028(const MenuItem *, s32 a1_, s32 a2, s32 a3, s32 a4_, const char *text); bool8 sub_809B1C0(s32, s32, char[12]); void sub_809B1D4(u8, s32, s32, const char*); void sub_809C770(s16, s16); @@ -151,7 +151,7 @@ extern s16 gCurrentMap; extern s16 gUnknown_2039A32; extern s16 gUnknown_2039A34; -extern struct { const char *unk0; s32 unk4; } gChoices[9]; +extern MenuItem gChoices[9]; extern char gUnknown_81165D4[]; extern char gUnknown_81165F4[]; @@ -235,8 +235,8 @@ extern Item gUnknown_81167E4; bool8 sub_809124C(u8 id, u8 param_3); extern const u8 gUnknown_81167EC[]; void sub_80A56A0(s32, s32); -void sub_80A56F0(); -void sub_80A5704(); +void sub_80A56F0(s32 *); +void sub_80A5704(s32 *); void sub_809C760(void); void sub_809C6EC(void); void sub_809C6CC(u16 param_1); @@ -2934,13 +2934,13 @@ s32 ExecuteScriptCommand(Action *action) } if (!out) out = gUnknown_81166D8; // "" for (; scriptData->script.ptr->op == 0xd9; scriptData->script.ptr++) { - gChoices[sNumChoices].unk0 = scriptData->script.ptr->argPtr; - gChoices[sNumChoices].unk4 = sNumChoices + 1; + gChoices[sNumChoices].text = scriptData->script.ptr->argPtr; + gChoices[sNumChoices].menuAction = sNumChoices + 1; sNumChoices++; } if (sNumChoices <= 0) break; - gChoices[sNumChoices].unk0 = NULL; - gChoices[sNumChoices].unk4 = curCmd.argShort; + gChoices[sNumChoices].text = NULL; + gChoices[sNumChoices].menuAction = curCmd.argShort; switch (curCmd.op) { case 0xd2: case 0xd3: case 0xd6: { sub_809B028(gChoices, (u8)curCmd.argByte > 0, -1, 0, (s16)curCmd.arg1, out); diff --git a/src/move_checks.c b/src/move_checks.c index 0b395bc22..d27db7b84 100644 --- a/src/move_checks.c +++ b/src/move_checks.c @@ -14,7 +14,6 @@ #include "moves.h" #include "number_util.h" #include "status.h" -#include "status_actions.h" #include "text_util.h" #include "trap.h" #include "weather.h" diff --git a/src/move_orb_actions_1.c b/src/move_orb_actions_1.c index 018b9f162..225197dfe 100644 --- a/src/move_orb_actions_1.c +++ b/src/move_orb_actions_1.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "move_orb_actions_1.h" #include "dungeon_move_util.h" #include "dungeon_vram.h" #include "code_803E724.h" @@ -23,7 +24,6 @@ #include "moves.h" #include "number_util.h" #include "pokemon.h" -#include "status_actions.h" #include "status.h" #include "structs/dungeon_entity.h" #include "structs/map.h" @@ -148,19 +148,19 @@ bool8 DigMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) return flag; } -bool32 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 SweetScentMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerAccuracyStageTarget(pokemon,target,gUnknown_8106A50[0],TRUE); return TRUE; } -bool32 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 CharmMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ChangeAttackMultiplierTarget(pokemon,target,gUnknown_8106A4C[0],FloatToF248(0.5),TRUE); return TRUE; } -bool32 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { gDungeon->weather.unkE267[WEATHER_RAIN] = gMoveWeatherDuration; if (sub_807EAA0(1,0) == 0) { @@ -170,7 +170,7 @@ bool32 RainDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para return TRUE; } -bool32 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { gDungeon->weather.unkE267[WEATHER_HAIL] = gMoveWeatherDuration; if (sub_807EAA0(1,0) == 0) { @@ -180,15 +180,15 @@ bool32 HailMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) return TRUE; } -bool32 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 sub_80578EC(Entity *pokemon, Entity *target, Move *move, s32 param_4) { sub_8079F20(pokemon, target, 1, 0); return TRUE; } -bool32 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) +bool8 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4) { - bool32 flag; + bool8 flag; flag = FALSE; if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { @@ -200,20 +200,20 @@ bool32 BubbleMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_ return flag; } -bool32 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 EncoreMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { EncoreStatusTarget(pokemon, target); return TRUE; } -bool32 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 RageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { // {POKEMON_0} is enraged SetChargeStatusTarget(pokemon,target,STATUS_ENRAGED,move,gUnknown_80FAC88); return TRUE; } -bool32 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SuperFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 newHP; bool8 local_24; @@ -325,7 +325,7 @@ bool8 SwaggerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 return TRUE; } -bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) +bool8 SnoreMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4) { bool8 flag; @@ -350,7 +350,7 @@ bool8 ScreechMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 return TRUE; } -bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, u32 param_4) +bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, s32 param_4) { bool8 flag; @@ -364,7 +364,7 @@ bool8 RockSlideMoveAction(Entity *pokemon, Entity *target, Move * move, u32 para return flag; } -bool32 WeatherBallMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool32 WeatherBallMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { u32 weather; s32 flag; @@ -378,7 +378,7 @@ bool32 WeatherBallMoveAction(Entity * pokemon, Entity * target, Move * move, u32 return flag; } -bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 WhirlpoolMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { s24_8 modifier; bool8 flag; @@ -449,7 +449,7 @@ bool8 MirrorMoveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 para return TRUE; } -bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { EntityInfo *entityInfo; bool8 flag; @@ -466,7 +466,7 @@ bool8 OverheatMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ return flag; } -bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 AuroraBeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -493,7 +493,7 @@ bool8 MementoMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 return TRUE; } -bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 OctazookaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -582,7 +582,7 @@ bool8 CounterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 return TRUE; } -bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -599,7 +599,7 @@ bool8 FlameWheelMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para } // NOTE: Do we have a better name for this?? -bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -615,7 +615,7 @@ bool8 BasicFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param return flag; } -bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { u16 uVar1; uVar1 = (move->id == MOVE_FORESIGHT) ? 0x7A : 0x51; @@ -623,13 +623,13 @@ bool8 ExposeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return TRUE; } -bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 DoubleTeamMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50[0]); return TRUE; } -bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; s32 modifierInt; @@ -644,26 +644,26 @@ bool8 GustMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) } // NOTE: Is there a better name for this? -bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BasicRaiseDefenseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); return TRUE; } -bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 DisableMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ParalyzeStatusTarget(pokemon, target, TRUE); return TRUE; } // NOTE: Is there a better name for this? -bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BasicRaiseAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); return TRUE; } -bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { bool8 flag; @@ -678,13 +678,13 @@ bool8 RazorWindMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa return flag; } -bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BideMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { SetChargeStatusTarget(pokemon, target, STATUS_BIDE, move, gUnknown_80FAC74); return TRUE; } -bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 iVar2; bool8 local_18; @@ -700,7 +700,7 @@ bool8 Bide2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return local_18; } -bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -715,7 +715,7 @@ bool8 ShadowBallMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para return flag; } -bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -730,7 +730,7 @@ bool8 BiteMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -745,7 +745,7 @@ bool8 ThunderMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return flag; } -bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 diffHP; bool8 local_24; @@ -766,7 +766,7 @@ bool8 EndeavorMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ return local_24; } -bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; s24_8 modifier; @@ -778,7 +778,7 @@ bool8 FacadeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -793,7 +793,7 @@ bool8 sub_8058580(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -808,7 +808,7 @@ bool8 BrickBreakMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para return flag; } -bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -823,7 +823,7 @@ bool8 RockTombMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ return flag; } -bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { bool8 flag; @@ -838,7 +838,7 @@ bool8 FocusPunchMoveAction(Entity * pokemon, Entity * target, Move * move, u32 p return flag; } -bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { bool8 hasLiquidOoze; s32 uVar3; @@ -867,7 +867,7 @@ bool8 GigaDrainMoveAction(Entity * pokemon, Entity * target, Move * move, u32 pa return flag; } -bool8 ReversalMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 ReversalMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { s32 index; bool8 flag; @@ -890,7 +890,7 @@ bool8 ReversalMoveAction(Entity * pokemon, Entity * target, Move * move, u32 par return flag; } -bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { bool8 flag; @@ -904,13 +904,13 @@ bool8 SmellingSaltMoveAction(Entity * pokemon, Entity * target, Move * move, u32 return flag; } -bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MetalSoundMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 3, 1, TRUE); return TRUE; } -bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 index = gUnknown_8106A4C[0]; LowerAttackStageTarget(pokemon, target, index, 1, 1, TRUE); @@ -918,19 +918,19 @@ bool8 TickleMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return TRUE; } -bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_805889C(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ImmobilizedStatusTarget(pokemon, target); return TRUE; } -bool8 HazeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 HazeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { sub_8079E34(pokemon, target, TRUE); return TRUE; } -bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag = FALSE; if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) @@ -944,7 +944,7 @@ bool8 OutrageMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return flag; } -bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s24_8 weight; bool8 flag; @@ -955,7 +955,7 @@ bool8 LowKickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return flag; } -bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag = FALSE; EntityInfo *entityInfo; @@ -980,19 +980,19 @@ bool8 AncientPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 pa return flag; } -bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SynthesisMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { HealTargetHP(pokemon, target, gSynthesisHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); return TRUE; } -bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 AgilityMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseMovementSpeedTarget(pokemon, target, 0, TRUE); return TRUE; } -bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag = FALSE; if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) @@ -1006,13 +1006,13 @@ bool8 RapidSpinMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param return flag; } -bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SureShotMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { SureShotStatusTarget(pokemon, target, CalculateStatusTurns(target, gSureShotTurnRange, FALSE)); return TRUE; } -bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 CosmicPowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C[0], 1); RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50[0], 1); diff --git a/src/move_orb_actions_2.c b/src/move_orb_actions_2.c index 22c280086..a9494a6e0 100644 --- a/src/move_orb_actions_2.c +++ b/src/move_orb_actions_2.c @@ -1,5 +1,6 @@ #include "global.h" #include "globaldata.h" +#include "move_orb_actions_2.h" #include "dungeon_move_util.h" #include "dungeon_vram.h" #include "code_803E724.h" @@ -23,7 +24,7 @@ #include "moves.h" #include "number_util.h" #include "pokemon.h" -#include "status_actions.h" +#include "move_orb_actions_4.h" #include "status.h" #include "structs/dungeon_entity.h" #include "structs/map.h" @@ -33,15 +34,9 @@ #include "dungeon_misc.h" #include "dungeon_strings.h" -extern void sub_806A5B8(Entity *entity); -void sub_8075900(Entity *pokemon, u8 r1); extern u8 sub_8044B28(void); -extern void sub_807EC28(bool8); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); -extern void MudWaterSportEffect(u32); -extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); -extern void sub_806A6E8(Entity *); extern void EndAbilityImmuneStatus(Entity *, Entity *); extern u8 sub_806F4A4(Entity *, u32); @@ -49,19 +44,12 @@ extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u3 extern void nullsub_92(Entity *); extern u8 sub_807EAA0(u32, u32); -// move_util.h -extern bool8 sub_805727C(Entity *, Entity *, s32); -bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); -bool8 sub_80571F0(Entity * pokemon, Move *move); - -extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern void DealDamageToEntity(Entity *, s32, u32, u32); -extern s16 sub_8057600(Move *move, s32 itemID); extern u32 gUnknown_8106A4C; extern u32 gUnknown_8106A50; -bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag = FALSE; @@ -82,7 +70,7 @@ bool8 SkyAttackMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param } // NOTE: Is there a better name for this? -bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -97,7 +85,7 @@ bool8 BasicIceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ return flag; } -bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; EntityInfo *entityInfo; @@ -115,19 +103,19 @@ bool8 MeteorMashMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para return flag; } -bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 EndureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { EndureStatusTarget(pokemon, pokemon); return TRUE; } -bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ScaryFaceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerMovementSpeedTarget(pokemon, target, 1, TRUE); return TRUE; } -bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -142,7 +130,7 @@ bool8 sub_8058C00(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 rand; bool8 flag; @@ -159,7 +147,7 @@ bool8 PsywaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return flag; } -bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 param_5) +bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, s32 param_4, u32 param_5) { bool8 flag; @@ -174,7 +162,7 @@ bool8 sub_8058C98(Entity *pokemon, Entity *target, Move *move, u32 param_4, u32 return flag; } -bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag = FALSE; if(HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) @@ -188,13 +176,13 @@ bool8 PsychoBoostMoveAction(Entity *pokemon, Entity *target, Move *move, u32 par return flag; } -bool8 UproarMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 UproarMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { SleeplessStatusTarget(pokemon, target); return TRUE; } -bool8 WaterSpoutMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 WaterSpoutMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { s32 index; bool8 flag; @@ -217,7 +205,7 @@ bool8 WaterSpoutMoveAction(Entity * pokemon, Entity * target, Move * move, u32 p return flag; } -bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 PsychUpMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { s32 index; EntityInfo *iVar3; @@ -265,7 +253,7 @@ bool8 sub_8058E5C(Entity *pokemon, Entity *target, Move *move, s32 param_4) return flag; } -bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_8058EE0(Entity *pokemon, Entity *target, Move *move, s32 param_4) { HealTargetHP(pokemon, target, GetEntInfo(target)->maxHPStat / 2, 0, TRUE); return TRUE; @@ -309,7 +297,7 @@ bool8 NaturePowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 par return flag; } -bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -324,25 +312,25 @@ bool8 LickMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SelfDestructMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { HandleExplosion(pokemon, target, &target->pos, 1, GetMoveType(move), sub_8057600(move, param_4)); return TRUE; } -bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 StunSporeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ParalyzeStatusTarget(pokemon, target, TRUE); return TRUE; } -bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ChargeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { SetChargeStatusTarget(pokemon, target, STATUS_CHARGING, move, gUnknown_80FAD6C); return TRUE; } -bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -357,7 +345,7 @@ bool8 ThunderboltMoveAction(Entity *pokemon, Entity *target, Move *move, u32 par return flag; } -bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { MistStatusTarget(pokemon, target); return TRUE; @@ -387,7 +375,7 @@ bool8 FissureMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 return flag; } -bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -402,7 +390,7 @@ bool8 ExtrasensoryMoveAction(Entity *pokemon, Entity *target, Move *move, u32 pa return flag; } -bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SafeguardMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { SafeguardStatusTarget(pokemon, target); return TRUE; @@ -471,10 +459,10 @@ bool8 SkillSwapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param return flag; } -bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) +bool8 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 i; - bool32 ret = FALSE; + bool8 ret = FALSE; EntityInfo *pokeInfo = GetEntInfo(pokemon); EntityInfo *targetInfo = GetEntInfo(target); bool32 moveFound = FALSE; @@ -510,7 +498,7 @@ bool32 SketchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4 return ret; } -bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -525,7 +513,7 @@ bool8 HeadbuttMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ return flag; } -bool8 DoubleEdgeMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 DoubleEdgeMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { s32 HP; bool8 flag; @@ -548,7 +536,7 @@ bool8 DoubleEdgeMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para return flag; } -bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { gDungeon->weather.unkE267[WEATHER_SANDSTORM] = gMoveWeatherDuration; if(sub_807EAA0(1, 0) == 0) @@ -558,13 +546,13 @@ bool8 SandstormMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param return TRUE; } -bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_8059528(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerAccuracyStageTarget(pokemon, target, gUnknown_8106A4C, TRUE); return TRUE; } -bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -579,13 +567,13 @@ bool8 SmogMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 GrowthMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseAttackStageTarget(pokemon, target, gUnknown_8106A50, 1); return TRUE; } -bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -600,7 +588,7 @@ bool8 SacredFireMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para return flag; } -bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,s32 param_4) { u8 moveType; u8 local_20; @@ -618,7 +606,7 @@ bool8 sub_80595EC(Entity * pokemon,Entity * target,Move * move,u32 param_4) } } -bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { u8 weather; // weather and flag are reused in same variable s24_8 modifier; @@ -640,7 +628,7 @@ bool8 SolarBeamMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param return weather; } -bool8 SonicboomMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 SonicboomMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { u8 local_20; @@ -650,7 +638,7 @@ bool8 SonicboomMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param return local_20; } -bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { bool8 flag; @@ -666,13 +654,13 @@ bool8 FlyMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) return flag; } -bool8 ExplosionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 ExplosionMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { HandleExplosion(pokemon,target,&target->pos,2,GetMoveType(move),sub_8057600(move,param_4)); return TRUE; } -bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4) +bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, s32 param_4) { bool8 flag; @@ -691,7 +679,7 @@ bool8 DiveMoveAction(Entity * pokemon, Entity * target, Move * move, u32 param_4 return flag; } -bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -706,13 +694,13 @@ bool8 MuddyWaterMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para return flag; } -bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 StockpileMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { HandleStockpile(pokemon, target); return TRUE; } -bool8 TwisterMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 TwisterMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { s32 modifierInt = 1; bool8 flag = FALSE; @@ -731,7 +719,7 @@ bool8 TwisterMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4 return flag; } -bool8 TwineedleMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 TwineedleMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { bool8 flag; @@ -747,7 +735,7 @@ bool8 TwineedleMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param return flag; } -bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 HP; @@ -758,13 +746,13 @@ bool8 sub_80599EC(Entity *pokemon, Entity *target, Move *move, u32 param_4) return TRUE; } -bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MinimizeMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseAccuracyStageTarget(pokemon, target, gUnknown_8106A50); return TRUE; } -bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,s32 param_4) { u8 local_20; u32 level; @@ -776,25 +764,25 @@ bool8 sub_8059A2C(Entity * pokemon,Entity * target,Move * move,u32 param_4) return local_20; } -bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SupersonicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ConfuseStatusTarget(pokemon, target, TRUE); return TRUE; } -bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 TauntMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { TauntStatusTarget(pokemon, target); return TRUE; } -bool8 MoonlightMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MoonlightMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { HealTargetHP(pokemon, target, gMoonlightHealValueByWeather[GetApparentWeather(pokemon)], 0, TRUE); return TRUE; } -bool8 HornDrillMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 HornDrillMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { u8 local_20; @@ -810,13 +798,13 @@ bool8 HornDrillMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param } } -bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SwordsDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2); return TRUE; } -bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { u8 moveType; Move *movePtr; @@ -860,13 +848,13 @@ bool8 ConversionMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para } } -bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 Conversion2MoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { Conversion2StatusTarget(pokemon, target); return TRUE; } -bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; flag = FALSE; @@ -882,19 +870,19 @@ bool8 HelpingHandMoveAction(Entity *pokemon, Entity *target, Move *move, u32 par return flag; } -bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_8059CD8(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 2); return TRUE; } -bool8 WarpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 WarpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { WarpTarget(pokemon, target, 0, NULL); return TRUE; } -bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -909,13 +897,13 @@ bool8 ThundershockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 pa return flag; } -bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ThunderWaveMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ParalyzeStatusTarget(pokemon, target, TRUE); return TRUE; } -bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -930,25 +918,25 @@ bool8 ZapCannonMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param return flag; } -bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BlockMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { ImmobilizedStatusTarget(pokemon, target); return TRUE; } -bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 PoisonGasMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { PoisonedStatusTarget(pokemon, target, TRUE); return TRUE; } -bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ToxicMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { BadlyPoisonedStatusTarget(pokemon, target, TRUE); return TRUE; } -bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 PoisonFangMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; diff --git a/src/move_orb_actions_3.c b/src/move_orb_actions_3.c index 077c54e98..55040671c 100644 --- a/src/move_orb_actions_3.c +++ b/src/move_orb_actions_3.c @@ -1,6 +1,7 @@ #include "global.h" #include "globaldata.h" #include "dungeon_vram.h" +#include "move_orb_actions_3.h" #include "code_803E724.h" #include "code_806CD90.h" #include "code_8077274_1.h" @@ -12,6 +13,7 @@ #include "constants/targeting.h" #include "constants/type.h" #include "constants/weather.h" +#include "dungeon_ai.h" #include "dungeon_logic.h" #include "dungeon_config.h" #include "run_dungeon.h" @@ -30,7 +32,7 @@ #include "number_util.h" #include "pokemon.h" #include "status.h" -#include "status_actions.h" +#include "move_orb_actions_4.h" #include "structs/dungeon_entity.h" #include "structs/map.h" #include "structs/str_dungeon.h" @@ -38,36 +40,23 @@ #include "trap.h" #include "weather.h" -extern void sub_806A5B8(Entity *entity); -void sub_8075900(Entity *pokemon, u8 r1); extern u8 sub_8044B28(void); extern void sub_807EC28(bool8); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); static void sub_805A7D4(Entity *, Entity *, Item *, DungeonPos *); extern void MudWaterSportEffect(u32); -extern void CalcDamage(Entity *, Entity *, u8, u32, u32, s32 *, u32, u16, u32); extern void sub_806A6E8(Entity *); -extern void EndAbilityImmuneStatus(Entity *, Entity *); extern u8 sub_806F4A4(Entity *, u32); extern void HandleExplosion(Entity *pokemon, Entity *target, DungeonPos *pos, u32, u8 moveType, s16); extern void nullsub_92(Entity *); extern u8 sub_807EAA0(u32, u32); -// move_util.h -extern bool8 sub_805727C(Entity *, Entity *, s32); -bool8 RollSecondaryEffect(Entity *pokemon, s32 chance); -bool8 sub_80571F0(Entity * pokemon, Move *move); - -extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern void DealDamageToEntity(Entity *, s32, u32, u32); -extern s16 sub_8057600(Move *move, s32 itemID); - extern u32 gUnknown_8106A4C; extern u32 gUnknown_8106A50; -bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -82,7 +71,7 @@ bool8 PoisonStingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 par return flag; } -bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5) +bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4,u8 param_5) { u8 moveType; u32 movePower; @@ -111,7 +100,7 @@ bool8 JumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_ return flag; } -bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) +bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4) { bool8 flag; @@ -132,7 +121,7 @@ bool8 BounceMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4) return flag; } -bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 param_4,u8 param_5) +bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,s32 param_4,u8 param_5) { u8 moveType; u32 movePower; @@ -161,7 +150,7 @@ bool8 HiJumpKickMoveAction(Entity * pokemon,Entity * target,Move * move,u32 para return flag; } -bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -189,14 +178,14 @@ bool8 TriAttackMoveAction(Entity * pokemon, Entity * target, Move *move, u32 par return flag; } -bool8 TrickMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) +bool8 TrickMoveAction(Entity * pokemon,Entity * target, Move *move, s32 param_4) { EntityInfo *r9; EntityInfo *r8; EntityInfo *r7; EntityInfo *sp; Item item; - bool32 flag; + bool8 flag; Item *item1; Item *item2; @@ -245,7 +234,7 @@ bool8 TrickMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) } } -bool8 TripleKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 TripleKickMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -254,7 +243,7 @@ bool8 TripleKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 pa return flag; } -bool8 MudWaterSportMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 MudWaterSportMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { if(move->id == MOVE_MUD_SPORT) { @@ -267,7 +256,7 @@ bool8 MudWaterSportMoveAction(Entity * pokemon, Entity * target, Move *move, u32 return TRUE; } -bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -282,24 +271,24 @@ bool8 MudSlapMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return flag; } -bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ThiefMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { return ThiefAction(pokemon, target, move, param_4); } -bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 AmnesiaMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { RaiseDefenseStageTarget(pokemon, target, gUnknown_8106A50, 2); return TRUE; } -bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 GrowlMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, TRUE); return TRUE; } -bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; s32 modifierInt; @@ -318,7 +307,7 @@ bool8 SurfMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { EntityInfo * entityInfo; EntityInfo * targetEntityInfo; @@ -341,7 +330,7 @@ bool8 RolePlayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ } } -bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { gDungeon->weather.unkE267[WEATHER_SUNNY] = gMoveWeatherDuration; if (sub_807EAA0(1,0) == 0) { @@ -350,19 +339,19 @@ bool8 SunnyDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_ return TRUE; } -bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 LeerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerDefenseStageTarget(pokemon, target, gUnknown_8106A4C, 1, 1, TRUE); return TRUE; } -bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 WishMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { WishStatusTarget(pokemon, target); return TRUE; } -bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -377,15 +366,15 @@ bool8 FakeOutMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return flag; } -bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 sub_805A450(Entity *pokemon, Entity *target, Move *move, s32 param_4) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC730); return FALSE; } -bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { - bool32 flag; + bool8 flag; Item item; DungeonPos pos; @@ -404,25 +393,25 @@ bool8 PayDayMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return flag; } -bool8 AssistMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 AssistMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { TryDisplayDungeonLoggableMessage3(pokemon,target,gUnknown_80FC74C); return FALSE; } -bool8 RestMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 RestMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { NappingStatusTarget(pokemon, target, CalculateStatusTurns(target, gNappingTurnRange, FALSE)); return TRUE; } -bool8 IngrainMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 IngrainMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { IngrainedStatusTarget(pokemon, target); return TRUE; } -bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { u8 *stockpileStage; @@ -437,13 +426,13 @@ bool8 SwallowMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4 return TRUE; } -bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 CurseMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { CurseStatusTarget(pokemon, target); return TRUE; } -bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -451,10 +440,10 @@ bool8 sub_805A568(Entity * pokemon, Entity * target, Move *move, u32 param_4) return flag; } -bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { u32 stat; - bool32 flag; + bool8 flag; flag = FALSE; if (HandleDamagingMove(pokemon, target, move, IntToF248_2(1), param_4) != 0) { @@ -468,10 +457,10 @@ bool8 SuperpowerMoveAction(Entity *pokemon, Entity *target, Move *move, u32 para return flag; } -bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 stat, u32 param_5) +bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, s32 stat, u32 param_5) { EntityInfo *entityInfo; - bool32 flag; + bool8 flag; flag = FALSE; if (HandleDamagingMove(pokemon,target,move,IntToF248_2(1),param_5) != 0) { @@ -485,7 +474,7 @@ bool8 SteelWingMoveAction(Entity *pokemon, Entity *target, Move *move, u32 stat, return flag; } -bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { u8 *stockpileStage; @@ -500,7 +489,7 @@ bool8 SpitUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return TRUE; } -bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -515,7 +504,7 @@ bool8 DynamicPunchMoveAction(Entity *pokemon, Entity *target, Move *move, u32 pa return flag; } -bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 KnockOffMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { EntityInfo *entityInfo; EntityInfo *targetEntityInfo; @@ -579,7 +568,7 @@ static void sub_805A7D4(Entity * pokemon, Entity * target, Item *item, sub_804652C(pokemon,&stackEntity,item,1,0); } -bool8 SplashMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 SplashMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { int x; int y; @@ -677,13 +666,13 @@ _0805AA5E: return TRUE; } -bool8 sub_805AAD0(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 sub_805AAD0(Entity * pokemon, Entity * target, Move *move, s32 param_4) { FixedDamageStatusTarget(pokemon, pokemon); return TRUE; } -bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 param_4) +bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, s32 param_4) { EntityInfo *info; bool8 flag; @@ -702,13 +691,13 @@ bool8 BellyDrumMoveAction(Entity * pokemon,Entity * target, Move *move, u32 para return flag; } -bool8 LightScreenMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 LightScreenMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { LightScreenStatusTarget(pokemon, target); return TRUE; } -bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -751,7 +740,7 @@ bool8 SecretPowerMoveAction(Entity * pokemon, Entity * target, Move *move, u32 p return flag; } -bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -765,7 +754,7 @@ bool8 sub_805AC90(Entity * pokemon, Entity * target, Move *move, u32 param_4) return flag; } -bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { s32 stat = gUnknown_8106A4C; RaiseAttackStageTarget(pokemon, target, stat, 1); @@ -773,24 +762,24 @@ bool8 BulkUpMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) return TRUE; } -bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 ObserverOrbAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { PausedStatusTarget(pokemon, target, 1, CalculateStatusTurns(target, gObserverOrbPausedTurnRange, TRUE), TRUE); return TRUE; } -bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 FeatherDanceMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { LowerAttackStageTarget(pokemon, target, gUnknown_8106A4C, 2, 1, TRUE); return TRUE; } -bool32 BeatUpMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 BeatUpMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { s32 numPossibleTargets; s32 i; Entity **possibleTargets; - bool32 flag = FALSE; + bool8 flag = FALSE; EntityInfo *info = GetEntInfo(pokemon); if (info->isNotTeamMember) { @@ -823,7 +812,7 @@ bool32 BeatUpMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param return flag; } -bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param_4) +bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, s32 param_4) { bool8 flag; @@ -832,7 +821,7 @@ bool8 BlastBurnMoveAction(Entity *pokemon, Entity *target, Move *move, u32 param return flag; } -bool8 CrushClawMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 CrushClawMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -846,7 +835,7 @@ bool8 CrushClawMoveAction(Entity * pokemon, Entity * target, Move *move, u32 par return flag; } -bool8 BlazeKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 BlazeKickMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -861,7 +850,7 @@ bool8 BlazeKickMoveAction(Entity * pokemon, Entity * target, Move *move, u32 par return flag; } -bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { bool8 flag; @@ -888,7 +877,7 @@ bool8 PresentMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param } } -bool8 EruptionMoveAction(Entity * pokemon, Entity * target, Move *move, u32 param_4) +bool8 EruptionMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { EntityInfo *entityInfo; s32 maxHp; @@ -915,7 +904,7 @@ bool8 EruptionMoveAction(Entity * pokemon, Entity * target, Move *move, u32 para return flag; } -bool8 GlareMoveAction(Entity * pokemon,Entity * target,Move *move) +bool8 GlareMoveAction(Entity * pokemon,Entity * target,Move *move,s32 param_4) { ParalyzeStatusTarget(pokemon,target, TRUE); return TRUE; @@ -948,13 +937,13 @@ bool8 PoisonTailMoveAction(Entity * pokemon, Entity * target, Move *move, s32 pa return flag; } -bool8 RoarMoveAction(Entity * pokemon, Entity * target) +bool8 RoarMoveAction(Entity * pokemon, Entity * target, Move *move, s32 param_4) { BlowAwayTarget(pokemon, target, GetEntInfo(pokemon)->action.direction); return TRUE; } -bool8 HandleColorChange(Entity * pokemon, Entity * target) +bool8 HandleColorChange(Entity * pokemon, Entity * target, Move *move, s32 param_4) { u8 newType; const char *typeString; diff --git a/src/move_orb_actions_4.c b/src/move_orb_actions_4.c index 169f6360c..96a8e6a53 100644 --- a/src/move_orb_actions_4.c +++ b/src/move_orb_actions_4.c @@ -1,6 +1,8 @@ #include "global.h" #include "globaldata.h" -#include "status_actions.h" +#include "move_orb_actions_4.h" +#include "move_orb_actions_2.h" +#include "dungeon_ai.h" #include "dungeon_move_util.h" #include "dungeon_message.h" #include "dungeon_move.h" @@ -20,6 +22,7 @@ #include "dungeon_map_access.h" #include "dungeon_misc.h" #include "dungeon_util.h" +#include "move_effects_target.h" #include "move_util.h" #include "moves.h" #include "number_util.h" @@ -35,15 +38,8 @@ extern void sub_807F43C(Entity *, Entity *); extern void HandleOneRoomOrb(Entity *, Entity *); -extern u32 GetRandomFloorItem(u32); -extern void sub_80464C8(Entity *, DungeonPos *, Item *); extern void sub_806F370(Entity *r0, Entity *r1, u32, u32, u8 *, u8, s32, u32, u32, u32); -extern void sub_807FC3C(DungeonPos *, u32, u32); -extern void sub_8042A64(DungeonPos *); extern void ShowWholeRevealedDungeonMap(void); -extern void sub_80498A8(s32, s32); -extern void sub_8042A54(DungeonPos *); -extern void sub_8049BB0(s32, s32); extern void HandleDroughtOrbAction(Entity *); extern void HandleLuminousOrbAction(Entity *pokemon); extern void HandleTrawlOrbAction(Entity *, Entity *); @@ -52,25 +48,8 @@ extern s16 sub_803D970(u32); extern bool8 sub_806AA0C(s32, u32); extern void sub_806BB6C(Entity *, s32); extern void HandleSwitcherOrb(Entity *, Entity *, u32); -extern void sub_806A6E8(Entity *); - -// TODO include dungeon_ai.h when SqueezedStatusTarget is figured out -extern void LowerDefenseStageTarget(Entity *, Entity *, s32, s32, u8, bool8); -extern void RaiseAttackStageTarget(Entity *, Entity *, s32, s32); -extern void PoisonedStatusTarget(Entity *, Entity *, bool8); -extern void RaiseDefenseStageTarget(Entity *, Entity *, s32, s32); -extern void InfatuateStatusTarget(Entity *, Entity *, bool8); -extern void LowerAttackStageTarget(Entity *, Entity *, s32, s32, u8, bool8); -extern void PetrifiedStatusTarget(Entity *, Entity *); -extern void WrapTarget(Entity *, Entity *); - -// TODO having matching issues when this isn't s32.. (move_effects_target.h) -extern void SqueezedStatusTarget(Entity *, Entity *, s32, bool32); -extern void SleepStatusTarget(Entity *, Entity *, s32, s32); extern void DealDamageToEntity(Entity *, s32, u32, u32); -extern bool8 MoveRequiresCharging(Entity* pokemon,u16 moveID); -extern void sub_80783C4(Entity *, Entity *, bool8); extern u32 gUnknown_8106A50; extern u32 gUnknown_8106A4C; diff --git a/src/pokemon_mail.c b/src/pokemon_mail.c index aa124c544..533a7c4d3 100644 --- a/src/pokemon_mail.c +++ b/src/pokemon_mail.c @@ -123,7 +123,7 @@ void CreateRescueTitle(unkStruct_802C39C *param_1) else uVar1 = sub_803C1D0(¶m_1->unk8->dungeon, param_1->mail->missionType); - PrintStringOnWindow(180, param_1->y, sub_803C1F0(uVar1), param_1->unk0[0], 0); + PrintStringOnWindow(180, param_1->y, GetMissionRankText(uVar1), param_1->unk0[0], 0); } void CreateRescueDescription(unkStruct_802C39C *param_1) @@ -329,7 +329,7 @@ void CreateRescueDescription(unkStruct_802C39C *param_1) y += 12; PrintStringOnWindow(10, y, gDifficultyText, param_1->unk0[0], 0); - PrintStringOnWindow(68, y, sub_803C1F0(uVar3), param_1->unk0[0], 0); + PrintStringOnWindow(68, y, GetMissionRankText(uVar3), param_1->unk0[0], 0); y += 12; PrintStringOnWindow(10, y, gRewardText, param_1->unk0[0], 0); diff --git a/src/thank_you_wonder_mail.c b/src/thank_you_wonder_mail.c index 946b3fbf0..ffe5b2ba0 100644 --- a/src/thank_you_wonder_mail.c +++ b/src/thank_you_wonder_mail.c @@ -1374,7 +1374,7 @@ void UpdateThankYouMailText(void) monName = GetMonSpecies(MONSTER_PELIPPER); strcpy(sUnknown_203B2C4->unk53C.clientName,monName); // 0x53C sUnknown_203B2C4->unk53C.clientSpecies = MONSTER_PELIPPER; // 0x550 - sUnknown_203B2C4->unk53C.unk16 = 2; // 0x552 + sUnknown_203B2C4->unk53C.rewardType = 2; // 0x552 sUnknown_203B2C4->unk53C.moneyReward = 0; // 0x554 mailIndex = GetMailIndex(6,sUnknown_203B2C4->unk430); mail = GetMailatIndex(mailIndex); diff --git a/src/titlemenu_sbin.c b/src/titlemenu_sbin.c new file mode 100644 index 000000000..c87f31703 --- /dev/null +++ b/src/titlemenu_sbin.c @@ -0,0 +1,66 @@ +#include "global.h" +#include "file_system.h" + +#define TITLE_MENU_FILES_COUNT 22 + +extern const File gTitleMenuFiles[TITLE_MENU_FILES_COUNT]; + +const FileArchive gTitleMenuFileArchive = { + .magic = "pksdir0", + .count = TITLE_MENU_FILES_COUNT, + .entries = gTitleMenuFiles, +}; + +UNUSED static const char sPksDir2[] = "pksdir0"; + +extern const u8 gUnknown_83801A0[]; +extern const u8 gUnknown_8380AB8[]; +extern const u8 gUnknown_8382884[]; +extern const u8 gUnknown_8382C04[]; +extern const u8 gUnknown_8384914[]; +extern const u8 gUnknown_8384C9C[]; +extern const u8 gUnknown_8388AD0[]; +extern const u8 gUnknown_8388E50[]; +extern const u8 gUnknown_838CF98[]; +extern const u8 gUnknown_838D318[]; +extern const u8 gUnknown_8391C48[]; +extern const u8 gUnknown_8391FC8[]; +extern const u8 gUnknown_83923A0[]; +extern const u8 gUnknown_8392638[]; +extern const u8 gUnknown_8392B88[]; +extern const u8 gUnknown_8398A9C[]; +extern const u8 gUnknown_8399F84[]; +extern const u8 gUnknown_839A304[]; +extern const u8 gUnknown_839B584[]; +extern const u8 gUnknown_839B814[]; +extern const u8 gUnknown_83A1574[]; +extern const u8 gUnknown_83A2AF4[]; + + +const File gTitleMenuFiles[TITLE_MENU_FILES_COUNT] = { + [0] = { "clmkpat", gUnknown_83801A0}, + [1] = { "commun0", gUnknown_8380AB8}, + [2] = { "commun0p", gUnknown_8382884}, + [3] = { "subdef", gUnknown_8382C04}, + [4] = { "subdefp", gUnknown_8384914}, + [5] = { "titlen0", gUnknown_8384C9C}, + [6] = { "titlen0p", gUnknown_8388AD0}, + [7] = { "titlen1", gUnknown_8388E50}, + [8] = { "titlen1p", gUnknown_838CF98}, + [9] = { "titlen2", gUnknown_838D318}, + [10] = { "titlen2p", gUnknown_8391C48}, + [11] = { "tmrkpat", gUnknown_8391FC8}, + [12] = { "wlicpat", gUnknown_83923A0}, + [13] = { "wmapcani", gUnknown_8392638}, + [14] = { "wmapfont", gUnknown_8392B88}, + [15] = { "wmapmcc", gUnknown_8398A9C}, + [16] = { "wmappal", gUnknown_8399F84}, + [17] = { "wmapspr", gUnknown_839A304}, + [18] = { "wmp2cani", gUnknown_839B584}, + [19] = { "wmp2font", gUnknown_839B814}, + [20] = { "wmp2mcc", gUnknown_83A1574}, + [21] = { "wmp2pal", gUnknown_83A2AF4}, +}; + +UNUSED ALIGNED(4) static const char sPksDir3[] = "pksdir0"; + diff --git a/src/warp_target.c b/src/warp_target.c index 1648999a2..df2ee2388 100644 --- a/src/warp_target.c +++ b/src/warp_target.c @@ -29,11 +29,8 @@ extern u32 gDungeonFramesCounter; -void sub_804EB30(); bool8 ExposeTrap(s32 x, s32 y); void ShowWholeRevealedDungeonMap(); -void sub_8049ED4(); -void sub_806A5B8(Entity *); u8 sub_8045888(Entity *); void sub_807EC28(u32); u8 sub_8044B28(void); diff --git a/src/weather.c b/src/weather.c index c06790b02..5a08c3b4c 100644 --- a/src/weather.c +++ b/src/weather.c @@ -37,7 +37,6 @@ #include "sprite.h" #include "dungeon_strings.h" -extern void TriggerWeatherAbilities(void); extern void sub_804178C(u32); extern void sub_803E874(bool8 r10, s32 r9); extern s32 CalculateStatusTurns(Entity *target, const s16 *turnRange, bool8 factorCurerSkills); diff --git a/src/wonder_mail_2.c b/src/wonder_mail_2.c index 7f4cb54c8..9371f3def 100644 --- a/src/wonder_mail_2.c +++ b/src/wonder_mail_2.c @@ -165,7 +165,7 @@ void sub_802B3E0(void) monName = GetMonSpecies(MONSTER_PELIPPER); strcpy(sUnknown_203B2C8->unk114.clientName, monName); sUnknown_203B2C8->unk114.clientSpecies = MONSTER_PELIPPER; - sUnknown_203B2C8->unk114.unk16 = 2; + sUnknown_203B2C8->unk114.rewardType = 2; sUnknown_203B2C8->unk114.moneyReward = 0; IncrementFriendRescueSuccesses(); mail = GetMailatIndex(sUnknown_203B2C8->unk1); diff --git a/tools/dungeonjson/json11.cpp b/tools/dungeonjson/json11.cpp index 1da530206..adcb83e51 100644 --- a/tools/dungeonjson/json11.cpp +++ b/tools/dungeonjson/json11.cpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace json11 { diff --git a/tools/mapjson/json11.cpp b/tools/mapjson/json11.cpp index 1da530206..adcb83e51 100644 --- a/tools/mapjson/json11.cpp +++ b/tools/mapjson/json11.cpp @@ -23,6 +23,7 @@ #include #include #include +#include namespace json11 {