From 7648420bb645270279da69bd8a7a149b7ca312b7 Mon Sep 17 00:00:00 2001 From: Eebit Date: Mon, 8 Jan 2024 18:06:33 -0500 Subject: [PATCH 1/3] (banim-efxmagic-gleipnir) Decompile --- asm/banim-efxmagic-66514.s | 2513 --------------------------------- include/efxbattle.h | 3 +- include/efxmagic.h | 72 +- ldscript.txt | 1 + src/banim-efxmagic-gleipnir.c | 1581 +++++++++++++++++++++ 5 files changed, 1620 insertions(+), 2550 deletions(-) create mode 100644 src/banim-efxmagic-gleipnir.c diff --git a/asm/banim-efxmagic-66514.s b/asm/banim-efxmagic-66514.s index f34a8d46d..a7aa823f3 100644 --- a/asm/banim-efxmagic-66514.s +++ b/asm/banim-efxmagic-66514.s @@ -2,2519 +2,6 @@ .SYNTAX UNIFIED - THUMB_FUNC_START sub_8068B80 -sub_8068B80: @ 0x08068B80 - push {r4, r5, lr} - adds r5, r0, #0 - bl SpellFx_Begin - bl SpellFx_ClearBG1Position - ldr r0, _08068BB4 @ gUnknown_085D8318 - movs r1, #3 - bl Proc_Start - adds r4, r0, #0 - str r5, [r4, #0x5c] - movs r0, #0 - strh r0, [r4, #0x2c] - adds r0, r5, #0 - bl GetAnimRoundTypeAnotherSide - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - bl CheckRoundMiss - adds r4, #0x29 - strb r0, [r4] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_08068BB4: .4byte gUnknown_085D8318 - - THUMB_FUNC_END sub_8068B80 - - THUMB_FUNC_START sub_8068BB8 -sub_8068BB8: @ 0x08068BB8 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x5c] - bl GetAnimAnotherSide - adds r5, r0, #0 - bl EfxGetCamMovDuration - adds r2, r0, #0 - ldrh r0, [r4, #0x2c] - adds r0, #1 - strh r0, [r4, #0x2c] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #1 - bne _08068BE4 - ldr r0, [r4, #0x5c] - movs r1, #1 - negs r1, r1 - bl NewEfxFarAttackWithDistance - b _08068D14 -_08068BE4: - movs r0, #0x2c - ldrsh r1, [r4, r0] - adds r0, r2, #2 - cmp r1, r0 - bne _08068C08 - bl GetBanimDragonStatusType - cmp r0, #1 - bne _08068BF8 - b _08068D14 -_08068BF8: - bl GetBanimDragonStatusType - cmp r0, #2 - bne _08068C02 - b _08068D14 -_08068C02: - bl sub_8068D78 - b _08068D14 -_08068C08: - adds r0, r2, #0 - adds r0, #0x22 - cmp r1, r0 - bne _08068C1C - adds r0, r5, #0 - bl sub_80692B0 - movs r0, #0xeb - lsls r0, r0, #2 - b _08068CD4 -_08068C1C: - adds r0, r2, #0 - adds r0, #0x60 - cmp r1, r0 - bne _08068C32 - adds r0, r5, #0 - bl sub_8069488 - adds r0, r5, #0 - bl sub_8069AC4 - b _08068D14 -_08068C32: - adds r0, r2, #0 - adds r0, #0xce - cmp r1, r0 - bne _08068C42 - adds r0, r5, #0 - bl sub_8069E88 - b _08068D14 -_08068C42: - movs r3, #0x97 - lsls r3, r3, #1 - adds r0, r2, r3 - cmp r1, r0 - bne _08068C8C - adds r0, r5, #0 - movs r1, #0xa - bl NewEfxFlashBgWhite - bl GetBanimDragonStatusType - cmp r0, #1 - beq _08068C68 - bl GetBanimDragonStatusType - cmp r0, #2 - beq _08068C68 - bl sub_8068D9C -_08068C68: - bl NewEfxSpellCast - ldrh r1, [r5, #0x10] - movs r0, #9 - orrs r0, r1 - strh r0, [r5, #0x10] - adds r4, #0x29 - ldrb r1, [r4] - adds r0, r5, #0 - bl StartBattleAnimHitEffectsDefault - ldrb r0, [r4] - cmp r0, #0 - bne _08068D14 - adds r0, r5, #0 - bl EfxPlayHittedSFX - b _08068D14 -_08068C8C: - movs r3, #0x9a - lsls r3, r3, #1 - adds r0, r2, r3 - cmp r1, r0 - bne _08068CB0 - adds r0, r4, #0 - adds r0, #0x29 - ldrb r0, [r0] - cmp r0, #0 - beq _08068D14 - bl SpellFx_Finish - bl RegisterEfxSpellCastEnd - adds r0, r4, #0 - bl Proc_Break - b _08068D14 -_08068CB0: - movs r3, #0x9c - lsls r3, r3, #1 - adds r0, r2, r3 - cmp r1, r0 - bne _08068CE8 - ldr r0, [r4, #0x5c] - movs r1, #0xf - movs r2, #9 - bl StartSpellThing_MagicQuake - adds r0, r5, #0 - movs r1, #0x1e - bl StartSubSpell_efxGespenstBG4 - adds r0, r5, #0 - bl StartSubSpell_efxGespenstBGCOL2 - ldr r0, _08068CE4 @ 0x000003AD -_08068CD4: - movs r1, #0x80 - lsls r1, r1, #1 - movs r2, #0x78 - movs r3, #1 - bl PlaySFX - b _08068D14 - .align 2, 0 -_08068CE4: .4byte 0x000003AD -_08068CE8: - movs r3, #0xa4 - lsls r3, r3, #1 - adds r0, r2, r3 - cmp r1, r0 - bne _08068CFE - ldr r0, [r4, #0x5c] - movs r1, #0xf - movs r2, #8 - bl StartSpellThing_MagicQuake - b _08068D14 -_08068CFE: - ldr r3, _08068D1C @ 0x00000161 - adds r0, r2, r3 - cmp r1, r0 - bne _08068D14 - bl SpellFx_Finish - bl RegisterEfxSpellCastEnd - adds r0, r4, #0 - bl Proc_Break -_08068D14: - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_08068D1C: .4byte 0x00000161 - - THUMB_FUNC_END sub_8068BB8 - - THUMB_FUNC_START sub_8068D20 -sub_8068D20: @ 0x08068D20 - push {r4, lr} - sub sp, #4 - adds r4, r0, #0 - movs r0, #0x2c - ldrsh r3, [r4, r0] - movs r0, #0x10 - str r0, [sp] - movs r0, #1 - movs r1, #4 - movs r2, #0x10 - bl Interpolate - adds r3, r0, #0 - ldr r0, _08068D70 @ gPaletteBuffer - movs r1, #6 - movs r2, #0xa - bl EfxPalBlackInOut - bl EnablePaletteSync - ldrh r0, [r4, #0x2c] - adds r0, #1 - strh r0, [r4, #0x2c] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x11 - bne _08068D68 - movs r0, #0 - strh r0, [r4, #0x2c] - ldr r1, _08068D74 @ gEfxBgSemaphore - ldr r0, [r1] - subs r0, #1 - str r0, [r1] - adds r0, r4, #0 - bl Proc_Break -_08068D68: - add sp, #4 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068D70: .4byte gPaletteBuffer -_08068D74: .4byte gEfxBgSemaphore - - THUMB_FUNC_END sub_8068D20 - - THUMB_FUNC_START sub_8068D78 -sub_8068D78: @ 0x08068D78 - push {lr} - ldr r1, _08068D94 @ gEfxBgSemaphore - ldr r0, [r1] - adds r0, #1 - str r0, [r1] - ldr r0, _08068D98 @ gUnknown_085D8330 - movs r1, #3 - bl Proc_Start - movs r1, #0 - strh r1, [r0, #0x2c] - pop {r0} - bx r0 - .align 2, 0 -_08068D94: .4byte gEfxBgSemaphore -_08068D98: .4byte gUnknown_085D8330 - - THUMB_FUNC_END sub_8068D78 - - THUMB_FUNC_START sub_8068D9C -sub_8068D9C: @ 0x08068D9C - push {lr} - ldr r1, _08068DB0 @ gBanimGackgroundIndex - movs r2, #0 - ldrsh r0, [r1, r2] - cmp r0, #0 - bne _08068DB4 - movs r0, #4 - bl EfxChapterMapFadeOUT - b _08068DCE - .align 2, 0 -_08068DB0: .4byte gBanimGackgroundIndex -_08068DB4: - movs r2, #0 - ldrsh r0, [r1, r2] - subs r0, #1 - bl PutBanimBgPAL - ldr r0, _08068DD4 @ gPaletteBuffer - movs r1, #6 - movs r2, #0xa - movs r3, #0 - bl EfxPalBlackInOut - bl EnablePaletteSync -_08068DCE: - pop {r0} - bx r0 - .align 2, 0 -_08068DD4: .4byte gPaletteBuffer - - THUMB_FUNC_END sub_8068D9C - - THUMB_FUNC_START sub_8068DD8 -sub_8068DD8: @ 0x08068DD8 - push {r4, lr} - ldr r0, _08068E08 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068E02 - ldr r4, _08068E0C @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #0xd - bl Div - ldr r2, _08068E10 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068E02: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068E08: .4byte 0x04000006 -_08068E0C: .4byte gUnknown_0201FB28 -_08068E10: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068DD8 - - THUMB_FUNC_START sub_8068E14 -sub_8068E14: @ 0x08068E14 - push {r4, lr} - ldr r0, _08068E44 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068E3E - ldr r4, _08068E48 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #0xc - bl Div - ldr r2, _08068E4C @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068E3E: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068E44: .4byte 0x04000006 -_08068E48: .4byte gUnknown_0201FB28 -_08068E4C: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068E14 - - THUMB_FUNC_START sub_8068E50 -sub_8068E50: @ 0x08068E50 - push {r4, lr} - ldr r0, _08068E80 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068E7A - ldr r4, _08068E84 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #0xb - bl Div - ldr r2, _08068E88 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068E7A: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068E80: .4byte 0x04000006 -_08068E84: .4byte gUnknown_0201FB28 -_08068E88: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068E50 - - THUMB_FUNC_START sub_8068E8C -sub_8068E8C: @ 0x08068E8C - push {r4, lr} - ldr r0, _08068EBC @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068EB6 - ldr r4, _08068EC0 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #0xa - bl Div - ldr r2, _08068EC4 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068EB6: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068EBC: .4byte 0x04000006 -_08068EC0: .4byte gUnknown_0201FB28 -_08068EC4: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068E8C - - THUMB_FUNC_START sub_8068EC8 -sub_8068EC8: @ 0x08068EC8 - push {r4, lr} - ldr r0, _08068EF8 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068EF2 - ldr r4, _08068EFC @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #9 - bl Div - ldr r2, _08068F00 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068EF2: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068EF8: .4byte 0x04000006 -_08068EFC: .4byte gUnknown_0201FB28 -_08068F00: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068EC8 - - THUMB_FUNC_START sub_8068F04 -sub_8068F04: @ 0x08068F04 - push {r4, lr} - ldr r0, _08068F34 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068F2E - ldr r4, _08068F38 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #8 - bl Div - ldr r2, _08068F3C @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068F2E: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068F34: .4byte 0x04000006 -_08068F38: .4byte gUnknown_0201FB28 -_08068F3C: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068F04 - - THUMB_FUNC_START sub_8068F40 -sub_8068F40: @ 0x08068F40 - push {r4, lr} - ldr r0, _08068F70 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068F6A - ldr r4, _08068F74 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #7 - bl Div - ldr r2, _08068F78 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068F6A: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068F70: .4byte 0x04000006 -_08068F74: .4byte gUnknown_0201FB28 -_08068F78: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068F40 - - THUMB_FUNC_START sub_8068F7C -sub_8068F7C: @ 0x08068F7C - push {r4, lr} - ldr r0, _08068FAC @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068FA6 - ldr r4, _08068FB0 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #6 - bl Div - ldr r2, _08068FB4 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068FA6: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068FAC: .4byte 0x04000006 -_08068FB0: .4byte gUnknown_0201FB28 -_08068FB4: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068F7C - - THUMB_FUNC_START sub_8068FB8 -sub_8068FB8: @ 0x08068FB8 - push {r4, lr} - ldr r0, _08068FE8 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08068FE2 - ldr r4, _08068FEC @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #5 - bl Div - ldr r2, _08068FF0 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08068FE2: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08068FE8: .4byte 0x04000006 -_08068FEC: .4byte gUnknown_0201FB28 -_08068FF0: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068FB8 - - THUMB_FUNC_START sub_8068FF4 -sub_8068FF4: @ 0x08068FF4 - push {r4, lr} - ldr r0, _08069024 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _0806901E - ldr r4, _08069028 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #4 - bl Div - ldr r2, _0806902C @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_0806901E: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08069024: .4byte 0x04000006 -_08069028: .4byte gUnknown_0201FB28 -_0806902C: .4byte 0x04000016 - - THUMB_FUNC_END sub_8068FF4 - - THUMB_FUNC_START sub_8069030 -sub_8069030: @ 0x08069030 - push {r4, lr} - ldr r0, _08069060 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _0806905A - ldr r4, _08069064 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #3 - bl Div - ldr r2, _08069068 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_0806905A: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08069060: .4byte 0x04000006 -_08069064: .4byte gUnknown_0201FB28 -_08069068: .4byte 0x04000016 - - THUMB_FUNC_END sub_8069030 - - THUMB_FUNC_START sub_806906C -sub_806906C: @ 0x0806906C - push {r4, lr} - ldr r0, _0806909C @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _08069096 - ldr r4, _080690A0 @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #2 - bl Div - ldr r2, _080690A4 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_08069096: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0806909C: .4byte 0x04000006 -_080690A0: .4byte gUnknown_0201FB28 -_080690A4: .4byte 0x04000016 - - THUMB_FUNC_END sub_806906C - - THUMB_FUNC_START sub_80690A8 -sub_80690A8: @ 0x080690A8 - push {r4, lr} - ldr r0, _080690D8 @ 0x04000006 - ldrh r0, [r0] - adds r0, #1 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x9f - bhi _080690D2 - ldr r4, _080690DC @ gUnknown_0201FB28 - adds r1, r0, #0 - subs r1, #0x3f - ldr r0, [r4] - subs r0, r0, r1 - movs r1, #1 - bl Div - ldr r2, _080690E0 @ 0x04000016 - ldr r1, [r4] - negs r1, r1 - subs r1, r1, r0 - strh r1, [r2] -_080690D2: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_080690D8: .4byte 0x04000006 -_080690DC: .4byte gUnknown_0201FB28 -_080690E0: .4byte 0x04000016 - - THUMB_FUNC_END sub_80690A8 - - THUMB_FUNC_START sub_80690E4 -sub_80690E4: @ 0x080690E4 - ldr r0, _080690F4 @ 0x04000006 - ldrh r0, [r0] - ldr r1, _080690F8 @ 0x04000016 - ldr r0, _080690FC @ gUnknown_0201FB28 - ldr r0, [r0] - negs r0, r0 - strh r0, [r1] - bx lr - .align 2, 0 -_080690F4: .4byte 0x04000006 -_080690F8: .4byte 0x04000016 -_080690FC: .4byte gUnknown_0201FB28 - - THUMB_FUNC_END sub_80690E4 - - THUMB_FUNC_START sub_8069100 -sub_8069100: @ 0x08069100 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - adds r7, r0, #0 - adds r0, #0x2c - adds r1, r7, #0 - adds r1, #0x44 - ldr r2, [r7, #0x48] - bl EfxAdvanceFrameLut - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - mov r8, r0 - ldr r0, [r7, #0x44] - subs r0, #1 - cmp r0, #4 - bls _08069124 - b _08069240 -_08069124: - lsls r0, r0, #2 - ldr r1, _08069130 @ _08069134 - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08069130: .4byte _08069134 -_08069134: @ jump table - .4byte _08069148 @ case 0 - .4byte _08069164 @ case 1 - .4byte _08069198 @ case 2 - .4byte _080691CC @ case 3 - .4byte _08069200 @ case 4 -_08069148: - movs r1, #0x2c - ldrsh r0, [r7, r1] - cmp r0, #0 - beq _0806918C - cmp r0, #1 - beq _08069156 - b _08069246 -_08069156: - ldr r0, _08069160 @ sub_8068DD8 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_08069160: .4byte sub_8068DD8 -_08069164: - movs r1, #0x2c - ldrsh r0, [r7, r1] - cmp r0, #1 - beq _0806918C - cmp r0, #1 - bgt _08069176 - cmp r0, #0 - beq _080691B4 - b _08069246 -_08069176: - cmp r0, #2 - beq _0806921C - cmp r0, #3 - bne _08069246 - ldr r0, _08069188 @ sub_8068F40 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_08069188: .4byte sub_8068F40 -_0806918C: - ldr r0, _08069194 @ sub_8068E8C - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_08069194: .4byte sub_8068E8C -_08069198: - movs r1, #0x2c - ldrsh r0, [r7, r1] - cmp r0, #1 - beq _080691B4 - cmp r0, #1 - bgt _080691AA - cmp r0, #0 - beq _080691C0 - b _08069246 -_080691AA: - cmp r0, #2 - beq _0806921C - cmp r0, #3 - bne _08069246 - b _080691C0 -_080691B4: - ldr r0, _080691BC @ sub_8068F04 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_080691BC: .4byte sub_8068F04 -_080691C0: - ldr r0, _080691C8 @ sub_8068F7C - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_080691C8: .4byte sub_8068F7C -_080691CC: - movs r1, #0x2c - ldrsh r0, [r7, r1] - cmp r0, #1 - beq _080691E8 - cmp r0, #1 - bgt _080691DE - cmp r0, #0 - beq _080691F4 - b _08069246 -_080691DE: - cmp r0, #2 - beq _0806921C - cmp r0, #3 - bne _08069246 - b _080691F4 -_080691E8: - ldr r0, _080691F0 @ sub_8068FB8 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_080691F0: .4byte sub_8068FB8 -_080691F4: - ldr r0, _080691FC @ sub_8068FF4 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_080691FC: .4byte sub_8068FF4 -_08069200: - movs r1, #0x2c - ldrsh r0, [r7, r1] - cmp r0, #1 - beq _08069228 - cmp r0, #1 - bgt _08069212 - cmp r0, #0 - beq _08069234 - b _08069246 -_08069212: - cmp r0, #2 - beq _0806921C - cmp r0, #3 - bne _08069246 - b _08069228 -_0806921C: - ldr r0, _08069224 @ sub_80690E4 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_08069224: .4byte sub_80690E4 -_08069228: - ldr r0, _08069230 @ sub_8069030 - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_08069230: .4byte sub_8069030 -_08069234: - ldr r0, _0806923C @ sub_806906C - bl SetPrimaryHBlankHandler - b _08069246 - .align 2, 0 -_0806923C: .4byte sub_806906C -_08069240: - ldr r0, _08069278 @ sub_80690E4 - bl SetPrimaryHBlankHandler -_08069246: - mov r1, r8 - lsls r0, r1, #0x10 - asrs r4, r0, #0x10 - cmp r4, #0 - blt _0806927C - ldr r5, [r7, #0x4c] - ldr r6, [r7, #0x50] - ldr r0, [r7, #0x54] - lsls r4, r4, #2 - adds r0, r4, r0 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #6 - bl SpellFx_RegisterBgGfx - ldr r0, [r7, #0x5c] - adds r5, r4, r5 - ldr r1, [r5] - adds r4, r4, r6 - ldr r2, [r4] - bl SpellFx_WriteBgMap - mov r0, r8 - strh r0, [r7, #0x2e] - b _080692A0 - .align 2, 0 -_08069278: .4byte sub_80690E4 -_0806927C: - movs r0, #1 - negs r0, r0 - cmp r4, r0 - bne _080692A0 - bl SpellFx_ClearBG1 - movs r0, #0 - bl SetPrimaryHBlankHandler - ldr r1, _080692AC @ gEfxBgSemaphore - ldr r0, [r1] - subs r0, #1 - str r0, [r1] - bl SetDefaultColorEffects_ - adds r0, r7, #0 - bl Proc_Break -_080692A0: - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_080692AC: .4byte gEfxBgSemaphore - - THUMB_FUNC_END sub_8069100 - - THUMB_FUNC_START sub_80692B0 -sub_80692B0: @ 0x080692B0 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r1, _0806930C @ gEfxBgSemaphore - ldr r0, [r1] - adds r0, #1 - str r0, [r1] - ldr r1, _08069310 @ gUnknown_0201FB28 - movs r0, #0x10 - str r0, [r1] - ldr r0, _08069314 @ ProcScr_efxDarkGradoBG01 - movs r1, #3 - bl Proc_Start - adds r5, r0, #0 - str r4, [r5, #0x5c] - movs r0, #0 - strh r0, [r5, #0x2c] - str r0, [r5, #0x44] - ldr r0, _08069318 @ gUnknown_080DEDBC - str r0, [r5, #0x48] - ldr r0, _0806931C @ gUnknown_085D8348 - str r0, [r5, #0x4c] - str r0, [r5, #0x50] - ldr r0, _08069320 @ gUnknown_085D8374 - str r0, [r5, #0x54] - ldr r0, _08069324 @ gUnknown_086A66D8 - movs r1, #0x20 - bl SpellFx_RegisterBgPal - ldr r0, _08069328 @ gEkrDistanceType - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #1 - bne _08069344 - ldr r0, [r5, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069330 - ldr r2, _0806932C @ 0x0000FFF0 - movs r0, #1 - movs r1, #0x18 - bl BG_SetPosition - b _0806934E - .align 2, 0 -_0806930C: .4byte gEfxBgSemaphore -_08069310: .4byte gUnknown_0201FB28 -_08069314: .4byte ProcScr_efxDarkGradoBG01 -_08069318: .4byte gUnknown_080DEDBC -_0806931C: .4byte gUnknown_085D8348 -_08069320: .4byte gUnknown_085D8374 -_08069324: .4byte gUnknown_086A66D8 -_08069328: .4byte gEkrDistanceType -_0806932C: .4byte 0x0000FFF0 -_08069330: - ldr r1, _0806933C @ 0x0000FFE8 - ldr r2, _08069340 @ 0x0000FFF0 - movs r0, #1 - bl BG_SetPosition - b _0806934E - .align 2, 0 -_0806933C: .4byte 0x0000FFE8 -_08069340: .4byte 0x0000FFF0 -_08069344: - ldr r2, _08069358 @ 0x0000FFF0 - movs r0, #1 - movs r1, #0 - bl BG_SetPosition -_0806934E: - bl SpellFx_SetSomeColorEffect - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_08069358: .4byte 0x0000FFF0 - - THUMB_FUNC_END sub_80692B0 - - THUMB_FUNC_START sub_806935C -sub_806935C: @ 0x0806935C - push {r4, r5, r6, r7, lr} - adds r7, r0, #0 - adds r0, #0x2c - adds r1, r7, #0 - adds r1, #0x44 - ldr r2, [r7, #0x48] - bl EfxAdvanceFrameLut - lsls r0, r0, #0x10 - asrs r5, r0, #0x10 - cmp r5, #0 - blt _080693A2 - ldr r6, [r7, #0x4c] - ldr r0, [r7, #0x54] - ldr r4, [r7, #0x58] - lsls r5, r5, #2 - adds r0, r5, r0 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #6 - bl SpellFx_RegisterBgGfx - adds r4, r5, r4 - ldr r0, [r4] - movs r1, #0x20 - bl SpellFx_RegisterBgPal - ldr r0, [r7, #0x5c] - adds r5, r5, r6 - ldr r1, [r5] - movs r2, #0x20 - movs r3, #0x14 - bl SpellFx_WriteBgMapExt - b _080693C4 -_080693A2: - movs r0, #6 - negs r0, r0 - cmp r5, r0 - bne _080693B6 - bl sub_80696F0 - ldr r0, [r7, #0x44] - adds r0, #1 - str r0, [r7, #0x44] - b _080693C4 -_080693B6: - movs r0, #1 - negs r0, r0 - cmp r5, r0 - bne _080693C4 - adds r0, r7, #0 - bl Proc_Break -_080693C4: - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_806935C - - THUMB_FUNC_START sub_80693CC -sub_80693CC: @ 0x080693CC - push {lr} - movs r1, #0 - strh r1, [r0, #0x2c] - strh r1, [r0, #0x2e] - str r1, [r0, #0x44] - ldr r1, _080693F0 @ gUnknown_080DEE40 - str r1, [r0, #0x48] - ldr r1, _080693F4 @ gUnknown_085D8478 - str r1, [r0, #0x4c] - ldr r1, _080693F8 @ gUnknown_085D847C - str r1, [r0, #0x54] - ldr r0, _080693FC @ gUnknown_086B52CC - movs r1, #0x20 - bl SpellFx_RegisterBgPal - pop {r0} - bx r0 - .align 2, 0 -_080693F0: .4byte gUnknown_080DEE40 -_080693F4: .4byte gUnknown_085D8478 -_080693F8: .4byte gUnknown_085D847C -_080693FC: .4byte gUnknown_086B52CC - - THUMB_FUNC_END sub_80693CC - - THUMB_FUNC_START sub_8069400 -sub_8069400: @ 0x08069400 - push {r4, r5, r6, lr} - adds r6, r0, #0 - ldrh r0, [r6, #0x2e] - lsls r0, r0, #0x10 - asrs r4, r0, #0x11 - ldr r0, [r6, #0x5c] - bl GetAnimPosition - cmp r0, #0 - beq _08069416 - negs r4, r4 -_08069416: - lsls r1, r4, #0x10 - lsrs r1, r1, #0x10 - movs r0, #1 - movs r2, #0 - bl BG_SetPosition - ldrh r0, [r6, #0x2e] - adds r0, #1 - strh r0, [r6, #0x2e] - adds r0, r6, #0 - adds r0, #0x2c - adds r1, r6, #0 - adds r1, #0x44 - ldr r2, [r6, #0x48] - bl EfxAdvanceFrameLut - lsls r0, r0, #0x10 - asrs r4, r0, #0x10 - cmp r4, #0 - blt _08069460 - ldr r5, [r6, #0x4c] - ldr r0, [r6, #0x54] - lsls r4, r4, #2 - adds r0, r4, r0 - ldr r0, [r0] - movs r1, #0x80 - lsls r1, r1, #6 - bl SpellFx_RegisterBgGfx - ldr r0, [r6, #0x5c] - adds r4, r4, r5 - ldr r1, [r4] - movs r2, #0x20 - movs r3, #0x14 - bl SpellFx_WriteBgMapExt - b _0806947E -_08069460: - movs r0, #1 - negs r0, r0 - cmp r4, r0 - bne _0806947E - bl SpellFx_ClearBG1 - ldr r1, _08069484 @ gEfxBgSemaphore - ldr r0, [r1] - subs r0, #1 - str r0, [r1] - bl SetDefaultColorEffects_ - adds r0, r6, #0 - bl Proc_Break -_0806947E: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_08069484: .4byte gEfxBgSemaphore - - THUMB_FUNC_END sub_8069400 - - THUMB_FUNC_START sub_8069488 -sub_8069488: @ 0x08069488 - push {r4, lr} - adds r4, r0, #0 - ldr r1, _080694D0 @ gEfxBgSemaphore - ldr r0, [r1] - adds r0, #1 - str r0, [r1] - ldr r0, _080694D4 @ ProcScr_efxDarkGradoBG02 - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x5c] - movs r1, #0 - strh r1, [r0, #0x2c] - str r1, [r0, #0x44] - ldr r1, _080694D8 @ gUnknown_080DEDFA - str r1, [r0, #0x48] - ldr r1, _080694DC @ gUnknown_085D83B8 - str r1, [r0, #0x4c] - ldr r1, _080694E0 @ gUnknown_085D83F8 - str r1, [r0, #0x54] - ldr r1, _080694E4 @ gUnknown_085D8438 - str r1, [r0, #0x58] - ldr r0, _080694E8 @ gEkrDistanceType - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #1 - bne _080694F8 - adds r0, r4, #0 - bl GetAnimPosition - cmp r0, #0 - bne _080694EC - movs r0, #1 - movs r1, #0x28 - b _08069506 - .align 2, 0 -_080694D0: .4byte gEfxBgSemaphore -_080694D4: .4byte ProcScr_efxDarkGradoBG02 -_080694D8: .4byte gUnknown_080DEDFA -_080694DC: .4byte gUnknown_085D83B8 -_080694E0: .4byte gUnknown_085D83F8 -_080694E4: .4byte gUnknown_085D8438 -_080694E8: .4byte gEkrDistanceType -_080694EC: - ldr r1, _080694F4 @ 0x0000FFE8 - movs r0, #1 - b _08069506 - .align 2, 0 -_080694F4: .4byte 0x0000FFE8 -_080694F8: - adds r0, r4, #0 - bl GetAnimPosition - cmp r0, #0 - bne _0806950E - movs r0, #1 - movs r1, #0x10 -_08069506: - movs r2, #0 - bl BG_SetPosition - b _08069518 -_0806950E: - movs r0, #1 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition -_08069518: - bl SpellFx_SetSomeColorEffect - movs r0, #0 - bl SetBlendBackdropB - pop {r4} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_8069488 - - THUMB_FUNC_START sub_8069528 -sub_8069528: @ 0x08069528 - adds r0, #0x4c - movs r1, #0 - strh r1, [r0] - bx lr - - THUMB_FUNC_END sub_8069528 - - THUMB_FUNC_START sub_8069530 -sub_8069530: @ 0x08069530 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, r9 - mov r5, r8 - push {r5, r6, r7} - sub sp, #0x1c - str r0, [sp, #4] - ldr r0, _08069564 @ gPaletteBuffer - mov r9, r0 - ldr r1, _08069568 @ gEfxPal - mov r8, r1 - ldr r0, [sp, #4] - adds r0, #0x4c - movs r2, #0 - ldrsh r1, [r0, r2] - cmp r1, #0x28 - ble _0806956C - adds r3, r1, #0 - subs r3, #0x28 - movs r0, #0x18 - str r0, [sp] - movs r0, #0 - movs r1, #0x10 - movs r2, #0 - b _08069582 - .align 2, 0 -_08069564: .4byte gPaletteBuffer -_08069568: .4byte gEfxPal -_0806956C: - cmp r1, #0x18 - ble _08069574 - movs r6, #0x10 - b _08069588 -_08069574: - movs r1, #0 - ldrsh r3, [r0, r1] - movs r0, #0x18 - str r0, [sp] - movs r0, #0 - movs r1, #0 - movs r2, #0x10 -_08069582: - bl Interpolate - adds r6, r0, #0 -_08069588: - mov r2, r9 - ldrh r0, [r2] - mov r7, r8 - strh r0, [r7] - movs r2, #0 - ldr r0, [sp, #4] - adds r0, #0x4c - str r0, [sp, #8] -_08069598: - subs r0, r2, #1 - cmp r0, #0x1d - bhi _0806962C - lsls r0, r0, #2 - ldr r1, _080695A8 @ _080695AC - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_080695A8: .4byte _080695AC -_080695AC: @ jump table - .4byte _08069624 @ case 0 - .4byte _08069624 @ case 1 - .4byte _08069624 @ case 2 - .4byte _0806962C @ case 3 - .4byte _0806962C @ case 4 - .4byte _0806962C @ case 5 - .4byte _0806962C @ case 6 - .4byte _0806962C @ case 7 - .4byte _0806962C @ case 8 - .4byte _0806962C @ case 9 - .4byte _0806962C @ case 10 - .4byte _0806962C @ case 11 - .4byte _0806962C @ case 12 - .4byte _0806962C @ case 13 - .4byte _0806962C @ case 14 - .4byte _08069624 @ case 15 - .4byte _0806962C @ case 16 - .4byte _0806962C @ case 17 - .4byte _0806962C @ case 18 - .4byte _0806962C @ case 19 - .4byte _08069624 @ case 20 - .4byte _08069624 @ case 21 - .4byte _0806962C @ case 22 - .4byte _0806962C @ case 23 - .4byte _0806962C @ case 24 - .4byte _0806962C @ case 25 - .4byte _08069624 @ case 26 - .4byte _08069624 @ case 27 - .4byte _08069624 @ case 28 - .4byte _08069624 @ case 29 -_08069624: - ldr r1, _08069628 @ 0x00007C1F - b _0806962E - .align 2, 0 -_08069628: .4byte 0x00007C1F -_0806962C: - movs r1, #0 -_0806962E: - movs r7, #2 - add r9, r7 - movs r0, #2 - add r8, r0 - lsrs r7, r1, #5 - str r7, [sp, #0x10] - lsrs r0, r1, #0xa - str r0, [sp, #0x14] - adds r2, #1 - str r2, [sp, #0xc] - movs r2, #0x1f - mov ip, r2 - movs r5, #0x1f - movs r0, #0x10 - subs r4, r0, r6 - movs r7, #0xe - str r7, [sp, #0x18] - ands r1, r5 - adds r0, r1, #0 - muls r0, r6, r0 - mov sl, r0 -_08069658: - mov r2, r9 - ldrh r1, [r2] - adds r0, r5, #0 - ands r0, r1 - adds r3, r0, #0 - muls r3, r4, r3 - add r3, sl - asrs r3, r3, #4 - lsls r1, r1, #0x10 - lsrs r0, r1, #0x15 - mov r7, ip - ands r0, r7 - adds r2, r0, #0 - muls r2, r4, r2 - asrs r2, r2, #4 - lsrs r1, r1, #0x1a - mov r0, ip - ands r1, r0 - muls r1, r4, r1 - ldr r0, [sp, #0x14] - ands r0, r7 - muls r0, r6, r0 - adds r1, r1, r0 - asrs r1, r1, #4 - ands r1, r5 - lsls r1, r1, #0xa - ands r2, r5 - lsls r2, r2, #5 - orrs r1, r2 - ands r3, r5 - orrs r3, r1 - mov r0, r8 - strh r3, [r0] - movs r1, #2 - add r9, r1 - add r8, r1 - ldr r2, [sp, #0x18] - subs r2, #1 - str r2, [sp, #0x18] - cmp r2, #0 - bge _08069658 - ldr r2, [sp, #0xc] - cmp r2, #0x1f - bgt _080696B2 - b _08069598 -_080696B2: - movs r1, #0xa0 - lsls r1, r1, #0x13 - movs r2, #0x80 - lsls r2, r2, #1 - ldr r0, _080696EC @ gEfxPal - bl CpuFastSet - bl DisablePaletteSync - ldr r7, [sp, #8] - movs r1, #0 - ldrsh r0, [r7, r1] - cmp r0, #0x40 - bne _080696D4 - ldr r0, [sp, #4] - bl Proc_Break -_080696D4: - ldr r2, [sp, #8] - ldrh r0, [r2] - adds r0, #1 - strh r0, [r2] - add sp, #0x1c - pop {r3, r4, r5} - mov r8, r3 - mov r9, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_080696EC: .4byte gEfxPal - - THUMB_FUNC_END sub_8069530 - - THUMB_FUNC_START sub_80696F0 -sub_80696F0: @ 0x080696F0 - push {lr} - ldr r0, _08069700 @ gUnknown_085D84B4 - movs r1, #0 - bl Proc_Start - pop {r0} - bx r0 - .align 2, 0 -_08069700: .4byte gUnknown_085D84B4 - - THUMB_FUNC_END sub_80696F0 - - THUMB_FUNC_START sub_8069704 -sub_8069704: @ 0x08069704 - push {lr} - adds r3, r0, #0 - cmp r1, #5 - bhi _08069764 - lsls r0, r1, #2 - ldr r1, _08069718 @ _0806971C - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08069718: .4byte _0806971C -_0806971C: @ jump table - .4byte _08069734 @ case 0 - .4byte _0806973C @ case 1 - .4byte _08069744 @ case 2 - .4byte _0806974C @ case 3 - .4byte _08069754 @ case 4 - .4byte _0806975C @ case 5 -_08069734: - ldr r1, _08069738 @ gUnknown_085D84D4 - b _08069766 - .align 2, 0 -_08069738: .4byte gUnknown_085D84D4 -_0806973C: - ldr r1, _08069740 @ gUnknown_085D8524 - b _08069766 - .align 2, 0 -_08069740: .4byte gUnknown_085D8524 -_08069744: - ldr r1, _08069748 @ gUnknown_085D8574 - b _08069766 - .align 2, 0 -_08069748: .4byte gUnknown_085D8574 -_0806974C: - ldr r1, _08069750 @ gUnknown_085D85C4 - b _08069766 - .align 2, 0 -_08069750: .4byte gUnknown_085D85C4 -_08069754: - ldr r1, _08069758 @ gUnknown_085D8614 - b _08069766 - .align 2, 0 -_08069758: .4byte gUnknown_085D8614 -_0806975C: - ldr r1, _08069760 @ gUnknown_085D8664 - b _08069766 - .align 2, 0 -_08069760: .4byte gUnknown_085D8664 -_08069764: - ldr r1, _08069778 @ gUnknown_085D86B4 -_08069766: - lsls r0, r3, #2 - adds r0, r0, r1 - movs r1, #0 - ldrsh r0, [r0, r1] - muls r0, r2, r0 - asrs r0, r0, #8 - pop {r1} - bx r1 - .align 2, 0 -_08069778: .4byte gUnknown_085D86B4 - - THUMB_FUNC_END sub_8069704 - - THUMB_FUNC_START sub_806977C -sub_806977C: @ 0x0806977C - push {lr} - adds r3, r0, #0 - cmp r1, #5 - bhi _080697DC - lsls r0, r1, #2 - ldr r1, _08069790 @ _08069794 - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08069790: .4byte _08069794 -_08069794: @ jump table - .4byte _080697AC @ case 0 - .4byte _080697B4 @ case 1 - .4byte _080697BC @ case 2 - .4byte _080697C4 @ case 3 - .4byte _080697CC @ case 4 - .4byte _080697D4 @ case 5 -_080697AC: - ldr r1, _080697B0 @ gUnknown_085D84D4 - b _080697DE - .align 2, 0 -_080697B0: .4byte gUnknown_085D84D4 -_080697B4: - ldr r1, _080697B8 @ gUnknown_085D8524 - b _080697DE - .align 2, 0 -_080697B8: .4byte gUnknown_085D8524 -_080697BC: - ldr r1, _080697C0 @ gUnknown_085D8574 - b _080697DE - .align 2, 0 -_080697C0: .4byte gUnknown_085D8574 -_080697C4: - ldr r1, _080697C8 @ gUnknown_085D85C4 - b _080697DE - .align 2, 0 -_080697C8: .4byte gUnknown_085D85C4 -_080697CC: - ldr r1, _080697D0 @ gUnknown_085D8614 - b _080697DE - .align 2, 0 -_080697D0: .4byte gUnknown_085D8614 -_080697D4: - ldr r1, _080697D8 @ gUnknown_085D8664 - b _080697DE - .align 2, 0 -_080697D8: .4byte gUnknown_085D8664 -_080697DC: - ldr r1, _080697F0 @ gUnknown_085D86B4 -_080697DE: - lsls r0, r3, #2 - adds r0, r0, r1 - movs r1, #2 - ldrsh r0, [r0, r1] - muls r0, r2, r0 - asrs r0, r0, #8 - pop {r1} - bx r1 - .align 2, 0 -_080697F0: .4byte gUnknown_085D86B4 - - THUMB_FUNC_END sub_806977C - - THUMB_FUNC_START sub_80697F4 -sub_80697F4: @ 0x080697F4 - push {r4, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069816 - movs r1, #0x2c - ldrsh r0, [r4, r1] - ldr r1, [r4, #0x44] - ldr r2, [r4, #0x48] - bl sub_8069704 - ldr r2, [r4, #0x60] - ldrh r1, [r4, #0x32] - adds r1, r1, r0 - b _08069828 -_08069816: - movs r2, #0x2c - ldrsh r0, [r4, r2] - ldr r1, [r4, #0x44] - ldr r2, [r4, #0x48] - bl sub_8069704 - ldr r2, [r4, #0x60] - ldrh r1, [r4, #0x32] - subs r1, r1, r0 -_08069828: - strh r1, [r2, #2] - movs r1, #0x2c - ldrsh r0, [r4, r1] - ldr r1, [r4, #0x44] - ldr r2, [r4, #0x48] - bl sub_806977C - ldr r2, [r4, #0x60] - ldrh r1, [r4, #0x3a] - adds r1, r1, r0 - strh r1, [r2, #4] - ldrh r0, [r4, #0x2c] - adds r0, #1 - strh r0, [r4, #0x2c] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #0x2e - ldrsh r1, [r4, r2] - cmp r0, r1 - beq _0806985A - movs r0, #0x2c - ldrsh r1, [r4, r0] - ldr r0, [r4, #0x4c] - cmp r1, r0 - bne _0806986E -_0806985A: - ldr r0, _08069874 @ gEfxBgSemaphore - ldr r1, [r0] - subs r1, #1 - str r1, [r0] - ldr r0, [r4, #0x60] - bl AnimDelete - adds r0, r4, #0 - bl Proc_Break -_0806986E: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08069874: .4byte gEfxBgSemaphore - - THUMB_FUNC_END sub_80697F4 - - THUMB_FUNC_START sub_8069878 -sub_8069878: @ 0x08069878 - push {r4, r5, r6, r7, lr} - mov r7, r9 - mov r6, r8 - push {r6, r7} - sub sp, #4 - adds r6, r0, #0 - adds r4, r1, #0 - ldr r0, [sp, #0x20] - lsls r4, r4, #0x10 - lsrs r4, r4, #0x10 - lsls r2, r2, #0x10 - lsrs r7, r2, #0x10 - lsls r3, r3, #0x10 - lsrs r3, r3, #0x10 - mov r8, r3 - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - mov r9, r0 - ldr r1, _080698CC @ gEfxBgSemaphore - ldr r0, [r1] - adds r0, #1 - str r0, [r1] - ldr r0, _080698D0 @ gUnknown_085D8704 - movs r1, #3 - bl Proc_Start - adds r5, r0, #0 - str r6, [r5, #0x5c] - movs r0, #0 - strh r0, [r5, #0x2c] - movs r0, #0x14 - strh r0, [r5, #0x2e] - lsls r4, r4, #0x10 - asrs r4, r4, #0x10 - cmp r4, #1 - beq _080698E4 - cmp r4, #1 - bgt _080698D4 - cmp r4, #0 - beq _080698DA - b _080698F4 - .align 2, 0 -_080698CC: .4byte gEfxBgSemaphore -_080698D0: .4byte gUnknown_085D8704 -_080698D4: - cmp r4, #2 - beq _080698EC - b _080698F4 -_080698DA: - ldr r3, _080698E0 @ gUnknown_086A2724 - b _080698F6 - .align 2, 0 -_080698E0: .4byte gUnknown_086A2724 -_080698E4: - ldr r3, _080698E8 @ gUnknown_086A2844 - b _080698F6 - .align 2, 0 -_080698E8: .4byte gUnknown_086A2844 -_080698EC: - ldr r3, _080698F0 @ gUnknown_086A273C - b _080698F6 - .align 2, 0 -_080698F0: .4byte gUnknown_086A273C -_080698F4: - ldr r3, _08069928 @ gUnknown_086A285C -_080698F6: - lsls r0, r7, #0x10 - asrs r0, r0, #0x10 - str r0, [r5, #0x44] - mov r1, r8 - lsls r0, r1, #0x10 - asrs r0, r0, #0x10 - str r0, [r5, #0x48] - mov r0, r9 - str r0, [r5, #0x4c] - str r3, [sp] - adds r0, r6, #0 - adds r1, r3, #0 - adds r2, r3, #0 - bl EfxCreateFrontAnim - adds r4, r0, #0 - str r4, [r5, #0x60] - ldr r0, [r5, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _0806992C - movs r0, #0x58 - b _0806992E - .align 2, 0 -_08069928: .4byte gUnknown_086A285C -_0806992C: - movs r0, #0x98 -_0806992E: - strh r0, [r5, #0x32] - movs r0, #0x50 - strh r0, [r5, #0x3a] - ldr r0, _08069950 @ gEkrDistanceType - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #1 - bne _0806995A - ldr r0, [r5, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069954 - ldrh r0, [r5, #0x32] - subs r0, #0x18 - b _08069958 - .align 2, 0 -_08069950: .4byte gEkrDistanceType -_08069954: - ldrh r0, [r5, #0x32] - adds r0, #0x18 -_08069958: - strh r0, [r5, #0x32] -_0806995A: - ldr r0, [r5, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069976 - movs r1, #0x2c - ldrsh r0, [r5, r1] - ldr r1, [r5, #0x44] - ldr r2, [r5, #0x48] - bl sub_8069704 - ldrh r1, [r5, #0x32] - adds r1, r1, r0 - b _08069986 -_08069976: - movs r1, #0x2c - ldrsh r0, [r5, r1] - ldr r1, [r5, #0x44] - ldr r2, [r5, #0x48] - bl sub_8069704 - ldrh r1, [r5, #0x32] - subs r1, r1, r0 -_08069986: - strh r1, [r4, #2] - movs r1, #0x2c - ldrsh r0, [r5, r1] - ldr r1, [r5, #0x44] - ldr r2, [r5, #0x48] - bl sub_806977C - ldrh r1, [r5, #0x3a] - adds r1, r1, r0 - strh r1, [r4, #4] - add sp, #4 - pop {r3, r4} - mov r8, r3 - mov r9, r4 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_8069878 - - THUMB_FUNC_START sub_80699A8 -sub_80699A8: @ 0x080699A8 - push {r4, r5, r6, r7, lr} - sub sp, #4 - adds r7, r0, #0 - ldrh r0, [r7, #0x2c] - adds r0, #1 - strh r0, [r7, #0x2c] - movs r1, #0x2c - ldrsh r0, [r7, r1] - movs r1, #0xc - bl DivRem - cmp r0, #0 - bne _08069AAE - ldrh r1, [r7, #0x2e] - movs r0, #1 - ands r0, r1 - cmp r0, #0 - bne _08069A2C - ldr r0, [r7, #0x5c] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - movs r5, #3 - ands r1, r5 - movs r6, #0x80 - lsls r6, r6, #1 - ldrh r2, [r7, #0x2c] - movs r4, #0x62 - subs r2, r4, r2 - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - str r2, [sp] - movs r2, #0 - adds r3, r6, #0 - bl sub_8069878 - ldr r0, [r7, #0x5c] - ldrh r1, [r7, #0x2e] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - adds r1, #2 - ands r1, r5 - ldrh r2, [r7, #0x2c] - subs r2, r4, r2 - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - str r2, [sp] - movs r2, #1 - adds r3, r6, #0 - bl sub_8069878 - ldr r0, [r7, #0x5c] - ldrh r1, [r7, #0x2e] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - adds r1, #1 - ands r1, r5 - ldrh r2, [r7, #0x2c] - subs r4, r4, r2 - lsls r4, r4, #0x10 - lsrs r4, r4, #0x10 - str r4, [sp] - movs r2, #2 - adds r3, r6, #0 - bl sub_8069878 - b _08069AA8 -_08069A2C: - ldr r0, [r7, #0x5c] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - movs r5, #3 - ands r1, r5 - movs r6, #0x80 - lsls r6, r6, #1 - ldrh r2, [r7, #0x2c] - movs r4, #0x62 - subs r2, r4, r2 - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - str r2, [sp] - movs r2, #3 - adds r3, r6, #0 - bl sub_8069878 - ldr r0, [r7, #0x5c] - ldrh r1, [r7, #0x2e] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - adds r1, #2 - ands r1, r5 - ldrh r2, [r7, #0x2c] - subs r2, r4, r2 - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - str r2, [sp] - movs r2, #4 - adds r3, r6, #0 - bl sub_8069878 - ldr r0, [r7, #0x5c] - ldrh r1, [r7, #0x2e] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - adds r1, #1 - ands r1, r5 - ldrh r2, [r7, #0x2c] - subs r2, r4, r2 - lsls r2, r2, #0x10 - lsrs r2, r2, #0x10 - str r2, [sp] - movs r2, #5 - adds r3, r6, #0 - bl sub_8069878 - ldr r0, [r7, #0x5c] - ldrh r1, [r7, #0x2e] - lsls r1, r1, #0x10 - asrs r1, r1, #0x11 - adds r1, #3 - ands r1, r5 - ldrh r2, [r7, #0x2c] - subs r4, r4, r2 - lsls r4, r4, #0x10 - lsrs r4, r4, #0x10 - str r4, [sp] - movs r2, #6 - adds r3, r6, #0 - bl sub_8069878 -_08069AA8: - ldrh r0, [r7, #0x2e] - adds r0, #1 - strh r0, [r7, #0x2e] -_08069AAE: - movs r1, #0x2c - ldrsh r0, [r7, r1] - cmp r0, #0x61 - bne _08069ABC - adds r0, r7, #0 - bl Proc_Break -_08069ABC: - add sp, #4 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_80699A8 - - THUMB_FUNC_START sub_8069AC4 -sub_8069AC4: @ 0x08069AC4 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _08069AF0 @ ProcScr_efxDarkGradoOBJ01 - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x5c] - movs r1, #0 - strh r1, [r0, #0x2c] - strh r1, [r0, #0x2e] - ldr r0, _08069AF4 @ gUnknown_086A2614 - movs r1, #0x20 - bl SpellFx_RegisterObjPal - ldr r0, _08069AF8 @ gUnknown_086A21F4 - movs r1, #0x80 - lsls r1, r1, #5 - bl SpellFx_RegisterObjGfx - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08069AF0: .4byte ProcScr_efxDarkGradoOBJ01 -_08069AF4: .4byte gUnknown_086A2614 -_08069AF8: .4byte gUnknown_086A21F4 - - THUMB_FUNC_END sub_8069AC4 - - THUMB_FUNC_START sub_8069AFC -sub_8069AFC: @ 0x08069AFC - push {r4, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x48] - ldr r1, [r4, #0x44] - adds r0, r0, r1 - str r0, [r4, #0x48] - ldr r0, [r4, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069B20 - ldr r2, [r4, #0x60] - ldr r1, [r4, #0x48] - asrs r1, r1, #8 - ldrh r0, [r4, #0x32] - subs r0, r0, r1 - strh r0, [r2, #2] - b _08069B2C -_08069B20: - ldr r1, [r4, #0x60] - ldr r0, [r4, #0x48] - asrs r0, r0, #8 - ldrh r2, [r4, #0x32] - adds r0, r0, r2 - strh r0, [r1, #2] -_08069B2C: - ldr r1, [r4, #0x60] - ldr r0, [r4, #0x48] - asrs r0, r0, #8 - ldrh r2, [r4, #0x3a] - adds r0, r0, r2 - strh r0, [r1, #4] - ldrh r0, [r4, #0x2c] - adds r0, #1 - strh r0, [r4, #0x2c] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #0x2e - ldrsh r1, [r4, r2] - cmp r0, r1 - bne _08069B5E - ldr r0, _08069B64 @ gEfxBgSemaphore - ldr r1, [r0] - subs r1, #1 - str r1, [r0] - ldr r0, [r4, #0x60] - bl AnimDelete - adds r0, r4, #0 - bl Proc_Break -_08069B5E: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08069B64: .4byte gEfxBgSemaphore - - THUMB_FUNC_END sub_8069AFC - - THUMB_FUNC_START sub_8069B68 -sub_8069B68: @ 0x08069B68 - push {r4, r5, r6, r7, lr} - mov r7, r9 - mov r6, r8 - push {r6, r7} - sub sp, #4 - adds r6, r0, #0 - mov r9, r1 - mov r8, r2 - adds r5, r3, #0 - ldr r4, [sp, #0x20] - ldr r1, _08069BC8 @ gEfxBgSemaphore - ldr r0, [r1] - adds r0, #1 - str r0, [r1] - ldr r0, _08069BCC @ ProcScr_efxDarkGradoOBJ02piece - movs r1, #3 - bl Proc_Start - adds r7, r0, #0 - str r6, [r7, #0x5c] - movs r0, #0 - strh r0, [r7, #0x2c] - strh r4, [r7, #0x2e] - str r5, [r7, #0x44] - str r0, [r7, #0x48] - ldr r3, _08069BD0 @ gUnknown_086A2E98 - ldr r2, _08069BD4 @ gUnknown_086A2DBC - str r2, [sp] - adds r0, r6, #0 - adds r1, r3, #0 - bl EfxCreateFrontAnim - adds r4, r0, #0 - str r4, [r7, #0x60] - movs r0, #0x68 - strh r0, [r4, #2] - mov r0, r8 - strh r0, [r4, #4] - ldr r0, [r7, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069BD8 - ldrh r0, [r4, #2] - mov r1, r9 - subs r0, r0, r1 - b _08069BDC - .align 2, 0 -_08069BC8: .4byte gEfxBgSemaphore -_08069BCC: .4byte ProcScr_efxDarkGradoOBJ02piece -_08069BD0: .4byte gUnknown_086A2E98 -_08069BD4: .4byte gUnknown_086A2DBC -_08069BD8: - ldrh r0, [r4, #2] - add r0, r9 -_08069BDC: - strh r0, [r4, #2] - ldr r0, _08069BF8 @ gEkrDistanceType - movs r1, #0 - ldrsh r0, [r0, r1] - cmp r0, #1 - bne _08069C02 - ldr r0, [r7, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069BFC - ldrh r0, [r4, #2] - subs r0, #0x18 - b _08069C00 - .align 2, 0 -_08069BF8: .4byte gEkrDistanceType -_08069BFC: - ldrh r0, [r4, #2] - adds r0, #0x18 -_08069C00: - strh r0, [r4, #2] -_08069C02: - ldrh r0, [r4, #2] - strh r0, [r7, #0x32] - ldrh r0, [r4, #4] - strh r0, [r7, #0x3a] - add sp, #4 - pop {r3, r4} - mov r8, r3 - mov r9, r4 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_8069B68 - - THUMB_FUNC_START sub_8069C18 -sub_8069C18: @ 0x08069C18 - push {r4, r5, r6, r7, lr} - mov r7, r9 - mov r6, r8 - push {r6, r7} - sub sp, #4 - adds r6, r0, #0 - mov r9, r1 - mov r8, r2 - adds r5, r3, #0 - ldr r4, [sp, #0x20] - ldr r1, _08069C78 @ gEfxBgSemaphore - ldr r0, [r1] - adds r0, #1 - str r0, [r1] - ldr r0, _08069C7C @ ProcScr_efxDarkGradoOBJ02piece - movs r1, #3 - bl Proc_Start - adds r7, r0, #0 - str r6, [r7, #0x5c] - movs r0, #0 - strh r0, [r7, #0x2c] - strh r4, [r7, #0x2e] - str r5, [r7, #0x44] - str r0, [r7, #0x48] - ldr r3, _08069C80 @ gUnknown_086A2EAC - ldr r2, _08069C84 @ gUnknown_086A2DD0 - str r2, [sp] - adds r0, r6, #0 - adds r1, r3, #0 - bl EfxCreateFrontAnim - adds r4, r0, #0 - str r4, [r7, #0x60] - movs r0, #0x78 - strh r0, [r4, #2] - mov r0, r8 - strh r0, [r4, #4] - ldr r0, [r7, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069C88 - ldrh r0, [r4, #2] - mov r1, r9 - subs r0, r0, r1 - b _08069C8C - .align 2, 0 -_08069C78: .4byte gEfxBgSemaphore -_08069C7C: .4byte ProcScr_efxDarkGradoOBJ02piece -_08069C80: .4byte gUnknown_086A2EAC -_08069C84: .4byte gUnknown_086A2DD0 -_08069C88: - ldrh r0, [r4, #2] - add r0, r9 -_08069C8C: - strh r0, [r4, #2] - ldr r0, _08069CA8 @ gEkrDistanceType - movs r2, #0 - ldrsh r0, [r0, r2] - cmp r0, #1 - bne _08069CB2 - ldr r0, [r7, #0x5c] - bl GetAnimPosition - cmp r0, #0 - bne _08069CAC - ldrh r0, [r4, #2] - subs r0, #0x18 - b _08069CB0 - .align 2, 0 -_08069CA8: .4byte gEkrDistanceType -_08069CAC: - ldrh r0, [r4, #2] - adds r0, #0x18 -_08069CB0: - strh r0, [r4, #2] -_08069CB2: - ldrh r0, [r4, #2] - strh r0, [r7, #0x32] - ldrh r0, [r4, #4] - strh r0, [r7, #0x3a] - movs r0, #0x14 - strh r0, [r4, #0xa] - ldrh r1, [r4, #8] - movs r2, #0xc0 - lsls r2, r2, #4 - adds r0, r2, #0 - orrs r0, r1 - strh r0, [r4, #8] - bl AnimSort - add sp, #4 - pop {r3, r4} - mov r8, r3 - mov r9, r4 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_8069C18 - - THUMB_FUNC_START sub_8069CDC -sub_8069CDC: @ 0x08069CDC - push {r4, r5, r6, lr} - sub sp, #4 - adds r6, r0, #0 - ldrh r0, [r6, #0x2c] - adds r0, #1 - strh r0, [r6, #0x2c] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x57 - ble _08069CF2 - b _08069E70 -_08069CF2: - movs r1, #0x2c - ldrsh r0, [r6, r1] - subs r0, #3 - cmp r0, #0 - ble _08069DBE - movs r1, #6 - bl DivRem - cmp r0, #0 - bne _08069DBE - ldr r0, [r6, #0x44] - cmp r0, #5 - bhi _08069DB0 - lsls r0, r0, #2 - ldr r1, _08069D18 @ _08069D1C - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08069D18: .4byte _08069D1C -_08069D1C: @ jump table - .4byte _08069D34 @ case 0 - .4byte _08069D3C @ case 1 - .4byte _08069D4C @ case 2 - .4byte _08069D68 @ case 3 - .4byte _08069D78 @ case 4 - .4byte _08069D96 @ case 5 -_08069D34: - ldr r0, [r6, #0x5c] - movs r1, #0x40 - negs r1, r1 - b _08069D7E -_08069D3C: - ldr r0, [r6, #0x5c] - movs r1, #0x80 - negs r1, r1 - movs r2, #0x10 - negs r2, r2 - movs r3, #0xf0 - lsls r3, r3, #3 - b _08069D86 -_08069D4C: - ldr r0, [r6, #0x5c] - movs r2, #0x10 - negs r2, r2 - movs r3, #0x90 - lsls r3, r3, #4 - movs r1, #0x2c - ldrsh r4, [r6, r1] - movs r1, #0x62 - subs r1, r1, r4 - str r1, [sp] - movs r1, #0 - bl sub_8069B68 - b _08069DB0 -_08069D68: - ldr r0, [r6, #0x5c] - movs r1, #0x40 - negs r1, r1 - movs r2, #0x10 - negs r2, r2 - movs r3, #0x90 - lsls r3, r3, #4 - b _08069D86 -_08069D78: - ldr r0, [r6, #0x5c] - movs r1, #0x80 - negs r1, r1 -_08069D7E: - movs r2, #0x10 - negs r2, r2 - movs r3, #0xa8 - lsls r3, r3, #4 -_08069D86: - movs r4, #0x2c - ldrsh r5, [r6, r4] - movs r4, #0x62 - subs r4, r4, r5 - str r4, [sp] - bl sub_8069B68 - b _08069DB0 -_08069D96: - ldr r0, [r6, #0x5c] - movs r2, #0x10 - negs r2, r2 - movs r3, #0xf0 - lsls r3, r3, #3 - movs r1, #0x2c - ldrsh r4, [r6, r1] - movs r1, #0x62 - subs r1, r1, r4 - str r1, [sp] - movs r1, #0 - bl sub_8069B68 -_08069DB0: - ldr r0, [r6, #0x44] - adds r0, #1 - str r0, [r6, #0x44] - cmp r0, #6 - bne _08069DBE - movs r0, #0 - str r0, [r6, #0x44] -_08069DBE: - movs r2, #0x2c - ldrsh r0, [r6, r2] - subs r0, #1 - cmp r0, #0 - ble _08069E70 - movs r1, #6 - bl DivRem - cmp r0, #0 - bne _08069E70 - ldr r0, [r6, #0x48] - cmp r0, #5 - bhi _08069E62 - lsls r0, r0, #2 - ldr r1, _08069DE4 @ _08069DE8 - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08069DE4: .4byte _08069DE8 -_08069DE8: @ jump table - .4byte _08069E00 @ case 0 - .4byte _08069E08 @ case 1 - .4byte _08069E14 @ case 2 - .4byte _08069E20 @ case 3 - .4byte _08069E2C @ case 4 - .4byte _08069E48 @ case 5 -_08069E00: - ldr r0, [r6, #0x5c] - movs r1, #0x18 - negs r1, r1 - b _08069E32 -_08069E08: - ldr r0, [r6, #0x5c] - movs r1, #0x38 - negs r1, r1 - movs r3, #0xf0 - lsls r3, r3, #2 - b _08069E36 -_08069E14: - ldr r0, [r6, #0x5c] - movs r1, #0x58 - negs r1, r1 - movs r3, #0x90 - lsls r3, r3, #3 - b _08069E36 -_08069E20: - ldr r0, [r6, #0x5c] - movs r1, #0x18 - negs r1, r1 - movs r3, #0x90 - lsls r3, r3, #3 - b _08069E36 -_08069E2C: - ldr r0, [r6, #0x5c] - movs r1, #0x38 - negs r1, r1 -_08069E32: - movs r3, #0xa8 - lsls r3, r3, #3 -_08069E36: - movs r2, #0x2c - ldrsh r4, [r6, r2] - movs r2, #0x62 - subs r2, r2, r4 - str r2, [sp] - movs r2, #0 - bl sub_8069C18 - b _08069E62 -_08069E48: - ldr r0, [r6, #0x5c] - movs r1, #0x58 - negs r1, r1 - movs r3, #0xf0 - lsls r3, r3, #2 - movs r2, #0x2c - ldrsh r4, [r6, r2] - movs r2, #0x62 - subs r2, r2, r4 - str r2, [sp] - movs r2, #0 - bl sub_8069C18 -_08069E62: - ldr r0, [r6, #0x48] - adds r0, #1 - str r0, [r6, #0x48] - cmp r0, #6 - bne _08069E70 - movs r0, #0 - str r0, [r6, #0x48] -_08069E70: - movs r4, #0x2c - ldrsh r0, [r6, r4] - cmp r0, #0x60 - bne _08069E7E - adds r0, r6, #0 - bl Proc_Break -_08069E7E: - add sp, #4 - pop {r4, r5, r6} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_8069CDC - - THUMB_FUNC_START sub_8069E88 -sub_8069E88: @ 0x08069E88 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _08069EB8 @ ProcScr_efxDarkGradoOBJ02 - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x5c] - movs r1, #0 - strh r1, [r0, #0x2c] - str r1, [r0, #0x44] - str r1, [r0, #0x48] - ldr r0, _08069EBC @ gUnknown_086A2CE8 - movs r1, #0x20 - bl SpellFx_RegisterObjPal - ldr r0, _08069EC0 @ gUnknown_086A2874 - movs r1, #0x80 - lsls r1, r1, #5 - bl SpellFx_RegisterObjGfx - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08069EB8: .4byte ProcScr_efxDarkGradoOBJ02 -_08069EBC: .4byte gUnknown_086A2CE8 -_08069EC0: .4byte gUnknown_086A2874 - - THUMB_FUNC_END sub_8069E88 - THUMB_FUNC_START StartSpellAnimCrimsonEye StartSpellAnimCrimsonEye: @ 0x08069EC4 push {r4, r5, lr} diff --git a/include/efxbattle.h b/include/efxbattle.h index 9aa25d28a..aa4088950 100644 --- a/include/efxbattle.h +++ b/include/efxbattle.h @@ -101,7 +101,8 @@ struct ProcEfxOBJ { /* 42 */ u16 unk42; /* 44 */ int unk44; /* 48 */ int unk48; - STRUCT_PAD(0x4C, 0x5C); + /* 4C */ int unk4C; + STRUCT_PAD(0x50, 0x5C); /* 5C */ struct Anim * anim; /* 60 */ struct Anim * anim2; /* 64 */ struct Anim * anim3; diff --git a/include/efxmagic.h b/include/efxmagic.h index 4d8910edd..a39a3971a 100644 --- a/include/efxmagic.h +++ b/include/efxmagic.h @@ -815,44 +815,44 @@ void StartSubSpell_efxDrzDrakbreathBGCOL(struct Anim * anim); void efxDrzDrakbreathBGCOL_Loop(struct ProcEfxBGCOL * proc); void sub_8068AFC(struct Anim * anim, u16 * tsaL, u16 * tsaR, u8 unk); void sub_8068B80(struct Anim * anim); -// ??? sub_8068BB8(???); -// ??? sub_8068D20(???); -// ??? sub_8068D78(???); -// ??? sub_8068D9C(???); -// ??? sub_8068DD8(???); -// ??? sub_8068E14(???); -// ??? sub_8068E50(???); -// ??? sub_8068E8C(???); -// ??? sub_8068EC8(???); -// ??? sub_8068F04(???); -// ??? sub_8068F40(???); -// ??? sub_8068F7C(???); -// ??? sub_8068FB8(???); -// ??? sub_8068FF4(???); -// ??? sub_8069030(???); -// ??? sub_806906C(???); -// ??? sub_80690A8(???); -// ??? sub_80690E4(???); -// ??? sub_8069100(???); -// ??? sub_80692B0(???); -// ??? sub_806935C(???); -// ??? sub_80693CC(???); -// ??? sub_8069400(???); -// ??? sub_8069488(???); +void sub_8068BB8(struct ProcEfx * proc); +void sub_8068D20(struct ProcEfx * proc); +void sub_8068D78(void); +void sub_8068D9C(void); +void sub_8068DD8(void); +void sub_8068E14(void); +void sub_8068E50(void); +void sub_8068E8C(void); +void sub_8068EC8(void); +void sub_8068F04(void); +void sub_8068F40(void); +void sub_8068F7C(void); +void sub_8068FB8(void); +void sub_8068FF4(void); +void sub_8069030(void); +void sub_806906C(void); +void sub_80690A8(void); +void sub_80690E4(void); +void sub_8069100(struct ProcEfxBG * proc); +void sub_80692B0(struct Anim * anim); +void sub_806935C(struct ProcEfxBG * proc); +void sub_80693CC(struct ProcEfxBG * proc); +void sub_8069400(struct ProcEfxBG * proc); +void sub_8069488(struct Anim * anim); // ??? sub_8069528(???); // ??? sub_8069530(???); -// ??? sub_80696F0(???); -// ??? sub_8069704(???); -// ??? sub_806977C(???); -// ??? sub_80697F4(???); -// ??? sub_8069878(???); -// ??? sub_80699A8(???); -// ??? sub_8069AC4(???); -// ??? sub_8069AFC(???); -// ??? sub_8069B68(???); -// ??? sub_8069C18(???); -// ??? sub_8069CDC(???); -// ??? sub_8069E88(???); +void sub_80696F0(void); +int sub_8069704(int a, int b, int c); +int sub_806977C(int a, int b, int c); +void sub_80697F4(struct ProcEfxOBJ * proc); +void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e); +void sub_80699A8(struct ProcEfxOBJ * proc); +void sub_8069AC4(struct Anim * anim); +void sub_8069AFC(struct ProcEfxOBJ * proc); +void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator); +void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator); +void sub_8069CDC(struct ProcEfxOBJ * proc); +void sub_8069E88(struct Anim * anim); void StartSpellAnimCrimsonEye(struct Anim * anim); // ??? sub_8069F00(???); // ??? sub_806A008(???); diff --git a/ldscript.txt b/ldscript.txt index 4768e4a6b..792ca21bb 100644 --- a/ldscript.txt +++ b/ldscript.txt @@ -209,6 +209,7 @@ SECTIONS src/banim-efxmagic-evileye.o(.text); src/banim-efxmagic-naglfar.o(.text); src/banim-efxmagic-wretchedair.o(.text); + src/banim-efxmagic-gleipnir.o(.text); asm/banim-efxmagic-66514.o(.text); src/banim-efxhit.o(.text); src/banim-efxmisc.o(.text); diff --git a/src/banim-efxmagic-gleipnir.c b/src/banim-efxmagic-gleipnir.c new file mode 100644 index 000000000..de04f1541 --- /dev/null +++ b/src/banim-efxmagic-gleipnir.c @@ -0,0 +1,1581 @@ +#include "global.h" + +#include "anime.h" +#include "ekrbattle.h" +#include "efxbattle.h" +#include "efxmagic.h" +#include "hardware.h" +#include "bmlib.h" +#include "ekrdragon.h" + +extern int gUnknown_0201FB28; + +extern struct ProcCmd gUnknown_085D8318[]; + +//! FE8U = 0x08068B80 +void sub_8068B80(struct Anim * anim) +{ + struct ProcEfx * proc; + + SpellFx_Begin(); + SpellFx_ClearBG1Position(); + + proc = Proc_Start(gUnknown_085D8318, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->hitted = CheckRoundMiss(GetAnimRoundTypeAnotherSide(anim)); + + return; +} + +//! FE8U = 0x08068BB8 +void sub_8068BB8(struct ProcEfx * proc) +{ + struct Anim * anim = GetAnimAnotherSide(proc->anim); + int duration = EfxGetCamMovDuration(); + + proc->timer++; + + if (proc->timer == 1) + { + NewEfxFarAttackWithDistance(proc->anim, -1); + } + else if (proc->timer == duration + 2) + { + if ((GetBanimDragonStatusType() != EKRDRGON_TYPE_DRACO_ZOMBIE) && + (GetBanimDragonStatusType() != EKRDRGON_TYPE_DEMON_KING)) + { + sub_8068D78(); + } + } + else if (proc->timer == duration + 34) + { + sub_80692B0(anim); + PlaySFX(0x3ac, 0x100, 120, 1); + } + else if (proc->timer == duration + 96) + { + sub_8069488(anim); + sub_8069AC4(anim); + } + else if (proc->timer == duration + 206) + { + sub_8069E88(anim); + } + else if (proc->timer == duration + 302) + { + NewEfxFlashBgWhite(anim, 10); + + if ((GetBanimDragonStatusType() != EKRDRGON_TYPE_DRACO_ZOMBIE) && + (GetBanimDragonStatusType() != EKRDRGON_TYPE_DEMON_KING)) + { + sub_8068D9C(); + } + + NewEfxSpellCast(); + + anim->state3 |= 9; + + StartBattleAnimHitEffectsDefault(anim, proc->hitted); + + if (!proc->hitted) + { + EfxPlayHittedSFX(anim); + } + } + else if (proc->timer == duration + 308) + { + if (proc->hitted) + { + SpellFx_Finish(); + RegisterEfxSpellCastEnd(); + Proc_Break(proc); + } + } + else if (proc->timer == duration + 312) + { + StartSpellThing_MagicQuake(proc->anim, 15, 9); + StartSubSpell_efxGespenstBG4(anim, 30); + StartSubSpell_efxGespenstBGCOL2(anim); + PlaySFX(0x3AD, 0x100, 120, 1); + } + else if (proc->timer == duration + 328) + { + StartSpellThing_MagicQuake(proc->anim, 15, 8); + } + else if (proc->timer == duration + 353) + { + SpellFx_Finish(); + RegisterEfxSpellCastEnd(); + Proc_Break(proc); + } + + return; +} + +//! FE8U = 0x08068D20 +void sub_8068D20(struct ProcEfx * proc) +{ + int ret = Interpolate(INTERPOLATE_SQUARE, 4, 16, proc->timer, 16); + + EfxPalBlackInOut(gPaletteBuffer, 6, 10, ret); + EnablePaletteSync(); + + proc->timer++; + + if (proc->timer == 17) + { + proc->timer = 0; + gEfxBgSemaphore--; + Proc_Break(proc); + } + + return; +} + +extern struct ProcCmd gUnknown_085D8330[]; + +//! FE8U = 0x08068D78 +void sub_8068D78(void) +{ + struct ProcEfx * proc; + + gEfxBgSemaphore++; + + proc = Proc_Start(gUnknown_085D8330, PROC_TREE_3); + proc->timer = 0; + + return; +} + +//! FE8U = 0x08068D9C +void sub_8068D9C(void) +{ + if (gBanimGackgroundIndex == 0) + { + EfxChapterMapFadeOUT(4); + } + else + { + PutBanimBgPAL(gBanimGackgroundIndex - 1); + EfxPalBlackInOut(gPaletteBuffer, 6, 10, 0); + EnablePaletteSync(); + } + + return; +} + +//! FE8U = 0x08068DD8 +void sub_8068DD8(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 0xd); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068E14 +void sub_8068E14(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 0xc); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068E50 +void sub_8068E50(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 0xb); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068E8C +void sub_8068E8C(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 0xa); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068EC8 +void sub_8068EC8(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 9); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068F04 +void sub_8068F04(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 8); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068F40 +void sub_8068F40(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 7); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068F7C +void sub_8068F7C(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 6); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068FB8 +void sub_8068FB8(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 5); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08068FF4 +void sub_8068FF4(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 4); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x08069030 +void sub_8069030(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 3); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x0806906C +void sub_806906C(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 2); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x080690A8 +void sub_80690A8(void) +{ + u16 vcount = REG_VCOUNT + 1; + + if (vcount < DISPLAY_HEIGHT) + { + int tmp = gUnknown_0201FB28; + int tmp2 = (vcount - 0x3f); + int result = Div((gUnknown_0201FB28 - tmp2), 1); + + REG_BG1VOFS = -gUnknown_0201FB28 - result; + } + + return; +} + +//! FE8U = 0x080690E4 +void sub_80690E4(void) +{ + u16 vcount = REG_VCOUNT + 1; + REG_BG1VOFS = -gUnknown_0201FB28; + return; +} + +//! FE8U = 0x08069100 +void sub_8069100(struct ProcEfxBG * proc) +{ + s16 ret = EfxAdvanceFrameLut((s16 *)&proc->timer, (s16 *)&proc->frame, proc->frame_config); + + switch (proc->frame) + { + case 1: + switch (proc->timer) + { + case 0: + SetPrimaryHBlankHandler(sub_8068E8C); + break; + + case 1: + SetPrimaryHBlankHandler(sub_8068DD8); + break; + } + + break; + + case 2: + switch (proc->timer) + { + case 2: + SetPrimaryHBlankHandler(sub_80690E4); + break; + + case 3: + SetPrimaryHBlankHandler(sub_8068F40); + break; + + case 0: + SetPrimaryHBlankHandler(sub_8068F04); + break; + + case 1: + SetPrimaryHBlankHandler(sub_8068E8C); + break; + } + + break; + + case 3: + switch (proc->timer) + { + case 2: + SetPrimaryHBlankHandler(sub_80690E4); + break; + + case 3: + SetPrimaryHBlankHandler(sub_8068F7C); + break; + + case 1: + SetPrimaryHBlankHandler(sub_8068F04); + break; + + case 0: + SetPrimaryHBlankHandler(sub_8068F7C); + break; + } + + break; + + case 4: + switch (proc->timer) + { + case 3: + SetPrimaryHBlankHandler(sub_8068FF4); + break; + + case 2: + SetPrimaryHBlankHandler(sub_80690E4); + break; + + case 1: + SetPrimaryHBlankHandler(sub_8068FB8); + break; + + case 0: + SetPrimaryHBlankHandler(sub_8068FF4); + break; + } + + break; + + case 5: + switch (proc->timer) + { + case 3: + SetPrimaryHBlankHandler(sub_8069030); + break; + + case 2: + SetPrimaryHBlankHandler(sub_80690E4); + break; + + case 1: + SetPrimaryHBlankHandler(sub_8069030); + break; + + case 0: + SetPrimaryHBlankHandler(sub_806906C); + break; + } + + break; + + default: + SetPrimaryHBlankHandler(sub_80690E4); + break; + } + + if (ret >= 0) + { + u16 ** tsaL = proc->tsal; + u16 ** tsaR = proc->tsar; + u16 ** img = proc->img; + + SpellFx_RegisterBgGfx(*(img + ret), 0x2000); + SpellFx_WriteBgMap(proc->anim, *(tsaL + ret), *(tsaR + ret)); + proc->terminator = ret; + } + else + { + if (ret == -1) + { + SpellFx_ClearBG1(); + SetPrimaryHBlankHandler(NULL); + gEfxBgSemaphore--; + SetDefaultColorEffects_(); + Proc_Break(proc); + } + } + + return; +} + +extern struct ProcCmd ProcScr_efxDarkGradoBG01[]; + +extern u16 * gUnknown_085D8348[]; +extern u16 * gUnknown_085D8374[]; + +extern u16 gUnknown_086A66D8[]; + +extern u16 gUnknown_080DEDBC[]; + +//! FE8U = 0x080692B0 +void sub_80692B0(struct Anim * anim) +{ + struct ProcEfxBG * proc; + + gEfxBgSemaphore++; + + gUnknown_0201FB28 = 0x10; + + proc = Proc_Start(ProcScr_efxDarkGradoBG01, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->frame = 0; + proc->frame_config = gUnknown_080DEDBC; + + proc->tsal = gUnknown_085D8348; + proc->tsar = gUnknown_085D8348; + proc->img = gUnknown_085D8374; + + SpellFx_RegisterBgPal(gUnknown_086A66D8, 0x20); + + if (gEkrDistanceType == 1) + { + if (GetAnimPosition(proc->anim) == 0) + { + BG_SetPosition(1, 0x18, -16); + } + else + { + BG_SetPosition(1, -0x18, -16); + } + } + else + { + BG_SetPosition(1, 0, -16); + } + + SpellFx_SetSomeColorEffect(); + + return; +} + +void sub_80696F0(void); + +//! FE8U = 0x0806935C +void sub_806935C(struct ProcEfxBG * proc) +{ + s16 ret = EfxAdvanceFrameLut((s16 *)&proc->timer, (s16 *)&proc->frame, proc->frame_config); + + if (ret >= 0) + { + u16 ** tsa = proc->tsal; + u16 ** img = proc->img; + u16 ** pal = proc->pal; + + SpellFx_RegisterBgGfx(*(img + ret), 0x2000); + SpellFx_RegisterBgPal(*(pal + ret), 0x20); + SpellFx_WriteBgMapExt(proc->anim, *(tsa + ret), 0x20, 0x14); + } + else + { + if (ret == -6) + { + sub_80696F0(); + proc->frame++; + } + else if (ret == -1) + { + Proc_Break(proc); + } + } + + return; +} + +extern u16 * gUnknown_085D8478[]; +extern u16 * gUnknown_085D847C[]; + +extern u16 gUnknown_086B52CC[]; + +extern u16 gUnknown_080DEE40[]; + +//! FE8U = 0x080693CC +void sub_80693CC(struct ProcEfxBG * proc) +{ + proc->timer = 0; + proc->terminator = 0; + proc->frame = 0; + proc->frame_config = gUnknown_080DEE40; + + proc->tsal = gUnknown_085D8478; + proc->img = gUnknown_085D847C; + + SpellFx_RegisterBgPal(gUnknown_086B52CC, 0x20); + + return; +} + +//! FE8U = 0x08069400 +void sub_8069400(struct ProcEfxBG * proc) +{ + s16 ret; + + int x = proc->terminator >> 1; + + if (GetAnimPosition(proc->anim) != 0) + { + x = -x; + } + + BG_SetPosition(1, x, 0); + + proc->terminator++; + + ret = EfxAdvanceFrameLut((s16 *)&proc->timer, (s16 *)&proc->frame, proc->frame_config); + + if (ret >= 0) + { + u16 ** tsa = proc->tsal; + u16 ** img = proc->img; + SpellFx_RegisterBgGfx(*(img + ret), 0x2000); + SpellFx_WriteBgMapExt(proc->anim, *(tsa + ret), 0x20, 0x14); + } + else + { + if (ret == -1) + { + SpellFx_ClearBG1(); + gEfxBgSemaphore--; + SetDefaultColorEffects_(); + Proc_Break(proc); + } + } + + return; +} + +extern struct ProcCmd ProcScr_efxDarkGradoBG02[]; + +extern u16 * gUnknown_085D83B8[]; +extern u16 * gUnknown_085D83F8[]; +extern u16 * gUnknown_085D8438[]; + +extern u16 gUnknown_080DEDFA[]; + +//! FE8U = 0x08069488 +void sub_8069488(struct Anim * anim) +{ + struct ProcEfxBG * proc; + + gEfxBgSemaphore++; + + proc = Proc_Start(ProcScr_efxDarkGradoBG02, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->frame = 0; + proc->frame_config = gUnknown_080DEDFA; + + proc->tsal = gUnknown_085D83B8; + proc->img = gUnknown_085D83F8; + proc->pal = gUnknown_085D8438; + + if (gEkrDistanceType == 1) + { + if (GetAnimPosition(anim) == 0) + { + BG_SetPosition(1, 0x28, 0); + } + else + { + BG_SetPosition(1, -0x18, 0); + } + } + else + { + if (GetAnimPosition(anim) == 0) + { + BG_SetPosition(1, 0x10, 0); + } + else + { + BG_SetPosition(1, 0, 0); + } + } + + SpellFx_SetSomeColorEffect(); + SetBlendBackdropB(0); + + return; +} + +struct Proc085D84B4 +{ + PROC_HEADER; + STRUCT_PAD(0x29, 0x4C); + u16 unk4C; +}; + +//! FE8U = 0x08069528 +void sub_8069528(struct Proc085D84B4 * proc) +{ + proc->unk4C = 0; + return; +} + +#if NONMATCHING + +#define RGB_(r, g, b) (((b) << 10) | ((g) << 5) | (r)) + +//! FE8U = 0x08069530 +void sub_8069530(struct Proc085D84B4 * param_1) +{ + int r6; + int sp_0c; + + u16 * r9 = gPaletteBuffer; + u16 * r8 = gEfxPal; + + if (param_1->unk4C >= 0x29) + { + r6 = Interpolate(0, 0x10, 0, param_1->unk4C - 0x28, 0x18); + } + else if (param_1->unk4C > 0x18) + { + r6 = 0x10; + } + else + { + r6 = Interpolate(0, 0, 0x10, param_1->unk4C, 0x18); + } + + *r9 = *r8; + + for (sp_0c = 0; sp_0c < 0x20; sp_0c++) + { + u32 r1; + int a; + int sp_10; + volatile int sp_14; + int sp_18; + + switch (sp_0c) + { + case 1: + case 2: + case 3: + case 16: + case 21: + case 27: + case 28: + case 29: + case 30: + // _08069624 + r1 = 0x00007C1F; + break; + + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 17: + case 18: + case 19: + case 20: + case 22: + case 23: + case 24: + case 25: + case 26: + // _0806962C + r1 = 0; + break; + } + + r9++; + r8++; + + a = r1; + sp_10 = r1 >> 5; + sp_14 = r1 >> 10; + + for (sp_18 = 0; sp_18 <= 0x10; sp_18++) + { + int r, g, b; + + r = (((*r9 & 0x1f) * (0x10 - r6) + ((a & 0x1f) * r6)) >> 4); + g = ((((*r9 >> 5) & 0x1f) * (0x10 - r6) + ((sp_10 & 0x1f) * r6) * 0) >> 4); + b = (((((*r9 >> 10) & 0x1f) * (0x10 - r6)) + ((sp_14 & 0x1f) * r6)) >> 4); + + *r8 = RGB_(r & 0x1f, g & 0x1f, b & 0x1f); + r8++; + r9++; + } + } + + CpuFastCopy(gEfxPal, (void *)PLTT, 0x400); + DisablePaletteSync(); + + if (param_1->unk4C == 0x40) + { + Proc_Break(param_1); + } + + param_1->unk4C++; + + return; +} + +#else + +NAKEDFUNC +void sub_8069530(struct Proc085D84B4 * param_1) +{ + asm("\n\ + .syntax unified\n\ + push {r4, r5, r6, r7, lr}\n\ + mov r7, sl\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5, r6, r7}\n\ + sub sp, #0x1c\n\ + str r0, [sp, #4]\n\ + ldr r0, _08069564 @ gPaletteBuffer\n\ + mov r9, r0\n\ + ldr r1, _08069568 @ gEfxPal\n\ + mov r8, r1\n\ + ldr r0, [sp, #4]\n\ + adds r0, #0x4c\n\ + movs r2, #0\n\ + ldrsh r1, [r0, r2]\n\ + cmp r1, #0x28\n\ + ble _0806956C\n\ + adds r3, r1, #0\n\ + subs r3, #0x28\n\ + movs r0, #0x18\n\ + str r0, [sp]\n\ + movs r0, #0\n\ + movs r1, #0x10\n\ + movs r2, #0\n\ + b _08069582\n\ + .align 2, 0\n\ + _08069564: .4byte gPaletteBuffer\n\ + _08069568: .4byte gEfxPal\n\ + _0806956C:\n\ + cmp r1, #0x18\n\ + ble _08069574\n\ + movs r6, #0x10\n\ + b _08069588\n\ + _08069574:\n\ + movs r1, #0\n\ + ldrsh r3, [r0, r1]\n\ + movs r0, #0x18\n\ + str r0, [sp]\n\ + movs r0, #0\n\ + movs r1, #0\n\ + movs r2, #0x10\n\ + _08069582:\n\ + bl Interpolate\n\ + adds r6, r0, #0\n\ + _08069588:\n\ + mov r2, r9\n\ + ldrh r0, [r2]\n\ + mov r7, r8\n\ + strh r0, [r7]\n\ + movs r2, #0\n\ + ldr r0, [sp, #4]\n\ + adds r0, #0x4c\n\ + str r0, [sp, #8]\n\ + _08069598:\n\ + subs r0, r2, #1\n\ + cmp r0, #0x1d\n\ + bhi _0806962C\n\ + lsls r0, r0, #2\n\ + ldr r1, _080695A8 @ _080695AC\n\ + adds r0, r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .align 2, 0\n\ + _080695A8: .4byte _080695AC\n\ + _080695AC: @ jump table\n\ + .4byte _08069624 @ case 0\n\ + .4byte _08069624 @ case 1\n\ + .4byte _08069624 @ case 2\n\ + .4byte _0806962C @ case 3\n\ + .4byte _0806962C @ case 4\n\ + .4byte _0806962C @ case 5\n\ + .4byte _0806962C @ case 6\n\ + .4byte _0806962C @ case 7\n\ + .4byte _0806962C @ case 8\n\ + .4byte _0806962C @ case 9\n\ + .4byte _0806962C @ case 10\n\ + .4byte _0806962C @ case 11\n\ + .4byte _0806962C @ case 12\n\ + .4byte _0806962C @ case 13\n\ + .4byte _0806962C @ case 14\n\ + .4byte _08069624 @ case 15\n\ + .4byte _0806962C @ case 16\n\ + .4byte _0806962C @ case 17\n\ + .4byte _0806962C @ case 18\n\ + .4byte _0806962C @ case 19\n\ + .4byte _08069624 @ case 20\n\ + .4byte _08069624 @ case 21\n\ + .4byte _0806962C @ case 22\n\ + .4byte _0806962C @ case 23\n\ + .4byte _0806962C @ case 24\n\ + .4byte _0806962C @ case 25\n\ + .4byte _08069624 @ case 26\n\ + .4byte _08069624 @ case 27\n\ + .4byte _08069624 @ case 28\n\ + .4byte _08069624 @ case 29\n\ + _08069624:\n\ + ldr r1, _08069628 @ 0x00007C1F\n\ + b _0806962E\n\ + .align 2, 0\n\ + _08069628: .4byte 0x00007C1F\n\ + _0806962C:\n\ + movs r1, #0\n\ + _0806962E:\n\ + movs r7, #2\n\ + add r9, r7\n\ + movs r0, #2\n\ + add r8, r0\n\ + lsrs r7, r1, #5\n\ + str r7, [sp, #0x10]\n\ + lsrs r0, r1, #0xa\n\ + str r0, [sp, #0x14]\n\ + adds r2, #1\n\ + str r2, [sp, #0xc]\n\ + movs r2, #0x1f\n\ + mov ip, r2\n\ + movs r5, #0x1f\n\ + movs r0, #0x10\n\ + subs r4, r0, r6\n\ + movs r7, #0xe\n\ + str r7, [sp, #0x18]\n\ + ands r1, r5\n\ + adds r0, r1, #0\n\ + muls r0, r6, r0\n\ + mov sl, r0\n\ + _08069658:\n\ + mov r2, r9\n\ + ldrh r1, [r2]\n\ + adds r0, r5, #0\n\ + ands r0, r1\n\ + adds r3, r0, #0\n\ + muls r3, r4, r3\n\ + add r3, sl\n\ + asrs r3, r3, #4\n\ + lsls r1, r1, #0x10\n\ + lsrs r0, r1, #0x15\n\ + mov r7, ip\n\ + ands r0, r7\n\ + adds r2, r0, #0\n\ + muls r2, r4, r2\n\ + asrs r2, r2, #4\n\ + lsrs r1, r1, #0x1a\n\ + mov r0, ip\n\ + ands r1, r0\n\ + muls r1, r4, r1\n\ + ldr r0, [sp, #0x14]\n\ + ands r0, r7\n\ + muls r0, r6, r0\n\ + adds r1, r1, r0\n\ + asrs r1, r1, #4\n\ + ands r1, r5\n\ + lsls r1, r1, #0xa\n\ + ands r2, r5\n\ + lsls r2, r2, #5\n\ + orrs r1, r2\n\ + ands r3, r5\n\ + orrs r3, r1\n\ + mov r0, r8\n\ + strh r3, [r0]\n\ + movs r1, #2\n\ + add r9, r1\n\ + add r8, r1\n\ + ldr r2, [sp, #0x18]\n\ + subs r2, #1\n\ + str r2, [sp, #0x18]\n\ + cmp r2, #0\n\ + bge _08069658\n\ + ldr r2, [sp, #0xc]\n\ + cmp r2, #0x1f\n\ + bgt _080696B2\n\ + b _08069598\n\ + _080696B2:\n\ + movs r1, #0xa0\n\ + lsls r1, r1, #0x13\n\ + movs r2, #0x80\n\ + lsls r2, r2, #1\n\ + ldr r0, _080696EC @ gEfxPal\n\ + bl CpuFastSet\n\ + bl DisablePaletteSync\n\ + ldr r7, [sp, #8]\n\ + movs r1, #0\n\ + ldrsh r0, [r7, r1]\n\ + cmp r0, #0x40\n\ + bne _080696D4\n\ + ldr r0, [sp, #4]\n\ + bl Proc_Break\n\ + _080696D4:\n\ + ldr r2, [sp, #8]\n\ + ldrh r0, [r2]\n\ + adds r0, #1\n\ + strh r0, [r2]\n\ + add sp, #0x1c\n\ + pop {r3, r4, r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov sl, r5\n\ + pop {r4, r5, r6, r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ + _080696EC: .4byte gEfxPal\n\ + .syntax divided\n\ + "); +} + +#endif + +extern struct ProcCmd gUnknown_085D84B4[]; + +//! FE8U = 0x080696F0 +void sub_80696F0(void) +{ + Proc_Start(gUnknown_085D84B4, PROC_TREE_VSYNC); + return; +} + +extern s16 gUnknown_085D84D4[]; +extern s16 gUnknown_085D8524[]; +extern s16 gUnknown_085D8574[]; +extern s16 gUnknown_085D85C4[]; +extern s16 gUnknown_085D8614[]; +extern s16 gUnknown_085D8664[]; +extern s16 gUnknown_085D86B4[]; + +//! FE8U = 0x08069704 +int sub_8069704(int a, int b, int c) +{ + s16 * ptr; + + switch (b) + { + case 0: + ptr = gUnknown_085D84D4; + break; + + case 1: + ptr = gUnknown_085D8524; + break; + + case 2: + ptr = gUnknown_085D8574; + break; + + case 3: + ptr = gUnknown_085D85C4; + break; + + case 4: + ptr = gUnknown_085D8614; + break; + + case 5: + ptr = gUnknown_085D8664; + break; + + default: + ptr = gUnknown_085D86B4; + break; + } + + return (ptr[a * 2] * c) >> 8; +} + +//! FE8U = 0x0806977C +int sub_806977C(int a, int b, int c) +{ + s16 * ptr; + + switch (b) + { + case 0: + ptr = gUnknown_085D84D4; + break; + + case 1: + ptr = gUnknown_085D8524; + break; + + case 2: + ptr = gUnknown_085D8574; + break; + + case 3: + ptr = gUnknown_085D85C4; + break; + + case 4: + ptr = gUnknown_085D8614; + break; + + case 5: + ptr = gUnknown_085D8664; + break; + + default: + ptr = gUnknown_085D86B4; + break; + } + + return (ptr[a * 2 + 1] * c) >> 8; +} + +//! FE8U = 0x080697F4 +void sub_80697F4(struct ProcEfxOBJ * proc) +{ + if (GetAnimPosition(proc->anim) == 0) + { + proc->anim2->xPosition = proc->unk32 + sub_8069704(proc->timer, proc->unk44, proc->unk48); + } + else + { + proc->anim2->xPosition = proc->unk32 - sub_8069704(proc->timer, proc->unk44, proc->unk48); + } + + proc->anim2->yPosition = proc->unk3A + sub_806977C(proc->timer, proc->unk44, proc->unk48); + + proc->timer++; + + if ((proc->timer == proc->terminator) || (proc->timer == proc->unk4C)) + { + gEfxBgSemaphore--; + AnimDelete(proc->anim2); + Proc_Break(proc); + } + + return; +} + +extern struct ProcCmd gUnknown_085D8704[]; + +extern u32 gUnknown_086A2724[]; +extern u32 gUnknown_086A2844[]; +extern u32 gUnknown_086A273C[]; +extern u32 gUnknown_086A285C[]; + +//! FE8U = 0x08069878 +void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e) +{ + struct ProcEfxOBJ * proc; + struct Anim * frontAnim; + u32 * scr; + + gEfxBgSemaphore++; + + proc = Proc_Start(gUnknown_085D8704, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->terminator = 0x14; + + switch (b) + { + case 0: + scr = gUnknown_086A2724; + break; + + case 1: + scr = gUnknown_086A2844; + break; + + case 2: + scr = gUnknown_086A273C; + break; + + default: + scr = gUnknown_086A285C; + break; + } + + proc->unk44 = c; + proc->unk48 = d; + proc->unk4C = e; + + frontAnim = (struct Anim *)EfxCreateFrontAnim(anim, scr, scr, scr, scr); + proc->anim2 = frontAnim; + + if (GetAnimPosition(proc->anim) == 0) + { + proc->unk32 = 0x58; + } + else + { + proc->unk32 = 0x98; + } + + proc->unk3A = 0x50; + + if (gEkrDistanceType == 1) + { + if (GetAnimPosition(proc->anim) == 0) + { + proc->unk32 -= 0x18; + } + else + { + proc->unk32 += 0x18; + } + } + + if (GetAnimPosition(proc->anim) == 0) + { + frontAnim->xPosition = proc->unk32 + sub_8069704(proc->timer, proc->unk44, proc->unk48); + } + else + { + frontAnim->xPosition = proc->unk32 - sub_8069704(proc->timer, proc->unk44, proc->unk48); + } + + frontAnim->yPosition = proc->unk3A + sub_806977C(proc->timer, proc->unk44, proc->unk48); + + return; +} + +//! FE8U = 0x080699A8 +void sub_80699A8(struct ProcEfxOBJ * proc) +{ + proc->timer++; + + if (DivRem(proc->timer, 0xc) == 0) + { + if ((proc->terminator & 1) == 0) + { + sub_8069878(proc->anim, (proc->terminator >> 1) & 3, 0, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 2) & 3, 1, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 1) & 3, 2, 0x100, 0x62 - proc->timer); + } + else + { + sub_8069878(proc->anim, (proc->terminator >> 1) & 3, 3, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 2) & 3, 4, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 1) & 3, 5, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 3) & 3, 6, 0x100, 0x62 - proc->timer); + } + + proc->terminator++; + } + + if (proc->timer == 0x61) + { + Proc_Break(proc); + } + + return; +} + +extern struct ProcCmd ProcScr_efxDarkGradoOBJ01[]; + +extern u16 gUnknown_086A2614[]; +extern u16 gUnknown_086A21F4[]; + +//! FE8U = 0x08069AC4 +void sub_8069AC4(struct Anim * anim) +{ + struct ProcEfxOBJ * proc; + + proc = Proc_Start(ProcScr_efxDarkGradoOBJ01, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->terminator = 0; + + SpellFx_RegisterObjPal(gUnknown_086A2614, 0x20); + SpellFx_RegisterObjGfx(gUnknown_086A21F4, 0x1000); + + return; +} + +//! FE8U = 0x08069AFC +void sub_8069AFC(struct ProcEfxOBJ * proc) +{ + proc->unk48 += proc->unk44; + + if (GetAnimPosition(proc->anim) == 0) + { + proc->anim2->xPosition = proc->unk32 - (proc->unk48 >> 8); + } + else + { + proc->anim2->xPosition = (proc->unk48 >> 8) + proc->unk32; + } + + proc->anim2->yPosition = (proc->unk48 >> 8) + proc->unk3A; + + proc->timer++; + + if (proc->timer == proc->terminator) + { + gEfxBgSemaphore--; + AnimDelete(proc->anim2); + Proc_Break(proc); + } + + return; +} + +extern struct ProcCmd ProcScr_efxDarkGradoOBJ02piece[]; + +extern u32 gUnknown_086A2E98[]; +extern u32 gUnknown_086A2DBC[]; + +//! FE8U = 0x08069B68 +void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) +{ + struct ProcEfxOBJ * proc; + struct Anim * frontAnim; + + gEfxBgSemaphore++; + + proc = Proc_Start(ProcScr_efxDarkGradoOBJ02piece, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->terminator = terminator; + + proc->unk44 = unk; + proc->unk48 = 0; + + frontAnim = EfxCreateFrontAnim(anim, gUnknown_086A2E98, gUnknown_086A2DBC, gUnknown_086A2E98, gUnknown_086A2DBC); + proc->anim2 = frontAnim; + + frontAnim->xPosition = 0x68; + frontAnim->yPosition = yPosition; + + if (GetAnimPosition(proc->anim) == 0) + { + frontAnim->xPosition -= xOffset; + } + else + { + frontAnim->xPosition += xOffset; + } + + if (gEkrDistanceType == 1) + { + if (GetAnimPosition(proc->anim) == 0) + { + frontAnim->xPosition -= 0x18; + } + else + { + frontAnim->xPosition += 0x18; + } + } + + proc->unk32 = frontAnim->xPosition; + proc->unk3A = frontAnim->yPosition; + + return; +} + +extern u32 gUnknown_086A2EAC[]; +extern u32 gUnknown_086A2DD0[]; + +//! FE8U = 0x08069C18 +void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) +{ + struct ProcEfxOBJ * proc; + struct Anim * frontAnim; + + gEfxBgSemaphore++; + + proc = Proc_Start(ProcScr_efxDarkGradoOBJ02piece, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + proc->terminator = terminator; + + proc->unk44 = unk; + proc->unk48 = 0; + + frontAnim = EfxCreateFrontAnim(anim, gUnknown_086A2EAC, gUnknown_086A2DD0, gUnknown_086A2EAC, gUnknown_086A2DD0); + proc->anim2 = frontAnim; + + frontAnim->xPosition = 0x78; + frontAnim->yPosition = yPosition; + + if (GetAnimPosition(proc->anim) == 0) + { + frontAnim->xPosition -= xOffset; + } + else + { + frontAnim->xPosition += xOffset; + } + + if (gEkrDistanceType == 1) + { + if (GetAnimPosition(proc->anim) == 0) + { + frontAnim->xPosition -= 0x18; + } + else + { + frontAnim->xPosition += 0x18; + } + } + + proc->unk32 = frontAnim->xPosition; + proc->unk3A = frontAnim->yPosition; + + frontAnim->drawLayerPriority = 0x14; + frontAnim->oam2Base |= 0xc00; + AnimSort(); + + return; +} + +//! FE8U = 0x08069CDC +void sub_8069CDC(struct ProcEfxOBJ * proc) +{ + proc->timer++; + + if (proc->timer < 0x58) + { + if ((proc->timer - 3 > 0) && (DivRem(proc->timer - 3, 6) == 0)) + { + switch (proc->unk44) + { + case 0: + sub_8069B68(proc->anim, -0x40, -0x10, 0xa80, 0x62 - proc->timer); + break; + + case 1: + sub_8069B68(proc->anim, -0x80, -0x10, 0x780, 0x62 - proc->timer); + break; + + case 2: + sub_8069B68(proc->anim, 0, -0x10, 0x900, 0x62 - proc->timer); + break; + + case 3: + sub_8069B68(proc->anim, -0x40, -0x10, 0x900, 0x62 - proc->timer); + break; + + case 4: + sub_8069B68(proc->anim, -0x80, -0x10, 0xa80, 0x62 - proc->timer); + break; + + case 5: + sub_8069B68(proc->anim, 0, -0x10, 0x780, 0x62 - proc->timer); + break; + } + + proc->unk44++; + + if (proc->unk44 == 6) + { + proc->unk44 = 0; + } + } + + if ((proc->timer - 1 > 0) && (DivRem(proc->timer - 1, 6) == 0)) + { + switch (proc->unk48) + { + case 0: + sub_8069C18(proc->anim, -0x18, 0, 0x540, 0x62 - proc->timer); + break; + + case 1: + sub_8069C18(proc->anim, -0x38, 0, 0x3c0, 0x62 - proc->timer); + break; + + case 2: + sub_8069C18(proc->anim, -0x58, 0, 0x480, 0x62 - proc->timer); + break; + + case 3: + sub_8069C18(proc->anim, -0x18, 0, 0x480, 0x62 - proc->timer); + break; + + case 4: + sub_8069C18(proc->anim, -0x38, 0, 0x540, 0x62 - proc->timer); + break; + + case 5: + sub_8069C18(proc->anim, -0x58, 0, 0x3c0, 0x62 - proc->timer); + break; + } + + proc->unk48++; + + if (proc->unk48 == 6) + { + proc->unk48 = 0; + } + } + } + + if (proc->timer == 0x60) + { + Proc_Break(proc); + } + + return; +} + +extern struct ProcCmd ProcScr_efxDarkGradoOBJ02[]; + +extern u16 gUnknown_086A2874[]; +extern u16 gUnknown_086A2CE8[]; + +//! FE8U = 0x08069E88 +void sub_8069E88(struct Anim * anim) +{ + struct ProcEfxOBJ * proc; + + proc = Proc_Start(ProcScr_efxDarkGradoOBJ02, PROC_TREE_3); + proc->anim = anim; + proc->timer = 0; + + proc->unk44 = 0; + proc->unk48 = 0; + + SpellFx_RegisterObjPal(gUnknown_086A2CE8, 0x20); + SpellFx_RegisterObjGfx(gUnknown_086A2874, 0x1000); + + return; +} From 59dcbe7258eeb882f273c4e82fb3005f59109cd3 Mon Sep 17 00:00:00 2001 From: Eebit Date: Mon, 8 Jan 2024 21:57:04 -0500 Subject: [PATCH 2/3] (banim-efxmagic-gleipnir) Extract data --- data/banim-efxdevilatk.s | 251 --------------- data/const_data_efxmagic.s | 18 +- data/data_banim.s | 294 +++++++++++++++++- include/efxbattle.h | 100 +++++- ldscript.txt | 2 + src/banim-efxmagic-gleipnir.c | 561 ++++++++++++++++++++++++++++------ 6 files changed, 842 insertions(+), 384 deletions(-) diff --git a/data/banim-efxdevilatk.s b/data/banim-efxdevilatk.s index 5032d488e..b8bc823d4 100644 --- a/data/banim-efxdevilatk.s +++ b/data/banim-efxdevilatk.s @@ -1,256 +1,5 @@ .section .data - .global gUnknown_085D8318 -gUnknown_085D8318: @ 0x085D8318 - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80ded94 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8068BB8 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_085D8330 -gUnknown_085D8330: @ 0x085D8330 - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80deda4 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8068D20 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_085D8348 -gUnknown_085D8348: @ 0x085D8348 - .4byte gUnknown_086A66D8 + 0x20 - .4byte gUnknown_086A66D8 + 0x1c8 - .4byte gUnknown_086A66D8 + 0x33c - .4byte gUnknown_086A66D8 + 0x4b0 - .4byte gUnknown_086A66D8 + 0x5f8 - .4byte gUnknown_086A66D8 + 0x704 - .4byte gUnknown_086A66D8 + 0x7e4 - .4byte gUnknown_086A66D8 + 0x8bc - .4byte gUnknown_086A66D8 + 0x980 - .4byte gUnknown_086A66D8 + 0xa3c - .4byte gUnknown_086A66D8 + 0xae0 - - .global gUnknown_085D8374 -gUnknown_085D8374: @ 0x085D8374 - .4byte gUnknown_086A2EAC + 0x14 - .4byte gUnknown_086A2EAC + 0x624 - .4byte gUnknown_086A2EAC + 0xcf4 - .4byte gUnknown_086A2EAC + 0x13c4 - .4byte gUnknown_086A2EAC + 0x1a2c - .4byte gUnknown_086A2EAC + 0x1ff0 - .4byte gUnknown_086A2EAC + 0x24e0 - .4byte gUnknown_086A2EAC + 0x28c0 - .4byte gUnknown_086A2EAC + 0x2ca0 - .4byte gUnknown_086A2EAC + 0x3080 - .4byte gUnknown_086A2EAC + 0x3458 - - .global ProcScr_efxDarkGradoBG01 -ProcScr_efxDarkGradoBG01: @ 0x085D83A0 - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80dede8 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8069100 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_085D83B8 -gUnknown_085D83B8: @ 0x085D83B8 - .4byte gUnknown_086A66D8 + 0xc3a0 - .4byte gUnknown_086A66D8 + 0xc458 - .4byte gUnknown_086A66D8 + 0xc51c - .4byte gUnknown_086A66D8 + 0xc5f4 - .4byte gUnknown_086A66D8 + 0xc6e0 - .4byte gUnknown_086A66D8 + 0xc7e4 - .4byte gUnknown_086A66D8 + 0xc900 - .4byte gUnknown_086A66D8 + 0xca3c - .4byte gUnknown_086A66D8 + 0xcb94 - .4byte gUnknown_086A66D8 + 0xcd08 - .4byte gUnknown_086A66D8 + 0xcea0 - .4byte gUnknown_086A66D8 + 0xd05c - .4byte gUnknown_086A66D8 + 0xd224 - .4byte gUnknown_086A66D8 + 0xd414 - .4byte gUnknown_086A66D8 + 0xd610 - .4byte gUnknown_086A66D8 + 0xd828 - - .global gUnknown_085D83F8 -gUnknown_085D83F8: @ 0x085D83F8 - .4byte gUnknown_086A66D8 + 0xb80 - .4byte gUnknown_086A66D8 + 0xfe8 - .4byte gUnknown_086A66D8 + 0x14ec - .4byte gUnknown_086A66D8 + 0x1aa4 - .4byte gUnknown_086A66D8 + 0x2114 - .4byte gUnknown_086A66D8 + 0x2870 - .4byte gUnknown_086A66D8 + 0x30d0 - .4byte gUnknown_086A66D8 + 0x3a64 - .4byte gUnknown_086A66D8 + 0x4508 - .4byte gUnknown_086A66D8 + 0x50b8 - .4byte gUnknown_086A66D8 + 0x5dd8 - .4byte gUnknown_086A66D8 + 0x6be0 - .4byte gUnknown_086A66D8 + 0x7b48 - .4byte gUnknown_086A66D8 + 0x8b94 - .4byte gUnknown_086A66D8 + 0x9cc0 - .4byte gUnknown_086A66D8 + 0xaeec - - .global gUnknown_085D8438 -gUnknown_085D8438: @ 0x085D8438 - .4byte gUnknown_086A66D8 + 0xc1a0 - .4byte gUnknown_086A66D8 + 0xc1c0 - .4byte gUnknown_086A66D8 + 0xc1e0 - .4byte gUnknown_086A66D8 + 0xc200 - .4byte gUnknown_086A66D8 + 0xc220 - .4byte gUnknown_086A66D8 + 0xc240 - .4byte gUnknown_086A66D8 + 0xc260 - .4byte gUnknown_086A66D8 + 0xc280 - .4byte gUnknown_086A66D8 + 0xc2a0 - .4byte gUnknown_086A66D8 + 0xc2c0 - .4byte gUnknown_086A66D8 + 0xc2e0 - .4byte gUnknown_086A66D8 + 0xc300 - .4byte gUnknown_086A66D8 + 0xc320 - .4byte gUnknown_086A66D8 + 0xc340 - .4byte gUnknown_086A66D8 + 0xc360 - .4byte gUnknown_086A66D8 + 0xc380 - - .global gUnknown_085D8478 -gUnknown_085D8478: @ 0x085D8478 - .4byte gUnknown_086B52CC + 0x20 - - .global gUnknown_085D847C -gUnknown_085D847C: @ 0x085D847C - .4byte gUnknown_086A66D8 + 0xda44 - .4byte gUnknown_086B52CC - - .global ProcScr_efxDarkGradoBG02 -ProcScr_efxDarkGradoBG02: @ 0x085D8484 - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80dee48 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_806935C - @ PROC_SLEEP - .short 0xe, 0xe - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_80693CC - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8069400 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_085D84B4 -gUnknown_085D84B4: @ 0x085D84B4 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_8069528 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8069530 - @ PROC_CALL - .short 0x2, 0x0 - .word EnablePaletteSync - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_085D84D4 -gUnknown_085D84D4: @ 0x085D84D4 - .incbin "baserom.gba", 0x5D84D4, 0x50 - - .global gUnknown_085D8524 -gUnknown_085D8524: @ 0x085D8524 - .incbin "baserom.gba", 0x5D8524, 0x50 - - .global gUnknown_085D8574 -gUnknown_085D8574: @ 0x085D8574 - .incbin "baserom.gba", 0x5D8574, 0x50 - - .global gUnknown_085D85C4 -gUnknown_085D85C4: @ 0x085D85C4 - .incbin "baserom.gba", 0x5D85C4, 0x50 - - .global gUnknown_085D8614 -gUnknown_085D8614: @ 0x085D8614 - .incbin "baserom.gba", 0x5D8614, 0x50 - - .global gUnknown_085D8664 -gUnknown_085D8664: @ 0x085D8664 - .incbin "baserom.gba", 0x5D8664, 0x50 - - .global gUnknown_085D86B4 -gUnknown_085D86B4: @ 0x085D86B4 - .incbin "baserom.gba", 0x5D86B4, 0x50 - - .global gUnknown_085D8704 -gUnknown_085D8704: @ 0x085D8704 - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80dee5c - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_80697F4 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global ProcScr_efxDarkGradoOBJ01 -ProcScr_efxDarkGradoOBJ01: @ 0x085D871C - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80dee74 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_80699A8 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global ProcScr_efxDarkGradoOBJ02piece -ProcScr_efxDarkGradoOBJ02piece: @ 0x085D8734 - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80dee88 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8069AFC - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global ProcScr_efxDarkGradoOBJ02 -ProcScr_efxDarkGradoOBJ02: @ 0x085D874C - @ PROC_NAME - .short 0x1, 0x0 - .word 0x80deea0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_8069CDC - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - .global ProcScr_efxCrimsonEye ProcScr_efxCrimsonEye: @ 0x085D8764 @ PROC_NAME diff --git a/data/const_data_efxmagic.s b/data/const_data_efxmagic.s index 09703dbd2..32819a8d4 100644 --- a/data/const_data_efxmagic.s +++ b/data/const_data_efxmagic.s @@ -1,22 +1,6 @@ .section .rodata - .asciz "efxDarkGrado" - .align 2, 0 - - .asciz "efxDarkGradoMapFadeOut" - .align 2, 0 - - .global gUnknown_080DEDBC -gUnknown_080DEDBC: @ 0x080DEDBC - .incbin "baserom.gba", 0xDEDBC, 0x3E - - .global gUnknown_080DEDFA -gUnknown_080DEDFA: @ 0x080DEDFA - .incbin "baserom.gba", 0xDEDFA, 0x46 - - .global gUnknown_080DEE40 -gUnknown_080DEE40: @ 0x080DEE40 - .incbin "baserom.gba", 0xDEE40, 0x82 + .asciz "efxCrimsonEye" .global gUnknown_080DEEC2 gUnknown_080DEEC2: @ 0x080DEEC2 diff --git a/data/data_banim.s b/data/data_banim.s index 7b8637c5d..96177f15a 100644 --- a/data/data_banim.s +++ b/data/data_banim.s @@ -29972,15 +29972,303 @@ gUnknown_086A2E98: @ 0x086A2E98 .global gUnknown_086A2EAC gUnknown_086A2EAC: @ 0x086A2EAC - .incbin "baserom.gba", 0x6A2EAC, 0x382C + .incbin "baserom.gba", 0x6A2EAC, 0x14 @ 0x6A2EC0 - 0x6A2EAC + + .global Img_086A2EC0 +Img_086A2EC0: @ 0x086A2EC0 + .incbin "baserom.gba", 0x6A2EC0, 0x610 @ 0x6A34D0 - 0x6A2EC0 + + .global Img_086A34D0 +Img_086A34D0: @ 0x086A34D0 + .incbin "baserom.gba", 0x6A34D0, 0x6D0 @ 0x6A3BA0 - 0x6A34D0 + + .global Img_086A3BA0 +Img_086A3BA0: @ 0x086A3BA0 + .incbin "baserom.gba", 0x6A3BA0, 0x6D0 @ 0x6A4270 - 0x6A3BA0 + + .global Img_086A4270 +Img_086A4270: @ 0x086A4270 + .incbin "baserom.gba", 0x6A4270, 0x668 @ 0x6A48D8 - 0x6A4270 + + .global Img_086A48D8 +Img_086A48D8: @ 0x086A48D8 + .incbin "baserom.gba", 0x6A48D8, 0x5C4 @ 0x6A4E9C - 0x6A48D8 + + .global Img_086A4E9C +Img_086A4E9C: @ 0x086A4E9C + .incbin "baserom.gba", 0x6A4E9C, 0x4F0 @ 0x6A538C - 0x6A4E9C + + .global Img_086A538C +Img_086A538C: @ 0x086A538C + .incbin "baserom.gba", 0x6A538C, 0x3E0 @ 0x6A576C - 0x6A538C + + .global Img_086A576C +Img_086A576C: @ 0x086A576C + .incbin "baserom.gba", 0x6A576C, 0x3E0 @ 0x6A5B4C - 0x6A576C + + .global Img_086A5B4C +Img_086A5B4C: @ 0x086A5B4C + .incbin "baserom.gba", 0x6A5B4C, 0x3E0 @ 0x6A5F2C - 0x6A5B4C + + .global Img_086A5F2C +Img_086A5F2C: @ 0x086A5F2C + .incbin "baserom.gba", 0x6A5F2C, 0x3D8 @ 0x6A6304 - 0x6A5F2C + + .global Img_086A6304 +Img_086A6304: @ 0x086A6304 + .incbin "baserom.gba", 0x6A6304, 0x3D4 @ 0x6A66D8 - 0x6A6304 .global gUnknown_086A66D8 gUnknown_086A66D8: @ 0x086A66D8 - .incbin "baserom.gba", 0x6A66D8, 0xEBF4 + .incbin "baserom.gba", 0x6A66D8, 0x20 @ 0x6A66F8 - 0x6A66D8 + + .global Tsa_086A66F8 +Tsa_086A66F8: @ 0x086A66F8 + .incbin "baserom.gba", 0x6A66F8, 0x1A8 @ 0x6A68A0 - 0x6A66F8 + + .global Tsa_086A68A0 +Tsa_086A68A0: @ 0x086A68A0 + .incbin "baserom.gba", 0x6A68A0, 0x174 @ 0x6A6A14 - 0x6A68A0 + + .global Tsa_086A6A14 +Tsa_086A6A14: @ 0x086A6A14 + .incbin "baserom.gba", 0x6A6A14, 0x174 @ 0x6A6B88 - 0x6A6A14 + + .global Tsa_086A6B88 +Tsa_086A6B88: @ 0x086A6B88 + .incbin "baserom.gba", 0x6A6B88, 0x148 @ 0x6A6CD0 - 0x6A6B88 + + .global Tsa_086A6CD0 +Tsa_086A6CD0: @ 0x086A6CD0 + .incbin "baserom.gba", 0x6A6CD0, 0x10C @ 0x6A6DDC - 0x6A6CD0 + + .global Tsa_086A6DDC +Tsa_086A6DDC: @ 0x086A6DDC + .incbin "baserom.gba", 0x6A6DDC, 0xE0 @ 0x6A6EBC - 0x6A6DDC + + .global Tsa_086A6EBC +Tsa_086A6EBC: @ 0x086A6EBC + .incbin "baserom.gba", 0x6A6EBC, 0xD8 @ 0x6A6F94 - 0x6A6EBC + + .global Tsa_086A6F94 +Tsa_086A6F94: @ 0x086A6F94 + .incbin "baserom.gba", 0x6A6F94, 0xC4 @ 0x6A7058 - 0x6A6F94 + + .global Tsa_086A7058 +Tsa_086A7058: @ 0x086A7058 + .incbin "baserom.gba", 0x6A7058, 0xBC @ 0x6A7114 - 0x6A7058 + + .global Tsa_086A7114 +Tsa_086A7114: @ 0x086A7114 + .incbin "baserom.gba", 0x6A7114, 0xA4 @ 0x6A71B8 - 0x6A7114 + + .global Tsa_086A71B8 +Tsa_086A71B8: @ 0x086A71B8 + .incbin "baserom.gba", 0x6A71B8, 0xA0 @ 0x6A7258 - 0x6A71B8 + + .global Img_086A7258 +Img_086A7258: @ 0x086A7258 + .incbin "baserom.gba", 0x6A7258, 0x468 @ 0x6A76C0 - 0x6A7258 + + .global Img_086A76C0 +Img_086A76C0: @ 0x086A76C0 + .incbin "baserom.gba", 0x6A76C0, 0x504 @ 0x6A7BC4 - 0x6A76C0 + + .global Img_086A7BC4 +Img_086A7BC4: @ 0x086A7BC4 + .incbin "baserom.gba", 0x6A7BC4, 0x5B8 @ 0x6A817C - 0x6A7BC4 + + .global Img_086A817C +Img_086A817C: @ 0x086A817C + .incbin "baserom.gba", 0x6A817C, 0x670 @ 0x6A87EC - 0x6A817C + + .global Img_086A87EC +Img_086A87EC: @ 0x086A87EC + .incbin "baserom.gba", 0x6A87EC, 0x75C @ 0x6A8F48 - 0x6A87EC + + .global Img_086A8F48 +Img_086A8F48: @ 0x086A8F48 + .incbin "baserom.gba", 0x6A8F48, 0x860 @ 0x6A97A8 - 0x6A8F48 + + .global Img_086A97A8 +Img_086A97A8: @ 0x086A97A8 + .incbin "baserom.gba", 0x6A97A8, 0x994 @ 0x6AA13C - 0x6A97A8 + + .global Img_086AA13C +Img_086AA13C: @ 0x086AA13C + .incbin "baserom.gba", 0x6AA13C, 0xAA4 @ 0x6AABE0 - 0x6AA13C + + .global Img_086AABE0 +Img_086AABE0: @ 0x086AABE0 + .incbin "baserom.gba", 0x6AABE0, 0xBB0 @ 0x6AB790 - 0x6AABE0 + + .global Img_086AB790 +Img_086AB790: @ 0x086AB790 + .incbin "baserom.gba", 0x6AB790, 0xD20 @ 0x6AC4B0 - 0x6AB790 + + .global Img_086AC4B0 +Img_086AC4B0: @ 0x086AC4B0 + .incbin "baserom.gba", 0x6AC4B0, 0xE08 @ 0x6AD2B8 - 0x6AC4B0 + + .global Img_086AD2B8 +Img_086AD2B8: @ 0x086AD2B8 + .incbin "baserom.gba", 0x6AD2B8, 0xF68 @ 0x6AE220 - 0x6AD2B8 + + .global Img_086AE220 +Img_086AE220: @ 0x086AE220 + .incbin "baserom.gba", 0x6AE220, 0x104C @ 0x6AF26C - 0x6AE220 + + .global Img_086AF26C +Img_086AF26C: @ 0x086AF26C + .incbin "baserom.gba", 0x6AF26C, 0x112C @ 0x6B0398 - 0x6AF26C + + .global Img_086B0398 +Img_086B0398: @ 0x086B0398 + .incbin "baserom.gba", 0x6B0398, 0x122C @ 0x6B15C4 - 0x6B0398 + + .global Img_086B15C4 +Img_086B15C4: @ 0x086B15C4 + .incbin "baserom.gba", 0x6B15C4, 0x12B4 @ 0x6B2878 - 0x6B15C4 + + .global Pal_086B2878 +Pal_086B2878: @ 0x086B2878 + .incbin "baserom.gba", 0x6B2878, 0x20 @ 0x6B2898 - 0x6B2878 + + .global Pal_086B2898 +Pal_086B2898: @ 0x086B2898 + .incbin "baserom.gba", 0x6B2898, 0x20 @ 0x6B28B8 - 0x6B2898 + + .global Pal_086B28B8 +Pal_086B28B8: @ 0x086B28B8 + .incbin "baserom.gba", 0x6B28B8, 0x20 @ 0x6B28D8 - 0x6B28B8 + + .global Pal_086B28D8 +Pal_086B28D8: @ 0x086B28D8 + .incbin "baserom.gba", 0x6B28D8, 0x20 @ 0x6B28F8 - 0x6B28D8 + + .global Pal_086B28F8 +Pal_086B28F8: @ 0x086B28F8 + .incbin "baserom.gba", 0x6B28F8, 0x20 @ 0x6B2918 - 0x6B28F8 + + .global Pal_086B2918 +Pal_086B2918: @ 0x086B2918 + .incbin "baserom.gba", 0x6B2918, 0x20 @ 0x6B2938 - 0x6B2918 + + .global Pal_086B2938 +Pal_086B2938: @ 0x086B2938 + .incbin "baserom.gba", 0x6B2938, 0x20 @ 0x6B2958 - 0x6B2938 + + .global Pal_086B2958 +Pal_086B2958: @ 0x086B2958 + .incbin "baserom.gba", 0x6B2958, 0x20 @ 0x6B2978 - 0x6B2958 + + .global Pal_086B2978 +Pal_086B2978: @ 0x086B2978 + .incbin "baserom.gba", 0x6B2978, 0x20 @ 0x6B2998 - 0x6B2978 + + .global Pal_086B2998 +Pal_086B2998: @ 0x086B2998 + .incbin "baserom.gba", 0x6B2998, 0x20 @ 0x6B29B8 - 0x6B2998 + + .global Pal_086B29B8 +Pal_086B29B8: @ 0x086B29B8 + .incbin "baserom.gba", 0x6B29B8, 0x20 @ 0x6B29D8 - 0x6B29B8 + + .global Pal_086B29D8 +Pal_086B29D8: @ 0x086B29D8 + .incbin "baserom.gba", 0x6B29D8, 0x20 @ 0x6B29F8 - 0x6B29D8 + + .global Pal_086B29F8 +Pal_086B29F8: @ 0x086B29F8 + .incbin "baserom.gba", 0x6B29F8, 0x20 @ 0x6B2A18 - 0x6B29F8 + + .global Pal_086B2A18 +Pal_086B2A18: @ 0x086B2A18 + .incbin "baserom.gba", 0x6B2A18, 0x20 @ 0x6B2A38 - 0x6B2A18 + + .global Pal_086B2A38 +Pal_086B2A38: @ 0x086B2A38 + .incbin "baserom.gba", 0x6B2A38, 0x20 @ 0x6B2A58 - 0x6B2A38 + + .global Pal_086B2A58 +Pal_086B2A58: @ 0x086B2A58 + .incbin "baserom.gba", 0x6B2A58, 0x20 @ 0x6B2A78 - 0x6B2A58 + + .global Tsa_086B2A78 +Tsa_086B2A78: @ 0x086B2A78 + .incbin "baserom.gba", 0x6B2A78, 0xB8 @ 0x6B2B30 - 0x6B2A78 + + .global Tsa_086B2B30 +Tsa_086B2B30: @ 0x086B2B30 + .incbin "baserom.gba", 0x6B2B30, 0xC4 @ 0x6B2BF4 - 0x6B2B30 + + .global Tsa_086B2BF4 +Tsa_086B2BF4: @ 0x086B2BF4 + .incbin "baserom.gba", 0x6B2BF4, 0xD8 @ 0x6B2CCC - 0x6B2BF4 + + .global Tsa_086B2CCC +Tsa_086B2CCC: @ 0x086B2CCC + .incbin "baserom.gba", 0x6B2CCC, 0xEC @ 0x6B2DB8 - 0x6B2CCC + + .global Tsa_086B2DB8 +Tsa_086B2DB8: @ 0x086B2DB8 + .incbin "baserom.gba", 0x6B2DB8, 0x104 @ 0x6B2EBC - 0x6B2DB8 + + .global Tsa_086B2EBC +Tsa_086B2EBC: @ 0x086B2EBC + .incbin "baserom.gba", 0x6B2EBC, 0x11C @ 0x6B2FD8 - 0x6B2EBC + + .global Tsa_086B2FD8 +Tsa_086B2FD8: @ 0x086B2FD8 + .incbin "baserom.gba", 0x6B2FD8, 0x13C @ 0x6B3114 - 0x6B2FD8 + + .global Tsa_086B3114 +Tsa_086B3114: @ 0x086B3114 + .incbin "baserom.gba", 0x6B3114, 0x158 @ 0x6B326C - 0x6B3114 + + .global Tsa_086B326C +Tsa_086B326C: @ 0x086B326C + .incbin "baserom.gba", 0x6B326C, 0x174 @ 0x6B33E0 - 0x6B326C + + .global Tsa_086B33E0 +Tsa_086B33E0: @ 0x086B33E0 + .incbin "baserom.gba", 0x6B33E0, 0x198 @ 0x6B3578 - 0x6B33E0 + + .global Tsa_086B3578 +Tsa_086B3578: @ 0x086B3578 + .incbin "baserom.gba", 0x6B3578, 0x1BC @ 0x6B3734 - 0x6B3578 + + .global Tsa_086B3734 +Tsa_086B3734: @ 0x086B3734 + .incbin "baserom.gba", 0x6B3734, 0x1C8 @ 0x6B38FC - 0x6B3734 + + .global Tsa_086B38FC +Tsa_086B38FC: @ 0x086B38FC + .incbin "baserom.gba", 0x6B38FC, 0x1F0 @ 0x6B3AEC - 0x6B38FC + + .global Tsa_086B3AEC +Tsa_086B3AEC: @ 0x086B3AEC + .incbin "baserom.gba", 0x6B3AEC, 0x1FC @ 0x6B3CE8 - 0x6B3AEC + + .global Tsa_086B3CE8 +Tsa_086B3CE8: @ 0x086B3CE8 + .incbin "baserom.gba", 0x6B3CE8, 0x218 @ 0x6B3F00 - 0x6B3CE8 + + .global Tsa_086B3F00 +Tsa_086B3F00: @ 0x086B3F00 + .incbin "baserom.gba", 0x6B3F00, 0x21C @ 0x6B411C - 0x6B3F00 + + .global Img_086B411C +Img_086B411C: @ 0x086B411C + .incbin "baserom.gba", 0x6B411C, 0x11B0 @ 0x6B52CC - 0x6B411C .global gUnknown_086B52CC gUnknown_086B52CC: @ 0x086B52CC - .incbin "baserom.gba", 0x6B52CC, 0x2B4 + .incbin "baserom.gba", 0x6B52CC, 0x20 @ 0x6B52EC - 0x6B52CC + + .global Tsa_086B52EC +Tsa_086B52EC: @ 0x086B52EC + .incbin "baserom.gba", 0x6B52EC, 0x294 @ 0x6B5580 - 0x6B52EC .global gUnknown_086B5580 gUnknown_086B5580: @ 0x086B5580 diff --git a/include/efxbattle.h b/include/efxbattle.h index aa4088950..1160b7a74 100644 --- a/include/efxbattle.h +++ b/include/efxbattle.h @@ -1806,20 +1806,92 @@ extern u16 Tsa_086A0388[]; extern u16 Img_IvaldiBg4[]; extern u16 Pal_IvaldiBg4[]; extern u16 Tsa_086A1D00[]; -// extern ??? gUnknown_086A21F4 -// extern ??? gUnknown_086A2614 -// extern ??? gUnknown_086A2724 -// extern ??? gUnknown_086A273C -// extern ??? gUnknown_086A2844 -// extern ??? gUnknown_086A285C -// extern ??? gUnknown_086A2874 -// extern ??? gUnknown_086A2CE8 -// extern ??? gUnknown_086A2DBC -// extern ??? gUnknown_086A2DD0 -// extern ??? gUnknown_086A2E98 -// extern ??? gUnknown_086A2EAC -// extern ??? gUnknown_086A66D8 -// extern ??? gUnknown_086B52CC +extern u16 gUnknown_086A21F4[]; +extern u16 gUnknown_086A2614[]; +extern u32 gUnknown_086A2724[]; +extern u32 gUnknown_086A273C[]; +extern u32 gUnknown_086A2844[]; +extern u32 gUnknown_086A285C[]; +extern u16 gUnknown_086A2874[]; +extern u16 gUnknown_086A2CE8[]; +extern u32 gUnknown_086A2DBC[]; +extern u32 gUnknown_086A2DD0[]; +extern u32 gUnknown_086A2E98[]; +extern u32 gUnknown_086A2EAC[]; +extern u16 Img_086A2EC0[]; +extern u16 Img_086A34D0[]; +extern u16 Img_086A3BA0[]; +extern u16 Img_086A4270[]; +extern u16 Img_086A48D8[]; +extern u16 Img_086A4E9C[]; +extern u16 Img_086A538C[]; +extern u16 Img_086A576C[]; +extern u16 Img_086A5B4C[]; +extern u16 Img_086A5F2C[]; +extern u16 Img_086A6304[]; +extern u16 gUnknown_086A66D8[]; +extern u16 Tsa_086A66F8[]; +extern u16 Tsa_086A68A0[]; +extern u16 Tsa_086A6A14[]; +extern u16 Tsa_086A6B88[]; +extern u16 Tsa_086A6CD0[]; +extern u16 Tsa_086A6DDC[]; +extern u16 Tsa_086A6EBC[]; +extern u16 Tsa_086A6F94[]; +extern u16 Tsa_086A7058[]; +extern u16 Tsa_086A7114[]; +extern u16 Tsa_086A71B8[]; +extern u16 Img_086A7258[]; +extern u16 Img_086A76C0[]; +extern u16 Img_086A7BC4[]; +extern u16 Img_086A817C[]; +extern u16 Img_086A87EC[]; +extern u16 Img_086A8F48[]; +extern u16 Img_086A97A8[]; +extern u16 Img_086AA13C[]; +extern u16 Img_086AABE0[]; +extern u16 Img_086AB790[]; +extern u16 Img_086AC4B0[]; +extern u16 Img_086AD2B8[]; +extern u16 Img_086AE220[]; +extern u16 Img_086AF26C[]; +extern u16 Img_086B0398[]; +extern u16 Img_086B15C4[]; +extern u16 Pal_086B2878[]; +extern u16 Pal_086B2898[]; +extern u16 Pal_086B28B8[]; +extern u16 Pal_086B28D8[]; +extern u16 Pal_086B28F8[]; +extern u16 Pal_086B2918[]; +extern u16 Pal_086B2938[]; +extern u16 Pal_086B2958[]; +extern u16 Pal_086B2978[]; +extern u16 Pal_086B2998[]; +extern u16 Pal_086B29B8[]; +extern u16 Pal_086B29D8[]; +extern u16 Pal_086B29F8[]; +extern u16 Pal_086B2A18[]; +extern u16 Pal_086B2A38[]; +extern u16 Pal_086B2A58[]; +extern u16 Tsa_086B2A78[]; +extern u16 Tsa_086B2B30[]; +extern u16 Tsa_086B2BF4[]; +extern u16 Tsa_086B2CCC[]; +extern u16 Tsa_086B2DB8[]; +extern u16 Tsa_086B2EBC[]; +extern u16 Tsa_086B2FD8[]; +extern u16 Tsa_086B3114[]; +extern u16 Tsa_086B326C[]; +extern u16 Tsa_086B33E0[]; +extern u16 Tsa_086B3578[]; +extern u16 Tsa_086B3734[]; +extern u16 Tsa_086B38FC[]; +extern u16 Tsa_086B3AEC[]; +extern u16 Tsa_086B3CE8[]; +extern u16 Tsa_086B3F00[]; +extern u16 Img_086B411C[]; +extern u16 gUnknown_086B52CC[]; +extern u16 Tsa_086B52EC[]; // extern ??? gUnknown_086B5580 // extern ??? gUnknown_086B58DC // extern ??? gUnknown_086B5974 diff --git a/ldscript.txt b/ldscript.txt index 792ca21bb..5175303ba 100644 --- a/ldscript.txt +++ b/ldscript.txt @@ -504,6 +504,7 @@ SECTIONS . = ALIGN(4); src/banim-efxmagic-evileye.o(.rodata); . = ALIGN(4); src/banim-efxmagic-naglfar.o(.rodata); . = ALIGN(4); src/banim-efxmagic-wretchedair.o(.rodata); + . = ALIGN(4); src/banim-efxmagic-gleipnir.o(.rodata); . = ALIGN(4); data/const_data_efxmagic.o(.rodata); . = ALIGN(4); src/banim-efxhit.o(.rodata); . = ALIGN(4); data/const_data_efxhit.o(.rodata); @@ -729,6 +730,7 @@ SECTIONS . = ALIGN(4); src/banim-efxmagic-evileye.o(.data); . = ALIGN(4); src/banim-efxmagic-naglfar.o(.data); . = ALIGN(4); src/banim-efxmagic-wretchedair.o(.data); + . = ALIGN(4); src/banim-efxmagic-gleipnir.o(.data); . = ALIGN(4); data/banim-efxdevilatk.o(.data); . = ALIGN(4); src/banim-efxhit.o(.data); . = ALIGN(4); data/banim-efxhit.o(.data); diff --git a/src/banim-efxmagic-gleipnir.c b/src/banim-efxmagic-gleipnir.c index de04f1541..a7b236071 100644 --- a/src/banim-efxmagic-gleipnir.c +++ b/src/banim-efxmagic-gleipnir.c @@ -10,7 +10,16 @@ extern int gUnknown_0201FB28; -extern struct ProcCmd gUnknown_085D8318[]; +// clang-format off + +struct ProcCmd CONST_DATA gUnknown_085D8318[] = +{ + PROC_NAME("efxDarkGrado"), + PROC_REPEAT(sub_8068BB8), + PROC_END, +}; + +// clang-format on //! FE8U = 0x08068B80 void sub_8068B80(struct Anim * anim) @@ -133,7 +142,16 @@ void sub_8068D20(struct ProcEfx * proc) return; } -extern struct ProcCmd gUnknown_085D8330[]; +// clang-format off + +struct ProcCmd CONST_DATA gUnknown_085D8330[] = +{ + PROC_NAME("efxDarkGradoMapFadeOut"), + PROC_REPEAT(sub_8068D20), + PROC_END, +}; + +// clang-format on //! FE8U = 0x08068D78 void sub_8068D78(void) @@ -514,7 +532,7 @@ void sub_8069100(struct ProcEfxBG * proc) u16 ** tsaR = proc->tsar; u16 ** img = proc->img; - SpellFx_RegisterBgGfx(*(img + ret), 0x2000); + SpellFx_RegisterBgGfx(*(img + ret), 32 * 8 * CHR_SIZE); SpellFx_WriteBgMap(proc->anim, *(tsaL + ret), *(tsaR + ret)); proc->terminator = ret; } @@ -533,14 +551,61 @@ void sub_8069100(struct ProcEfxBG * proc) return; } -extern struct ProcCmd ProcScr_efxDarkGradoBG01[]; +// clang-format off + +u16 * CONST_DATA gUnknown_085D8348[] = +{ + Tsa_086A66F8, + Tsa_086A68A0, + Tsa_086A6A14, + Tsa_086A6B88, + Tsa_086A6CD0, + Tsa_086A6DDC, + Tsa_086A6EBC, + Tsa_086A6F94, + Tsa_086A7058, + Tsa_086A7114, + Tsa_086A71B8, +}; + +u16 * CONST_DATA gUnknown_085D8374[] = +{ + Img_086A2EC0, + Img_086A34D0, + Img_086A3BA0, + Img_086A4270, + Img_086A48D8, + Img_086A4E9C, + Img_086A538C, + Img_086A576C, + Img_086A5B4C, + Img_086A5F2C, + Img_086A6304, +}; -extern u16 * gUnknown_085D8348[]; -extern u16 * gUnknown_085D8374[]; +const u16 gUnknown_080DEDBC[] = +{ + 0, 24, + 1, 4, + 3, 4, + 4, 4, + 5, 4, + 6, 4, + 7, 4, + 8, 4, + 9, 4, + 10, 4, + -1, +}; -extern u16 gUnknown_086A66D8[]; +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoBG01[] = +{ + PROC_NAME("efxDarkGradoBG01"), + PROC_REPEAT(sub_8069100), + PROC_END, +}; -extern u16 gUnknown_080DEDBC[]; +// clang-format on //! FE8U = 0x080692B0 void sub_80692B0(struct Anim * anim) @@ -561,22 +626,22 @@ void sub_80692B0(struct Anim * anim) proc->tsar = gUnknown_085D8348; proc->img = gUnknown_085D8374; - SpellFx_RegisterBgPal(gUnknown_086A66D8, 0x20); + SpellFx_RegisterBgPal(gUnknown_086A66D8, PLTT_SIZE_4BPP); if (gEkrDistanceType == 1) { if (GetAnimPosition(proc->anim) == 0) { - BG_SetPosition(1, 0x18, -16); + BG_SetPosition(BG_1, 24, -16); } else { - BG_SetPosition(1, -0x18, -16); + BG_SetPosition(BG_1, -24, -16); } } else { - BG_SetPosition(1, 0, -16); + BG_SetPosition(BG_1, 0, -16); } SpellFx_SetSomeColorEffect(); @@ -584,8 +649,6 @@ void sub_80692B0(struct Anim * anim) return; } -void sub_80696F0(void); - //! FE8U = 0x0806935C void sub_806935C(struct ProcEfxBG * proc) { @@ -597,9 +660,9 @@ void sub_806935C(struct ProcEfxBG * proc) u16 ** img = proc->img; u16 ** pal = proc->pal; - SpellFx_RegisterBgGfx(*(img + ret), 0x2000); - SpellFx_RegisterBgPal(*(pal + ret), 0x20); - SpellFx_WriteBgMapExt(proc->anim, *(tsa + ret), 0x20, 0x14); + SpellFx_RegisterBgGfx(*(img + ret), 32 * 8 * CHR_SIZE); + SpellFx_RegisterBgPal(*(pal + ret), PLTT_SIZE_4BPP); + SpellFx_WriteBgMapExt(proc->anim, *(tsa + ret), 0x20, 20); } else { @@ -617,12 +680,108 @@ void sub_806935C(struct ProcEfxBG * proc) return; } -extern u16 * gUnknown_085D8478[]; -extern u16 * gUnknown_085D847C[]; +// clang-format off -extern u16 gUnknown_086B52CC[]; +u16 * CONST_DATA gUnknown_085D83B8[] = +{ + Tsa_086B2A78, + Tsa_086B2B30, + Tsa_086B2BF4, + Tsa_086B2CCC, + Tsa_086B2DB8, + Tsa_086B2EBC, + Tsa_086B2FD8, + Tsa_086B3114, + Tsa_086B326C, + Tsa_086B33E0, + Tsa_086B3578, + Tsa_086B3734, + Tsa_086B38FC, + Tsa_086B3AEC, + Tsa_086B3CE8, + Tsa_086B3F00, +}; -extern u16 gUnknown_080DEE40[]; +u16 * CONST_DATA gUnknown_085D83F8[] = +{ + Img_086A7258, + Img_086A76C0, + Img_086A7BC4, + Img_086A817C, + Img_086A87EC, + Img_086A8F48, + Img_086A97A8, + Img_086AA13C, + Img_086AABE0, + Img_086AB790, + Img_086AC4B0, + Img_086AD2B8, + Img_086AE220, + Img_086AF26C, + Img_086B0398, + Img_086B15C4, +}; + +u16 * CONST_DATA gUnknown_085D8438[] = +{ + Pal_086B2878, + Pal_086B2898, + Pal_086B28B8, + Pal_086B28D8, + Pal_086B28F8, + Pal_086B2918, + Pal_086B2938, + Pal_086B2958, + Pal_086B2978, + Pal_086B2998, + Pal_086B29B8, + Pal_086B29D8, + Pal_086B29F8, + Pal_086B2A18, + Pal_086B2A38, + Pal_086B2A58, +}; + +u16 * CONST_DATA gUnknown_085D8478[] = +{ + Tsa_086B52EC, +}; + +u16 * CONST_DATA gUnknown_085D847C[] = +{ + Img_086B411C, + gUnknown_086B52CC, +}; + +const u16 gUnknown_080DEDFA[] = +{ + 0, 6, + 1, 6, + 2, 6, + 3, 6, + 4, 6, + 5, 6, + 6, 6, + 7, 6, + 8, 6, + 9, 6, + 10, 6, + 11, 6, + 12, 6, + -6, 0, + 13, 6, + 14, 6, + 15, 6, + -1, +}; + +const u16 gUnknown_080DEE40[] = +{ + 0, 96, + -1, +}; + +// clang-format on //! FE8U = 0x080693CC void sub_80693CC(struct ProcEfxBG * proc) @@ -635,7 +794,7 @@ void sub_80693CC(struct ProcEfxBG * proc) proc->tsal = gUnknown_085D8478; proc->img = gUnknown_085D847C; - SpellFx_RegisterBgPal(gUnknown_086B52CC, 0x20); + SpellFx_RegisterBgPal(gUnknown_086B52CC, PLTT_SIZE_4BPP); return; } @@ -652,7 +811,7 @@ void sub_8069400(struct ProcEfxBG * proc) x = -x; } - BG_SetPosition(1, x, 0); + BG_SetPosition(BG_1, x, 0); proc->terminator++; @@ -662,7 +821,7 @@ void sub_8069400(struct ProcEfxBG * proc) { u16 ** tsa = proc->tsal; u16 ** img = proc->img; - SpellFx_RegisterBgGfx(*(img + ret), 0x2000); + SpellFx_RegisterBgGfx(*(img + ret), 32 * 8 * CHR_SIZE); SpellFx_WriteBgMapExt(proc->anim, *(tsa + ret), 0x20, 0x14); } else @@ -679,13 +838,22 @@ void sub_8069400(struct ProcEfxBG * proc) return; } -extern struct ProcCmd ProcScr_efxDarkGradoBG02[]; +// clang-format off + +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoBG02[] = +{ + PROC_NAME("efxDarkGradoBG02"), + + PROC_REPEAT(sub_806935C), + PROC_SLEEP(14), -extern u16 * gUnknown_085D83B8[]; -extern u16 * gUnknown_085D83F8[]; -extern u16 * gUnknown_085D8438[]; + PROC_CALL(sub_80693CC), + PROC_REPEAT(sub_8069400), -extern u16 gUnknown_080DEDFA[]; + PROC_END, +}; + +// clang-format on //! FE8U = 0x08069488 void sub_8069488(struct Anim * anim) @@ -708,22 +876,22 @@ void sub_8069488(struct Anim * anim) { if (GetAnimPosition(anim) == 0) { - BG_SetPosition(1, 0x28, 0); + BG_SetPosition(BG_1, 40, 0); } else { - BG_SetPosition(1, -0x18, 0); + BG_SetPosition(BG_1, -24, 0); } } else { if (GetAnimPosition(anim) == 0) { - BG_SetPosition(1, 0x10, 0); + BG_SetPosition(BG_1, 16, 0); } else { - BG_SetPosition(1, 0, 0); + BG_SetPosition(BG_1, 0, 0); } } @@ -1071,7 +1239,19 @@ void sub_8069530(struct Proc085D84B4 * param_1) #endif -extern struct ProcCmd gUnknown_085D84B4[]; +// clang-format off + +struct ProcCmd CONST_DATA gUnknown_085D84B4[] = +{ + PROC_CALL(sub_8069528), + PROC_REPEAT(sub_8069530), + + PROC_CALL(EnablePaletteSync), + + PROC_END, +}; + +// clang-format on //! FE8U = 0x080696F0 void sub_80696F0(void) @@ -1080,13 +1260,177 @@ void sub_80696F0(void) return; } -extern s16 gUnknown_085D84D4[]; -extern s16 gUnknown_085D8524[]; -extern s16 gUnknown_085D8574[]; -extern s16 gUnknown_085D85C4[]; -extern s16 gUnknown_085D8614[]; -extern s16 gUnknown_085D8664[]; -extern s16 gUnknown_085D86B4[]; +// clang-format off + +s16 CONST_DATA gUnknown_085D84D4[] = +{ + 0xFFBF, 0xFFA3, + 0xFFCE, 0xFFA4, + 0xFFDA, 0xFFA6, + 0xFFE7, 0xFFAA, + 0xFFF1, 0xFFAD, + 0xFFFB, 0xFFB3, + 0x0002, 0xFFB8, + 0x0009, 0xFFBE, + 0x000E, 0xFFC4, + 0x0013, 0xFFCB, + 0x0018, 0xFFD3, + 0x001C, 0xFFDB, + 0x001D, 0xFFE4, + 0x001E, 0xFFED, + 0x001E, 0xFFF6, + 0x001D, 0xFFFD, + 0x001B, 0x0003, + 0x0017, 0x0008, + 0x0013, 0x000B, + 0x000F, 0x000E, +}; + +s16 CONST_DATA gUnknown_085D8524[] = +{ + 0x001C, 0x0035, + 0x000D, 0x0033, + 0x0001, 0x0030, + 0xFFF3, 0x002C, + 0xFFE8, 0x0024, + 0xFFDF, 0x0019, + 0xFFD9, 0x0010, + 0xFFD5, 0x0005, + 0xFFD4, 0xFFFC, + 0xFFD5, 0xFFF3, + 0xFFD9, 0xFFEC, + 0xFFE1, 0xFFE7, + 0xFFE9, 0xFFE7, + 0xFFF2, 0xFFE8, + 0xFFF9, 0xFFE9, + 0xFFFF, 0xFFEC, + 0x0006, 0xFFF1, + 0x000A, 0xFFF6, + 0x000C, 0xFFFC, + 0x000D, 0x0001, +}; + +s16 CONST_DATA gUnknown_085D8574[] = +{ + 0x0096, 0x0012, + 0x0085, 0x001D, + 0x0076, 0x0023, + 0x0066, 0x0027, + 0x0059, 0x0029, + 0x004E, 0x002A, + 0x0044, 0x002A, + 0x003B, 0x002A, + 0x0030, 0x0028, + 0x0025, 0x0025, + 0x001A, 0x0021, + 0x0012, 0x001D, + 0x000B, 0x0018, + 0x0005, 0x0013, + 0x0000, 0x000F, + 0xFFFB, 0x000B, + 0xFFF7, 0x0005, + 0xFFF4, 0xFFFF, + 0xFFF2, 0xFFF7, + 0xFFF1, 0xFFF0, +}; + +s16 CONST_DATA gUnknown_085D85C4[] = +{ + 0xFFA5, 0xFFFB, + 0xFFAA, 0xFFEF, + 0xFFB0, 0xFFE4, + 0xFFB5, 0xFFDA, + 0xFFBC, 0xFFD1, + 0xFFC5, 0xFFC9, + 0xFFD0, 0xFFC6, + 0xFFDB, 0xFFC5, + 0xFFE6, 0xFFC6, + 0xFFEF, 0xFFC8, + 0xFFF8, 0xFFCC, + 0xFFFF, 0xFFD0, + 0x0006, 0xFFD5, + 0x000B, 0xFFDB, + 0x000E, 0xFFE3, + 0x0010, 0xFFE9, + 0x0011, 0xFFF0, + 0x0011, 0xFFF6, + 0x0010, 0xFFFD, + 0x000E, 0x0003, +}; + +s16 CONST_DATA gUnknown_085D8614[] = +{ + 0x0019, 0x0037, + 0x000F, 0x0035, + 0x0005, 0x0032, + 0xFFFB, 0x002E, + 0xFFF1, 0x0028, + 0xFFE9, 0x0023, + 0xFFE2, 0x001C, + 0xFFDC, 0x0013, + 0xFFD8, 0x000A, + 0xFFD5, 0x0001, + 0xFFD4, 0xFFF8, + 0xFFD4, 0xFFF0, + 0xFFD6, 0xFFE8, + 0xFFDD, 0xFFE3, + 0xFFE4, 0xFFE2, + 0xFFEB, 0xFFE2, + 0xFFF1, 0xFFE3, + 0xFFF7, 0xFFE6, + 0xFFFC, 0xFFE9, + 0x0001, 0xFFEE, +}; + +s16 CONST_DATA gUnknown_085D8664[] = +{ + 0x0091, 0xFFB7, + 0x0092, 0xFFD2, + 0x008F, 0xFFEA, + 0x0082, 0x0002, + 0x0070, 0x0011, + 0x0061, 0x0018, + 0x0052, 0x001D, + 0x0044, 0x0020, + 0x0036, 0x0023, + 0x002B, 0x0022, + 0x0020, 0x0020, + 0x0016, 0x001E, + 0x000C, 0x001C, + 0x0004, 0x0019, + 0xFFFD, 0x0015, + 0xFFF7, 0x0010, + 0xFFF2, 0x000A, + 0xFFEF, 0x0002, + 0xFFEE, 0xFFFB, + 0xFFEE, 0xFFF5, +}; + +s16 CONST_DATA gUnknown_085D86B4[] = +{ + 0x000E, 0xFFAE, + 0x001C, 0xFFB2, + 0x0026, 0xFFB9, + 0x002E, 0xFFC2, + 0x0034, 0xFFCC, + 0x0037, 0xFFD6, + 0x0039, 0xFFE0, + 0x0039, 0xFFE9, + 0x0038, 0xFFF3, + 0x0035, 0xFFFB, + 0x0032, 0x0002, + 0x002D, 0x0007, + 0x0027, 0x000C, + 0x0022, 0x000F, + 0x001C, 0x0012, + 0x0016, 0x0013, + 0x0011, 0x0013, + 0x000C, 0x0012, + 0x0006, 0x0011, + 0x0000, 0x000E, +}; + +// clang-format on //! FE8U = 0x08069704 int sub_8069704(int a, int b, int c) @@ -1192,12 +1536,16 @@ void sub_80697F4(struct ProcEfxOBJ * proc) return; } -extern struct ProcCmd gUnknown_085D8704[]; +// clang-format off + +struct ProcCmd CONST_DATA gUnknown_085D8704[] = +{ + PROC_NAME("efxDarkGradoOBJ01piece"), + PROC_REPEAT(sub_80697F4), + PROC_END, +}; -extern u32 gUnknown_086A2724[]; -extern u32 gUnknown_086A2844[]; -extern u32 gUnknown_086A273C[]; -extern u32 gUnknown_086A285C[]; +// clang-format on //! FE8U = 0x08069878 void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e) @@ -1211,7 +1559,7 @@ void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e) proc = Proc_Start(gUnknown_085D8704, PROC_TREE_3); proc->anim = anim; proc->timer = 0; - proc->terminator = 0x14; + proc->terminator = 20; switch (b) { @@ -1236,29 +1584,29 @@ void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e) proc->unk48 = d; proc->unk4C = e; - frontAnim = (struct Anim *)EfxCreateFrontAnim(anim, scr, scr, scr, scr); + frontAnim = EfxCreateFrontAnim(anim, scr, scr, scr, scr); proc->anim2 = frontAnim; if (GetAnimPosition(proc->anim) == 0) { - proc->unk32 = 0x58; + proc->unk32 = 88; } else { - proc->unk32 = 0x98; + proc->unk32 = 152; } - proc->unk3A = 0x50; + proc->unk3A = 80; if (gEkrDistanceType == 1) { if (GetAnimPosition(proc->anim) == 0) { - proc->unk32 -= 0x18; + proc->unk32 -= 24; } else { - proc->unk32 += 0x18; + proc->unk32 += 24; } } @@ -1281,26 +1629,26 @@ void sub_80699A8(struct ProcEfxOBJ * proc) { proc->timer++; - if (DivRem(proc->timer, 0xc) == 0) + if (DivRem(proc->timer, 12) == 0) { if ((proc->terminator & 1) == 0) { - sub_8069878(proc->anim, (proc->terminator >> 1) & 3, 0, 0x100, 0x62 - proc->timer); - sub_8069878(proc->anim, ((proc->terminator >> 1) + 2) & 3, 1, 0x100, 0x62 - proc->timer); - sub_8069878(proc->anim, ((proc->terminator >> 1) + 1) & 3, 2, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, (proc->terminator >> 1) & 3, 0, 0x100, 98 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 2) & 3, 1, 0x100, 98 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 1) & 3, 2, 0x100, 98 - proc->timer); } else { - sub_8069878(proc->anim, (proc->terminator >> 1) & 3, 3, 0x100, 0x62 - proc->timer); - sub_8069878(proc->anim, ((proc->terminator >> 1) + 2) & 3, 4, 0x100, 0x62 - proc->timer); - sub_8069878(proc->anim, ((proc->terminator >> 1) + 1) & 3, 5, 0x100, 0x62 - proc->timer); - sub_8069878(proc->anim, ((proc->terminator >> 1) + 3) & 3, 6, 0x100, 0x62 - proc->timer); + sub_8069878(proc->anim, (proc->terminator >> 1) & 3, 3, 0x100, 98 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 2) & 3, 4, 0x100, 98 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 1) & 3, 5, 0x100, 98 - proc->timer); + sub_8069878(proc->anim, ((proc->terminator >> 1) + 3) & 3, 6, 0x100, 98 - proc->timer); } proc->terminator++; } - if (proc->timer == 0x61) + if (proc->timer == 97) { Proc_Break(proc); } @@ -1308,10 +1656,16 @@ void sub_80699A8(struct ProcEfxOBJ * proc) return; } -extern struct ProcCmd ProcScr_efxDarkGradoOBJ01[]; +// clang-format off -extern u16 gUnknown_086A2614[]; -extern u16 gUnknown_086A21F4[]; +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ01[] = +{ + PROC_NAME("efxDarkGradoOBJ01"), + PROC_REPEAT(sub_80699A8), + PROC_END, +}; + +// clang-format on //! FE8U = 0x08069AC4 void sub_8069AC4(struct Anim * anim) @@ -1323,8 +1677,8 @@ void sub_8069AC4(struct Anim * anim) proc->timer = 0; proc->terminator = 0; - SpellFx_RegisterObjPal(gUnknown_086A2614, 0x20); - SpellFx_RegisterObjGfx(gUnknown_086A21F4, 0x1000); + SpellFx_RegisterObjPal(gUnknown_086A2614, PLTT_SIZE_4BPP); + SpellFx_RegisterObjGfx(gUnknown_086A21F4, 32 * 4 * CHR_SIZE); return; } @@ -1357,10 +1711,16 @@ void sub_8069AFC(struct ProcEfxOBJ * proc) return; } -extern struct ProcCmd ProcScr_efxDarkGradoOBJ02piece[]; +// clang-format off + +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ02piece[] = +{ + PROC_NAME("efxDarkGradoOBJ02piece"), + PROC_REPEAT(sub_8069AFC), + PROC_END, +}; -extern u32 gUnknown_086A2E98[]; -extern u32 gUnknown_086A2DBC[]; +// clang-format on //! FE8U = 0x08069B68 void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) @@ -1381,7 +1741,7 @@ void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int te frontAnim = EfxCreateFrontAnim(anim, gUnknown_086A2E98, gUnknown_086A2DBC, gUnknown_086A2E98, gUnknown_086A2DBC); proc->anim2 = frontAnim; - frontAnim->xPosition = 0x68; + frontAnim->xPosition = 104; frontAnim->yPosition = yPosition; if (GetAnimPosition(proc->anim) == 0) @@ -1397,11 +1757,11 @@ void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int te { if (GetAnimPosition(proc->anim) == 0) { - frontAnim->xPosition -= 0x18; + frontAnim->xPosition -= 24; } else { - frontAnim->xPosition += 0x18; + frontAnim->xPosition += 24; } } @@ -1411,9 +1771,6 @@ void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int te return; } -extern u32 gUnknown_086A2EAC[]; -extern u32 gUnknown_086A2DD0[]; - //! FE8U = 0x08069C18 void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) { @@ -1433,7 +1790,7 @@ void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int te frontAnim = EfxCreateFrontAnim(anim, gUnknown_086A2EAC, gUnknown_086A2DD0, gUnknown_086A2EAC, gUnknown_086A2DD0); proc->anim2 = frontAnim; - frontAnim->xPosition = 0x78; + frontAnim->xPosition = 120; frontAnim->yPosition = yPosition; if (GetAnimPosition(proc->anim) == 0) @@ -1449,18 +1806,18 @@ void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int te { if (GetAnimPosition(proc->anim) == 0) { - frontAnim->xPosition -= 0x18; + frontAnim->xPosition -= 24; } else { - frontAnim->xPosition += 0x18; + frontAnim->xPosition += 24; } } proc->unk32 = frontAnim->xPosition; proc->unk3A = frontAnim->yPosition; - frontAnim->drawLayerPriority = 0x14; + frontAnim->drawLayerPriority = 20; frontAnim->oam2Base |= 0xc00; AnimSort(); @@ -1472,34 +1829,34 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) { proc->timer++; - if (proc->timer < 0x58) + if (proc->timer < 88) { if ((proc->timer - 3 > 0) && (DivRem(proc->timer - 3, 6) == 0)) { switch (proc->unk44) { case 0: - sub_8069B68(proc->anim, -0x40, -0x10, 0xa80, 0x62 - proc->timer); + sub_8069B68(proc->anim, -64, -16, 0xa80, 98 - proc->timer); break; case 1: - sub_8069B68(proc->anim, -0x80, -0x10, 0x780, 0x62 - proc->timer); + sub_8069B68(proc->anim, -128, -16, 0x780, 98 - proc->timer); break; case 2: - sub_8069B68(proc->anim, 0, -0x10, 0x900, 0x62 - proc->timer); + sub_8069B68(proc->anim, 0, -16, 0x900, 98 - proc->timer); break; case 3: - sub_8069B68(proc->anim, -0x40, -0x10, 0x900, 0x62 - proc->timer); + sub_8069B68(proc->anim, -64, -16, 0x900, 98 - proc->timer); break; case 4: - sub_8069B68(proc->anim, -0x80, -0x10, 0xa80, 0x62 - proc->timer); + sub_8069B68(proc->anim, -128, -16, 0xa80, 98 - proc->timer); break; case 5: - sub_8069B68(proc->anim, 0, -0x10, 0x780, 0x62 - proc->timer); + sub_8069B68(proc->anim, 0, -16, 0x780, 98 - proc->timer); break; } @@ -1516,27 +1873,27 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) switch (proc->unk48) { case 0: - sub_8069C18(proc->anim, -0x18, 0, 0x540, 0x62 - proc->timer); + sub_8069C18(proc->anim, -24, 0, 0x540, 98 - proc->timer); break; case 1: - sub_8069C18(proc->anim, -0x38, 0, 0x3c0, 0x62 - proc->timer); + sub_8069C18(proc->anim, -56, 0, 0x3c0, 98 - proc->timer); break; case 2: - sub_8069C18(proc->anim, -0x58, 0, 0x480, 0x62 - proc->timer); + sub_8069C18(proc->anim, -88, 0, 0x480, 98 - proc->timer); break; case 3: - sub_8069C18(proc->anim, -0x18, 0, 0x480, 0x62 - proc->timer); + sub_8069C18(proc->anim, -24, 0, 0x480, 98 - proc->timer); break; case 4: - sub_8069C18(proc->anim, -0x38, 0, 0x540, 0x62 - proc->timer); + sub_8069C18(proc->anim, -56, 0, 0x540, 98 - proc->timer); break; case 5: - sub_8069C18(proc->anim, -0x58, 0, 0x3c0, 0x62 - proc->timer); + sub_8069C18(proc->anim, -88, 0, 0x3c0, 98 - proc->timer); break; } @@ -1549,7 +1906,7 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) } } - if (proc->timer == 0x60) + if (proc->timer == 96) { Proc_Break(proc); } @@ -1557,10 +1914,16 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) return; } -extern struct ProcCmd ProcScr_efxDarkGradoOBJ02[]; +// clang-format off + +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ02[] = +{ + PROC_NAME("efxDarkGradoOBJ02"), + PROC_REPEAT(sub_8069CDC), + PROC_END, +}; -extern u16 gUnknown_086A2874[]; -extern u16 gUnknown_086A2CE8[]; +// clang-format on //! FE8U = 0x08069E88 void sub_8069E88(struct Anim * anim) @@ -1574,8 +1937,8 @@ void sub_8069E88(struct Anim * anim) proc->unk44 = 0; proc->unk48 = 0; - SpellFx_RegisterObjPal(gUnknown_086A2CE8, 0x20); - SpellFx_RegisterObjGfx(gUnknown_086A2874, 0x1000); + SpellFx_RegisterObjPal(gUnknown_086A2CE8, PLTT_SIZE_4BPP); + SpellFx_RegisterObjGfx(gUnknown_086A2874, 32 * 4 * CHR_SIZE); return; } From 50f777de4b10c113afc7380dfae349a6eae6dea3 Mon Sep 17 00:00:00 2001 From: Eebit Date: Tue, 9 Jan 2024 00:53:10 -0500 Subject: [PATCH 3/3] (banim-efxmagic-gleipnir) Renames --- asm/banim-ekrcheckenable.s | 8 +- data/data_banim.s | 32 +-- include/efxbattle.h | 38 +-- include/efxmagic.h | 36 +-- include/ekrbattle.h | 8 +- src/banim-efxmagic-gleipnir.c | 461 +++++++++++++++++----------------- src/banim-efxmagic.c | 2 +- src/banim-ekrbattleending.c | 8 +- src/banim-ekrbattlestarting.c | 6 +- src/banim-ekrhensei.c | 2 +- sym_ewram.txt | 2 +- 11 files changed, 305 insertions(+), 298 deletions(-) diff --git a/asm/banim-ekrcheckenable.s b/asm/banim-ekrcheckenable.s index cf96edf84..bb15e7de3 100644 --- a/asm/banim-ekrcheckenable.s +++ b/asm/banim-ekrcheckenable.s @@ -1286,7 +1286,7 @@ _08057A18: strh r4, [r0, #2] strh r4, [r0] _08057A1E: - ldr r5, _08057A40 @ gBanimGackgroundIndex + ldr r5, _08057A40 @ gBanimBackgroundIndex movs r0, #0 strh r0, [r5] bl GetBattleAnimType @@ -1302,7 +1302,7 @@ _08057A1E: b _08057A50 .align 2, 0 _08057A3C: .4byte gUnknown_0203E1DC -_08057A40: .4byte gBanimGackgroundIndex +_08057A40: .4byte gBanimBackgroundIndex _08057A44: .4byte gEkrPairSideVaild _08057A48: .4byte gEkrPairTerrainID _08057A4C: @@ -1322,7 +1322,7 @@ _08057A66: bl CheckBanimHensei cmp r0, #1 bne _08057A74 - ldr r1, _08057C80 @ gBanimGackgroundIndex + ldr r1, _08057C80 @ gBanimBackgroundIndex movs r0, #0x3c strh r0, [r1] _08057A74: @@ -1589,7 +1589,7 @@ _08057C72: .align 2, 0 _08057C78: .4byte gEkrPairTerrainID _08057C7C: .4byte gPlaySt -_08057C80: .4byte gBanimGackgroundIndex +_08057C80: .4byte gBanimBackgroundIndex _08057C84: .4byte gEkrDistanceType _08057C88: .4byte gEkrPairSideVaild _08057C8C: .4byte gEkrPairBanimID2 diff --git a/data/data_banim.s b/data/data_banim.s index 96177f15a..14a16d075 100644 --- a/data/data_banim.s +++ b/data/data_banim.s @@ -29926,12 +29926,12 @@ Pal_IvaldiBg4: @ 0x086A1CE0 Tsa_086A1D00: @ 0x086A1D00 .incbin "baserom.gba", 0x6A1D00, 0x4F4 @ 0x6A21F4 - 0x6A1D00 - .global gUnknown_086A21F4 -gUnknown_086A21F4: @ 0x086A21F4 + .global Img_GleipnirSprites_Rocks +Img_GleipnirSprites_Rocks: @ 0x086A21F4 .incbin "baserom.gba", 0x6A21F4, 0x420 - .global gUnknown_086A2614 -gUnknown_086A2614: @ 0x086A2614 + .global Pal_GleipnirSprites_Rocks +Pal_GleipnirSprites_Rocks: @ 0x086A2614 .incbin "baserom.gba", 0x6A2614, 0x110 .global gUnknown_086A2724 @@ -29950,12 +29950,12 @@ gUnknown_086A2844: @ 0x086A2844 gUnknown_086A285C: @ 0x086A285C .incbin "baserom.gba", 0x6A285C, 0x18 - .global gUnknown_086A2874 -gUnknown_086A2874: @ 0x086A2874 + .global Img_GleipnirSprites_Comet +Img_GleipnirSprites_Comet: @ 0x086A2874 .incbin "baserom.gba", 0x6A2874, 0x474 - .global gUnknown_086A2CE8 -gUnknown_086A2CE8: @ 0x086A2CE8 + .global Pal_GleipnirSprites_Comet +Pal_GleipnirSprites_Comet: @ 0x086A2CE8 .incbin "baserom.gba", 0x6A2CE8, 0xD4 .global gUnknown_086A2DBC @@ -30018,8 +30018,8 @@ Img_086A5F2C: @ 0x086A5F2C Img_086A6304: @ 0x086A6304 .incbin "baserom.gba", 0x6A6304, 0x3D4 @ 0x6A66D8 - 0x6A6304 - .global gUnknown_086A66D8 -gUnknown_086A66D8: @ 0x086A66D8 + .global Pal_GleipnirBg_Sigil +Pal_GleipnirBg_Sigil: @ 0x086A66D8 .incbin "baserom.gba", 0x6A66D8, 0x20 @ 0x6A66F8 - 0x6A66D8 .global Tsa_086A66F8 @@ -30258,16 +30258,16 @@ Tsa_086B3CE8: @ 0x086B3CE8 Tsa_086B3F00: @ 0x086B3F00 .incbin "baserom.gba", 0x6B3F00, 0x21C @ 0x6B411C - 0x6B3F00 - .global Img_086B411C -Img_086B411C: @ 0x086B411C + .global Img_GleipnirBg_Fog +Img_GleipnirBg_Fog: @ 0x086B411C .incbin "baserom.gba", 0x6B411C, 0x11B0 @ 0x6B52CC - 0x6B411C - .global gUnknown_086B52CC -gUnknown_086B52CC: @ 0x086B52CC + .global Pal_GleipnirBg_Fog +Pal_GleipnirBg_Fog: @ 0x086B52CC .incbin "baserom.gba", 0x6B52CC, 0x20 @ 0x6B52EC - 0x6B52CC - .global Tsa_086B52EC -Tsa_086B52EC: @ 0x086B52EC + .global Tsa_GleipnirBg_Fog +Tsa_GleipnirBg_Fog: @ 0x086B52EC .incbin "baserom.gba", 0x6B52EC, 0x294 @ 0x6B5580 - 0x6B52EC .global gUnknown_086B5580 diff --git a/include/efxbattle.h b/include/efxbattle.h index 1160b7a74..540863f59 100644 --- a/include/efxbattle.h +++ b/include/efxbattle.h @@ -638,18 +638,18 @@ extern u32 gUnknown_0201FAD8; // extern ??? ProcScr_efxDrzDrakbreathOBJ // extern ??? ProcScr_efxDrzDrakbreathBG // extern ??? ProcScr_efxDrzDrakbreathBGCOL -// extern ??? gUnknown_085D8318 -// extern ??? gUnknown_085D8330 -// extern ??? gUnknown_085D8348 -// extern ??? gUnknown_085D8374 +// extern ??? ProcScr_efxDarkGrado +// extern ??? ProcScr_efxDarkGradoMapFadeOut +// extern ??? TsaArray_GleipnirBg_Sigil +// extern ??? ImgArray_GleipnirBg_Sigil // extern ??? ProcScr_efxDarkGradoBG01 -// extern ??? gUnknown_085D83B8 -// extern ??? gUnknown_085D83F8 -// extern ??? gUnknown_085D8438 -// extern ??? gUnknown_085D8478 -// extern ??? gUnknown_085D847C +// extern ??? TsaArray_GleipnirBg_Nebula +// extern ??? ImgArray_GleipnirBg_Nebula +// extern ??? PalArray_GleipnirBg_Nebula +// extern ??? TsaArray_GleipnirBg_Fog +// extern ??? ImgArray_GleipnirBg_Fog // extern ??? ProcScr_efxDarkGradoBG02 -// extern ??? gUnknown_085D84B4 +// extern ??? ProcScr_085D84B4 // extern ??? gUnknown_085D84D4 // extern ??? gUnknown_085D8524 // extern ??? gUnknown_085D8574 @@ -657,7 +657,7 @@ extern u32 gUnknown_0201FAD8; // extern ??? gUnknown_085D8614 // extern ??? gUnknown_085D8664 // extern ??? gUnknown_085D86B4 -// extern ??? gUnknown_085D8704 +// extern ??? ProcScr_efxDarkGradoOBJ01piece // extern ??? ProcScr_efxDarkGradoOBJ01 // extern ??? ProcScr_efxDarkGradoOBJ02piece // extern ??? ProcScr_efxDarkGradoOBJ02 @@ -1806,14 +1806,14 @@ extern u16 Tsa_086A0388[]; extern u16 Img_IvaldiBg4[]; extern u16 Pal_IvaldiBg4[]; extern u16 Tsa_086A1D00[]; -extern u16 gUnknown_086A21F4[]; -extern u16 gUnknown_086A2614[]; +extern u16 Img_GleipnirSprites_Rocks[]; +extern u16 Pal_GleipnirSprites_Rocks[]; extern u32 gUnknown_086A2724[]; extern u32 gUnknown_086A273C[]; extern u32 gUnknown_086A2844[]; extern u32 gUnknown_086A285C[]; -extern u16 gUnknown_086A2874[]; -extern u16 gUnknown_086A2CE8[]; +extern u16 Img_GleipnirSprites_Comet[]; +extern u16 Pal_GleipnirSprites_Comet[]; extern u32 gUnknown_086A2DBC[]; extern u32 gUnknown_086A2DD0[]; extern u32 gUnknown_086A2E98[]; @@ -1829,7 +1829,7 @@ extern u16 Img_086A576C[]; extern u16 Img_086A5B4C[]; extern u16 Img_086A5F2C[]; extern u16 Img_086A6304[]; -extern u16 gUnknown_086A66D8[]; +extern u16 Pal_GleipnirBg_Sigil[]; extern u16 Tsa_086A66F8[]; extern u16 Tsa_086A68A0[]; extern u16 Tsa_086A6A14[]; @@ -1889,9 +1889,9 @@ extern u16 Tsa_086B38FC[]; extern u16 Tsa_086B3AEC[]; extern u16 Tsa_086B3CE8[]; extern u16 Tsa_086B3F00[]; -extern u16 Img_086B411C[]; -extern u16 gUnknown_086B52CC[]; -extern u16 Tsa_086B52EC[]; +extern u16 Img_GleipnirBg_Fog[]; +extern u16 Pal_GleipnirBg_Fog[]; +extern u16 Tsa_GleipnirBg_Fog[]; // extern ??? gUnknown_086B5580 // extern ??? gUnknown_086B58DC // extern ??? gUnknown_086B5974 diff --git a/include/efxmagic.h b/include/efxmagic.h index a39a3971a..0f8724f56 100644 --- a/include/efxmagic.h +++ b/include/efxmagic.h @@ -814,10 +814,10 @@ void efxDrzDrakbreathBG_Loop(struct ProcEfxBG * proc); void StartSubSpell_efxDrzDrakbreathBGCOL(struct Anim * anim); void efxDrzDrakbreathBGCOL_Loop(struct ProcEfxBGCOL * proc); void sub_8068AFC(struct Anim * anim, u16 * tsaL, u16 * tsaR, u8 unk); -void sub_8068B80(struct Anim * anim); -void sub_8068BB8(struct ProcEfx * proc); -void sub_8068D20(struct ProcEfx * proc); -void sub_8068D78(void); +void StartSpellAnimGleipnir(struct Anim * anim); +void efxDarkGrado_Loop_Main(struct ProcEfx * proc); +void efxDarkGradoMapFadeOut_Loop(struct ProcEfx * proc); +void StartSubSpell_efxDarkGradoMapFadeOut(void); void sub_8068D9C(void); void sub_8068DD8(void); void sub_8068E14(void); @@ -833,26 +833,26 @@ void sub_8069030(void); void sub_806906C(void); void sub_80690A8(void); void sub_80690E4(void); -void sub_8069100(struct ProcEfxBG * proc); -void sub_80692B0(struct Anim * anim); -void sub_806935C(struct ProcEfxBG * proc); -void sub_80693CC(struct ProcEfxBG * proc); -void sub_8069400(struct ProcEfxBG * proc); -void sub_8069488(struct Anim * anim); +void efxDarkGradoBG01_Loop(struct ProcEfxBG * proc); +void StartSubSpell_efxDarkGradoBG01(struct Anim * anim); +void efxDarkGradoBG02_Loop_A(struct ProcEfxBG * proc); +void efxDarkGradoBG02_80693CC(struct ProcEfxBG * proc); +void efxDarkGradoBG02_Loop_B(struct ProcEfxBG * proc); +void StartSubSpell_efxDarkGradoBG02(struct Anim * anim); // ??? sub_8069528(???); // ??? sub_8069530(???); void sub_80696F0(void); int sub_8069704(int a, int b, int c); int sub_806977C(int a, int b, int c); -void sub_80697F4(struct ProcEfxOBJ * proc); +void efxDarkGradoOBJ01piece_Loop(struct ProcEfxOBJ * proc); void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e); -void sub_80699A8(struct ProcEfxOBJ * proc); -void sub_8069AC4(struct Anim * anim); -void sub_8069AFC(struct ProcEfxOBJ * proc); -void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator); -void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator); -void sub_8069CDC(struct ProcEfxOBJ * proc); -void sub_8069E88(struct Anim * anim); +void efxDarkGradoOBJ01_Loop(struct ProcEfxOBJ * proc); +void StartSubSpell_efxDarkGradoOBJ01(struct Anim * anim); +void efxDarkGradoOBJ02piece_Loop(struct ProcEfxOBJ * proc); +void StartSubSpell_efxDarkGradoOBJ02piece_A(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator); +void StartSubSpell_efxDarkGradoOBJ02piece_B(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator); +void efxDarkGradoOBJ02_Loop(struct ProcEfxOBJ * proc); +void StartSubSpell_efxDarkGradoOBJ02(struct Anim * anim); void StartSpellAnimCrimsonEye(struct Anim * anim); // ??? sub_8069F00(???); // ??? sub_806A008(???); diff --git a/include/ekrbattle.h b/include/ekrbattle.h index 958b91dac..79a850ef2 100644 --- a/include/ekrbattle.h +++ b/include/ekrbattle.h @@ -422,7 +422,7 @@ extern int gBanimLinkArenaFlag; extern int gBattleDeamonActive; extern struct ProcEkrBattleDeamon *gpProcEkrBattleDeamon; extern s16 gEkrDebugModeMaybe; -extern s16 gBanimGackgroundIndex; +extern s16 gBanimBackgroundIndex; extern s16 gEkrInitialHitSide; extern s16 gEkrSnowWeather; extern s16 gEkrPairSideVaild[2]; @@ -616,9 +616,9 @@ extern const u16 gUnknown_080DCDE4[]; // extern ??? gUnknown_080DEBF8 // extern ??? gUnknown_080DEC0C // extern ??? gUnknown_080DEC30 -// extern ??? gUnknown_080DEDBC -// extern ??? gUnknown_080DEDFA -// extern ??? gUnknown_080DEE40 +// extern ??? gFrameConfig_GleipnirBg_Sigil +// extern ??? gFrameConfig_GleipnirBg_Nebula +// extern ??? gFrameConfig_GleipnirBg_Fog // extern ??? gUnknown_080DEEC2 // extern ??? gUnknown_080DEF20 // extern ??? gUnknown_080DEF78 diff --git a/src/banim-efxmagic-gleipnir.c b/src/banim-efxmagic-gleipnir.c index a7b236071..3b23a5467 100644 --- a/src/banim-efxmagic-gleipnir.c +++ b/src/banim-efxmagic-gleipnir.c @@ -7,29 +7,30 @@ #include "hardware.h" #include "bmlib.h" #include "ekrdragon.h" +#include "ctc.h" extern int gUnknown_0201FB28; // clang-format off -struct ProcCmd CONST_DATA gUnknown_085D8318[] = +struct ProcCmd CONST_DATA ProcScr_efxDarkGrado[] = { PROC_NAME("efxDarkGrado"), - PROC_REPEAT(sub_8068BB8), + PROC_REPEAT(efxDarkGrado_Loop_Main), PROC_END, }; // clang-format on //! FE8U = 0x08068B80 -void sub_8068B80(struct Anim * anim) +void StartSpellAnimGleipnir(struct Anim * anim) { struct ProcEfx * proc; SpellFx_Begin(); SpellFx_ClearBG1Position(); - proc = Proc_Start(gUnknown_085D8318, PROC_TREE_3); + proc = Proc_Start(ProcScr_efxDarkGrado, PROC_TREE_3); proc->anim = anim; proc->timer = 0; proc->hitted = CheckRoundMiss(GetAnimRoundTypeAnotherSide(anim)); @@ -38,7 +39,7 @@ void sub_8068B80(struct Anim * anim) } //! FE8U = 0x08068BB8 -void sub_8068BB8(struct ProcEfx * proc) +void efxDarkGrado_Loop_Main(struct ProcEfx * proc) { struct Anim * anim = GetAnimAnotherSide(proc->anim); int duration = EfxGetCamMovDuration(); @@ -54,22 +55,22 @@ void sub_8068BB8(struct ProcEfx * proc) if ((GetBanimDragonStatusType() != EKRDRGON_TYPE_DRACO_ZOMBIE) && (GetBanimDragonStatusType() != EKRDRGON_TYPE_DEMON_KING)) { - sub_8068D78(); + StartSubSpell_efxDarkGradoMapFadeOut(); } } else if (proc->timer == duration + 34) { - sub_80692B0(anim); + StartSubSpell_efxDarkGradoBG01(anim); PlaySFX(0x3ac, 0x100, 120, 1); } else if (proc->timer == duration + 96) { - sub_8069488(anim); - sub_8069AC4(anim); + StartSubSpell_efxDarkGradoBG02(anim); + StartSubSpell_efxDarkGradoOBJ01(anim); } else if (proc->timer == duration + 206) { - sub_8069E88(anim); + StartSubSpell_efxDarkGradoOBJ02(anim); } else if (proc->timer == duration + 302) { @@ -83,7 +84,7 @@ void sub_8068BB8(struct ProcEfx * proc) NewEfxSpellCast(); - anim->state3 |= 9; + anim->state3 |= (ANIM_BIT3_TAKE_BACK_ENABLE | ANIM_BIT3_HIT_EFFECT_APPLIED); StartBattleAnimHitEffectsDefault(anim, proc->hitted); @@ -123,7 +124,7 @@ void sub_8068BB8(struct ProcEfx * proc) } //! FE8U = 0x08068D20 -void sub_8068D20(struct ProcEfx * proc) +void efxDarkGradoMapFadeOut_Loop(struct ProcEfx * proc) { int ret = Interpolate(INTERPOLATE_SQUARE, 4, 16, proc->timer, 16); @@ -144,23 +145,23 @@ void sub_8068D20(struct ProcEfx * proc) // clang-format off -struct ProcCmd CONST_DATA gUnknown_085D8330[] = +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoMapFadeOut[] = { PROC_NAME("efxDarkGradoMapFadeOut"), - PROC_REPEAT(sub_8068D20), + PROC_REPEAT(efxDarkGradoMapFadeOut_Loop), PROC_END, }; // clang-format on //! FE8U = 0x08068D78 -void sub_8068D78(void) +void StartSubSpell_efxDarkGradoMapFadeOut(void) { struct ProcEfx * proc; gEfxBgSemaphore++; - proc = Proc_Start(gUnknown_085D8330, PROC_TREE_3); + proc = Proc_Start(ProcScr_efxDarkGradoMapFadeOut, PROC_TREE_3); proc->timer = 0; return; @@ -169,13 +170,13 @@ void sub_8068D78(void) //! FE8U = 0x08068D9C void sub_8068D9C(void) { - if (gBanimGackgroundIndex == 0) + if (gBanimBackgroundIndex == 0) { EfxChapterMapFadeOUT(4); } else { - PutBanimBgPAL(gBanimGackgroundIndex - 1); + PutBanimBgPAL(gBanimBackgroundIndex - 1); EfxPalBlackInOut(gPaletteBuffer, 6, 10, 0); EnablePaletteSync(); } @@ -413,7 +414,7 @@ void sub_80690E4(void) } //! FE8U = 0x08069100 -void sub_8069100(struct ProcEfxBG * proc) +void efxDarkGradoBG01_Loop(struct ProcEfxBG * proc) { s16 ret = EfxAdvanceFrameLut((s16 *)&proc->timer, (s16 *)&proc->frame, proc->frame_config); @@ -553,7 +554,7 @@ void sub_8069100(struct ProcEfxBG * proc) // clang-format off -u16 * CONST_DATA gUnknown_085D8348[] = +u16 * CONST_DATA TsaArray_GleipnirBg_Sigil[] = { Tsa_086A66F8, Tsa_086A68A0, @@ -568,7 +569,7 @@ u16 * CONST_DATA gUnknown_085D8348[] = Tsa_086A71B8, }; -u16 * CONST_DATA gUnknown_085D8374[] = +u16 * CONST_DATA ImgArray_GleipnirBg_Sigil[] = { Img_086A2EC0, Img_086A34D0, @@ -583,7 +584,7 @@ u16 * CONST_DATA gUnknown_085D8374[] = Img_086A6304, }; -const u16 gUnknown_080DEDBC[] = +const u16 gFrameConfig_GleipnirBg_Sigil[] = { 0, 24, 1, 4, @@ -601,14 +602,14 @@ const u16 gUnknown_080DEDBC[] = struct ProcCmd CONST_DATA ProcScr_efxDarkGradoBG01[] = { PROC_NAME("efxDarkGradoBG01"), - PROC_REPEAT(sub_8069100), + PROC_REPEAT(efxDarkGradoBG01_Loop), PROC_END, }; // clang-format on //! FE8U = 0x080692B0 -void sub_80692B0(struct Anim * anim) +void StartSubSpell_efxDarkGradoBG01(struct Anim * anim) { struct ProcEfxBG * proc; @@ -620,13 +621,13 @@ void sub_80692B0(struct Anim * anim) proc->anim = anim; proc->timer = 0; proc->frame = 0; - proc->frame_config = gUnknown_080DEDBC; + proc->frame_config = gFrameConfig_GleipnirBg_Sigil; - proc->tsal = gUnknown_085D8348; - proc->tsar = gUnknown_085D8348; - proc->img = gUnknown_085D8374; + proc->tsal = TsaArray_GleipnirBg_Sigil; + proc->tsar = TsaArray_GleipnirBg_Sigil; + proc->img = ImgArray_GleipnirBg_Sigil; - SpellFx_RegisterBgPal(gUnknown_086A66D8, PLTT_SIZE_4BPP); + SpellFx_RegisterBgPal(Pal_GleipnirBg_Sigil, PLTT_SIZE_4BPP); if (gEkrDistanceType == 1) { @@ -650,7 +651,7 @@ void sub_80692B0(struct Anim * anim) } //! FE8U = 0x0806935C -void sub_806935C(struct ProcEfxBG * proc) +void efxDarkGradoBG02_Loop_A(struct ProcEfxBG * proc) { s16 ret = EfxAdvanceFrameLut((s16 *)&proc->timer, (s16 *)&proc->frame, proc->frame_config); @@ -682,7 +683,7 @@ void sub_806935C(struct ProcEfxBG * proc) // clang-format off -u16 * CONST_DATA gUnknown_085D83B8[] = +u16 * CONST_DATA TsaArray_GleipnirBg_Nebula[] = { Tsa_086B2A78, Tsa_086B2B30, @@ -702,7 +703,7 @@ u16 * CONST_DATA gUnknown_085D83B8[] = Tsa_086B3F00, }; -u16 * CONST_DATA gUnknown_085D83F8[] = +u16 * CONST_DATA ImgArray_GleipnirBg_Nebula[] = { Img_086A7258, Img_086A76C0, @@ -722,7 +723,7 @@ u16 * CONST_DATA gUnknown_085D83F8[] = Img_086B15C4, }; -u16 * CONST_DATA gUnknown_085D8438[] = +u16 * CONST_DATA PalArray_GleipnirBg_Nebula[] = { Pal_086B2878, Pal_086B2898, @@ -742,18 +743,22 @@ u16 * CONST_DATA gUnknown_085D8438[] = Pal_086B2A58, }; -u16 * CONST_DATA gUnknown_085D8478[] = +u16 * CONST_DATA TsaArray_GleipnirBg_Fog[] = { - Tsa_086B52EC, + Tsa_GleipnirBg_Fog, }; -u16 * CONST_DATA gUnknown_085D847C[] = +u16 * CONST_DATA ImgArray_GleipnirBg_Fog[] = { - Img_086B411C, - gUnknown_086B52CC, + Img_GleipnirBg_Fog, }; -const u16 gUnknown_080DEDFA[] = +u16 * CONST_DATA PalArray_GleipnirBg_Fog[] = +{ + Pal_GleipnirBg_Fog, +}; + +const u16 gFrameConfig_GleipnirBg_Nebula[] = { 0, 6, 1, 6, @@ -775,7 +780,7 @@ const u16 gUnknown_080DEDFA[] = -1, }; -const u16 gUnknown_080DEE40[] = +const u16 gFrameConfig_GleipnirBg_Fog[] = { 0, 96, -1, @@ -784,23 +789,23 @@ const u16 gUnknown_080DEE40[] = // clang-format on //! FE8U = 0x080693CC -void sub_80693CC(struct ProcEfxBG * proc) +void efxDarkGradoBG02_80693CC(struct ProcEfxBG * proc) { proc->timer = 0; proc->terminator = 0; proc->frame = 0; - proc->frame_config = gUnknown_080DEE40; + proc->frame_config = gFrameConfig_GleipnirBg_Fog; - proc->tsal = gUnknown_085D8478; - proc->img = gUnknown_085D847C; + proc->tsal = TsaArray_GleipnirBg_Fog; + proc->img = ImgArray_GleipnirBg_Fog; - SpellFx_RegisterBgPal(gUnknown_086B52CC, PLTT_SIZE_4BPP); + SpellFx_RegisterBgPal(Pal_GleipnirBg_Fog, PLTT_SIZE_4BPP); return; } //! FE8U = 0x08069400 -void sub_8069400(struct ProcEfxBG * proc) +void efxDarkGradoBG02_Loop_B(struct ProcEfxBG * proc) { s16 ret; @@ -844,11 +849,11 @@ struct ProcCmd CONST_DATA ProcScr_efxDarkGradoBG02[] = { PROC_NAME("efxDarkGradoBG02"), - PROC_REPEAT(sub_806935C), + PROC_REPEAT(efxDarkGradoBG02_Loop_A), PROC_SLEEP(14), - PROC_CALL(sub_80693CC), - PROC_REPEAT(sub_8069400), + PROC_CALL(efxDarkGradoBG02_80693CC), + PROC_REPEAT(efxDarkGradoBG02_Loop_B), PROC_END, }; @@ -856,7 +861,7 @@ struct ProcCmd CONST_DATA ProcScr_efxDarkGradoBG02[] = // clang-format on //! FE8U = 0x08069488 -void sub_8069488(struct Anim * anim) +void StartSubSpell_efxDarkGradoBG02(struct Anim * anim) { struct ProcEfxBG * proc; @@ -866,11 +871,11 @@ void sub_8069488(struct Anim * anim) proc->anim = anim; proc->timer = 0; proc->frame = 0; - proc->frame_config = gUnknown_080DEDFA; + proc->frame_config = gFrameConfig_GleipnirBg_Nebula; - proc->tsal = gUnknown_085D83B8; - proc->img = gUnknown_085D83F8; - proc->pal = gUnknown_085D8438; + proc->tsal = TsaArray_GleipnirBg_Nebula; + proc->img = ImgArray_GleipnirBg_Nebula; + proc->pal = PalArray_GleipnirBg_Nebula; if (gEkrDistanceType == 1) { @@ -917,6 +922,8 @@ void sub_8069528(struct Proc085D84B4 * proc) #if NONMATCHING +/* https://decomp.me/scratch/afZTp */ + #define RGB_(r, g, b) (((b) << 10) | ((g) << 5) | (r)) //! FE8U = 0x08069530 @@ -1241,7 +1248,7 @@ void sub_8069530(struct Proc085D84B4 * param_1) // clang-format off -struct ProcCmd CONST_DATA gUnknown_085D84B4[] = +struct ProcCmd CONST_DATA ProcScr_085D84B4[] = { PROC_CALL(sub_8069528), PROC_REPEAT(sub_8069530), @@ -1256,7 +1263,7 @@ struct ProcCmd CONST_DATA gUnknown_085D84B4[] = //! FE8U = 0x080696F0 void sub_80696F0(void) { - Proc_Start(gUnknown_085D84B4, PROC_TREE_VSYNC); + Proc_Start(ProcScr_085D84B4, PROC_TREE_VSYNC); return; } @@ -1264,170 +1271,170 @@ void sub_80696F0(void) s16 CONST_DATA gUnknown_085D84D4[] = { - 0xFFBF, 0xFFA3, - 0xFFCE, 0xFFA4, - 0xFFDA, 0xFFA6, - 0xFFE7, 0xFFAA, - 0xFFF1, 0xFFAD, - 0xFFFB, 0xFFB3, - 0x0002, 0xFFB8, - 0x0009, 0xFFBE, - 0x000E, 0xFFC4, - 0x0013, 0xFFCB, - 0x0018, 0xFFD3, - 0x001C, 0xFFDB, - 0x001D, 0xFFE4, - 0x001E, 0xFFED, - 0x001E, 0xFFF6, - 0x001D, 0xFFFD, - 0x001B, 0x0003, - 0x0017, 0x0008, - 0x0013, 0x000B, - 0x000F, 0x000E, + -65, -93, + -50, -92, + -38, -90, + -25, -86, + -15, -83, + -5, -77, + 2, -72, + 9, -66, + 14, -60, + 19, -53, + 24, -45, + 28, -37, + 29, -28, + 30, -19, + 30, -10, + 29, -3, + 27, 3, + 23, 8, + 19, 11, + 15, 14, }; s16 CONST_DATA gUnknown_085D8524[] = { - 0x001C, 0x0035, - 0x000D, 0x0033, - 0x0001, 0x0030, - 0xFFF3, 0x002C, - 0xFFE8, 0x0024, - 0xFFDF, 0x0019, - 0xFFD9, 0x0010, - 0xFFD5, 0x0005, - 0xFFD4, 0xFFFC, - 0xFFD5, 0xFFF3, - 0xFFD9, 0xFFEC, - 0xFFE1, 0xFFE7, - 0xFFE9, 0xFFE7, - 0xFFF2, 0xFFE8, - 0xFFF9, 0xFFE9, - 0xFFFF, 0xFFEC, - 0x0006, 0xFFF1, - 0x000A, 0xFFF6, - 0x000C, 0xFFFC, - 0x000D, 0x0001, + 28, 53, + 13, 51, + 1, 48, + -13, 44, + -24, 36, + -33, 25, + -39, 16, + -43, 5, + -44, -4, + -43, -13, + -39, -20, + -31, -25, + -23, -25, + -14, -24, + -7, -23, + -1, -20, + 6, -15, + 10, -10, + 12, -4, + 13, 1, }; s16 CONST_DATA gUnknown_085D8574[] = { - 0x0096, 0x0012, - 0x0085, 0x001D, - 0x0076, 0x0023, - 0x0066, 0x0027, - 0x0059, 0x0029, - 0x004E, 0x002A, - 0x0044, 0x002A, - 0x003B, 0x002A, - 0x0030, 0x0028, - 0x0025, 0x0025, - 0x001A, 0x0021, - 0x0012, 0x001D, - 0x000B, 0x0018, - 0x0005, 0x0013, - 0x0000, 0x000F, - 0xFFFB, 0x000B, - 0xFFF7, 0x0005, - 0xFFF4, 0xFFFF, - 0xFFF2, 0xFFF7, - 0xFFF1, 0xFFF0, + 150, 18, + 133, 29, + 118, 35, + 102, 39, + 89, 41, + 78, 42, + 68, 42, + 59, 42, + 48, 40, + 37, 37, + 26, 33, + 18, 29, + 11, 24, + 5, 19, + 0, 15, + -5, 11, + -9, 5, + -12, -1, + -14, -9, + -15, -16, }; s16 CONST_DATA gUnknown_085D85C4[] = { - 0xFFA5, 0xFFFB, - 0xFFAA, 0xFFEF, - 0xFFB0, 0xFFE4, - 0xFFB5, 0xFFDA, - 0xFFBC, 0xFFD1, - 0xFFC5, 0xFFC9, - 0xFFD0, 0xFFC6, - 0xFFDB, 0xFFC5, - 0xFFE6, 0xFFC6, - 0xFFEF, 0xFFC8, - 0xFFF8, 0xFFCC, - 0xFFFF, 0xFFD0, - 0x0006, 0xFFD5, - 0x000B, 0xFFDB, - 0x000E, 0xFFE3, - 0x0010, 0xFFE9, - 0x0011, 0xFFF0, - 0x0011, 0xFFF6, - 0x0010, 0xFFFD, - 0x000E, 0x0003, + -91, -5, + -86, -17, + -80, -28, + -75, -38, + -68, -47, + -59, -55, + -48, -58, + -37, -59, + -26, -58, + -17, -56, + -8, -52, + -1, -48, + 6, -43, + 11, -37, + 14, -29, + 16, -23, + 17, -16, + 17, -10, + 16, -3, + 14, 3, }; s16 CONST_DATA gUnknown_085D8614[] = { - 0x0019, 0x0037, - 0x000F, 0x0035, - 0x0005, 0x0032, - 0xFFFB, 0x002E, - 0xFFF1, 0x0028, - 0xFFE9, 0x0023, - 0xFFE2, 0x001C, - 0xFFDC, 0x0013, - 0xFFD8, 0x000A, - 0xFFD5, 0x0001, - 0xFFD4, 0xFFF8, - 0xFFD4, 0xFFF0, - 0xFFD6, 0xFFE8, - 0xFFDD, 0xFFE3, - 0xFFE4, 0xFFE2, - 0xFFEB, 0xFFE2, - 0xFFF1, 0xFFE3, - 0xFFF7, 0xFFE6, - 0xFFFC, 0xFFE9, - 0x0001, 0xFFEE, + 25, 55, + 15, 53, + 5, 50, + -5, 46, + -15, 40, + -23, 35, + -30, 28, + -36, 19, + -40, 10, + -43, 1, + -44, -8, + -44, -16, + -42, -24, + -35, -29, + -28, -30, + -21, -30, + -15, -29, + -9, -26, + -4, -23, + 1, -18, }; s16 CONST_DATA gUnknown_085D8664[] = { - 0x0091, 0xFFB7, - 0x0092, 0xFFD2, - 0x008F, 0xFFEA, - 0x0082, 0x0002, - 0x0070, 0x0011, - 0x0061, 0x0018, - 0x0052, 0x001D, - 0x0044, 0x0020, - 0x0036, 0x0023, - 0x002B, 0x0022, - 0x0020, 0x0020, - 0x0016, 0x001E, - 0x000C, 0x001C, - 0x0004, 0x0019, - 0xFFFD, 0x0015, - 0xFFF7, 0x0010, - 0xFFF2, 0x000A, - 0xFFEF, 0x0002, - 0xFFEE, 0xFFFB, - 0xFFEE, 0xFFF5, + 145, -73, + 146, -46, + 143, -22, + 130, 2, + 112, 17, + 97, 24, + 82, 29, + 68, 32, + 54, 35, + 43, 34, + 32, 32, + 22, 30, + 12, 28, + 4, 25, + -3, 21, + -9, 16, + -14, 10, + -17, 2, + -18, -5, + -18, -11, }; s16 CONST_DATA gUnknown_085D86B4[] = { - 0x000E, 0xFFAE, - 0x001C, 0xFFB2, - 0x0026, 0xFFB9, - 0x002E, 0xFFC2, - 0x0034, 0xFFCC, - 0x0037, 0xFFD6, - 0x0039, 0xFFE0, - 0x0039, 0xFFE9, - 0x0038, 0xFFF3, - 0x0035, 0xFFFB, - 0x0032, 0x0002, - 0x002D, 0x0007, - 0x0027, 0x000C, - 0x0022, 0x000F, - 0x001C, 0x0012, - 0x0016, 0x0013, - 0x0011, 0x0013, - 0x000C, 0x0012, - 0x0006, 0x0011, - 0x0000, 0x000E, + 14, -82, + 28, -78, + 38, -71, + 46, -62, + 52, -52, + 55, -42, + 57, -32, + 57, -23, + 56, -13, + 53, -5, + 50, 2, + 45, 7, + 39, 12, + 34, 15, + 28, 18, + 22, 19, + 17, 19, + 12, 18, + 6, 17, + 0, 14, }; // clang-format on @@ -1511,7 +1518,7 @@ int sub_806977C(int a, int b, int c) } //! FE8U = 0x080697F4 -void sub_80697F4(struct ProcEfxOBJ * proc) +void efxDarkGradoOBJ01piece_Loop(struct ProcEfxOBJ * proc) { if (GetAnimPosition(proc->anim) == 0) { @@ -1538,10 +1545,10 @@ void sub_80697F4(struct ProcEfxOBJ * proc) // clang-format off -struct ProcCmd CONST_DATA gUnknown_085D8704[] = +struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ01piece[] = { PROC_NAME("efxDarkGradoOBJ01piece"), - PROC_REPEAT(sub_80697F4), + PROC_REPEAT(efxDarkGradoOBJ01piece_Loop), PROC_END, }; @@ -1556,7 +1563,7 @@ void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e) gEfxBgSemaphore++; - proc = Proc_Start(gUnknown_085D8704, PROC_TREE_3); + proc = Proc_Start(ProcScr_efxDarkGradoOBJ01piece, PROC_TREE_3); proc->anim = anim; proc->timer = 0; proc->terminator = 20; @@ -1625,7 +1632,7 @@ void sub_8069878(struct Anim * anim, s16 b, s16 c, s16 d, u16 e) } //! FE8U = 0x080699A8 -void sub_80699A8(struct ProcEfxOBJ * proc) +void efxDarkGradoOBJ01_Loop(struct ProcEfxOBJ * proc) { proc->timer++; @@ -1661,14 +1668,14 @@ void sub_80699A8(struct ProcEfxOBJ * proc) struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ01[] = { PROC_NAME("efxDarkGradoOBJ01"), - PROC_REPEAT(sub_80699A8), + PROC_REPEAT(efxDarkGradoOBJ01_Loop), PROC_END, }; // clang-format on //! FE8U = 0x08069AC4 -void sub_8069AC4(struct Anim * anim) +void StartSubSpell_efxDarkGradoOBJ01(struct Anim * anim) { struct ProcEfxOBJ * proc; @@ -1677,14 +1684,14 @@ void sub_8069AC4(struct Anim * anim) proc->timer = 0; proc->terminator = 0; - SpellFx_RegisterObjPal(gUnknown_086A2614, PLTT_SIZE_4BPP); - SpellFx_RegisterObjGfx(gUnknown_086A21F4, 32 * 4 * CHR_SIZE); + SpellFx_RegisterObjPal(Pal_GleipnirSprites_Rocks, PLTT_SIZE_4BPP); + SpellFx_RegisterObjGfx(Img_GleipnirSprites_Rocks, 32 * 4 * CHR_SIZE); return; } //! FE8U = 0x08069AFC -void sub_8069AFC(struct ProcEfxOBJ * proc) +void efxDarkGradoOBJ02piece_Loop(struct ProcEfxOBJ * proc) { proc->unk48 += proc->unk44; @@ -1716,14 +1723,14 @@ void sub_8069AFC(struct ProcEfxOBJ * proc) struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ02piece[] = { PROC_NAME("efxDarkGradoOBJ02piece"), - PROC_REPEAT(sub_8069AFC), + PROC_REPEAT(efxDarkGradoOBJ02piece_Loop), PROC_END, }; // clang-format on //! FE8U = 0x08069B68 -void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) +void StartSubSpell_efxDarkGradoOBJ02piece_A(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) { struct ProcEfxOBJ * proc; struct Anim * frontAnim; @@ -1772,7 +1779,7 @@ void sub_8069B68(struct Anim * anim, int xOffset, int yPosition, int unk, int te } //! FE8U = 0x08069C18 -void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) +void StartSubSpell_efxDarkGradoOBJ02piece_B(struct Anim * anim, int xOffset, int yPosition, int unk, int terminator) { struct ProcEfxOBJ * proc; struct Anim * frontAnim; @@ -1818,14 +1825,14 @@ void sub_8069C18(struct Anim * anim, int xOffset, int yPosition, int unk, int te proc->unk3A = frontAnim->yPosition; frontAnim->drawLayerPriority = 20; - frontAnim->oam2Base |= 0xc00; + frontAnim->oam2Base |= OAM2_LAYER(3); AnimSort(); return; } //! FE8U = 0x08069CDC -void sub_8069CDC(struct ProcEfxOBJ * proc) +void efxDarkGradoOBJ02_Loop(struct ProcEfxOBJ * proc) { proc->timer++; @@ -1836,27 +1843,27 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) switch (proc->unk44) { case 0: - sub_8069B68(proc->anim, -64, -16, 0xa80, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_A(proc->anim, -64, -16, 0xa80, 98 - proc->timer); break; case 1: - sub_8069B68(proc->anim, -128, -16, 0x780, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_A(proc->anim, -128, -16, 0x780, 98 - proc->timer); break; case 2: - sub_8069B68(proc->anim, 0, -16, 0x900, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_A(proc->anim, 0, -16, 0x900, 98 - proc->timer); break; case 3: - sub_8069B68(proc->anim, -64, -16, 0x900, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_A(proc->anim, -64, -16, 0x900, 98 - proc->timer); break; case 4: - sub_8069B68(proc->anim, -128, -16, 0xa80, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_A(proc->anim, -128, -16, 0xa80, 98 - proc->timer); break; case 5: - sub_8069B68(proc->anim, 0, -16, 0x780, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_A(proc->anim, 0, -16, 0x780, 98 - proc->timer); break; } @@ -1873,27 +1880,27 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) switch (proc->unk48) { case 0: - sub_8069C18(proc->anim, -24, 0, 0x540, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_B(proc->anim, -24, 0, 0x540, 98 - proc->timer); break; case 1: - sub_8069C18(proc->anim, -56, 0, 0x3c0, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_B(proc->anim, -56, 0, 0x3c0, 98 - proc->timer); break; case 2: - sub_8069C18(proc->anim, -88, 0, 0x480, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_B(proc->anim, -88, 0, 0x480, 98 - proc->timer); break; case 3: - sub_8069C18(proc->anim, -24, 0, 0x480, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_B(proc->anim, -24, 0, 0x480, 98 - proc->timer); break; case 4: - sub_8069C18(proc->anim, -56, 0, 0x540, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_B(proc->anim, -56, 0, 0x540, 98 - proc->timer); break; case 5: - sub_8069C18(proc->anim, -88, 0, 0x3c0, 98 - proc->timer); + StartSubSpell_efxDarkGradoOBJ02piece_B(proc->anim, -88, 0, 0x3c0, 98 - proc->timer); break; } @@ -1919,14 +1926,14 @@ void sub_8069CDC(struct ProcEfxOBJ * proc) struct ProcCmd CONST_DATA ProcScr_efxDarkGradoOBJ02[] = { PROC_NAME("efxDarkGradoOBJ02"), - PROC_REPEAT(sub_8069CDC), + PROC_REPEAT(efxDarkGradoOBJ02_Loop), PROC_END, }; // clang-format on //! FE8U = 0x08069E88 -void sub_8069E88(struct Anim * anim) +void StartSubSpell_efxDarkGradoOBJ02(struct Anim * anim) { struct ProcEfxOBJ * proc; @@ -1937,8 +1944,8 @@ void sub_8069E88(struct Anim * anim) proc->unk44 = 0; proc->unk48 = 0; - SpellFx_RegisterObjPal(gUnknown_086A2CE8, PLTT_SIZE_4BPP); - SpellFx_RegisterObjGfx(gUnknown_086A2874, 32 * 4 * CHR_SIZE); + SpellFx_RegisterObjPal(Pal_GleipnirSprites_Comet, PLTT_SIZE_4BPP); + SpellFx_RegisterObjGfx(Img_GleipnirSprites_Comet, 32 * 4 * CHR_SIZE); return; } diff --git a/src/banim-efxmagic.c b/src/banim-efxmagic.c index 9d583f468..fe9d2d067 100644 --- a/src/banim-efxmagic.c +++ b/src/banim-efxmagic.c @@ -71,7 +71,7 @@ CONST_DATA SpellAnimFunc gEkrSpellAnimLut[] = { StartSpellAnimStone, StartSpellAnimIvaldi, StartSpellAnimDemonLight, - sub_8068B80, + StartSpellAnimGleipnir, StartSpellAnimCrimsonEye, StartSpellAnimEvilEye, sub_806AEF4, diff --git a/src/banim-ekrbattleending.c b/src/banim-ekrbattleending.c index 2ac347cd6..f01c0c685 100644 --- a/src/banim-ekrbattleending.c +++ b/src/banim-ekrbattleending.c @@ -35,7 +35,7 @@ void ekrBattleEnding_80560F0(struct ProcEkrBattleEnding * proc) { int ret; - if (gBanimGackgroundIndex == 0) { + if (gBanimBackgroundIndex == 0) { Proc_Break(proc); return; } @@ -51,7 +51,7 @@ void ekrBattleEnding_80560F0(struct ProcEkrBattleEnding * proc) } ret = Interpolate(INTERPOLATE_LINEAR, 0, 0x10, proc->timer, 0x8); - PutBanimBgPAL(gBanimGackgroundIndex - 1); + PutBanimBgPAL(gBanimBackgroundIndex - 1); EfxPalBlackInOut(gPaletteBuffer, 0x6, 0xA, ret); EnablePaletteSync(); @@ -63,7 +63,7 @@ void ekrBattleEnding_80560F0(struct ProcEkrBattleEnding * proc) void ekrBattleEnding_8056170(struct ProcEkrBattleEnding * proc) { - if (gBanimGackgroundIndex == 0) { + if (gBanimBackgroundIndex == 0) { Proc_Break(proc); return; } @@ -87,7 +87,7 @@ void ekrBattleEnding_8056170(struct ProcEkrBattleEnding * proc) void ekrBattleEnding_80561C8(struct ProcEkrBattleEnding * proc) { - if (gBanimGackgroundIndex == 0) { + if (gBanimBackgroundIndex == 0) { Proc_Break(proc); return; } diff --git a/src/banim-ekrbattlestarting.c b/src/banim-ekrbattlestarting.c index 3116c162c..1a9987380 100644 --- a/src/banim-ekrbattlestarting.c +++ b/src/banim-ekrbattlestarting.c @@ -207,7 +207,7 @@ void ekrBaStart_InitBattleScreen(struct ProcEkrBattleStarting *proc) void ekrBaStart_ExecEkrBattle6C(struct ProcEkrBattleStarting *proc) { if (++proc->timer > 0xB) { - if (gBanimGackgroundIndex == 0 || GetBanimDragonStatusType() != EKRDRGON_TYPE_NORMAL) { + if (gBanimBackgroundIndex == 0 || GetBanimDragonStatusType() != EKRDRGON_TYPE_NORMAL) { /* In normal battle, here will directly end the proc */ NewEkrBattle(); @@ -237,7 +237,7 @@ void ekrBaStart_8056024(struct ProcEkrBattleStarting *proc) else gUnknown_0201FAD8 = 0xA; - PutBanimBG(gBanimGackgroundIndex - 1); + PutBanimBG(gBanimBackgroundIndex - 1); EfxPalBlackInOut(gPaletteBuffer, 0x6, 0xA, 0x10); Proc_Break(proc); } @@ -246,7 +246,7 @@ void ekrBaStart_8056078(struct ProcEkrBattleStarting *proc) { int val = Interpolate(0, 0x10, 0, proc->timer, 8); - PutBanimBgPAL(gBanimGackgroundIndex - 1); + PutBanimBgPAL(gBanimBackgroundIndex - 1); EfxPalBlackInOut(gPaletteBuffer, 0x6, 0xA, val); EnablePaletteSync(); diff --git a/src/banim-ekrhensei.c b/src/banim-ekrhensei.c index 63e91dff4..ec4e0697f 100644 --- a/src/banim-ekrhensei.c +++ b/src/banim-ekrhensei.c @@ -64,7 +64,7 @@ void sub_8076380(struct ProcEkrHensei *proc) NewEkrDispUP(); NewEkrBattle(); - PutBanimBG(gBanimGackgroundIndex - 1); + PutBanimBG(gBanimBackgroundIndex - 1); CpuFastCopy(PAL_BG(0), gEfxPal, 0x400); EfxPalBlackInOut(PAL_BG(0), 0, 0x20, 0x10); EnablePaletteSync(); diff --git a/sym_ewram.txt b/sym_ewram.txt index 36274d2b9..007ec3be6 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -301,7 +301,7 @@ . = 0x03E0F4; gBattleDeamonActive = .; . = 0x03E0F8; gpProcEkrBattleDeamon = .; . = 0x03E0FC; gEkrDebugModeMaybe = .; -. = 0x03E0FE; gBanimGackgroundIndex = .; +. = 0x03E0FE; gBanimBackgroundIndex = .; . = 0x03E100; gEkrInitialHitSide = .; . = 0x03E102; gEkrSnowWeather = .; . = 0x03E104; gEkrPairSideVaild = .;