diff --git a/asm/mapanim_807CDD0.s b/asm/mapanim_807CDD0.s deleted file mode 100644 index 3d0caeba0..000000000 --- a/asm/mapanim_807CDD0.s +++ /dev/null @@ -1,2472 +0,0 @@ - .INCLUDE "macro.inc" - - .SYNTAX UNIFIED - - THUMB_FUNC_START AntitoxinPureWaterfx_Loop -AntitoxinPureWaterfx_Loop: @ 0x0807D760 - push {r4, r5, r6, r7, lr} - sub sp, #0x10 - adds r6, r0, #0 - ldr r7, _0807D7C8 @ gBG2TilemapBuffer - ldr r0, [r6, #0x30] - cmp r0, #0 - bge _0807D770 - adds r0, #7 -_0807D770: - asrs r0, r0, #3 - subs r1, r0, #3 - ldr r2, [r6, #0x34] - cmp r2, #0 - bge _0807D77C - adds r2, #7 -_0807D77C: - asrs r2, r2, #3 - subs r2, #3 - ldr r3, _0807D7CC @ 0x00004160 - movs r0, #6 - str r0, [sp] - str r0, [sp, #4] - ldr r0, _0807D7D0 @ gUnknown_089AF310 - str r0, [sp, #8] - ldr r5, _0807D7D4 @ gUnknown_089A3B6C - adds r4, r6, #0 - adds r4, #0x40 - ldrh r0, [r4] - lsrs r0, r0, #1 - adds r0, r0, r5 - ldrb r0, [r0] - str r0, [sp, #0xc] - adds r0, r7, #0 - bl sub_80146A0 - movs r0, #4 - bl BG_EnableSyncByMask - ldrh r0, [r4] - adds r0, #1 - strh r0, [r4] - ldrh r0, [r4] - lsrs r0, r0, #1 - adds r0, r0, r5 - ldrb r0, [r0] - cmp r0, #0xff - bne _0807D7C0 - adds r0, r6, #0 - bl Proc_Break -_0807D7C0: - add sp, #0x10 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807D7C8: .4byte gBG2TilemapBuffer -_0807D7CC: .4byte 0x00004160 -_0807D7D0: .4byte gUnknown_089AF310 -_0807D7D4: .4byte gUnknown_089A3B6C - - THUMB_FUNC_END AntitoxinPureWaterfx_Loop - - THUMB_FUNC_START sub_807D7D8 -sub_807D7D8: @ 0x0807D7D8 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807D810 @ gUnknown_089A3B84 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807D814 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #4 - adds r2, #8 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #4 - adds r2, #8 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807D810: .4byte gUnknown_089A3B84 -_0807D814: .4byte gBmSt - - THUMB_FUNC_END sub_807D7D8 - - THUMB_FUNC_START sub_807D818 -sub_807D818: @ 0x0807D818 - push {lr} - ldr r2, _0807D828 @ 0x0000010F - ldr r1, [r0, #0x30] - adds r0, r2, #0 - bl PlaySeSpacial - pop {r0} - bx r0 - .align 2, 0 -_0807D828: .4byte 0x0000010F - - THUMB_FUNC_END sub_807D818 - - THUMB_FUNC_START NewMapAnimEffectAnimator -NewMapAnimEffectAnimator: @ 0x0807D82C - push {r4, r5, r6, lr} - mov r6, r8 - push {r6} - adds r5, r0, #0 - adds r6, r1, #0 - mov r8, r2 - lsls r4, r3, #0x10 - lsrs r4, r4, #0x10 - ldr r0, _0807D85C @ gUnknown_089A3BA4 - movs r1, #3 - bl Proc_Start - str r5, [r0, #0x2c] - str r6, [r0, #0x50] - mov r1, r8 - str r1, [r0, #0x54] - adds r0, #0x58 - strh r4, [r0] - pop {r3} - mov r8, r3 - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0807D85C: .4byte gUnknown_089A3BA4 - - THUMB_FUNC_END NewMapAnimEffectAnimator - - THUMB_FUNC_START sub_807D860 -sub_807D860: @ 0x0807D860 - push {r4, r5, r6, lr} - sub sp, #8 - adds r6, r0, #0 - ldr r2, _0807D930 @ gLCDControlBuffer - ldrb r3, [r2, #0xc] - movs r1, #4 - negs r1, r1 - adds r0, r1, #0 - ands r0, r3 - strb r0, [r2, #0xc] - ldrb r3, [r2, #0x10] - adds r0, r1, #0 - ands r0, r3 - movs r4, #1 - orrs r0, r4 - strb r0, [r2, #0x10] - ldrb r3, [r2, #0x14] - adds r0, r1, #0 - ands r0, r3 - orrs r0, r4 - strb r0, [r2, #0x14] - ldrb r0, [r2, #0x18] - ands r1, r0 - movs r0, #2 - orrs r1, r0 - strb r1, [r2, #0x18] - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - ldr r4, [r6, #0x50] - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807D934 @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r0, _0807D938 @ gBG2TilemapBuffer - ldr r3, [r6, #0x2c] - movs r1, #0x10 - ldrsb r1, [r3, r1] - ldr r5, _0807D93C @ gBmSt - ldrh r2, [r5, #0xc] - lsls r2, r2, #0x10 - asrs r2, r2, #0x14 - subs r1, r1, r2 - lsls r1, r1, #1 - subs r1, #2 - movs r2, #0x11 - ldrsb r2, [r3, r2] - ldrh r3, [r5, #0xe] - lsls r3, r3, #0x10 - asrs r3, r3, #0x14 - subs r2, r2, r3 - lsls r2, r2, #1 - subs r2, #2 - ldr r3, _0807D940 @ 0x00004160 - movs r4, #6 - str r4, [sp] - str r4, [sp, #4] - bl sub_8014560 - movs r0, #4 - bl BG_EnableSyncByMask - ldr r0, [r6, #0x54] - str r6, [sp] - movs r1, #0x80 - movs r2, #0x20 - movs r3, #4 - bl StartPaletteAnimatorNormal - adds r1, r6, #0 - adds r1, #0x40 - movs r0, #0 - strh r0, [r1] - adds r1, #2 - movs r0, #0x10 - strh r0, [r1] - adds r0, r6, #0 - adds r0, #0x58 - ldrh r0, [r0] - ldr r1, [r6, #0x2c] - ldrb r1, [r1, #0x10] - lsls r1, r1, #0x18 - asrs r1, r1, #0x18 - ldrh r2, [r5, #0xc] - lsls r2, r2, #0x10 - asrs r2, r2, #0x14 - subs r1, r1, r2 - lsls r1, r1, #1 - adds r1, #1 - lsls r1, r1, #3 - bl PlaySeSpacial - add sp, #8 - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0807D930: .4byte gLCDControlBuffer -_0807D934: .4byte 0x06002C00 -_0807D938: .4byte gBG2TilemapBuffer -_0807D93C: .4byte gBmSt -_0807D940: .4byte 0x00004160 - - THUMB_FUNC_END sub_807D860 - - THUMB_FUNC_START sub_807D944 -sub_807D944: @ 0x0807D944 - push {r4, r5, lr} - sub sp, #4 - adds r4, r0, #0 - adds r5, r4, #0 - adds r5, #0x40 - ldrh r0, [r5] - adds r0, #1 - strh r0, [r5] - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x10 - bne _0807D962 - adds r0, r4, #0 - bl Proc_Break -_0807D962: - ldrh r1, [r5] - movs r0, #0x16 - subs r0, r0, r1 - adds r2, r4, #0 - adds r2, #0x42 - strh r0, [r2] - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x10 - bls _0807D97A - movs r0, #0x10 - strh r0, [r2] -_0807D97A: - ldrb r1, [r5] - ldrb r2, [r2] - movs r0, #1 - movs r3, #0 - bl SetBlendConfig - movs r0, #0 - str r0, [sp] - movs r1, #0 - movs r2, #1 - movs r3, #0 - bl SetBlendTargetA - movs r0, #0 - bl SetBlendBackdropA - movs r0, #1 - str r0, [sp] - movs r0, #0 - movs r1, #0 - movs r2, #0 - movs r3, #1 - bl SetBlendTargetB - movs r0, #1 - bl SetBlendBackdropB - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807D944 - - THUMB_FUNC_START sub_807D9B8 -sub_807D9B8: @ 0x0807D9B8 - push {r4, r5, lr} - sub sp, #4 - adds r4, r0, #0 - adds r5, r4, #0 - adds r5, #0x40 - ldrh r0, [r5] - subs r0, #1 - strh r0, [r5] - lsls r0, r0, #0x10 - cmp r0, #0 - bne _0807D9D4 - adds r0, r4, #0 - bl Proc_Break -_0807D9D4: - ldrh r1, [r5] - movs r0, #0x16 - subs r0, r0, r1 - adds r2, r4, #0 - adds r2, #0x42 - strh r0, [r2] - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0x10 - bls _0807D9EC - movs r0, #0x10 - strh r0, [r2] -_0807D9EC: - ldrb r1, [r5] - ldrb r2, [r2] - movs r0, #1 - movs r3, #0 - bl SetBlendConfig - movs r0, #0 - str r0, [sp] - movs r1, #0 - movs r2, #1 - movs r3, #0 - bl SetBlendTargetA - movs r0, #0 - bl SetBlendBackdropA - movs r0, #1 - str r0, [sp] - movs r0, #0 - movs r1, #0 - movs r2, #0 - movs r3, #1 - bl SetBlendTargetB - movs r0, #1 - bl SetBlendBackdropB - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807D9B8 - - THUMB_FUNC_START MapSpellAnim_CommonEnd -MapSpellAnim_CommonEnd: @ 0x0807DA2C - push {lr} - bl DeleteAllPaletteAnimator - ldr r0, _0807DA60 @ gBG2TilemapBuffer - movs r1, #0 - bl BG_Fill - movs r0, #4 - bl BG_EnableSyncByMask - bl SetDefaultColorEffects - ldr r2, _0807DA64 @ gLCDControlBuffer - ldrb r1, [r2, #1] - movs r0, #0x21 - negs r0, r0 - ands r0, r1 - movs r1, #0x41 - negs r1, r1 - ands r0, r1 - movs r1, #0x7f - ands r0, r1 - strb r0, [r2, #1] - pop {r0} - bx r0 - .align 2, 0 -_0807DA60: .4byte gBG2TilemapBuffer -_0807DA64: .4byte gLCDControlBuffer - - THUMB_FUNC_END MapSpellAnim_CommonEnd - - THUMB_FUNC_START sub_807DA68 -sub_807DA68: @ 0x0807DA68 - push {lr} - movs r0, #0 - bl SetPrimaryHBlankHandler - bl DeleteAllPaletteAnimator - ldr r0, _0807DAA0 @ gBG2TilemapBuffer - movs r1, #0 - bl BG_Fill - movs r0, #4 - bl BG_EnableSyncByMask - bl SetDefaultColorEffects - ldr r2, _0807DAA4 @ gLCDControlBuffer - ldrb r1, [r2, #1] - movs r0, #0x21 - negs r0, r0 - ands r0, r1 - movs r1, #0x41 - negs r1, r1 - ands r0, r1 - movs r1, #0x7f - ands r0, r1 - strb r0, [r2, #1] - pop {r0} - bx r0 - .align 2, 0 -_0807DAA0: .4byte gBG2TilemapBuffer -_0807DAA4: .4byte gLCDControlBuffer - - THUMB_FUNC_END sub_807DA68 - - THUMB_FUNC_START New6C_SomethingFlashy -New6C_SomethingFlashy: @ 0x0807DAA8 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807DAE0 @ gUnknown_089A3BDC - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x2c] - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807DAE4 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807DAE0: .4byte gUnknown_089A3BDC -_0807DAE4: .4byte gBmSt - - THUMB_FUNC_END New6C_SomethingFlashy - - THUMB_FUNC_START sub_807DAE8 -sub_807DAE8: @ 0x0807DAE8 - push {r4, r5, lr} - adds r5, r0, #0 - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - ldr r4, _0807DB24 @ gUnknown_089AE224 - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807DB28 @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r0, _0807DB2C @ gUnknown_089AE484 - movs r1, #0x80 - movs r2, #0x20 - bl CopyToPaletteBuffer - bl LoadSparkGfx - adds r5, #0x40 - movs r0, #0 - strh r0, [r5] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807DB24: .4byte gUnknown_089AE224 -_0807DB28: .4byte 0x06002C00 -_0807DB2C: .4byte gUnknown_089AE484 - - THUMB_FUNC_END sub_807DAE8 - - THUMB_FUNC_START sub_807DB30 -sub_807DB30: @ 0x0807DB30 - push {r4, r5, r6, r7, lr} - sub sp, #0x10 - adds r7, r0, #0 - ldr r0, _0807DB98 @ gBG2TilemapBuffer - ldr r1, [r7, #0x30] - subs r1, #1 - ldr r2, [r7, #0x34] - subs r2, #3 - ldr r3, _0807DB9C @ 0x00004160 - movs r4, #4 - str r4, [sp] - movs r4, #6 - str r4, [sp, #4] - ldr r4, _0807DBA0 @ gUnknown_089AE4A4 - str r4, [sp, #8] - ldr r6, _0807DBA4 @ gUnknown_089A3C0C - adds r5, r7, #0 - adds r5, #0x40 - ldrh r4, [r5] - lsrs r4, r4, #1 - adds r4, r4, r6 - ldrb r4, [r4] - str r4, [sp, #0xc] - bl sub_80146A0 - movs r0, #4 - bl BG_EnableSyncByMask - ldrh r0, [r5] - adds r0, #1 - strh r0, [r5] - ldrh r0, [r5] - lsrs r0, r0, #1 - adds r0, r0, r6 - ldrb r0, [r0] - cmp r0, #0xff - bne _0807DB80 - adds r0, r7, #0 - bl Proc_Break -_0807DB80: - bl SetDefaultMapAnimScreenConf - movs r0, #1 - movs r1, #0xc - movs r2, #0xc - movs r3, #0 - bl SetBlendConfig - add sp, #0x10 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807DB98: .4byte gBG2TilemapBuffer -_0807DB9C: .4byte 0x00004160 -_0807DBA0: .4byte gUnknown_089AE4A4 -_0807DBA4: .4byte gUnknown_089A3C0C - - THUMB_FUNC_END sub_807DB30 - - THUMB_FUNC_START sub_807DBA8 -sub_807DBA8: @ 0x0807DBA8 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r0, _0807DBD8 @ gUnknown_089A3C24 - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x2c] - ldr r4, _0807DBDC @ gActionData - ldrb r1, [r4, #0x13] - lsls r1, r1, #4 - ldr r3, _0807DBE0 @ gBmSt - movs r5, #0xc - ldrsh r2, [r3, r5] - subs r1, r1, r2 - str r1, [r0, #0x30] - ldrb r1, [r4, #0x14] - lsls r1, r1, #4 - movs r4, #0xe - ldrsh r2, [r3, r4] - subs r1, r1, r2 - str r1, [r0, #0x34] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807DBD8: .4byte gUnknown_089A3C24 -_0807DBDC: .4byte gActionData -_0807DBE0: .4byte gBmSt - - THUMB_FUNC_END sub_807DBA8 - - THUMB_FUNC_START sub_807DBE4 -sub_807DBE4: @ 0x0807DBE4 - push {r4, r5, lr} - sub sp, #8 - adds r5, r0, #0 - ldr r0, _0807DC80 @ gPlaySt - adds r0, #0x41 - ldrb r0, [r0] - lsls r0, r0, #0x1e - cmp r0, #0 - blt _0807DBFC - movs r0, #0xb3 - bl m4aSongNumStart -_0807DBFC: - ldr r0, _0807DC84 @ gUnknown_089B03D4 - ldr r1, _0807DC88 @ 0x06013800 - bl Decompress - ldr r0, _0807DC8C @ gUnknown_089B068C - movs r1, #0xa0 - lsls r1, r1, #2 - movs r2, #0x20 - bl CopyToPaletteBuffer - movs r0, #4 - bl SetWhitePal - movs r0, #2 - bl GetBackgroundTileDataOffset - ldr r1, _0807DC90 @ 0x06002C00 - adds r0, r0, r1 - ldr r2, _0807DC94 @ 0x0000FFFF - movs r1, #0x10 - bl sub_8014930 - ldr r0, _0807DC98 @ gBG2TilemapBuffer - movs r1, #0x80 - lsls r1, r1, #3 - ldr r2, _0807DC9C @ 0x00004160 - bl sub_8014930 - movs r0, #4 - bl BG_EnableSyncByMask - adds r0, r5, #0 - adds r0, #0x40 - movs r1, #0 - strh r1, [r0] - adds r0, #2 - strh r1, [r0] - ldr r0, [r5, #0x30] - adds r4, r0, #4 - cmp r4, #0 - blt _0807DC60 - ldr r0, _0807DCA0 @ gUnknown_089A61F8 - ldr r2, [r5, #0x34] - ldr r3, _0807DCA4 @ 0x000041C0 - str r1, [sp] - movs r1, #2 - str r1, [sp, #4] - adds r1, r4, #0 - bl APProc_Create -_0807DC60: - bl InitScanline - bl sub_8081EAC - bl SetDefaultMapAnimScreenConf - movs r0, #1 - movs r1, #0 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - add sp, #8 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807DC80: .4byte gPlaySt -_0807DC84: .4byte gUnknown_089B03D4 -_0807DC88: .4byte 0x06013800 -_0807DC8C: .4byte gUnknown_089B068C -_0807DC90: .4byte 0x06002C00 -_0807DC94: .4byte 0x0000FFFF -_0807DC98: .4byte gBG2TilemapBuffer -_0807DC9C: .4byte 0x00004160 -_0807DCA0: .4byte gUnknown_089A61F8 -_0807DCA4: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807DBE4 - - THUMB_FUNC_START sub_807DCA8 -sub_807DCA8: @ 0x0807DCA8 - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x40 - ldrh r3, [r4] - movs r0, #0x50 - str r0, [sp] - movs r0, #5 - movs r1, #1 - movs r2, #0xa0 - bl Interpolate - adds r2, r0, #0 - ldr r0, [r5, #0x30] - adds r0, #8 - ldr r1, [r5, #0x34] - adds r1, #8 - bl sub_8081F24 - ldrh r0, [r4] - adds r0, #1 - strh r0, [r4] - ldrh r0, [r4] - lsls r0, r0, #4 - movs r1, #0x28 - bl __divsi3 - cmp r0, #0xf - ble _0807DCE6 - movs r0, #0x10 -_0807DCE6: - lsls r1, r0, #0x18 - lsrs r1, r1, #0x18 - movs r0, #1 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - ldrh r0, [r4] - cmp r0, #0x27 - bls _0807DD04 - adds r0, r5, #0 - bl Proc_Break - bl APProc_DeleteAll -_0807DD04: - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807DCA8 - - THUMB_FUNC_START sub_807DD0C -sub_807DD0C: @ 0x0807DD0C - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x40 - ldrh r3, [r4] - movs r0, #0x50 - str r0, [sp] - movs r0, #5 - movs r1, #1 - movs r2, #0xa0 - bl Interpolate - adds r2, r0, #0 - ldr r0, [r5, #0x30] - adds r0, #8 - ldr r1, [r5, #0x34] - adds r1, #8 - bl sub_8081F24 - ldrh r0, [r4] - adds r0, #1 - strh r0, [r4] - ldrh r0, [r4] - subs r0, #0x28 - lsls r0, r0, #4 - movs r1, #0x1e - bl __divsi3 - movs r1, #0x10 - subs r1, r1, r0 - cmp r1, #0 - bgt _0807DD50 - movs r1, #0 -_0807DD50: - lsls r1, r1, #0x18 - lsrs r1, r1, #0x18 - movs r0, #1 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - ldrh r0, [r4] - cmp r0, #0x45 - bls _0807DD6A - adds r0, r5, #0 - bl Proc_Break -_0807DD6A: - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807DD0C - - THUMB_FUNC_START sub_807DD74 -sub_807DD74: @ 0x0807DD74 - push {lr} - bl sub_8081F58 - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807DD74 - - THUMB_FUNC_START sub_807DD80 -sub_807DD80: @ 0x0807DD80 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807DDC0 @ gUnknown_089A3C6C - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x2c] - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807DDC4 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807DDC0: .4byte gUnknown_089A3C6C -_0807DDC4: .4byte gBmSt - - THUMB_FUNC_END sub_807DD80 - - THUMB_FUNC_START sub_807DDC8 -sub_807DDC8: @ 0x0807DDC8 - push {r4, r5, lr} - sub sp, #8 - adds r5, r0, #0 - ldr r1, [r5, #0x30] - movs r0, #0x87 - bl PlaySeSpacial - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - bl SetDefaultMapAnimScreenConf - ldr r0, _0807DE1C @ gUnknown_089B1E10 - ldr r1, _0807DE20 @ 0x06013800 - bl Decompress - ldr r0, _0807DE24 @ gUnknown_089B20E8 - movs r1, #0xa0 - lsls r1, r1, #2 - movs r2, #0x20 - bl CopyToPaletteBuffer - ldr r0, _0807DE28 @ gUnknown_089B2108 - ldr r1, [r5, #0x30] - ldr r2, [r5, #0x34] - ldr r3, _0807DE2C @ 0x000041C0 - movs r4, #0 - str r4, [sp] - movs r4, #2 - str r4, [sp, #4] - bl APProc_Create - adds r5, #0x48 - movs r0, #1 - strh r0, [r5] - add sp, #8 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807DE1C: .4byte gUnknown_089B1E10 -_0807DE20: .4byte 0x06013800 -_0807DE24: .4byte gUnknown_089B20E8 -_0807DE28: .4byte gUnknown_089B2108 -_0807DE2C: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807DDC8 - - THUMB_FUNC_START sub_807DE30 -sub_807DE30: @ 0x0807DE30 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807DE68 @ gUnknown_089A3C94 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807DE6C @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #4 - adds r2, #8 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #4 - adds r2, #8 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807DE68: .4byte gUnknown_089A3C94 -_0807DE6C: .4byte gBmSt - - THUMB_FUNC_END sub_807DE30 - - THUMB_FUNC_START sub_807DE70 -sub_807DE70: @ 0x0807DE70 - push {lr} - ldr r1, [r0, #0x30] - movs r0, #0x86 - bl PlaySeSpacial - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807DE70 - - THUMB_FUNC_START sub_807DE80 -sub_807DE80: @ 0x0807DE80 - push {r4, r5, lr} - adds r5, r0, #0 - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - bl SetDefaultMapAnimScreenConf - movs r0, #1 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - ldr r4, _0807DED0 @ gUnknown_089B0AD0 - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807DED4 @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r0, _0807DED8 @ Pal_HammerneBg - movs r1, #0x80 - movs r2, #0x20 - bl CopyToPaletteBuffer - adds r0, r5, #0 - adds r0, #0x48 - movs r1, #0 - strh r1, [r0] - adds r5, #0x4a - strh r1, [r5] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807DED0: .4byte gUnknown_089B0AD0 -_0807DED4: .4byte 0x06002C00 -_0807DED8: .4byte Pal_HammerneBg - - THUMB_FUNC_END sub_807DE80 - - THUMB_FUNC_START sub_807DEDC -sub_807DEDC: @ 0x0807DEDC - push {r4, r5, r6, r7, lr} - sub sp, #0x10 - adds r6, r0, #0 - ldr r0, _0807DF4C @ gBG2TilemapBuffer - mov ip, r0 - ldr r0, [r6, #0x30] - cmp r0, #0 - bge _0807DEEE - adds r0, #7 -_0807DEEE: - asrs r0, r0, #3 - subs r7, r0, #2 - ldr r2, [r6, #0x34] - cmp r2, #0 - bge _0807DEFA - adds r2, #7 -_0807DEFA: - asrs r2, r2, #3 - subs r2, #9 - ldr r3, _0807DF50 @ 0x00004160 - movs r0, #4 - str r0, [sp] - movs r0, #0xb - str r0, [sp, #4] - ldr r0, _0807DF54 @ gUnknown_089B17A4 - str r0, [sp, #8] - ldr r5, _0807DF58 @ gUnknown_08205824 - adds r4, r6, #0 - adds r4, #0x48 - ldrh r0, [r4] - adds r1, r0, #1 - strh r1, [r4] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - adds r0, r0, r5 - ldrb r0, [r0] - str r0, [sp, #0xc] - mov r0, ip - adds r1, r7, #0 - bl sub_801474C - movs r0, #4 - bl BG_EnableSyncByMask - movs r1, #0 - ldrsh r0, [r4, r1] - adds r0, r0, r5 - ldrb r0, [r0] - cmp r0, #0xff - bne _0807DF42 - adds r0, r6, #0 - bl Proc_Break -_0807DF42: - add sp, #0x10 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807DF4C: .4byte gBG2TilemapBuffer -_0807DF50: .4byte 0x00004160 -_0807DF54: .4byte gUnknown_089B17A4 -_0807DF58: .4byte gUnknown_08205824 - - THUMB_FUNC_END sub_807DEDC - - THUMB_FUNC_START sub_807DF5C -sub_807DF5C: @ 0x0807DF5C - push {r4, r5, lr} - sub sp, #0x14 - adds r5, r0, #0 - ldr r1, _0807DFA8 @ gUnknown_08205833 - mov r0, sp - movs r2, #0x13 - bl memcpy - adds r4, r5, #0 - adds r4, #0x4a - ldrh r0, [r4] - adds r1, r0, #1 - strh r1, [r4] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - add r0, sp - ldrb r1, [r0] - movs r0, #1 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - movs r1, #0 - ldrsh r0, [r4, r1] - add r0, sp - ldrb r0, [r0] - cmp r0, #0xff - bne _0807DF9E - movs r0, #0 - strh r0, [r4] - adds r0, r5, #0 - bl Proc_Break -_0807DF9E: - add sp, #0x14 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807DFA8: .4byte gUnknown_08205833 - - THUMB_FUNC_END sub_807DF5C - - THUMB_FUNC_START sub_807DFAC -sub_807DFAC: @ 0x0807DFAC - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x4a - ldrh r3, [r4] - adds r0, r3, #1 - strh r0, [r4] - lsls r3, r3, #0x10 - asrs r3, r3, #0x10 - movs r0, #0x1e - str r0, [sp] - movs r0, #0 - movs r1, #0x10 - movs r2, #0 - bl Interpolate - adds r1, r0, #0 - lsls r1, r1, #0x18 - lsrs r1, r1, #0x18 - movs r0, #1 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - movs r1, #0 - ldrsh r0, [r4, r1] - cmp r0, #0x1e - ble _0807DFEC - adds r0, r5, #0 - bl Proc_Break -_0807DFEC: - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807DFAC - - THUMB_FUNC_START sub_807DFF4 -sub_807DFF4: @ 0x0807DFF4 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807E030 @ gUnknown_089A3CD4 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807E034 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E030: .4byte gUnknown_089A3CD4 -_0807E034: .4byte gBmSt - - THUMB_FUNC_END sub_807DFF4 - - THUMB_FUNC_START sub_807E038 -sub_807E038: @ 0x0807E038 - push {lr} - ldr r1, [r0, #0x30] - movs r0, #0x82 - bl PlaySeSpacial - ldr r0, _0807E050 @ gUnknown_0867B5A4 - movs r1, #0x80 - movs r2, #0x20 - bl CopyToPaletteBuffer - pop {r0} - bx r0 - .align 2, 0 -_0807E050: .4byte gUnknown_0867B5A4 - - THUMB_FUNC_END sub_807E038 - - THUMB_FUNC_START sub_807E054 -sub_807E054: @ 0x0807E054 - push {r4, r5, r6, r7, lr} - sub sp, #0x10 - adds r6, r0, #0 - ldr r0, _0807E0C4 @ gBG2TilemapBuffer - mov ip, r0 - ldr r0, [r6, #0x30] - cmp r0, #0 - bge _0807E066 - adds r0, #7 -_0807E066: - asrs r0, r0, #3 - subs r7, r0, #2 - ldr r2, [r6, #0x34] - cmp r2, #0 - bge _0807E072 - adds r2, #7 -_0807E072: - asrs r2, r2, #3 - subs r2, #9 - ldr r3, _0807E0C8 @ 0x00004160 - movs r0, #4 - str r0, [sp] - movs r0, #0xb - str r0, [sp, #4] - ldr r0, _0807E0CC @ gUnknown_089B0864 - str r0, [sp, #8] - ldr r5, _0807E0D0 @ gUnknown_08205846 - adds r4, r6, #0 - adds r4, #0x48 - ldrh r0, [r4] - adds r1, r0, #1 - strh r1, [r4] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - adds r0, r0, r5 - ldrb r0, [r0] - str r0, [sp, #0xc] - mov r0, ip - adds r1, r7, #0 - bl sub_801474C - movs r0, #4 - bl BG_EnableSyncByMask - movs r1, #0 - ldrsh r0, [r4, r1] - adds r0, r0, r5 - ldrb r0, [r0] - cmp r0, #0xff - bne _0807E0BA - adds r0, r6, #0 - bl Proc_Break -_0807E0BA: - add sp, #0x10 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807E0C4: .4byte gBG2TilemapBuffer -_0807E0C8: .4byte 0x00004160 -_0807E0CC: .4byte gUnknown_089B0864 -_0807E0D0: .4byte gUnknown_08205846 - - THUMB_FUNC_END sub_807E054 - - THUMB_FUNC_START sub_807E0D4 -sub_807E0D4: @ 0x0807E0D4 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807E110 @ gUnknown_089A3D14 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807E114 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E110: .4byte gUnknown_089A3D14 -_0807E114: .4byte gBmSt - - THUMB_FUNC_END sub_807E0D4 - - THUMB_FUNC_START sub_807E118 -sub_807E118: @ 0x0807E118 - push {r4, lr} - sub sp, #8 - adds r4, r0, #0 - ldr r1, [r4, #0x30] - movs r0, #0x85 - bl PlaySeSpacial - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - bl SetDefaultMapAnimScreenConf - ldr r0, _0807E168 @ Img_SleepSprites - ldr r1, _0807E16C @ 0x06013800 - bl Decompress - ldr r0, _0807E170 @ Pal_SleepSprites - movs r1, #0xa0 - lsls r1, r1, #2 - movs r2, #0x20 - bl CopyToPaletteBuffer - ldr r0, _0807E174 @ gUnknown_089B1A10 - ldr r1, [r4, #0x30] - ldr r2, [r4, #0x34] - subs r2, #0x10 - ldr r3, _0807E178 @ 0x000041C0 - movs r4, #0 - str r4, [sp] - movs r4, #2 - str r4, [sp, #4] - bl APProc_Create - add sp, #8 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E168: .4byte Img_SleepSprites -_0807E16C: .4byte 0x06013800 -_0807E170: .4byte Pal_SleepSprites -_0807E174: .4byte gUnknown_089B1A10 -_0807E178: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807E118 - - THUMB_FUNC_START sub_807E17C -sub_807E17C: @ 0x0807E17C - push {r4, lr} - sub sp, #8 - adds r4, r0, #0 - ldr r1, [r4, #0x30] - movs r0, #0x85 - bl PlaySeSpacial - ldr r0, _0807E1A8 @ gUnknown_089B1A10 - ldr r1, [r4, #0x30] - ldr r2, [r4, #0x34] - subs r2, #8 - ldr r3, _0807E1AC @ 0x000041C0 - movs r4, #0 - str r4, [sp] - movs r4, #2 - str r4, [sp, #4] - bl APProc_Create - add sp, #8 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E1A8: .4byte gUnknown_089B1A10 -_0807E1AC: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807E17C - - THUMB_FUNC_START sub_807E1B0 -sub_807E1B0: @ 0x0807E1B0 - push {r4, lr} - sub sp, #8 - adds r4, r0, #0 - ldr r1, [r4, #0x30] - movs r0, #0x85 - bl PlaySeSpacial - ldr r0, _0807E1DC @ gUnknown_089B1A10 - ldr r1, [r4, #0x30] - ldr r2, [r4, #0x34] - ldr r3, _0807E1E0 @ 0x000041C0 - movs r4, #0 - str r4, [sp] - movs r4, #2 - str r4, [sp, #4] - bl APProc_Create - add sp, #8 - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E1DC: .4byte gUnknown_089B1A10 -_0807E1E0: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807E1B0 - - THUMB_FUNC_START sub_807E1E4 -sub_807E1E4: @ 0x0807E1E4 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807E224 @ gUnknown_089A3D54 - movs r1, #3 - bl Proc_Start - str r4, [r0, #0x2c] - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807E228 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E224: .4byte gUnknown_089A3D54 -_0807E228: .4byte gBmSt - - THUMB_FUNC_END sub_807E1E4 - - THUMB_FUNC_START sub_807E22C -sub_807E22C: @ 0x0807E22C - push {r4, r5, lr} - adds r5, r0, #0 - bl SetDefaultMapAnimScreenConf - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - ldr r4, _0807E280 @ gUnknown_089B6AA0 - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807E284 @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r0, _0807E288 @ gUnknown_089B73D4 - movs r1, #0x80 - movs r2, #0x20 - bl CopyToPaletteBuffer - movs r0, #1 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - adds r0, r5, #0 - adds r0, #0x40 - movs r1, #0 - strh r1, [r0] - adds r5, #0x42 - strh r1, [r5] - bl EnablePaletteSync - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E280: .4byte gUnknown_089B6AA0 -_0807E284: .4byte 0x06002C00 -_0807E288: .4byte gUnknown_089B73D4 - - THUMB_FUNC_END sub_807E22C - - THUMB_FUNC_START sub_807E28C -sub_807E28C: @ 0x0807E28C - push {r4, r5, r6, lr} - sub sp, #4 - adds r4, r0, #0 - adds r0, #0x42 - ldrh r0, [r0] - cmp r0, #0 - bne _0807E312 - adds r0, r4, #0 - adds r0, #0x40 - ldrh r1, [r0] - adds r5, r0, #0 - cmp r1, #0 - bne _0807E2B4 - ldr r0, _0807E2B0 @ 0x000003BA - ldr r1, [r4, #0x30] - bl PlaySeSpacial - b _0807E2BE - .align 2, 0 -_0807E2B0: .4byte 0x000003BA -_0807E2B4: - cmp r1, #9 - bls _0807E2BE - adds r0, r4, #0 - bl Proc_Break -_0807E2BE: - ldr r0, _0807E324 @ gUnknown_089A3D8C - ldrh r1, [r5] - lsls r1, r1, #2 - adds r1, r1, r0 - ldr r0, [r1] - ldr r6, _0807E328 @ gGenericBuffer - adds r1, r6, #0 - bl Decompress - ldr r1, _0807E32C @ gBG2TilemapBuffer - ldr r0, [r4, #0x30] - cmp r0, #0 - bge _0807E2DA - adds r0, #7 -_0807E2DA: - asrs r0, r0, #3 - subs r0, #4 - lsls r0, r0, #0x10 - asrs r2, r0, #0x10 - ldr r3, [r4, #0x34] - cmp r3, #0 - bge _0807E2EA - adds r3, #7 -_0807E2EA: - asrs r3, r3, #3 - subs r3, #4 - lsls r3, r3, #0x10 - asrs r3, r3, #0x10 - ldr r0, _0807E330 @ 0x00004160 - str r0, [sp] - adds r0, r1, #0 - adds r1, r6, #0 - bl sub_800159C - movs r0, #4 - bl BG_EnableSyncByMask - ldrh r0, [r5] - adds r0, #1 - strh r0, [r5] - adds r1, r4, #0 - adds r1, #0x42 - movs r0, #4 - strh r0, [r1] -_0807E312: - adds r1, r4, #0 - adds r1, #0x42 - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - add sp, #4 - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0807E324: .4byte gUnknown_089A3D8C -_0807E328: .4byte gGenericBuffer -_0807E32C: .4byte gBG2TilemapBuffer -_0807E330: .4byte 0x00004160 - - THUMB_FUNC_END sub_807E28C - - THUMB_FUNC_START sub_807E334 -sub_807E334: @ 0x0807E334 - push {lr} - ldr r0, _0807E348 @ gBG2TilemapBuffer - movs r1, #0 - bl BG_Fill - movs r0, #4 - bl BG_EnableSyncByMask - pop {r0} - bx r0 - .align 2, 0 -_0807E348: .4byte gBG2TilemapBuffer - - THUMB_FUNC_END sub_807E334 - - THUMB_FUNC_START sub_807E34C -sub_807E34C: @ 0x0807E34C - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807E388 @ gUnknown_089A3DB4 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807E38C @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #4 - adds r2, #0x12 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E388: .4byte gUnknown_089A3DB4 -_0807E38C: .4byte gBmSt - - THUMB_FUNC_END sub_807E34C - - THUMB_FUNC_START sub_807E390 -sub_807E390: @ 0x0807E390 - push {r4, lr} - adds r4, r0, #0 - ldr r1, [r4, #0x30] - movs r0, #0xfd - bl PlaySeSpacial - bl InitScanline - bl sub_8081EAC - ldr r0, _0807E3F0 @ sub_8081FA8 - bl SetPrimaryHBlankHandler - bl SetDefaultMapAnimScreenConf - movs r0, #1 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - ldr r0, _0807E3F4 @ gBG2TilemapBuffer - ldr r1, _0807E3F8 @ gGenericBuffer - ldr r2, _0807E3FC @ 0x00004160 - bl CallARM_FillTileRect - movs r0, #4 - bl BG_EnableSyncByMask - movs r0, #2 - movs r1, #0 - movs r2, #1 - adds r3, r4, #0 - bl sub_807EA20 - ldr r0, _0807E400 @ gUnknown_089A52FC - adds r1, r4, #0 - bl Proc_Start - adds r0, r4, #0 - adds r0, #0x48 - movs r1, #0 - strh r1, [r0] - adds r4, #0x4a - strh r1, [r4] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E3F0: .4byte sub_8081FA8 -_0807E3F4: .4byte gBG2TilemapBuffer -_0807E3F8: .4byte gGenericBuffer -_0807E3FC: .4byte 0x00004160 -_0807E400: .4byte gUnknown_089A52FC - - THUMB_FUNC_END sub_807E390 - - THUMB_FUNC_START sub_807E404 -sub_807E404: @ 0x0807E404 - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x48 - ldrh r1, [r4] - movs r2, #0 - ldrsh r0, [r4, r2] - cmp r0, #0xb - ble _0807E422 - subs r0, r1, #1 - strh r0, [r4] - adds r0, r5, #0 - bl Proc_Break -_0807E422: - ldr r0, [r5, #0x30] - ldr r1, [r5, #0x34] - ldrh r2, [r4] - adds r2, #1 - strh r2, [r4] - lsls r2, r2, #0x10 - asrs r2, r2, #0x10 - ldr r3, _0807E444 @ gUnknown_089A3DFC - str r3, [sp] - movs r3, #0xc - bl sub_808218C - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E444: .4byte gUnknown_089A3DFC - - THUMB_FUNC_END sub_807E404 - - THUMB_FUNC_START sub_807E448 -sub_807E448: @ 0x0807E448 - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x48 - ldrh r1, [r4] - movs r2, #0 - ldrsh r0, [r4, r2] - cmp r0, #0 - bgt _0807E466 - adds r0, r1, #1 - strh r0, [r4] - adds r0, r5, #0 - bl Proc_Break -_0807E466: - ldr r0, [r5, #0x30] - ldr r1, [r5, #0x34] - ldrh r2, [r4] - subs r2, #1 - strh r2, [r4] - lsls r2, r2, #0x10 - asrs r2, r2, #0x10 - ldr r3, _0807E488 @ gUnknown_089A3DFC - str r3, [sp] - movs r3, #0xc - bl sub_808218C - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E488: .4byte gUnknown_089A3DFC - - THUMB_FUNC_END sub_807E448 - - THUMB_FUNC_START MapAnimCallSpellAssocSilencefx -MapAnimCallSpellAssocSilencefx: @ 0x0807E48C - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807E4C8 @ gUnknown_089A3E04 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807E4CC @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E4C8: .4byte gUnknown_089A3E04 -_0807E4CC: .4byte gBmSt - - THUMB_FUNC_END MapAnimCallSpellAssocSilencefx - - THUMB_FUNC_START sub_807E4D0 -sub_807E4D0: @ 0x0807E4D0 - push {r4, r5, r6, lr} - sub sp, #8 - adds r6, r0, #0 - ldr r1, [r6, #0x30] - movs r0, #0x83 - bl PlaySeSpacial - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - bl SetDefaultMapAnimScreenConf - ldr r4, _0807E568 @ gUnknown_089B2618 - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807E56C @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r0, _0807E570 @ gUnknown_089B21D8 - ldr r1, _0807E574 @ 0x06013800 - bl Decompress - ldr r4, _0807E578 @ gUnknown_089B2728 - adds r0, r4, #0 - movs r1, #0x80 - movs r2, #0x20 - bl CopyToPaletteBuffer - movs r1, #0xa0 - lsls r1, r1, #2 - adds r0, r4, #0 - movs r2, #0x20 - bl CopyToPaletteBuffer - ldr r0, _0807E57C @ gUnknown_089B2748 - ldr r1, [r6, #0x30] - ldr r2, [r6, #0x34] - movs r3, #0x80 - lsls r3, r3, #3 - orrs r2, r3 - ldr r3, _0807E580 @ 0x000041C0 - movs r5, #0 - str r5, [sp] - movs r4, #2 - str r4, [sp, #4] - bl APProc_Create - adds r6, #0x48 - strh r5, [r6] - movs r0, #1 - str r0, [sp] - movs r0, #0 - movs r1, #0 - movs r2, #0 - movs r3, #0 - bl SetBlendTargetA - movs r0, #0 - bl SetBlendBackdropA - movs r0, #0 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - add sp, #8 - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0807E568: .4byte gUnknown_089B2618 -_0807E56C: .4byte 0x06002C00 -_0807E570: .4byte gUnknown_089B21D8 -_0807E574: .4byte 0x06013800 -_0807E578: .4byte gUnknown_089B2728 -_0807E57C: .4byte gUnknown_089B2748 -_0807E580: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807E4D0 - - THUMB_FUNC_START sub_807E584 -sub_807E584: @ 0x0807E584 - push {r4, r5, lr} - sub sp, #8 - adds r4, r0, #0 - ldr r1, [r4, #0x30] - movs r0, #0x84 - bl PlaySeSpacial - ldr r5, _0807E5E8 @ gBG2TilemapBuffer - ldr r0, [r4, #0x30] - cmp r0, #0 - bge _0807E59C - adds r0, #7 -_0807E59C: - asrs r0, r0, #3 - subs r1, r0, #2 - ldr r0, [r4, #0x34] - cmp r0, #0 - bge _0807E5A8 - adds r0, #7 -_0807E5A8: - asrs r2, r0, #3 - subs r2, #2 - ldr r3, _0807E5EC @ 0x00004160 - movs r0, #4 - str r0, [sp] - str r0, [sp, #4] - adds r0, r5, #0 - bl sub_8014560 - movs r0, #4 - bl BG_EnableSyncByMask - movs r0, #0 - str r0, [sp] - movs r1, #0 - movs r2, #1 - movs r3, #0 - bl SetBlendTargetA - movs r0, #0 - bl SetBlendBackdropA - movs r0, #1 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - add sp, #8 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E5E8: .4byte gBG2TilemapBuffer -_0807E5EC: .4byte 0x00004160 - - THUMB_FUNC_END sub_807E584 - - THUMB_FUNC_START sub_807E5F0 -sub_807E5F0: @ 0x0807E5F0 - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x48 - ldrh r3, [r4] - adds r0, r3, #1 - strh r0, [r4] - lsls r3, r3, #0x10 - asrs r3, r3, #0x10 - movs r0, #0x1e - str r0, [sp] - movs r0, #0 - movs r1, #0x10 - movs r2, #0 - bl Interpolate - adds r1, r0, #0 - lsls r1, r1, #0x18 - lsrs r1, r1, #0x18 - movs r0, #1 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - movs r1, #0 - ldrsh r0, [r4, r1] - cmp r0, #0x1d - ble _0807E630 - adds r0, r5, #0 - bl Proc_Break -_0807E630: - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807E5F0 - - THUMB_FUNC_START MapAnimCallSpellAssocBarrierfx -MapAnimCallSpellAssocBarrierfx: @ 0x0807E638 - push {r4, lr} - adds r4, r0, #0 - ldr r0, _0807E674 @ gUnknown_089A3E44 - movs r1, #3 - bl Proc_Start - movs r2, #0x10 - ldrsb r2, [r4, r2] - ldr r3, _0807E678 @ gBmSt - ldrh r1, [r3, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x30] - movs r2, #0x11 - ldrsb r2, [r4, r2] - ldrh r1, [r3, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r2, r2, r1 - lsls r2, r2, #1 - adds r2, #1 - lsls r2, r2, #3 - str r2, [r0, #0x34] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E674: .4byte gUnknown_089A3E44 -_0807E678: .4byte gBmSt - - THUMB_FUNC_END MapAnimCallSpellAssocBarrierfx - - THUMB_FUNC_START sub_807E67C -sub_807E67C: @ 0x0807E67C - push {r4, r5, lr} - adds r5, r0, #0 - ldr r1, [r5, #0x30] - movs r0, #0x88 - bl PlaySeSpacial - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - bl SetDefaultMapAnimScreenConf - movs r0, #1 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - ldr r4, _0807E6D4 @ gUnknown_089B2880 - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807E6D8 @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r0, _0807E6DC @ Pal_BarrierBg - movs r1, #0x80 - movs r2, #0x20 - bl CopyToPaletteBuffer - adds r0, r5, #0 - adds r0, #0x48 - movs r1, #0 - strh r1, [r0] - adds r5, #0x4a - strh r1, [r5] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E6D4: .4byte gUnknown_089B2880 -_0807E6D8: .4byte 0x06002C00 -_0807E6DC: .4byte Pal_BarrierBg - - THUMB_FUNC_END sub_807E67C - - THUMB_FUNC_START sub_807E6E0 -sub_807E6E0: @ 0x0807E6E0 - push {r4, r5, r6, r7, lr} - sub sp, #0x10 - adds r6, r0, #0 - ldr r0, _0807E750 @ gBG2TilemapBuffer - mov ip, r0 - ldr r0, [r6, #0x30] - cmp r0, #0 - bge _0807E6F2 - adds r0, #7 -_0807E6F2: - asrs r0, r0, #3 - subs r7, r0, #2 - ldr r2, [r6, #0x34] - cmp r2, #0 - bge _0807E6FE - adds r2, #7 -_0807E6FE: - asrs r2, r2, #3 - subs r2, #8 - ldr r3, _0807E754 @ 0x00004160 - movs r0, #4 - str r0, [sp] - movs r0, #0xa - str r0, [sp, #4] - ldr r0, _0807E758 @ gUnknown_089B343C - str r0, [sp, #8] - ldr r5, _0807E75C @ gUnknown_08205855 - adds r4, r6, #0 - adds r4, #0x48 - ldrh r0, [r4] - adds r1, r0, #1 - strh r1, [r4] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - adds r0, r0, r5 - ldrb r0, [r0] - str r0, [sp, #0xc] - mov r0, ip - adds r1, r7, #0 - bl sub_801474C - movs r0, #4 - bl BG_EnableSyncByMask - movs r1, #0 - ldrsh r0, [r4, r1] - adds r0, r0, r5 - ldrb r0, [r0] - cmp r0, #0xff - bne _0807E746 - adds r0, r6, #0 - bl Proc_Break -_0807E746: - add sp, #0x10 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807E750: .4byte gBG2TilemapBuffer -_0807E754: .4byte 0x00004160 -_0807E758: .4byte gUnknown_089B343C -_0807E75C: .4byte gUnknown_08205855 - - THUMB_FUNC_END sub_807E6E0 - - THUMB_FUNC_START sub_807E760 -sub_807E760: @ 0x0807E760 - push {r4, r5, lr} - adds r4, r0, #0 - adds r5, r1, #0 - ldr r0, _0807E794 @ gUnknown_089A3E6C - movs r1, #3 - bl Proc_Start - ldr r2, _0807E798 @ gBmSt - ldrh r1, [r2, #0xc] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r4, r4, r1 - lsls r4, r4, #4 - adds r4, #8 - str r4, [r0, #0x30] - ldrh r1, [r2, #0xe] - lsls r1, r1, #0x10 - asrs r1, r1, #0x14 - subs r5, r5, r1 - lsls r5, r5, #4 - adds r5, #8 - str r5, [r0, #0x34] - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E794: .4byte gUnknown_089A3E6C -_0807E798: .4byte gBmSt - - THUMB_FUNC_END sub_807E760 - - THUMB_FUNC_START HideUnitUnlockDoor -HideUnitUnlockDoor: @ 0x0807E79C - push {r4, lr} - ldr r4, _0807E7C0 @ gActionData - ldrb r0, [r4, #0xc] - bl GetUnit - ldr r1, [r0, #0xc] - movs r2, #1 - orrs r1, r2 - str r1, [r0, #0xc] - movs r0, #0x13 - ldrsb r0, [r4, r0] - movs r1, #0x14 - ldrsb r1, [r4, r1] - bl StartAvailableDoorTileEvent - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0807E7C0: .4byte gActionData - - THUMB_FUNC_END HideUnitUnlockDoor - - THUMB_FUNC_START UnhideUnit -UnhideUnit: @ 0x0807E7C4 - push {lr} - ldr r0, _0807E7DC @ gActionData - ldrb r0, [r0, #0xc] - bl GetUnit - ldr r1, [r0, #0xc] - movs r2, #2 - negs r2, r2 - ands r1, r2 - str r1, [r0, #0xc] - pop {r0} - bx r0 - .align 2, 0 -_0807E7DC: .4byte gActionData - - THUMB_FUNC_END UnhideUnit - - THUMB_FUNC_START sub_807E7E0 -sub_807E7E0: @ 0x0807E7E0 - push {r4, r5, lr} - sub sp, #0x10 - adds r5, r0, #0 - ldr r1, [r5, #0x30] - movs r0, #0x8d - bl PlaySeSpacial - movs r0, #2 - movs r1, #0 - movs r2, #0 - bl BG_SetPosition - ldr r4, _0807E88C @ gUnknown_089B0720 - movs r0, #2 - bl GetBackgroundTileDataOffset - adds r1, r0, #0 - ldr r0, _0807E890 @ 0x06002C00 - adds r1, r1, r0 - adds r0, r4, #0 - bl Decompress - ldr r4, _0807E894 @ gBG2TilemapBuffer - ldr r0, [r5, #0x30] - cmp r0, #0 - bge _0807E816 - adds r0, #7 -_0807E816: - asrs r0, r0, #3 - subs r1, r0, #2 - ldr r2, [r5, #0x34] - cmp r2, #0 - bge _0807E822 - adds r2, #7 -_0807E822: - asrs r2, r2, #3 - subs r2, #2 - ldr r3, _0807E898 @ 0x00004160 - movs r0, #4 - str r0, [sp] - str r0, [sp, #4] - ldr r0, _0807E89C @ gUnknown_089B0840 - str r0, [sp, #8] - movs r0, #0 - str r0, [sp, #0xc] - adds r0, r4, #0 - bl sub_801474C - movs r0, #4 - bl BG_EnableSyncByMask - ldr r0, _0807E8A0 @ Img_089B06AC - ldr r1, _0807E8A4 @ 0x06013800 - bl Decompress - ldr r0, _0807E8A8 @ Pal_089B0700 - movs r1, #0xa0 - lsls r1, r1, #2 - movs r2, #0x20 - bl CopyToPaletteBuffer - ldr r0, _0807E8AC @ gUnknown_089B0820 - str r5, [sp] - movs r1, #0x80 - movs r2, #0x20 - movs r3, #4 - bl StartPaletteAnimatorReverse - bl InitScanline - bl sub_8081EAC - bl SetDefaultMapAnimScreenConf - movs r0, #1 - movs r1, #0x10 - movs r2, #0x10 - movs r3, #0 - bl SetBlendConfig - adds r1, r5, #0 - adds r1, #0x48 - movs r0, #1 - strh r0, [r1] - add sp, #0x10 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_0807E88C: .4byte gUnknown_089B0720 -_0807E890: .4byte 0x06002C00 -_0807E894: .4byte gBG2TilemapBuffer -_0807E898: .4byte 0x00004160 -_0807E89C: .4byte gUnknown_089B0840 -_0807E8A0: .4byte Img_089B06AC -_0807E8A4: .4byte 0x06013800 -_0807E8A8: .4byte Pal_089B0700 -_0807E8AC: .4byte gUnknown_089B0820 - - THUMB_FUNC_END sub_807E7E0 - - THUMB_FUNC_START sub_807E8B0 -sub_807E8B0: @ 0x0807E8B0 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - sub sp, #8 - adds r7, r0, #0 - adds r4, r7, #0 - adds r4, #0x48 - movs r0, #0 - ldrsh r3, [r4, r0] - movs r0, #0x1e - str r0, [sp] - movs r0, #5 - movs r1, #1 - movs r2, #0x10 - bl Interpolate - adds r2, r0, #0 - ldrh r0, [r4] - adds r0, #1 - movs r1, #0 - mov r8, r1 - strh r0, [r4] - ldr r0, [r7, #0x30] - ldr r1, [r7, #0x34] - bl sub_8081F24 - movs r1, #0 - ldrsh r0, [r4, r1] - cmp r0, #0x1d - ble _0807E920 - mov r0, r8 - strh r0, [r4] - adds r0, r7, #0 - bl Proc_Break - ldr r5, _0807E92C @ ApConf_089A6254 - ldr r1, [r7, #0x30] - ldr r2, [r7, #0x34] - ldr r6, _0807E930 @ 0x000041C0 - mov r0, r8 - str r0, [sp] - movs r4, #2 - str r4, [sp, #4] - adds r0, r5, #0 - adds r3, r6, #0 - bl APProc_Create - ldr r1, [r7, #0x30] - ldr r2, [r7, #0x34] - movs r0, #1 - str r0, [sp] - str r4, [sp, #4] - adds r0, r5, #0 - adds r3, r6, #0 - bl APProc_Create -_0807E920: - add sp, #8 - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807E92C: .4byte ApConf_089A6254 -_0807E930: .4byte 0x000041C0 - - THUMB_FUNC_END sub_807E8B0 - - THUMB_FUNC_START sub_807E934 -sub_807E934: @ 0x0807E934 - push {r4, r5, lr} - sub sp, #4 - adds r5, r0, #0 - adds r4, r5, #0 - adds r4, #0x48 - movs r0, #0 - ldrsh r3, [r4, r0] - movs r0, #0x1e - str r0, [sp] - movs r0, #5 - movs r1, #0x10 - movs r2, #0 - bl Interpolate - adds r2, r0, #0 - ldrh r0, [r4] - adds r0, #1 - strh r0, [r4] - ldr r0, [r5, #0x30] - ldr r1, [r5, #0x34] - bl sub_8081F24 - movs r1, #0 - ldrsh r0, [r4, r1] - cmp r0, #0x1d - ble _0807E96E - adds r0, r5, #0 - bl Proc_Break -_0807E96E: - add sp, #4 - pop {r4, r5} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807E934 - - THUMB_FUNC_START SetDefaultMapAnimScreenConf -SetDefaultMapAnimScreenConf: @ 0x0807E978 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - sub sp, #4 - ldr r4, _0807EA1C @ gLCDControlBuffer - ldrb r2, [r4, #0xc] - movs r1, #4 - negs r1, r1 - adds r0, r1, #0 - ands r0, r2 - strb r0, [r4, #0xc] - ldrb r2, [r4, #0x10] - adds r0, r1, #0 - ands r0, r2 - strb r0, [r4, #0x10] - ldrb r2, [r4, #0x14] - adds r0, r1, #0 - ands r0, r2 - strb r0, [r4, #0x14] - ldrb r0, [r4, #0x18] - ands r1, r0 - movs r6, #2 - orrs r1, r6 - strb r1, [r4, #0x18] - movs r0, #0 - str r0, [sp] - movs r1, #0 - movs r2, #1 - movs r3, #0 - bl SetBlendTargetA - movs r0, #0 - bl SetBlendBackdropA - movs r0, #1 - str r0, [sp] - movs r0, #0 - movs r1, #0 - movs r2, #0 - movs r3, #1 - bl SetBlendTargetB - movs r0, #1 - bl SetBlendBackdropB - movs r0, #0x34 - adds r0, r0, r4 - mov r8, r0 - ldrb r0, [r0] - movs r1, #0x20 - orrs r0, r1 - adds r4, #0x36 - ldrb r2, [r4] - movs r1, #0x21 - negs r1, r1 - ands r1, r2 - movs r5, #1 - orrs r0, r5 - orrs r0, r6 - movs r2, #4 - orrs r0, r2 - movs r3, #8 - orrs r0, r3 - movs r2, #0x10 - orrs r0, r2 - mov r7, r8 - strb r0, [r7] - orrs r1, r5 - orrs r1, r6 - movs r0, #5 - negs r0, r0 - ands r1, r0 - orrs r1, r3 - orrs r1, r2 - strb r1, [r4] - add sp, #4 - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0807EA1C: .4byte gLCDControlBuffer - - THUMB_FUNC_END SetDefaultMapAnimScreenConf - - THUMB_FUNC_START sub_807EA20 -sub_807EA20: @ 0x0807EA20 - push {r4, r5, r6, lr} - adds r4, r0, #0 - adds r5, r1, #0 - adds r6, r2, #0 - adds r1, r3, #0 - ldr r0, _0807EA4C @ gUnknown_089A3EC4 - bl Proc_Start - adds r2, r0, #0 - str r4, [r2, #0x58] - adds r0, #0x64 - movs r1, #0 - strh r1, [r0] - adds r0, #2 - strh r5, [r0] - adds r0, #2 - strh r1, [r0] - adds r0, #2 - strh r6, [r0] - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0807EA4C: .4byte gUnknown_089A3EC4 - - THUMB_FUNC_END sub_807EA20 - - THUMB_FUNC_START sub_807EA50 -sub_807EA50: @ 0x0807EA50 - push {lr} - ldr r0, _0807EA5C @ gUnknown_089A3EC4 - bl Proc_EndEach - pop {r0} - bx r0 - .align 2, 0 -_0807EA5C: .4byte gUnknown_089A3EC4 - - THUMB_FUNC_END sub_807EA50 - - THUMB_FUNC_START sub_807EA60 -sub_807EA60: @ 0x0807EA60 - push {r4, r5, r6, lr} - adds r6, r0, #0 - ldr r0, [r6, #0x58] - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - adds r4, r6, #0 - adds r4, #0x64 - ldrh r1, [r4] - adds r5, r6, #0 - adds r5, #0x68 - ldrh r2, [r5] - bl BG_SetPosition - adds r0, r6, #0 - adds r0, #0x66 - ldrh r0, [r0] - ldrh r1, [r4] - adds r0, r0, r1 - strh r0, [r4] - adds r0, r6, #0 - adds r0, #0x6a - ldrh r0, [r0] - ldrh r1, [r5] - adds r0, r0, r1 - strh r0, [r5] - pop {r4, r5, r6} - pop {r0} - bx r0 - - THUMB_FUNC_END sub_807EA60 - -.align 2, 0 diff --git a/asm/mapanim_eventcall.s b/asm/mapanim_eventcall.s index 957d3f401..6f600f226 100644 --- a/asm/mapanim_eventcall.s +++ b/asm/mapanim_eventcall.s @@ -332,7 +332,7 @@ sub_8080498: @ 0x08080498 mov r1, r9 movs r2, #0 movs r3, #0 - bl sub_800159C + bl AddAttr2dBitMap movs r0, #4 bl BG_EnableSyncByMask movs r2, #4 @@ -401,7 +401,7 @@ sub_8080530: @ 0x08080530 adds r1, r4, #0 movs r2, #0 movs r3, #0 - bl sub_800159C + bl AddAttr2dBitMap movs r0, #4 bl BG_EnableSyncByMask add sp, #4 @@ -1585,7 +1585,7 @@ _08080E3A: str r0, [sp] adds r0, r1, #0 adds r1, r6, #0 - bl sub_800159C + bl AddAttr2dBitMap movs r0, #4 bl BG_EnableSyncByMask ldrh r0, [r5] @@ -1782,7 +1782,7 @@ _08080FBE: str r0, [sp] adds r0, r1, #0 adds r1, r6, #0 - bl sub_800159C + bl AddAttr2dBitMap movs r0, #4 bl BG_EnableSyncByMask ldrh r0, [r5] @@ -1999,7 +1999,7 @@ _08081160: str r0, [sp] adds r0, r1, #0 adds r1, r6, #0 - bl sub_800159C + bl AddAttr2dBitMap movs r0, #4 bl BG_EnableSyncByMask ldrh r0, [r5] diff --git a/data/const_data_205714.s b/data/const_data_205714.s index 606848f54..8b6762360 100644 --- a/data/const_data_205714.s +++ b/data/const_data_205714.s @@ -1,21 +1,5 @@ .section .rodata - .global gUnknown_08205824 -gUnknown_08205824: @ 0x08205824 - .incbin "baserom.gba", 0x205824, 0xF - - .global gUnknown_08205833 -gUnknown_08205833: @ 0x08205833 - .incbin "baserom.gba", 0x205833, 0x13 - - .global gUnknown_08205846 -gUnknown_08205846: @ 0x08205846 - .incbin "baserom.gba", 0x205846, 0xF - - .global gUnknown_08205855 -gUnknown_08205855: @ 0x08205855 - .incbin "baserom.gba", 0x205855, 0x2F - .global gUnknown_08205884 gUnknown_08205884: @ 0x08205884 .incbin "baserom.gba", 0x205884, 0x8 diff --git a/data/data_9A31F8.s b/data/data_9A31F8.s index b621b9733..4c00f9e12 100644 --- a/data/data_9A31F8.s +++ b/data/data_9A31F8.s @@ -1,7 +1,7 @@ .section .data - .global gUnknown_089A52FC -gUnknown_089A52FC: @ 0x089A52FC + .global ProcScr_ManimShiftingSineWaveScanlineBuf +ProcScr_ManimShiftingSineWaveScanlineBuf: @ 0x089A52FC @ PROC_CALL .short 0x2, 0x0 .word sub_80825B0 @@ -21,8 +21,8 @@ SpriteAnim_ManimStatGain: @ 0x089A5314 gUnknown_089A5A6C: @ 0x089A5A6C .incbin "baserom.gba", 0x9A5A6C, 0x78C - .global gUnknown_089A61F8 -gUnknown_089A61F8: @ 0x089A61F8 + .global ApConf_MapAnimTorchfx +ApConf_MapAnimTorchfx: @ 0x089A61F8 .incbin "baserom.gba", 0x9A61F8, 0x5C .global ApConf_089A6254 @@ -225,84 +225,84 @@ Pal_089AFFB8: @ 0x089AFFB8 gUnknown_089AFFF8: @ 0x089AFFF8 .incbin "baserom.gba", 0x9AFFF8, 0x3DC - .global gUnknown_089B03D4 -gUnknown_089B03D4: @ 0x089B03D4 + .global Img_MapAnimTorchfx +Img_MapAnimTorchfx: @ 0x089B03D4 .incbin "baserom.gba", 0x9B03D4, 0x2B8 - .global gUnknown_089B068C -gUnknown_089B068C: @ 0x089B068C + .global Pal_MapAnimTorchfx +Pal_MapAnimTorchfx: @ 0x089B068C .incbin "baserom.gba", 0x9B068C, 0x20 - .global Img_089B06AC -Img_089B06AC: @ 0x089B06AC + .global Img_MapAnimUnlockObjfx +Img_MapAnimUnlockObjfx: @ 0x089B06AC .incbin "baserom.gba", 0x9B06AC, 0x54 - .global Pal_089B0700 -Pal_089B0700: @ 0x089B0700 + .global Pal_MapAnimUnlockObjfx +Pal_MapAnimUnlockObjfx: @ 0x089B0700 .incbin "baserom.gba", 0x9B0700, 0x20 - .global gUnknown_089B0720 -gUnknown_089B0720: @ 0x089B0720 + .global Img_MapAnimUnlockBgfx +Img_MapAnimUnlockBgfx: @ 0x089B0720 .incbin "baserom.gba", 0x9B0720, 0x100 - .global gUnknown_089B0820 -gUnknown_089B0820: @ 0x089B0820 + .global Pal_MapAnimUnlockObjfx_Unk +Pal_MapAnimUnlockObjfx_Unk: @ 0x089B0820 .incbin "baserom.gba", 0x9B0820, 0x20 - .global gUnknown_089B0840 -gUnknown_089B0840: @ 0x089B0840 + .global Tsa_MapAnimUnlockBgfx +Tsa_MapAnimUnlockBgfx: @ 0x089B0840 .incbin "baserom.gba", 0x9B0840, 0x24 - .global gUnknown_089B0864 -gUnknown_089B0864: @ 0x089B0864 + .global Tsa_089B0864 +Tsa_089B0864: @ 0x089B0864 .incbin "baserom.gba", 0x9B0864, 0x26C - .global gUnknown_089B0AD0 -gUnknown_089B0AD0: @ 0x089B0AD0 + .global Img_MapAnimRepairfx +Img_MapAnimRepairfx: @ 0x089B0AD0 .incbin "baserom.gba", 0x9B0AD0, 0xCD4 - .global gUnknown_089B17A4 -gUnknown_089B17A4: @ 0x089B17A4 + .global Tsa_089B17A4 +Tsa_089B17A4: @ 0x089B17A4 .incbin "baserom.gba", 0x9B17A4, 0x26C - .global gUnknown_089B1A10 -gUnknown_089B1A10: @ 0x089B1A10 + .global ApConf_MapAnimSleep +ApConf_MapAnimSleep: @ 0x089B1A10 .incbin "baserom.gba", 0x9B1A10, 0x400 - .global gUnknown_089B1E10 -gUnknown_089B1E10: @ 0x089B1E10 + .global Img_MapAnimBerserkfx +Img_MapAnimBerserkfx: @ 0x089B1E10 .incbin "baserom.gba", 0x9B1E10, 0x2D8 - .global gUnknown_089B20E8 -gUnknown_089B20E8: @ 0x089B20E8 + .global Pal_MapAnimBerserkfx +Pal_MapAnimBerserkfx: @ 0x089B20E8 .incbin "baserom.gba", 0x9B20E8, 0x20 - .global gUnknown_089B2108 -gUnknown_089B2108: @ 0x089B2108 + .global ApConf_MapAnimBerserkfx +ApConf_MapAnimBerserkfx: @ 0x089B2108 .incbin "baserom.gba", 0x9B2108, 0xD0 - .global gUnknown_089B21D8 -gUnknown_089B21D8: @ 0x089B21D8 + .global Img_ManimSilenceObjfx +Img_ManimSilenceObjfx: @ 0x089B21D8 .incbin "baserom.gba", 0x9B21D8, 0x440 - .global gUnknown_089B2618 -gUnknown_089B2618: @ 0x089B2618 + .global Img_ManimSilenceBgfx +Img_ManimSilenceBgfx: @ 0x089B2618 .incbin "baserom.gba", 0x9B2618, 0x110 - .global gUnknown_089B2728 -gUnknown_089B2728: @ 0x089B2728 + .global Pal_ManimSilencefx +Pal_ManimSilencefx: @ 0x089B2728 .incbin "baserom.gba", 0x9B2728, 0x20 - .global gUnknown_089B2748 -gUnknown_089B2748: @ 0x089B2748 + .global ApConf_ManimSilencefx +ApConf_ManimSilencefx: @ 0x089B2748 .incbin "baserom.gba", 0x9B2748, 0x138 - .global gUnknown_089B2880 -gUnknown_089B2880: @ 0x089B2880 + .global Img_ManimBarrierBgfx +Img_ManimBarrierBgfx: @ 0x089B2880 .incbin "baserom.gba", 0x9B2880, 0xBBC - .global gUnknown_089B343C -gUnknown_089B343C: @ 0x089B343C + .global Tsa_089B343C +Tsa_089B343C: @ 0x089B343C .incbin "baserom.gba", 0x9B343C, 0x194 .global Img_NightMareMapAnimfx @@ -445,13 +445,53 @@ Tsa_NightMareMapAnimfx32: Tsa_NightMareMapAnimfx33: .incbin "baserom.gba", 0x9B69BC, 0x9B6AA0 - 0x9B69BC - .global gUnknown_089B6AA0 -gUnknown_089B6AA0: @ 0x089B6AA0 + .global Img_MonsterStoneMapAnimfx +Img_MonsterStoneMapAnimfx: @ 0x089B6AA0 .incbin "baserom.gba", 0x9B6AA0, 0x934 - .global gUnknown_089B73D4 -gUnknown_089B73D4: @ 0x089B73D4 - .incbin "baserom.gba", 0x9B73D4, 0x23C + .global Pal_MonsterStoneMapAnimfx +Pal_MonsterStoneMapAnimfx: @ 0x089B73D4 + .incbin "baserom.gba", 0x9B73D4, 0x20 + + .global Tsa1_MonsterStoneMapAnimfx +Tsa1_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B73F4, 0x9B7414 - 0x9B73F4 + + .global Tsa2_MonsterStoneMapAnimfx +Tsa2_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B7414, 0x9B743C - 0x9B7414 + + .global Tsa3_MonsterStoneMapAnimfx +Tsa3_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B743C, 0x9B7468 - 0x9B743C + + .global Tsa4_MonsterStoneMapAnimfx +Tsa4_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B7468, 0x9B749C - 0x9B7468 + + .global Tsa5_MonsterStoneMapAnimfx +Tsa5_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B749C, 0x9B74D4 - 0x9B749C + + .global Tsa6_MonsterStoneMapAnimfx +Tsa6_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B74D4, 0x9B7514 - 0x9B74D4 + + .global Tsa7_MonsterStoneMapAnimfx +Tsa7_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B7514, 0x9B7554 - 0x9B7514 + + .global Tsa8_MonsterStoneMapAnimfx +Tsa8_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B7554, 0x9B759C - 0x9B7554 + + .global Tsa9_MonsterStoneMapAnimfx +Tsa9_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B759C, 0x9B75D8 - 0x9B759C + + .global Tsa10_MonsterStoneMapAnimfx +Tsa10_MonsterStoneMapAnimfx: + .incbin "baserom.gba", 0x9B75D8, 0x9B7610 - 0x9B75D8 .global Img_GorgonHatchCloud Img_GorgonHatchCloud: @ 0x089B7610 diff --git a/data/data_banim.s b/data/data_banim.s index 821b25bc3..d94b60dcc 100644 --- a/data/data_banim.s +++ b/data/data_banim.s @@ -29298,8 +29298,8 @@ Img_0867A828: @ 0x0867A828 Img_0867AE48: @ 0x0867AE48 .incbin "baserom.gba", 0x67AE48, 0x75C @ 0x67B5A4 - 0x67AE48 - .global gUnknown_0867B5A4 -gUnknown_0867B5A4: @ 0x0867B5A4 + .global Pal_MapAnimRestore +Pal_MapAnimRestore: @ 0x0867B5A4 .incbin "baserom.gba", 0x67B5A4, 0x20 @ 0x67B5C4 - 0x67B5A4 .global Tsa_0867B5C4 @@ -29357,47 +29357,47 @@ Tsa_0867C09C: @ 0x0867C09C .global gUnknown_0867EE04 gUnknown_0867EE04: @ 0x0867EE04 @ Replacing .incbin "baserom.gba", 0x67EE04, 0xB0 - .4byte gUnknown_0867B5A4 + 0xc3a - .4byte gUnknown_0867B5A4 + 0xc52 - .4byte gUnknown_0867B5A4 + 0xc76 - .4byte gUnknown_0867B5A4 + 0xcb2 - .4byte gUnknown_0867B5A4 + 0xd06 - .4byte gUnknown_0867B5A4 + 0xd72 - .4byte gUnknown_0867B5A4 + 0xdf6 - .4byte gUnknown_0867B5A4 + 0xe92 - .4byte gUnknown_0867B5A4 + 0xf52 - .4byte gUnknown_0867B5A4 + 0x1036 - .4byte gUnknown_0867B5A4 + 0x113e - .4byte gUnknown_0867B5A4 + 0x126a - .4byte gUnknown_0867B5A4 + 0x13ba - .4byte gUnknown_0867B5A4 + 0x1522 - .4byte gUnknown_0867B5A4 + 0x16a2 - .4byte gUnknown_0867B5A4 + 0x1846 - .4byte gUnknown_0867B5A4 + 0x1a02 - .4byte gUnknown_0867B5A4 + 0x1bd6 - .4byte gUnknown_0867B5A4 + 0x1db6 - .4byte gUnknown_0867B5A4 + 0x1fa2 - .4byte gUnknown_0867B5A4 + 0x218e - .4byte gUnknown_0867B5A4 + 0x236e - .4byte gUnknown_0867B5A4 + 0x2542 - .4byte gUnknown_0867B5A4 + 0x270a - .4byte gUnknown_0867B5A4 + 0x28ae - .4byte gUnknown_0867B5A4 + 0x2a2e - .4byte gUnknown_0867B5A4 + 0x2b96 - .4byte gUnknown_0867B5A4 + 0x2ce6 - .4byte gUnknown_0867B5A4 + 0x2e12 - .4byte gUnknown_0867B5A4 + 0x2f1a - .4byte gUnknown_0867B5A4 + 0x300a - .4byte gUnknown_0867B5A4 + 0x30e2 - .4byte gUnknown_0867B5A4 + 0x31a2 - .4byte gUnknown_0867B5A4 + 0x323e - .4byte gUnknown_0867B5A4 + 0x32ce - .4byte gUnknown_0867B5A4 + 0x3346 - .4byte gUnknown_0867B5A4 + 0x33a6 - .4byte gUnknown_0867B5A4 + 0x33ee - .4byte gUnknown_0867B5A4 + 0x342a - .4byte gUnknown_0867B5A4 + 0x345a - .4byte gUnknown_0867B5A4 + 0x347e + .4byte Pal_MapAnimRestore + 0xc3a + .4byte Pal_MapAnimRestore + 0xc52 + .4byte Pal_MapAnimRestore + 0xc76 + .4byte Pal_MapAnimRestore + 0xcb2 + .4byte Pal_MapAnimRestore + 0xd06 + .4byte Pal_MapAnimRestore + 0xd72 + .4byte Pal_MapAnimRestore + 0xdf6 + .4byte Pal_MapAnimRestore + 0xe92 + .4byte Pal_MapAnimRestore + 0xf52 + .4byte Pal_MapAnimRestore + 0x1036 + .4byte Pal_MapAnimRestore + 0x113e + .4byte Pal_MapAnimRestore + 0x126a + .4byte Pal_MapAnimRestore + 0x13ba + .4byte Pal_MapAnimRestore + 0x1522 + .4byte Pal_MapAnimRestore + 0x16a2 + .4byte Pal_MapAnimRestore + 0x1846 + .4byte Pal_MapAnimRestore + 0x1a02 + .4byte Pal_MapAnimRestore + 0x1bd6 + .4byte Pal_MapAnimRestore + 0x1db6 + .4byte Pal_MapAnimRestore + 0x1fa2 + .4byte Pal_MapAnimRestore + 0x218e + .4byte Pal_MapAnimRestore + 0x236e + .4byte Pal_MapAnimRestore + 0x2542 + .4byte Pal_MapAnimRestore + 0x270a + .4byte Pal_MapAnimRestore + 0x28ae + .4byte Pal_MapAnimRestore + 0x2a2e + .4byte Pal_MapAnimRestore + 0x2b96 + .4byte Pal_MapAnimRestore + 0x2ce6 + .4byte Pal_MapAnimRestore + 0x2e12 + .4byte Pal_MapAnimRestore + 0x2f1a + .4byte Pal_MapAnimRestore + 0x300a + .4byte Pal_MapAnimRestore + 0x30e2 + .4byte Pal_MapAnimRestore + 0x31a2 + .4byte Pal_MapAnimRestore + 0x323e + .4byte Pal_MapAnimRestore + 0x32ce + .4byte Pal_MapAnimRestore + 0x3346 + .4byte Pal_MapAnimRestore + 0x33a6 + .4byte Pal_MapAnimRestore + 0x33ee + .4byte Pal_MapAnimRestore + 0x342a + .4byte Pal_MapAnimRestore + 0x345a + .4byte Pal_MapAnimRestore + 0x347e .4byte 0x7867ea3b .4byte 0x84000013 .4byte 0x81000000 diff --git a/data/mapanim_89A398C.s b/data/mapanim_89A398C.s deleted file mode 100644 index 9aa5c65aa..000000000 --- a/data/mapanim_89A398C.s +++ /dev/null @@ -1,378 +0,0 @@ - .section .data - - .global gUnknown_089A3B84 -gUnknown_089A3B84: @ 0x089A3B84 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807D818 - @ PROC_SLEEP - .short 0xe, 0x64 - .word 0x0 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3BA4 -gUnknown_089A3BA4: @ 0x089A3BA4 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807D860 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807D944 - @ PROC_SLEEP - .short 0xe, 0x1e - .word 0x0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807D9B8 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3BDC -gUnknown_089A3BDC: @ 0x089A3BDC - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DAE8 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DB30 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3C0C -gUnknown_089A3C0C: @ 0x089A3C0C -@ Replacing .incbin "baserom.gba", 0x9A3C0C, 0x18 - .4byte 0x03020100 - .4byte 0x03030303 - .4byte 0x03030303 - .4byte 0x04030303 - .4byte 0x08070605 - .4byte 0x0000ff09 - - .global gUnknown_089A3C24 -gUnknown_089A3C24: @ 0x089A3C24 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DBE4 - @ PROC_SLEEP - .short 0xe, 0x1e - .word 0x0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DCA8 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DD0C - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DD74 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DA68 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3C6C -gUnknown_089A3C6C: @ 0x089A3C6C - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DDC8 - @ PROC_SLEEP - .short 0xe, 0x78 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3C94 -gUnknown_089A3C94: @ 0x089A3C94 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DE80 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DE70 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DEDC - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DF5C - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DFAC - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3CD4 -gUnknown_089A3CD4: @ 0x089A3CD4 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DE80 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E038 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E054 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DF5C - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807DFAC - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3D14 -gUnknown_089A3D14: @ 0x089A3D14 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E118 - @ PROC_SLEEP - .short 0xe, 0x32 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E17C - @ PROC_SLEEP - .short 0xe, 0x32 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E1B0 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3D54 -gUnknown_089A3D54: @ 0x089A3D54 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E22C - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E28C - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E334 - @ PROC_SLEEP - .short 0xe, 0x3c - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3D8C -gUnknown_089A3D8C: @ 0x089A3D8C -@ replacing .incbin "baserom.gba", 0x009a3d8c, 0x28 -.4byte gUnknown_089B73D4 + 0x20 -.4byte gUnknown_089B73D4 + 0x40 -.4byte gUnknown_089B73D4 + 0x68 -.4byte gUnknown_089B73D4 + 0x94 -.4byte gUnknown_089B73D4 + 0xc8 -.4byte gUnknown_089B73D4 + 0x100 -.4byte gUnknown_089B73D4 + 0x140 -.4byte gUnknown_089B73D4 + 0x180 -.4byte gUnknown_089B73D4 + 0x1c8 -.4byte gUnknown_089B73D4 + 0x204 - - .global gUnknown_089A3DB4 -gUnknown_089A3DB4: @ 0x089A3DB4 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E390 - @ PROC_SLEEP - .short 0xe, 0xa - .word 0x0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E404 - @ PROC_SLEEP - .short 0xe, 0x3c - .word 0x0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E448 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DA68 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3DFC -gUnknown_089A3DFC: @ 0x089A3DFC -@ Replacing .incbin "baserom.gba", 0x9A3DFC, 0x8 - .4byte 0x08070604 - .4byte 0x00ff0908 - - .global gUnknown_089A3E04 -gUnknown_089A3E04: @ 0x089A3E04 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E4D0 - @ PROC_SLEEP - .short 0xe, 0x32 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E584 - @ PROC_SLEEP - .short 0xe, 0x28 - .word 0x0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E5F0 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3E44 -gUnknown_089A3E44: @ 0x089A3E44 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E67C - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E6E0 - @ PROC_CALL - .short 0x2, 0x0 - .word MapSpellAnim_CommonEnd - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3E6C -gUnknown_089A3E6C: @ 0x089A3E6C - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807E7E0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E8B0 - @ PROC_SLEEP - .short 0xe, 0x50 - .word 0x0 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807E934 - @ PROC_SLEEP - .short 0xe, 0x1 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word sub_807DA68 - @ PROC_CALL - .short 0x2, 0x0 - .word HideUnitUnlockDoor - @ PROC_SLEEP - .short 0xe, 0x4 - .word 0x0 - @ PROC_CALL - .short 0x2, 0x0 - .word UnhideUnit - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - - - .global gUnknown_089A3EC4 -gUnknown_089A3EC4: @ 0x089A3EC4 - @ PROC_REPEAT - .short 0x3, 0x0 - .word sub_807EA60 - @ PROC_END - .short 0x0, 0x0 - .word 0x0 - diff --git a/include/constants/video-global.h b/include/constants/video-global.h index 61132f1bf..51f459bc8 100644 --- a/include/constants/video-global.h +++ b/include/constants/video-global.h @@ -39,6 +39,8 @@ enum BGCHR_MANIM_1 = 1, BGCHR_MANIM_140 = 0x140, + BGCHR_MANIM_160 = 0x160, + OBCHR_MANIM_1C0 = 0x1C0, BGCHR_MANIM_200 = 0x200, }; diff --git a/include/efxbattle.h b/include/efxbattle.h index 4c36c8ea4..08c49e081 100644 --- a/include/efxbattle.h +++ b/include/efxbattle.h @@ -1593,7 +1593,7 @@ extern u16 Img_08679B04[]; extern u16 Img_0867A130[]; extern u16 Img_0867A828[]; extern u16 Img_0867AE48[]; -extern u16 gUnknown_0867B5A4[]; +extern u16 Pal_MapAnimRestore[]; extern u16 Tsa_0867B5C4[]; extern u16 Tsa_0867B670[]; extern u16 Tsa_0867B724[]; diff --git a/include/hardware.h b/include/hardware.h index 1f18e615c..c2d13733d 100644 --- a/include/hardware.h +++ b/include/hardware.h @@ -388,7 +388,7 @@ void sub_800151C(u8 a, u8 b); void sub_800151C(u8 a, u8 b); void sub_8001530(u16 *a, u16 *b); void sub_800154C(void* outTm, void const* inData, u8 base, u8 linebits); -void sub_800159C(u16 *a1, u16 *a2, s16 a3, s16 a4, u16 a5); +void AddAttr2dBitMap(u16 * _dst, u16 * _src, s16 ix, s16 iy, u16 chr); // ??? sub_80016C4(???); void MaybeResetSomePal(void); void MaybeSmoothChangeSomePal(u16 *src, int b, int c, int d); diff --git a/include/mapanim.h b/include/mapanim.h index 85b9b0398..8eb366b9a 100644 --- a/include/mapanim.h +++ b/include/mapanim.h @@ -108,7 +108,7 @@ struct MAEffectProc { STRUCT_PAD(0x46, 0x48); /* 48 */ short unk48; - /* 4A */ short unk4A; + /* 4A */ short frame_idx; /* 4C */ short unk4C; STRUCT_PAD(0x4E, 0x50); @@ -317,24 +317,22 @@ extern CONST_DATA struct ProcCmd ProcScr_MapLatonaShiningfx[]; extern CONST_DATA struct ProcCmd ProcScr_NightMarefx[]; extern CONST_DATA void * TsaSet_NightMareMapAnimfx[]; extern CONST_DATA struct ProcCmd ProcScr_MapAnimAntitoxinPureWaterfx[]; -// extern ??? gUnknown_089A3B6C -// extern ??? gUnknown_089A3B84 -// extern ??? gUnknown_089A3BA4 -// extern ??? gUnknown_089A3BDC -// extern ??? gUnknown_089A3C0C -// extern ??? gUnknown_089A3C24 -// extern ??? gUnknown_089A3C6C -// extern ??? gUnknown_089A3C94 -// extern ??? gUnknown_089A3CD4 -// extern ??? gUnknown_089A3D14 -// extern ??? gUnknown_089A3D54 -// extern ??? gUnknown_089A3D8C -// extern ??? gUnknown_089A3DB4 -// extern ??? gUnknown_089A3DFC -// extern ??? gUnknown_089A3E04 -// extern ??? gUnknown_089A3E44 -// extern ??? gUnknown_089A3E6C -// extern ??? gUnknown_089A3EC4 +extern CONST_DATA struct ProcCmd ProcScr_089A3B84[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimEffectAnimator[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimWarpFlashy[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimTorch[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimBerserk[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimRepair[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimRestore[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimSleep[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimMonsterStone[]; +extern CONST_DATA void * TsaSet_MonsterStoneMapAnimfx[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimEffect_Unk_089A3DB4[]; +extern CONST_DATA u8 gUnknown_089A3DFC[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimSilencefx[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimBarrierfx[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimUnlock[]; +extern CONST_DATA struct ProcCmd ProcScr_MapAnimEffect_Unk_089A3EC4[]; // extern ??? gManimLevelUpLabelInfoList extern CONST_DATA struct ProcCmd ProcScr_ManimLevelUpStatGainLabel[]; extern CONST_DATA struct ProcCmd ProcScr_ManimLevelUpLabelColor[]; @@ -386,10 +384,10 @@ extern CONST_DATA struct ProcCmd ProcScr_EggDmgMapEffect2[]; extern CONST_DATA struct ProcCmd ProcScr_CritAtkMapEffect[]; extern CONST_DATA struct ProcCmd ProcScr_SpellAssocBarrier[]; extern CONST_DATA struct ProcCmd ProcScr_SpellAssocWarp[]; -// extern ??? gUnknown_089A52FC +extern CONST_DATA struct ProcCmd ProcScr_ManimShiftingSineWaveScanlineBuf[]; extern u16 SpriteAnim_ManimStatGain[]; extern u16 gUnknown_089A5A6C[]; -// extern ??? gUnknown_089A61F8 +extern u16 ApConf_MapAnimTorchfx[]; extern u16 ApConf_089A6254[]; extern u16 CONST_DATA Obj_PoisonAnim[]; extern u16 CONST_DATA Obj_WallBreakAnim[]; @@ -425,13 +423,13 @@ extern u16 CONST_DATA Pal_WallBreakAnim[]; extern const u8 Img_GmapSoguSprites[]; extern u16 CONST_DATA Img_PoisonAnim[]; extern u16 CONST_DATA Pal_PoisonAnim[]; -// extern ??? gUnknown_089AE224 -// extern ??? gUnknown_089AE484 -// extern ??? gUnknown_089AE4A4 +extern u16 CONST_DATA gUnknown_089AE224[]; +extern u16 CONST_DATA gUnknown_089AE484[]; +extern u16 CONST_DATA gUnknown_089AE4A4[]; extern u8 Img_089AE7A4[]; extern u16 Pal_089AE7C4[]; extern u8 CONST_DATA Img_MapAnimAntitoxinPureWater[]; -// extern ??? gUnknown_089AF310 +extern u16 CONST_DATA gUnknown_089AF310[]; extern u16 CONST_DATA Pal_MapAnimPureWater[]; extern u16 CONST_DATA Pal_MapAnimAntitoxin[]; extern u8 CONST_DATA gUnknown_089AF950[]; @@ -440,26 +438,26 @@ extern u8 CONST_DATA gUnknown_089AFCBC[]; extern u16 CONST_DATA Pal_089AFF78[]; extern u16 CONST_DATA Pal_089AFFB8[]; extern u8 CONST_DATA gUnknown_089AFFF8[]; -// extern ??? gUnknown_089B03D4 -// extern ??? gUnknown_089B068C -extern u8 Img_089B06AC[]; -extern u16 Pal_089B0700[]; -// extern ??? gUnknown_089B0720 -// extern ??? gUnknown_089B0820 -// extern ??? gUnknown_089B0840 -// extern ??? gUnknown_089B0864 -// extern ??? gUnknown_089B0AD0 -// extern ??? gUnknown_089B17A4 -// extern ??? gUnknown_089B1A10 -// extern ??? gUnknown_089B1E10 -// extern ??? gUnknown_089B20E8 -// extern ??? gUnknown_089B2108 -// extern ??? gUnknown_089B21D8 -// extern ??? gUnknown_089B2618 -// extern ??? gUnknown_089B2728 -// extern ??? gUnknown_089B2748 -// extern ??? gUnknown_089B2880 -// extern ??? gUnknown_089B343C +extern u8 CONST_DATA Img_MapAnimTorchfx[]; +extern u16 CONST_DATA Pal_MapAnimTorchfx[]; +extern u8 Img_MapAnimUnlockObjfx[]; +extern u16 Pal_MapAnimUnlockObjfx[]; +extern u8 Img_MapAnimUnlockBgfx[]; +extern u16 Pal_MapAnimUnlockObjfx_Unk[]; +extern u8 Tsa_MapAnimUnlockBgfx[]; +extern u8 Tsa_089B0864[]; +extern u8 Img_MapAnimRepairfx[]; +extern u8 Tsa_089B17A4[]; +extern u16 ApConf_MapAnimSleep[]; +extern u8 Img_MapAnimBerserkfx[]; +extern u16 Pal_MapAnimBerserkfx[]; +extern u16 ApConf_MapAnimBerserkfx[]; +extern u8 Img_ManimSilenceObjfx[]; +extern u8 Img_ManimSilenceBgfx[]; +extern u16 Pal_ManimSilencefx[]; +extern u16 ApConf_ManimSilencefx[]; +extern u8 Img_ManimBarrierBgfx[]; +extern u8 Tsa_089B343C[]; extern u16 Img_NightMareMapAnimfx[]; extern u16 Pal_NightMareMapAnimfx[]; extern u8 Tsa_NightMareMapAnimfx1[]; @@ -495,8 +493,18 @@ extern u8 Tsa_NightMareMapAnimfx30[]; extern u8 Tsa_NightMareMapAnimfx31[]; extern u8 Tsa_NightMareMapAnimfx32[]; extern u8 Tsa_NightMareMapAnimfx33[]; -// extern ??? gUnknown_089B6AA0 -// extern ??? gUnknown_089B73D4 +extern u8 Img_MonsterStoneMapAnimfx[]; +extern u16 Pal_MonsterStoneMapAnimfx[]; +extern u8 Tsa1_MonsterStoneMapAnimfx[]; +extern u8 Tsa2_MonsterStoneMapAnimfx[]; +extern u8 Tsa3_MonsterStoneMapAnimfx[]; +extern u8 Tsa4_MonsterStoneMapAnimfx[]; +extern u8 Tsa5_MonsterStoneMapAnimfx[]; +extern u8 Tsa6_MonsterStoneMapAnimfx[]; +extern u8 Tsa7_MonsterStoneMapAnimfx[]; +extern u8 Tsa8_MonsterStoneMapAnimfx[]; +extern u8 Tsa9_MonsterStoneMapAnimfx[]; +extern u8 Tsa10_MonsterStoneMapAnimfx[]; extern u16 Img_GorgonHatchCloud[]; extern u16 Pal_GorgonHatchCloud[]; extern u16 Tsa_GorgonHatchCloud_A[]; @@ -626,62 +634,94 @@ void NightMarefx_End(struct MAEffectProc * proc); void MapAnimCallSpellAssocAntitoxinPureWaterfx(struct Unit * unit, u8 * img, u16 * pal); void AntitoxinPureWaterfx_Init(struct MAEffectProc * proc); void AntitoxinPureWaterfx_Loop(struct MAEffectProc * proc); -// ??? sub_807D7D8(???); -// ??? sub_807D818(???); -void NewMapAnimEffectAnimator(struct Unit * unit, u8 * unk1, u16 * unk2, int unk3); -// ??? sub_807D860(???); -// ??? sub_807D944(???); -// ??? sub_807D9B8(???); -void MapSpellAnim_CommonEnd(void); -// ??? sub_807DA68(???); -void New6C_SomethingFlashy(struct Unit * unit, int x, int y); -// ??? sub_807DAE8(???); -// ??? sub_807DB30(???); -void sub_807DBA8(struct Unit * unit); -// ??? sub_807DBE4(???); -// ??? sub_807DCA8(???); -// ??? sub_807DD0C(???); -// ??? sub_807DD74(???); -void sub_807DD80(struct Unit * unit); -// ??? sub_807DDC8(???); -void sub_807DE30(struct Unit * unit); -// ??? sub_807DE70(???); -// ??? sub_807DE80(???); -// ??? sub_807DEDC(???); -// ??? sub_807DF5C(???); -// ??? sub_807DFAC(???); -void sub_807DFF4(struct Unit * unit); -// ??? sub_807E038(???); -// ??? sub_807E054(???); -void sub_807E0D4(struct Unit * unit); -// ??? sub_807E118(???); -// ??? sub_807E17C(???); -// ??? sub_807E1B0(???); -void sub_807E1E4(struct Unit * unit); -// ??? sub_807E22C(???); -// ??? sub_807E28C(???); -// ??? sub_807E334(???); -// ??? sub_807E34C(???); -// ??? sub_807E390(???); -// ??? sub_807E404(???); -// ??? sub_807E448(???); + +/* Unused mapanim effect? */ +void sub_807D7D8(struct Unit * unit); +void sub_807D818(struct MAEffectProc * proc); + +/* This is just the same as MAEffectProc */ +struct ProcMapAnimator { + /* 00 */ PROC_HEADER; + /* 2C */ struct Unit * unit; + /* 30 */ u8 pad_30[0x40 - 0x30]; + /* 40 */ u16 ca; + /* 42 */ u16 cb; + /* 44 */ u8 pad_44[0x50 - 0x44]; + /* 50 */ void const * img; + /* 54 */ void const * pal; + /* 58 */ u16 song; +}; + +void NewMapAnimEffectAnimator(struct Unit * unit, void const * img, void const * pal, u16 song); +void MapAnimEffectAnimator_Init(struct ProcMapAnimator * proc); +void MapAnimEffectAnimator_Loop1(struct ProcMapAnimator * proc); +void MapAnimEffectAnimator_Loop2(struct ProcMapAnimator * proc); +void MapSpellAnim_CommonEnd(ProcPtr proc); +void MapSpellAnim_EndWithHBlank(ProcPtr proc); +void StartWarpFlashy(struct Unit * unit, int x, int y); +void WarpFlashy_Init(struct MAEffectProc * proc); +void WarpFlashy_Loop(struct MAEffectProc * proc); +void MapAnimTorchEffect(struct Unit * unit); +void MapAnimTorch_Init(struct MAEffectProc * proc); +void MapAnimTorch_Loop1(struct MAEffectProc * proc); +void MapAnimTorch_Loop2(struct MAEffectProc * proc); +void MapAnimTorch_ResetHBlank(struct MAEffectProc * proc); +void MapAnimBerserkEffect(struct Unit * unit); +void MapAnimBerserk_Loop(struct MAEffectProc * proc); +void MapAnimRepairEffect(struct Unit * unit); +void MapAnimRepair_Init(struct MAEffectProc * proc); +void MapAnimRepair_Init0(struct MAEffectProc * proc); +void MapAnimRepair_Loop1(struct MAEffectProc * proc); +void MapAnimRepair_Loop2(struct MAEffectProc * proc); +void MapAnimRepair_Loop3(struct MAEffectProc * proc); +void MapAnimRestoreEffect(struct Unit * unit); +void MapAnimRestore_Init(struct MAEffectProc * proc); +void MapAnimRestore_Loop(struct MAEffectProc * proc); +void MapAnimSleepEffect(struct Unit * unit); +void MapAnimSleep_Init(struct MAEffectProc * proc); +void MapAnimSleep_Anim1(struct MAEffectProc * proc); +void MapAnimSleep_Anim2(struct MAEffectProc * proc); +void MapAnimMonsterStoneEffect(struct Unit * unit); +void MapAnimMonsterStone_Init(struct MAEffectProc * proc); +void MapAnimMonsterStone_Loop1(struct MAEffectProc * proc); +void MapAnimMonsterStone_Resetfx(struct MAEffectProc * proc); + +/* Unused mapanim effect? */ +void StartMapAnimEffect_Unk_089A3DB4(struct Unit * unit); +void MapAnim_Init_807E390(struct MAEffectProc * proc); +void MapAnim_Loop1_807E404(struct MAEffectProc * proc); +void MapAnim_Loop2_807E448(struct MAEffectProc * proc); + void MapAnimCallSpellAssocSilencefx(struct Unit * unit); -// ??? sub_807E4D0(???); -// ??? sub_807E584(???); -// ??? sub_807E5F0(???); +void MapAnimSilence_InitGfx(struct MAEffectProc * proc); +void MapAnimSilence_InitScreenConf(struct MAEffectProc * proc); +void MapAnimSilence_Loop(struct MAEffectProc * proc); void MapAnimCallSpellAssocBarrierfx(struct Unit * unit); -// ??? sub_807E67C(???); -// ??? sub_807E6E0(???); -void sub_807E760(int, int); +void MapAnimBarrierfx_Init(struct MAEffectProc * proc); +void MapAnimBarrierfx_Loop(struct MAEffectProc * proc); +void MapAnimUnlockEffect(int, int); void HideUnitUnlockDoor(void); void UnhideUnit(void); -// ??? sub_807E7E0(???); -// ??? sub_807E8B0(???); -// ??? sub_807E934(???); +void MapAnimUnlock_Init(struct MAEffectProc * proc); +void MapAnimUnlock_Loop1(struct MAEffectProc * proc); +void MapAnimUnlock_Loop2(struct MAEffectProc * proc); void SetDefaultMapAnimScreenConf(void); -// ??? sub_807EA20(???); -// ??? sub_807EA50(???); -// ??? sub_807EA60(???); + +struct ManimSomethingProc_08067498 +{ + /* 00 */ PROC_HEADER; + /* 29 */ STRUCT_PAD(0x29, 0x58); + /* 58 */ int bg; + /* 5C */ STRUCT_PAD(0x5C, 0x64); + /* 64 */ s16 x; + /* 66 */ s16 x_inc; + /* 68 */ s16 y; + /* 6A */ s16 y_inc; +}; + +void StartMapAnimEffect_Unk_089A3EC4(int bg, int x_inc, int y_inc, ProcPtr parent); +void sub_807EA50(void); +void sub_807EA60(struct ManimSomethingProc_08067498 * proc); void PutManimLevelUpFrame(int actor_id, int x, int y); void PutManimLevelUpStat(int actor_id, int x, int y, int stat_num, bool after_gain); int GetManimLevelUpStatGain(int actor_id, int stat_num); @@ -826,16 +866,16 @@ void MapAnimSpellAssocResetPal(ProcPtr proc); void sub_8081E60(ProcPtr proc); void InitScanline(); -// ??? sub_8081EAC(???); -// ??? sub_8081F24(???); -// ??? sub_8081F58(???); +void sub_8081EAC(void); +void UpdateMapAnimScanline(int x, int y, int arg3); +void MapAnimResetHBlank(void); void sub_8081F64(void); -// ??? sub_8081FA8(???); -// ??? sub_8081FFC(???); -// ??? sub_8082050(???); -// ??? sub_8082094(???); +void HBlank_MapAnimEffect_Unk_8081FA8(void); +void sub_8081FFC(void); +void sub_8082050(void); +void sub_8082094(void); void StartManimFrameGradientScanlineEffect(u16, u16, u16, u16); -// ??? sub_808218C(???); +void sub_808218C(int x, int y, int a, int b, const u8 * unk); // ??? PrepareSineWaveScanlineBuf(???); // ??? sub_8082268(???); // ??? sub_80822AC(???); @@ -845,7 +885,7 @@ void SwapScanlineBufs(void); void InitScanlineBuf(u16 *); void SetScanlineBufWinL(u16 * buf, int x, int y); void SetScanlineBufWinR(u16 * buf, int x, int y); -void sub_80823FC(u16 *, int, int, int); +void MapAnimScanlineCore(u16 *, int, int, int); void PrepareGradientScanlineBuf(u16 *, u16, u16, u16, u16); // ??? sub_80825B0(???); // ??? sub_80825B8(???); diff --git a/include/variables.h b/include/variables.h index ac866d90b..30caaf25c 100644 --- a/include/variables.h +++ b/include/variables.h @@ -270,10 +270,10 @@ extern u8 gTsa_StoneShatter_081C1CDC[]; extern const u8 gUnknown_08205714[4]; // extern ??? NigtMarefxConf -// extern ??? gUnknown_08205824 -// extern ??? gUnknown_08205833 -// extern ??? gUnknown_08205846 -// extern ??? gUnknown_08205855 +extern const u8 gUnknown_08205824[]; +extern const u8 gUnknown_08205833[]; +extern const u8 gUnknown_08205846[]; +extern const u8 gUnknown_08205855[]; extern const int gUnknown_08205884[]; extern const u8 gUnknown_0820588C[]; extern const u8 gUnknown_0820588E[]; diff --git a/ldscript.txt b/ldscript.txt index e395cef45..db79a865d 100644 --- a/ldscript.txt +++ b/ldscript.txt @@ -494,7 +494,6 @@ SECTIONS src/mapanim_eventbattle.o(.text); src/mapanim_specialeffect.o(.text); src/mapanim_staffeffect.o(.text); - asm/mapanim_807CDD0.o(.text); src/mapanim_lvupfx.o(.text); src/mapanim_lvup.o(.text); src/mapanim_spellassocfx.o(.text); @@ -1071,7 +1070,6 @@ SECTIONS . = ALIGN(4); src/mapanim_eventbattle.o(.data); . = ALIGN(4); src/mapanim_specialeffect.o(.data); . = ALIGN(4); src/mapanim_staffeffect.o(.data); - . = ALIGN(4); data/mapanim_89A398C.o(.data); . = ALIGN(4); src/mapanim_lvupfx.o(.data); . = ALIGN(4); src/mapanim_lvup.o(.data); . = ALIGN(4); src/mapanim_spellassocfx.o(.data); diff --git a/src/banim-efxmagic-healstaves.c b/src/banim-efxmagic-healstaves.c index 49b8f42e9..fbb0f0a5f 100644 --- a/src/banim-efxmagic-healstaves.c +++ b/src/banim-efxmagic-healstaves.c @@ -1789,7 +1789,7 @@ void StartSubSpell_efxRestBG(struct Anim * anim) proc->img = ImgArray_RestoreBg; - SpellFx_RegisterBgPal(gUnknown_0867B5A4, PLTT_SIZE_4BPP); + SpellFx_RegisterBgPal(Pal_MapAnimRestore, PLTT_SIZE_4BPP); SpellFx_SetSomeColorEffect(); return; diff --git a/src/eventfx-shinningstone.c b/src/eventfx-shinningstone.c index 3a3c5ecd6..bce76425f 100644 --- a/src/eventfx-shinningstone.c +++ b/src/eventfx-shinningstone.c @@ -35,8 +35,8 @@ void Eventfx_SetScreenConfig(void) void ShinningStonefx_InitGfx(struct ProcShinningStonefx * proc) { PlaySeSpacial(0x8D, proc->x); - Decompress(Img_089B06AC, OBJ_VRAM0 + 0x3800); - ApplyPalette(Pal_089B0700, 0x14); + Decompress(Img_MapAnimUnlockObjfx, OBJ_VRAM0 + 0x3800); + ApplyPalette(Pal_MapAnimUnlockObjfx, 0x14); proc->timer = 1; } diff --git a/src/hardware.c b/src/hardware.c index a99b3f401..dcfad6cf7 100644 --- a/src/hardware.c +++ b/src/hardware.c @@ -465,65 +465,64 @@ void sub_800154C(void* outTm, void const* inData, u8 base, u8 linebits) } } -void sub_800159C(u16 *a1, u16 *a2, s16 a3, s16 a4, u16 a5) // TODO: handle type of a1 +void AddAttr2dBitMap(u16 * _dst, u16 * _src, s16 ix, s16 iy, u16 chr) // TODO: handle type of a1 { u16 *dst; - s16 r4, r5; - s16 ip; - s16 sp04; - s16 sp08; - s16 sp0C; - - r4 = ((u8 *)a2)[0] + 1; - sp04 = ((u8 *)a2)[1]; - r5 = sp04 + 1; - ip = r4; - sp04 = r5; - ++a2; - sp0C = 0; - sp08 = 0; - - if (a3 + r4 > 0x20) - r4 = 0x20 - a3; - - if (a3 < 0) + s16 width, height; + s16 _width; + s16 _height; + s16 _ix, _iy; + + width = ((u8 *)_src)[0] + 1; + _height = ((u8 *)_src)[1]; + height = _height + 1; + _width = width; + _height = height; + ++_src; + _iy = 0; + _ix = 0; + + if (ix + width > 0x20) + width = 0x20 - ix; + + if (ix < 0) { - sp08 = -a3; - r4 -= sp08; - a3 = 0; + _ix = -ix; + width -= _ix; + ix = 0; } - if (r4 > 0) + if (width > 0) { int i, j; - if (a4 + r5 > 0x20) - r5 = 0x20 - a4; + if (iy + height > 0x20) + height = 0x20 - iy; - if (a4 < 0) + if (iy < 0) { - sp0C = -a4; - r5 -= sp0C; - a4 = 0; + _iy = -iy; + height -= _iy; + iy = 0; } - if (r5 > 0) + if (height > 0) { - a2 += ip * (sp04 - (sp0C + r5)); - dst = a1 + (a4 + r5 - 1) * 0x20 + a3; + _src += _width * (_height - (_iy + height)); + dst = _dst + (iy + height - 1) * 0x20 + ix; - for (i = r5 - 1; i >= 0; --i) + for (i = height - 1; i >= 0; --i) { - const u16 *src = a2 + sp08; + const u16 *src = _src + _ix; u16 *dst2 = dst; - for (j = 0; r4 > j; ++j) + for (j = 0; width > j; ++j) { - *dst2 = *src + a5; + *dst2 = *src + chr; ++src; ++dst2; } - a2 += ip; + _src += _width; dst -= 0x20; } } @@ -928,7 +927,7 @@ void SetBlendBackdropB(int a) void SetDefaultColorEffects(void) { - SetBlendConfig(0, 16, 0, 0); + SetBlendNone(); } void EnablePaletteSync(void) diff --git a/src/mapanim_eventcall.c b/src/mapanim_eventcall.c index ddd6f5726..e92609966 100644 --- a/src/mapanim_eventcall.c +++ b/src/mapanim_eventcall.c @@ -385,7 +385,7 @@ void sub_807F964(struct MAEffectProc * proc) MapAnimfxConf_089A40AC[proc->frame].tsa, gGenericBuffer); - sub_800159C( + AddAttr2dBitMap( gBG2TilemapBuffer, (u16 *)gGenericBuffer, 0, 0, @@ -416,7 +416,7 @@ void sub_807FAA0(struct MAEffectProc * proc) MapAnimfxConf_089A419C[proc->frame].tsa, gGenericBuffer); - sub_800159C( + AddAttr2dBitMap( gBG2TilemapBuffer, (u16 *)gGenericBuffer, 0, 0, @@ -597,7 +597,7 @@ void sub_807FE0C(struct MAEffectProc * proc) MapAnimfxConf_089A42BC[proc->frame].tsa, gGenericBuffer); - sub_800159C( + AddAttr2dBitMap( gBG2TilemapBuffer, (u16*) gGenericBuffer, 0, 0, @@ -611,7 +611,7 @@ void sub_807FE0C(struct MAEffectProc * proc) EnablePaletteSync(); } - proc->unk4A = proc->frame; + proc->frame_idx = proc->frame; proc->frame++; proc->timer = 4; @@ -626,7 +626,7 @@ void sub_807FE0C(struct MAEffectProc * proc) { int i, addedBrightness = proc->unk48 * 32 / 240; - const u16 * const in = MapAnimfxConf_089A42BC[proc->unk4A].pal; + const u16 * const in = MapAnimfxConf_089A42BC[proc->frame_idx].pal; u16 * const out = &gPaletteBuffer[0x10 * gUnknown_0820588C[proc->unk4C]]; for (i = 1; i < 16; ++i) @@ -727,7 +727,7 @@ void sub_8080138(struct MAEffectProc* proc) gUnknown_089A43D4[v0].tsa, gGenericBuffer); - sub_800159C( + AddAttr2dBitMap( gBG2TilemapBuffer, (u16*) gGenericBuffer, 0, 0, diff --git a/src/mapanim_scanline.c b/src/mapanim_scanline.c index bc806a0f4..278473a5e 100644 --- a/src/mapanim_scanline.c +++ b/src/mapanim_scanline.c @@ -37,19 +37,17 @@ void sub_8081EAC(void) } //! FE8U = 0x08081F24 -void sub_8081F24(int x, int y, int arg3) +void UpdateMapAnimScanline(int x, int y, int arg3) { InitScanlineBuf(gManimScanlineBufs[1]); - sub_80823FC(gManimScanlineBufs[1], x, y, arg3); + MapAnimScanlineCore(gManimScanlineBufs[1], x, y, arg3); SwapScanlineBufs(); - return; } //! FE8U = 0x08081F58 -void sub_8081F58(void) +void MapAnimResetHBlank(void) { SetPrimaryHBlankHandler(NULL); - return; } //! FE8U = 0x08081F64 @@ -73,7 +71,7 @@ void sub_8081F64(void) } //! FE8U = 0x08081FA8 -void sub_8081FA8(void) +void HBlank_MapAnimEffect_Unk_8081FA8(void) { u16 vcount = REG_VCOUNT; @@ -180,7 +178,7 @@ void StartManimFrameGradientScanlineEffect(u16 yTop, u16 yBottom, u16 colorArg3, } //! FE8U = 0x0808218C -void sub_808218C(int x, int y, int a, int b, u8 * unk) +void sub_808218C(int x, int y, int a, int b, const u8 * unk) { int var; @@ -359,7 +357,7 @@ void SetScanlineBufWinR(u16 * buf, int x, int y) } //! FE8U = 0x080823FC -void sub_80823FC(u16 * buf, int x, int y, int arg4) +void MapAnimScanlineCore(u16 * buf, int x, int y, int arg4) { int i; @@ -385,8 +383,6 @@ void sub_80823FC(u16 * buf, int x, int y, int arg4) var = var - 1; } } - - return; } //! FE8U = 0x080824C4 diff --git a/src/mapanim_specialeffect.c b/src/mapanim_specialeffect.c index ea160aee0..266a5079d 100644 --- a/src/mapanim_specialeffect.c +++ b/src/mapanim_specialeffect.c @@ -243,7 +243,7 @@ void MapAnim_GorgonHatch_Loop(struct MAEffectProc * proc) TsaLut_GorgonHatchCloud[proc->frame], gGenericBuffer); - sub_800159C( + AddAttr2dBitMap( gBG2TilemapBuffer, (void *)gGenericBuffer, proc->xDisplay / 8 - 8, diff --git a/src/mapanim_spellassoc.c b/src/mapanim_spellassoc.c index dc8069a26..61364eb9d 100644 --- a/src/mapanim_spellassoc.c +++ b/src/mapanim_spellassoc.c @@ -426,14 +426,14 @@ void SpellWarpStartFlashy(ProcPtr proc) gManimSt.ytarget = gBattleTarget.changePow; unit = gManimSt.actor[gManimSt.targetActorId].unit; - New6C_SomethingFlashy(unit, unit->xPos, unit->yPos); + StartWarpFlashy(unit, unit->xPos, unit->yPos); } void SpellWarpStartFlashyAtNewPos(ProcPtr proc) { struct Unit * unit; unit = gManimSt.actor[gManimSt.targetActorId].unit; - New6C_SomethingFlashy( + StartWarpFlashy( gManimSt.actor[gManimSt.targetActorId].unit, gManimSt.xtarget, gManimSt.ytarget @@ -442,37 +442,37 @@ void SpellWarpStartFlashyAtNewPos(ProcPtr proc) void MapAnimCallSpellAssocTorch(ProcPtr proc) { - sub_807DBA8(gManimSt.actor[gManimSt.subjectActorId].unit); + MapAnimTorchEffect(gManimSt.actor[gManimSt.subjectActorId].unit); } void MapAnimCallSpellAssocUnlock(ProcPtr proc) { - sub_807E760(gManimSt.xtarget, gManimSt.ytarget); + MapAnimUnlockEffect(gManimSt.xtarget, gManimSt.ytarget); } void MapAnimCallSpellAssocBerserk(ProcPtr proc) { - sub_807DD80(gManimSt.actor[gManimSt.targetActorId].unit); + MapAnimBerserkEffect(gManimSt.actor[gManimSt.targetActorId].unit); } void MapAnimCallSpellAssocRestore(ProcPtr proc) { - sub_807DFF4(gManimSt.actor[gManimSt.targetActorId].unit); + MapAnimRestoreEffect(gManimSt.actor[gManimSt.targetActorId].unit); } void MapAnimCallSpellAssocSleep(ProcPtr proc) { - sub_807E0D4(gManimSt.actor[gManimSt.targetActorId].unit); + MapAnimSleepEffect(gManimSt.actor[gManimSt.targetActorId].unit); } void MapAnimCallSpellAssocMonsterStone(ProcPtr proc) { - sub_807E1E4(gManimSt.actor[gManimSt.targetActorId].unit); + MapAnimMonsterStoneEffect(gManimSt.actor[gManimSt.targetActorId].unit); } void MapAnimCallSpellAssocRepair(ProcPtr proc) { - sub_807DE30(gManimSt.actor[gManimSt.targetActorId].unit); + MapAnimRepairEffect(gManimSt.actor[gManimSt.targetActorId].unit); } void SpellWarpStartFlashFade(ProcPtr proc) diff --git a/src/mapanim_staffeffect.c b/src/mapanim_staffeffect.c index 27d3a9de6..abcdc8f58 100644 --- a/src/mapanim_staffeffect.c +++ b/src/mapanim_staffeffect.c @@ -6,8 +6,16 @@ #include "bmbattle.h" #include "mapanim.h" #include "hardware.h" +#include "bmlib.h" #include "bmitem.h" +#include "bmmind.h" +#include "soundwrapper.h" +#include "ctc.h" +#include "ap.h" +#include "eventinfo.h" +#include "efxbattle.h" #include "constants/items.h" +#include "constants/video-global.h" /********************************************* ******************* Latona ****************** @@ -368,7 +376,7 @@ void NightMarefx_Loop(struct MAEffectProc * proc) { Decompress(TsaSet_NightMareMapAnimfx[NigtMarefxConf[proc->frame].tsa_idx], gGenericBuffer); - sub_800159C( + AddAttr2dBitMap( gBG2TilemapBuffer, (void *)gGenericBuffer, proc->xDisplay / 8 - 9, @@ -442,7 +450,1013 @@ void AntitoxinPureWaterfx_Init(struct MAEffectProc * proc) proc->frame = 0; } -CONST_DATA u8 gUnknown_089A3B6C[] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 0xFF +void AntitoxinPureWaterfx_Loop(struct MAEffectProc * proc) +{ + static u8 CONST_DATA lut[] = + { + 0, 1, 2, 3, + 4, 5, 6, 7, + 8, 9, 10, 11, + 12, 13, 14, 15, + 16, 17, 18, 19, + + UINT8_MAX, // end + }; + + sub_80146A0( + gBG2TilemapBuffer, + proc->xDisplay / 8 - 3, + proc->yDisplay / 8 - 3, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), + 6, 6, + gUnknown_089AF310, + lut[proc->frame / 2]); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + proc->frame++; + + if (lut[proc->frame / 2] == UINT8_MAX) + { + Proc_Break(proc); + } +} + +struct ProcCmd CONST_DATA ProcScr_089A3B84[] = { + PROC_SLEEP(1), + PROC_CALL(sub_807D818), + PROC_SLEEP(100), + PROC_END, +}; + +void sub_807D7D8(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_089A3B84, PROC_TREE_3); + + proc->xDisplay = SCREEN_TILE_X(unit->xPos) * 16 + 8; + proc->yDisplay = SCREEN_TILE_Y(unit->yPos) * 16 + 8; +} + +void sub_807D818(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x10F, proc->xDisplay); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimEffectAnimator[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimEffectAnimator_Init), + PROC_REPEAT(MapAnimEffectAnimator_Loop1), + PROC_SLEEP(30), + PROC_REPEAT(MapAnimEffectAnimator_Loop2), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void NewMapAnimEffectAnimator(struct Unit * unit, void const * img, void const * pal, u16 song) +{ + struct ProcMapAnimator * proc; + + proc = Proc_Start(ProcScr_MapAnimEffectAnimator, PROC_TREE_3); + + proc->unit = unit; + proc->img = img; + proc->pal = pal; + proc->song = song; +} + +void MapAnimEffectAnimator_Init(struct ProcMapAnimator * proc) +{ + gLCDControlBuffer.bg0cnt.priority = 0; + gLCDControlBuffer.bg1cnt.priority = 1; + gLCDControlBuffer.bg2cnt.priority = 1; + gLCDControlBuffer.bg3cnt.priority = 2; + + BG_SetPosition(BG_2, 0, 0); + + Decompress(proc->img, ((void *) VRAM) + GetBackgroundTileDataOffset(BG_2) + CHR_SIZE * BGCHR_MANIM_160); + + sub_8014560( + gBG2TilemapBuffer, + SCREEN_TILE_X(proc->unit->xPos) * 2 - 2, + SCREEN_TILE_Y(proc->unit->yPos) * 2 - 2, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), 6, 6); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + StartPaletteAnimatorNormal(proc->pal, BGPAL_MANIM_4 * 0x20, 0x20, 4, proc); + + proc->ca = 0; + proc->cb = 0x10; + + PlaySeSpacial(proc->song, (SCREEN_TILE_X(proc->unit->xPos) * 2 + 1) * 8); +} + +void MapAnimEffectAnimator_Loop1(struct ProcMapAnimator * proc) +{ + proc->ca++; + + if (proc->ca == 0x10) + { + Proc_Break(proc); + } + + proc->cb = 0x16 - proc->ca; + + if (proc->cb > 0x10) + proc->cb = 0x10; + + SetBlendAlpha(proc->ca, proc->cb); + + SetBlendTargetA(0, 0, 1, 0, 0); SetBlendBackdropA(0); + SetBlendTargetB(0, 0, 0, 1, 1); SetBlendBackdropB(1); +} + +void MapAnimEffectAnimator_Loop2(struct ProcMapAnimator * proc) +{ + proc->ca--; + + if (proc->ca == 0) + { + Proc_Break(proc); + } + + proc->cb = 0x16 - proc->ca; + + if (proc->cb > 0x10) + proc->cb = 0x10; + + SetBlendAlpha(proc->ca, proc->cb); + + SetBlendTargetA(0, 0, 1, 0, 0); SetBlendBackdropA(0); + SetBlendTargetB(0, 0, 0, 1, 1); SetBlendBackdropB(1); +} + +void MapSpellAnim_CommonEnd(ProcPtr proc) +{ + DeleteAllPaletteAnimator(); + + BG_Fill(gBG2TilemapBuffer, 0); + BG_EnableSyncByMask(BG2_SYNC_BIT); + + SetDefaultColorEffects(); + SetWinEnable(0, 0, 0); +} + +void MapSpellAnim_EndWithHBlank(ProcPtr proc) +{ + SetPrimaryHBlankHandler(NULL); + + DeleteAllPaletteAnimator(); + + BG_Fill(gBG2TilemapBuffer, 0); + BG_EnableSyncByMask(BG2_SYNC_BIT); + + SetDefaultColorEffects(); + SetWinEnable(0, 0, 0); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimWarpFlashy[] = { + PROC_SLEEP(1), + PROC_CALL(WarpFlashy_Init), + PROC_REPEAT(WarpFlashy_Loop), + PROC_SLEEP(1), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void StartWarpFlashy(struct Unit * unit, int arg_04, int arg_08) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimWarpFlashy, PROC_TREE_3); + + proc->unit = unit; + proc->xDisplay = SCREEN_TILE_X(unit->xPos) * 2; + proc->yDisplay = SCREEN_TILE_Y(unit->yPos) * 2; +} + +void WarpFlashy_Init(struct MAEffectProc * proc) +{ + BG_SetPosition(BG_2, 0, 0); + + Decompress(gUnknown_089AE224, ((void *) VRAM) + GetBackgroundTileDataOffset(2) + CHR_SIZE * BGCHR_MANIM_160); + ApplyPalette(gUnknown_089AE484, BGPAL_MANIM_4); + + LoadSparkGfx(); + + proc->frame = 0; +} + +void WarpFlashy_Loop(struct MAEffectProc * proc) +{ + static CONST_DATA u8 lut[] = + { + 0, 1, 2, 3, + 3, 3, 3, 3, + 3, 3, 3, 3, + 3, 3, 3, 4, + 5, 6, 7, 8, + 9, + UINT8_MAX, // end + }; + + sub_80146A0( + gBG2TilemapBuffer, + proc->xDisplay - 1, + proc->yDisplay - 3, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), + 4, 6, + gUnknown_089AE4A4, lut[proc->frame / 2]); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + proc->frame++; + + if (lut[proc->frame / 2] == UINT8_MAX) + { + Proc_Break(proc); + } + + SetDefaultMapAnimScreenConf(); + SetBlendAlpha(12, 12); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimTorch[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimTorch_Init), + PROC_SLEEP(30), + PROC_REPEAT(MapAnimTorch_Loop1), + PROC_REPEAT(MapAnimTorch_Loop2), + PROC_SLEEP(1), + PROC_CALL(MapAnimTorch_ResetHBlank), + PROC_CALL(MapSpellAnim_EndWithHBlank), + PROC_END, +}; + +void MapAnimTorchEffect(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimTorch, PROC_TREE_3); + + proc->unit = unit; + proc->xDisplay = SCREEN_TILE_IX(gActionData.xOther); + proc->yDisplay = SCREEN_TILE_IY(gActionData.yOther); +} + +void MapAnimTorch_Init(struct MAEffectProc * proc) +{ + PlaySoundEffect(0xB3); + + Decompress(Img_MapAnimTorchfx, ((void *) VRAM) + 0x10000 + OBCHR_MANIM_1C0 * CHR_SIZE); + ApplyPalette(Pal_MapAnimTorchfx, 0x10 + OBJPAL_MANIM_4); + + SetWhitePal(BGPAL_MANIM_4); + sub_8014930( + ((void *) VRAM) + GetBackgroundTileDataOffset(BG_2) + BGCHR_MANIM_160 * CHR_SIZE, + CHR_SIZE / sizeof(u16), + 0xFFFF); + + sub_8014930( + gBG2TilemapBuffer, + ARRAY_COUNT(gBG2TilemapBuffer), + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4)); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + proc->frame = 0; + proc->timer = 0; + + if ((proc->xDisplay + 4) >= 0) + { + APProc_Create( + ApConf_MapAnimTorchfx, + proc->xDisplay + 4, + proc->yDisplay, + OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 0, 2); + } + InitScanline(); + sub_8081EAC(); + SetDefaultMapAnimScreenConf(); + + SetBlendAlpha(0, 0x10); +} + +void MapAnimTorch_Loop1(struct MAEffectProc * proc) +{ + int ret, ca; + + ret = Interpolate(INTERPOLATE_RCUBIC, 1, 160, proc->frame, 80); + UpdateMapAnimScanline(proc->xDisplay + 8, proc->yDisplay + 8, ret); + + proc->frame++; + + ca = (proc->frame * 0x10) / 40; + + if (ca >= 0x10) + ca = 0x10; + + SetBlendAlpha(ca, 0x10); + + if (proc->frame >= 40) + { + Proc_Break(proc); + APProc_DeleteAll(); + } +} + +void MapAnimTorch_Loop2(struct MAEffectProc * proc) +{ + int ret, ca; + + ret = Interpolate(INTERPOLATE_RCUBIC, 1, 160, proc->frame, 80); + UpdateMapAnimScanline(proc->xDisplay + 8, proc->yDisplay + 8, ret); + + proc->frame++; + + ca = 0x10 - ((proc->frame - 40) * 0x10) / 30; + + if (ca <= 0) + ca = 0; + + SetBlendAlpha(ca, 0x10); + + if (proc->frame >= 70) + { + Proc_Break(proc); + } +} + +void MapAnimTorch_ResetHBlank(struct MAEffectProc * proc) +{ + MapAnimResetHBlank(); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimBerserk[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimBerserk_Loop), + PROC_SLEEP(120), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void MapAnimBerserkEffect(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimBerserk, PROC_TREE_3); + + proc->unit = unit; + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos) * 2 + 1) * 8; +} + +void MapAnimBerserk_Loop(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x87, proc->xDisplay); + BG_SetPosition(BG_2, 0, 0); + SetDefaultMapAnimScreenConf(); + Decompress(Img_MapAnimBerserkfx, ((void *) VRAM) + 0x10000 + CHR_SIZE * OBCHR_MANIM_1C0); + ApplyPalette(Pal_MapAnimBerserkfx, 0x10 + OBJPAL_MANIM_4); + APProc_Create( + ApConf_MapAnimBerserkfx, + proc->xDisplay, + proc->yDisplay, + OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), + 0, 2); + + proc->unk48 = 1; +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimRepair[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimRepair_Init0), + PROC_CALL(MapAnimRepair_Init), + PROC_REPEAT(MapAnimRepair_Loop1), + PROC_REPEAT(MapAnimRepair_Loop2), + PROC_REPEAT(MapAnimRepair_Loop3), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void MapAnimRepairEffect(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimRepair, PROC_TREE_3); + + proc->xDisplay = SCREEN_TILE_X(unit->xPos) * 0x10 + 8; + proc->yDisplay = SCREEN_TILE_Y(unit->yPos) * 0x10 + 8; +} + +void MapAnimRepair_Init(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x86, proc->xDisplay); +} + +void MapAnimRepair_Init0(struct MAEffectProc * proc) +{ + BG_SetPosition(BG_2, 0, 0); + SetDefaultMapAnimScreenConf(); + SetBlendAlpha(0x10, 0x10); + Decompress(Img_MapAnimRepairfx, ((void *) VRAM) + GetBackgroundTileDataOffset(BG_2) + CHR_SIZE * BGCHR_MANIM_160); + ApplyPalette(Pal_HammerneBg, BGPAL_MANIM_4); + proc->unk48 = 0; + proc->frame_idx = 0; +} + +void MapAnimRepair_Loop1(struct MAEffectProc * proc) +{ + static u8 const unk_param_list[] = + { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + UINT8_MAX, // end + }; + + sub_801474C( + gBG2TilemapBuffer, + proc->xDisplay / 8 - 2, proc->yDisplay / 8 - 9, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), + 4, 11, Tsa_089B17A4, + unk_param_list[proc->unk48++]); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + if (unk_param_list[proc->unk48] == UINT8_MAX) + Proc_Break(proc); +} + +void MapAnimRepair_Loop2(struct MAEffectProc * proc) +{ + u8 blend_coef_list[] = + { + 16, 14, 12, 10, 8, 10, 12, 14, 16, + 16, 14, 12, 10, 8, 10, 12, 14, 16, + UINT8_MAX, // end + }; + + SetBlendAlpha(blend_coef_list[proc->frame_idx++], 0x10); + + if (blend_coef_list[proc->frame_idx] == UINT8_MAX) + { + proc->frame_idx = 0; + Proc_Break(proc); + } +} + +void MapAnimRepair_Loop3(struct MAEffectProc * proc) +{ + enum { DURATION = 30 }; + + SetBlendAlpha( + Interpolate(INTERPOLATE_LINEAR, 0x10, 0, proc->frame_idx++, DURATION), 0x10); + + if (proc->frame_idx > DURATION) + { + Proc_Break(proc); + } +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimRestore[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimRepair_Init0), + PROC_CALL(MapAnimRestore_Init), + PROC_REPEAT(MapAnimRestore_Loop), + PROC_REPEAT(MapAnimRepair_Loop2), + PROC_REPEAT(MapAnimRepair_Loop3), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, }; + +void MapAnimRestoreEffect(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimRestore, PROC_TREE_3); + + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos) * 2 + 1) * 8; +} + +void MapAnimRestore_Init(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x82, proc->xDisplay); + ApplyPalette(Pal_MapAnimRestore, BGPAL_MANIM_4); +} + +void MapAnimRestore_Loop(struct MAEffectProc * proc) +{ + // same as func_fe6_080663E0 except gUnk_082E07A8 -> gUnk_082DF868 + + static u8 const unk_param_list[] = + { + 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + UINT8_MAX, // end + }; + + sub_801474C( + gBG2TilemapBuffer, + proc->xDisplay / 8 - 2, proc->yDisplay / 8 - 9, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), + 4, 11, Tsa_089B0864, + unk_param_list[proc->unk48++]); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + if (unk_param_list[proc->unk48] == UINT8_MAX) + Proc_Break(proc); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimSleep[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimSleep_Init), + PROC_SLEEP(50), + PROC_CALL(MapAnimSleep_Anim1), + PROC_SLEEP(50), + PROC_CALL(MapAnimSleep_Anim2), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void MapAnimSleepEffect(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimSleep, PROC_TREE_3); + + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos) * 2 + 1) * 8; +} + +void MapAnimSleep_Init(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x85, proc->xDisplay); + + BG_SetPosition(BG_2, 0, 0); + SetDefaultMapAnimScreenConf(); + + Decompress(Img_SleepSprites, OBJ_VRAM0 + OBCHR_MANIM_1C0 * CHR_SIZE); + ApplyPalette(Pal_SleepSprites, 0x10 + OBJPAL_MANIM_4); + + APProc_Create( + ApConf_MapAnimSleep, + proc->xDisplay, + proc->yDisplay - 16, + OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 0, 2); +} + +void MapAnimSleep_Anim1(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x85, proc->xDisplay); + APProc_Create( + ApConf_MapAnimSleep, + proc->xDisplay, + proc->yDisplay - 8, + OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 0, 2); +} + +void MapAnimSleep_Anim2(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x85, proc->xDisplay); + APProc_Create( + ApConf_MapAnimSleep, + proc->xDisplay, + proc->yDisplay, + OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 0, 2); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimMonsterStone[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimMonsterStone_Init), + PROC_REPEAT(MapAnimMonsterStone_Loop1), + PROC_CALL(MapAnimMonsterStone_Resetfx), + PROC_SLEEP(60), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void MapAnimMonsterStoneEffect(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimMonsterStone, PROC_TREE_3); + + proc->unit = unit; + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos) * 2 + 1) * 8; +} + +void MapAnimMonsterStone_Init(struct MAEffectProc * proc) +{ + SetDefaultMapAnimScreenConf(); + BG_SetPosition(2, 0, 0); + + Decompress( + Img_MonsterStoneMapAnimfx, + (void*)(VRAM) + GetBackgroundTileDataOffset(BG_2) + BGCHR_MANIM_160 * CHR_SIZE); + + ApplyPalette( + Pal_MonsterStoneMapAnimfx, + BGPAL_MANIM_4); + + SetBlendAlpha(0x10, 0x10); + + proc->frame = 0; + proc->timer = 0; + + EnablePaletteSync(); +} + +CONST_DATA void * TsaSet_MonsterStoneMapAnimfx[] = { + Tsa1_MonsterStoneMapAnimfx, + Tsa2_MonsterStoneMapAnimfx, + Tsa3_MonsterStoneMapAnimfx, + Tsa4_MonsterStoneMapAnimfx, + Tsa5_MonsterStoneMapAnimfx, + Tsa6_MonsterStoneMapAnimfx, + Tsa7_MonsterStoneMapAnimfx, + Tsa8_MonsterStoneMapAnimfx, + Tsa9_MonsterStoneMapAnimfx, + Tsa10_MonsterStoneMapAnimfx +}; + +void MapAnimMonsterStone_Loop1(struct MAEffectProc * proc) +{ + if (proc->timer == 0) + { + if (proc->frame == 0) + PlaySeSpacial(0x3BA, proc->xDisplay); + else if (proc->frame > 9) + { + Proc_Break(proc); + } + + Decompress(TsaSet_MonsterStoneMapAnimfx[proc->frame], gGenericBuffer); + + AddAttr2dBitMap( + gBG2TilemapBuffer, + (void *)gGenericBuffer, + proc->xDisplay / 8 - 4, + proc->yDisplay / 8 - 4, + TILEREF(BM_BGCHR_BANIM_UNK160, BM_BGPAL_BANIM_UNK4)); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + proc->frame++; + proc->timer = 4; + } + proc->timer--; +} + +void MapAnimMonsterStone_Resetfx(struct MAEffectProc * proc) +{ + BG_Fill(gBG2TilemapBuffer, 0); + BG_EnableSyncByMask(BG2_SYNC_BIT); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimEffect_Unk_089A3DB4[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnim_Init_807E390), + PROC_SLEEP(10), + PROC_REPEAT(MapAnim_Loop1_807E404), + PROC_SLEEP(60), + PROC_REPEAT(MapAnim_Loop2_807E448), + PROC_SLEEP(1), + PROC_CALL(MapSpellAnim_EndWithHBlank), + PROC_END, +}; + +void StartMapAnimEffect_Unk_089A3DB4(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimEffect_Unk_089A3DB4, PROC_TREE_3); + + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos)) * 16 + 18; +} + +void MapAnim_Init_807E390(struct MAEffectProc * proc) +{ + PlaySeSpacial(0xFD, proc->xDisplay); + + InitScanline(); + sub_8081EAC(); + SetPrimaryHBlankHandler(HBlank_MapAnimEffect_Unk_8081FA8); + SetDefaultMapAnimScreenConf(); + SetBlendAlpha(0x10, 0x10); + + CallARM_FillTileRect(gBG2TilemapBuffer, gGenericBuffer, TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4)); + BG_EnableSyncByMask(BG2_SYNC_BIT); + + StartMapAnimEffect_Unk_089A3EC4(2, 0, 1, proc); + Proc_Start(ProcScr_ManimShiftingSineWaveScanlineBuf, proc); + + proc->unk48 = 0; + proc->frame_idx = 0; +} + +u8 CONST_DATA gUnknown_089A3DFC[] = +{ + 4, 6, 7, 8, 8, 9, + UINT8_MAX, // end +}; + +void MapAnim_Loop1_807E404(struct MAEffectProc * proc) +{ + if (proc->unk48 >= 12) + { + proc->unk48--; + Proc_Break(proc); + } + + sub_808218C(proc->xDisplay, proc->yDisplay, ++proc->unk48, 12, gUnknown_089A3DFC); +} + +void MapAnim_Loop2_807E448(struct MAEffectProc * proc) +{ + if (proc->unk48 <= 0) + { + proc->unk48++; + Proc_Break(proc); + } + + sub_808218C(proc->xDisplay, proc->yDisplay, --proc->unk48, 12, gUnknown_089A3DFC); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimSilencefx[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimSilence_InitGfx), + PROC_SLEEP(50), + PROC_CALL(MapAnimSilence_InitScreenConf), + PROC_SLEEP(40), + PROC_REPEAT(MapAnimSilence_Loop), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void MapAnimCallSpellAssocSilencefx(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimSilencefx, PROC_TREE_3); + + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos) * 2 + 1) * 8; +} + +void MapAnimSilence_InitGfx(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x83, proc->xDisplay); + + BG_SetPosition(BG_2, 0, 0); + SetDefaultMapAnimScreenConf(); + + Decompress(Img_ManimSilenceBgfx, ((void *) VRAM) + GetBackgroundTileDataOffset(BG_2) + CHR_SIZE * BGCHR_MANIM_160); + Decompress(Img_ManimSilenceObjfx, OBJ_VRAM0 + CHR_SIZE * OBCHR_MANIM_1C0); + ApplyPalette(Pal_ManimSilencefx, BGPAL_MANIM_4); + ApplyPalette(Pal_ManimSilencefx, 0x10 + OBJPAL_MANIM_4); + + APProc_Create( + ApConf_ManimSilencefx, + proc->xDisplay, proc->yDisplay | OAM0_BLEND, + OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 0, 2); + + proc->unk48 = 0; + + SetBlendTargetA(0, 0, 0, 0, 1); + SetBlendBackdropA(0); + SetBlendConfig(BLEND_EFFECT_NONE, 0x10, 0x10, 0); +} + +void MapAnimSilence_InitScreenConf(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x84, proc->xDisplay); + + sub_8014560( + gBG2TilemapBuffer, + proc->xDisplay / 8 - 2, + proc->yDisplay / 8 - 2, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), 4, 4); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + SetBlendTargetA(0, 0, 1, 0, 0); + SetBlendBackdropA(0); + SetBlendAlpha(0x10, 0x10); +} + +void MapAnimSilence_Loop(struct MAEffectProc * proc) +{ + SetBlendAlpha(Interpolate(INTERPOLATE_LINEAR, 0x10, 0, proc->unk48++, 30), 0x10); + + if (proc->unk48 >= 30) + Proc_Break(proc); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimBarrierfx[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimBarrierfx_Init), + PROC_REPEAT(MapAnimBarrierfx_Loop), + PROC_CALL(MapSpellAnim_CommonEnd), + PROC_END, +}; + +void MapAnimCallSpellAssocBarrierfx(struct Unit * unit) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimBarrierfx, PROC_TREE_3); + + proc->xDisplay = (SCREEN_TILE_X(unit->xPos) * 2 + 1) * 8; + proc->yDisplay = (SCREEN_TILE_Y(unit->yPos) * 2 + 1) * 8; +} + +void MapAnimBarrierfx_Init(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x88, proc->xDisplay); + + BG_SetPosition(BG_2, 0, 0); + SetDefaultMapAnimScreenConf(); + + SetBlendAlpha(0x10, 0x10); + + Decompress(Img_ManimBarrierBgfx, ((void *) VRAM) + GetBackgroundTileDataOffset(BG_2) + CHR_SIZE * BGCHR_MANIM_160); + ApplyPalette(Pal_BarrierBg, BGPAL_MANIM_4); + + proc->unk48 = 0; + proc->frame_idx = 0; +} + +void MapAnimBarrierfx_Loop(struct MAEffectProc * proc) +{ + static u8 const unk_param_list[] = + { + 0, 0, 1, 1, 2, 2, 3, 3, + 4, 4, 3, 3, 4, 4, 3, 3, + 4, 4, 3, 3, 4, 4, 3, 3, + 4, 4, 3, 3, 4, 4, 3, 3, + 4, 4, 3, 3, 4, 4, 3, 3, + 2, 2, 1, 1, 0, 0, + UINT8_MAX, // end + }; + + sub_801474C( + gBG2TilemapBuffer, + proc->xDisplay / 8 - 2, proc->yDisplay / 8 - 8, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), + 4, 10, Tsa_089B343C, + unk_param_list[proc->unk48++]); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + if (unk_param_list[proc->unk48] == UINT8_MAX) + Proc_Break(proc); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimUnlock[] = { + PROC_SLEEP(1), + PROC_CALL(MapAnimUnlock_Init), + PROC_REPEAT(MapAnimUnlock_Loop1), + PROC_SLEEP(80), + PROC_REPEAT(MapAnimUnlock_Loop2), + PROC_SLEEP(1), + PROC_CALL(MapSpellAnim_EndWithHBlank), + PROC_CALL(HideUnitUnlockDoor), + PROC_SLEEP(4), + PROC_CALL(UnhideUnit), + PROC_END, +}; + +void MapAnimUnlockEffect(int x, int y) +{ + struct MAEffectProc * proc; + + proc = Proc_Start(ProcScr_MapAnimUnlock, PROC_TREE_3); + + proc->xDisplay = SCREEN_TILE_X(x) * 2 * 8 + 8; + proc->yDisplay = SCREEN_TILE_Y(y) * 2 * 8 + 8; +} + +void HideUnitUnlockDoor(void) +{ + GetUnit(gActionData.subjectIndex)->state |= US_HIDDEN; + StartAvailableDoorTileEvent(gActionData.xOther, gActionData.yOther); +} + +void UnhideUnit(void) +{ + GetUnit(gActionData.subjectIndex)->state &= ~US_HIDDEN; +} + +void MapAnimUnlock_Init(struct MAEffectProc * proc) +{ + PlaySeSpacial(0x8D, proc->xDisplay); + + BG_SetPosition(BG_2, 0, 0); + Decompress(Img_MapAnimUnlockBgfx, ((void *) VRAM) + GetBackgroundTileDataOffset(BG_2) + CHR_SIZE * BGCHR_MANIM_160); + + sub_801474C( + gBG2TilemapBuffer, + proc->xDisplay / 8 - 2, proc->yDisplay / 8 - 2, + TILEREF(BGCHR_MANIM_160, BGPAL_MANIM_4), + 4, 4, Tsa_MapAnimUnlockBgfx, 0); + + BG_EnableSyncByMask(BG2_SYNC_BIT); + + Decompress(Img_MapAnimUnlockObjfx, ((void *) VRAM) + 0x10000 + CHR_SIZE * OBCHR_MANIM_1C0); + ApplyPalette(Pal_MapAnimUnlockObjfx, 0x10 + OBJPAL_MANIM_4); + + StartPaletteAnimatorReverse(Pal_MapAnimUnlockObjfx_Unk, 0x20 * BGPAL_MANIM_4, 0x20, 4, proc); + + InitScanline(); + sub_8081EAC(); + SetDefaultMapAnimScreenConf(); + + SetBlendAlpha(0x10, 0x10); + + proc->unk48 = 1; +} + +void MapAnimUnlock_Loop1(struct MAEffectProc * proc) +{ + int ret = Interpolate(INTERPOLATE_RCUBIC, 1, 0x10, proc->unk48, 30); + + proc->unk48++; + + UpdateMapAnimScanline(proc->xDisplay, proc->yDisplay, ret); + + if (proc->unk48 >= 30) + { + proc->unk48 = 0; + + Proc_Break(proc); + + APProc_Create(ApConf_089A6254, proc->xDisplay, proc->yDisplay, OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 0, 2); + APProc_Create(ApConf_089A6254, proc->xDisplay, proc->yDisplay, OAM2_CHR(OBCHR_MANIM_1C0) + OAM2_PAL(OBJPAL_MANIM_4), 1, 2); + } +} + +void MapAnimUnlock_Loop2(struct MAEffectProc * proc) +{ + int ret = Interpolate(INTERPOLATE_RCUBIC, 0x10, 0, proc->unk48, 30); + + proc->unk48++; + + UpdateMapAnimScanline(proc->xDisplay, proc->yDisplay, ret); + + if (proc->unk48 >= 30) + Proc_Break(proc); +} + +void SetDefaultMapAnimScreenConf(void) +{ + // TODO: macro? + gLCDControlBuffer.bg0cnt.priority = 0; + gLCDControlBuffer.bg1cnt.priority = 0; + gLCDControlBuffer.bg2cnt.priority = 0; + gLCDControlBuffer.bg3cnt.priority = 2; + + SetBlendTargetA(0, 0, 1, 0, 0); SetBlendBackdropA(0); + SetBlendTargetB(0, 0, 0, 1, 1); SetBlendBackdropB(1); + + gLCDControlBuffer.wincnt.win0_enableBlend = 1; + gLCDControlBuffer.wincnt.wout_enableBlend = 0; + + SetWin0Layers(1, 1, 1, 1, 1); + SetWOutLayers(1, 1, 0, 1, 1); +} + +struct ProcCmd CONST_DATA ProcScr_MapAnimEffect_Unk_089A3EC4[] = { + PROC_REPEAT(sub_807EA60), + PROC_END, +}; + +void StartMapAnimEffect_Unk_089A3EC4(int bg, int x_inc, int y_inc, ProcPtr parent) +{ + struct ManimSomethingProc_08067498 * proc; + + proc = Proc_Start(ProcScr_MapAnimEffect_Unk_089A3EC4, parent); + + proc->bg = bg; + + proc->x = 0; + proc->x_inc = x_inc; + proc->y = 0; + proc->y_inc = y_inc; +} + +void sub_807EA50(void) +{ + Proc_EndEach(ProcScr_MapAnimEffect_Unk_089A3EC4); +} + +void sub_807EA60(struct ManimSomethingProc_08067498 * proc) +{ + BG_SetPosition(proc->bg, proc->x, proc->y); + + proc->x += proc->x_inc; + proc->y += proc->y_inc; +}