ref: 2a2222476ae509aaebd7851abd49172cf6e854d4
parent: 41618f9e98b9aa04cedaf4b357531fd7fbf15deb
author: PikalaxALT <PikalaxALT@gmail.com>
date: Thu Dec 24 09:07:33 EST 2015
Split up anim objects into several files
--- a/battle/anim_objects.asm
+++ b/battle/anim_objects.asm
@@ -1,649 +1,9 @@
; Objects used in battle animations.
-QueueBattleAnimation: ; cc9a1 (33:49a1)
- ld hl, ActiveAnimObjects
- ld e, 10
-.loop
- ld a, [hl]
- and a
- jr z, .done
- ld bc, BATTLEANIMSTRUCT_LENGTH
- add hl, bc
- dec e
- jr nz, .loop
- scf
- ret
-
-.done
- ld c, l
- ld b, h
- ld hl, wNumActiveBattleAnims
- inc [hl]
- call InitBattleAnimation
- ret
-
-DeinitBattleAnimation: ; cc9bd
- ld hl, BATTLEANIMSTRUCT_INDEX
- add hl, bc
- ld [hl], $0
- ret
-
-; cc9c4
-
-InitBattleAnimation: ; cc9c4 (33:49c4)
- ld a, [wBattleAnimTemp0]
- ld e, a
- ld d, 0
- ld hl, BattleAnimObjects
-rept 6
- add hl, de
-endr
- ld e, l
- ld d, h
- ld hl, BATTLEANIMSTRUCT_INDEX
- add hl, bc
- ld a, [wNumActiveBattleAnims]
- ld [hli], a ; Index
- ld a, [de]
- inc de
- ld [hli], a ; 01
- ld a, [de]
- inc de
- ld [hli], a ; 02
- ld a, [de]
- inc de
- ld [hli], a ; Frameset ID
- ld a, [de]
- inc de
- ld [hli], a ; Function
- ld a, [de]
- inc de
- ld [hli], a ; 05
- ld a, [de]
- call GetBattleAnimTileOffset
- ld [hli], a ; Tile ID
- ld a, [wBattleAnimTemp1]
- ld [hli], a ; X Coord
- ld a, [wBattleAnimTemp2]
- ld [hli], a ; Y Coord
- xor a
- ld [hli], a ; X Offset
- ld [hli], a ; Y Offset
- ld a, [wBattleAnimTemp3]
- ld [hli], a ; 0b
- xor a
- ld [hli], a ; 0c
- dec a
- ld [hli], a ; 0d
- xor a
- ld [hli], a ; 0e
- ld [hli], a ; 0f
- ld [hl], a ; 10
- ret
-
-BattleAnimOAMUpdate: ; cca09
- call InitBattleAnimBuffer
- call GetBattleAnimFrame
- cp -3
- jp z, .done
- cp -4
- jp z, .delete
- push af
- ld hl, wBattleAnimTempOAMFlags
- ld a, [wBattleAnimTemp7]
- xor [hl]
- and $e0
- ld [hl], a
- pop af
- push bc
- call GetBattleAnimOAMPointer
- ld a, [wBattleAnimTempTileID]
- add [hl]
- ld [wBattleAnimTempTileID], a
- inc hl
- ld a, [hli]
- ld c, a
- ld a, [hli]
- ld h, [hl]
- ld l, a
- ld a, [wBattleAnimOAMPointerLo]
- ld e, a
- ld d, Sprites / $100
-.loop
- ld a, [wBattleAnimTempYCoord]
- ld b, a
- ld a, [wBattleAnimTempYOffset]
- add b
- ld b, a
- push hl
- ld a, [hl]
- ld hl, wBattleAnimTempOAMFlags
- bit 6, [hl]
- jr z, .no_yflip
- add $8
- xor $ff
- inc a
-
-.no_yflip
- pop hl
- add b
- ld [de], a
- inc hl
- inc de
- ld a, [wBattleAnimTempXCoord]
- ld b, a
- ld a, [wBattleAnimTempXOffset]
- add b
- ld b, a
- push hl
- ld a, [hl]
- ld hl, wBattleAnimTempOAMFlags
- bit 5, [hl]
- jr z, .no_xflip
- add $8
- xor $ff
- inc a
-
-.no_xflip
- pop hl
- add b
- ld [de], a
- inc hl
- inc de
- ld a, [wBattleAnimTempTileID]
- add $31
- add [hl]
- ld [de], a
- inc hl
- inc de
- ld a, [wBattleAnimTempOAMFlags]
- ld b, a
- ld a, [hl]
- xor b
- and $e0
- ld b, a
- ld a, [hl]
- and $10
- or b
- ld b, a
- ld a, [wBattleAnimTempPalette]
- and $f
- or b
- ld [de], a
- inc hl
- inc de
- ld a, e
- ld [wBattleAnimOAMPointerLo], a
- cp $a0
- jr nc, .exit_set_carry
- dec c
- jr nz, .loop
- pop bc
- jr .done
-
-.delete
- call DeinitBattleAnimation
-
-.done
- and a
- ret
-
-.exit_set_carry
- pop bc
- scf
- ret
-
-; ccaaa
-
-InitBattleAnimBuffer: ; ccaaa
- ld hl, BATTLEANIMSTRUCT_01
- add hl, bc
- ld a, [hl]
- and %10000000
- ld [wBattleAnimTempOAMFlags], a
- xor a
- ld [wBattleAnimTemp7], a
- ld hl, BATTLEANIMSTRUCT_PALETTE
- add hl, bc
- ld a, [hl]
- ld [wBattleAnimTempPalette], a
- ld hl, BATTLEANIMSTRUCT_02
- add hl, bc
- ld a, [hl]
- ld [wBattleAnimTemp1], a
- ld hl, BATTLEANIMSTRUCT_TILEID
- add hl, bc
- ld a, [hli]
- ld [wBattleAnimTempTileID], a
- ld a, [hli]
- ld [wBattleAnimTempXCoord], a
- ld a, [hli]
- ld [wBattleAnimTempYCoord], a
- ld a, [hli]
- ld [wBattleAnimTempXOffset], a
- ld a, [hli]
- ld [wBattleAnimTempYOffset], a
- ld a, [hBattleTurn]
- and a
- ret z
- ld hl, BATTLEANIMSTRUCT_01
- add hl, bc
- ld a, [hl]
- ld [wBattleAnimTempOAMFlags], a
- bit 0, [hl]
- ret z
- ld hl, BATTLEANIMSTRUCT_XCOORD
- add hl, bc
- ld a, [hli]
- ld d, a
- ld a, (-10 * 8) + 4
- sub d
- ld [wBattleAnimTempXCoord], a
- ld a, [hli]
- ld d, a
- ld a, [wBattleAnimTemp1]
- cp $ff
- jr nz, .check_kinesis_softboiled_milkdrink
- ld a, 5 * 8
- add d
- jr .done
-
-.check_kinesis_softboiled_milkdrink
- sub d
- push af
- ld a, [FXAnimIDHi]
- or a
- jr nz, .no_sub
- ld a, [FXAnimIDLo]
- cp KINESIS
- jr z, .kinesis
- cp SOFTBOILED
- jr z, .softboiled
- cp MILK_DRINK
- jr nz, .no_sub
-.kinesis
-.softboiled
-.milk_drink
- pop af
- sub 1 * 8
- jr .done
-
-.no_sub
- pop af
-.done
- ld [wBattleAnimTempYCoord], a
- ld a, [hli]
- xor $ff
- inc a
- ld [wBattleAnimTempXOffset], a
- ret
-
-; ccb31
-
-GetBattleAnimTileOffset: ; ccb31 (33:4b31)
- push hl
- push bc
- ld hl, wBattleAnimTileDict
- ld b, a
- ld c, 10 / 2
-.loop
- ld a, [hli]
- cp b
- jr z, .load
- inc hl
- dec c
- jr nz, .loop
- xor a
- jr .done
-
-.load
- ld a, [hl]
-.done
- pop bc
- pop hl
- ret
-
-_ExecuteBGEffects: ; ccb48
- callab ExecuteBGEffects
- ret
-
-; ccb4f
-
-_QueueBGEffect: ; ccb4f (33:4b4f)
- callab QueueBGEffect
- ret
-
-; ccb56 (33:4b56)
-
-BattleAnimObjects: ; ccb56
-battleanimobj: MACRO
-; ??, ??, frameset, function, ??, tile offset
- db \1, \2, \3, \4, \5, \6
-endm
-
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_00
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_01
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_02
- battleanimobj $01, $90, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_03
- battleanimobj $01, $90, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_04
- battleanimobj $01, $90, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_05
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_03, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_06
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_04, BATTLEANIMFUNC_1B, $02, $01 ; ANIM_OBJ_07
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_08
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_06, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_09
- battleanimobj $01, $90, BATTLEANIMFRAMESET_07, BATTLEANIMFUNC_09, $02, $01 ; ANIM_OBJ_0A
- battleanimobj $01, $aa, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_10, $04, $03 ; ANIM_OBJ_0B
- battleanimobj $01, $90, BATTLEANIMFRAMESET_0E, BATTLEANIMFUNC_04, $04, $03 ; ANIM_OBJ_0C
- battleanimobj $01, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_03, $04, $03 ; ANIM_OBJ_0D
- battleanimobj $01, $90, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_08, $04, $03 ; ANIM_OBJ_0E
- battleanimobj $01, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_0A, $04, $03 ; ANIM_OBJ_0F
- battleanimobj $01, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_03, $04, $03 ; ANIM_OBJ_BURNED
- battleanimobj $01, $90, BATTLEANIMFRAMESET_12, BATTLEANIMFUNC_08, $06, $0a ; ANIM_OBJ_11
- battleanimobj $01, $90, BATTLEANIMFRAMESET_13, BATTLEANIMFUNC_00, $06, $0a ; ANIM_OBJ_12
- battleanimobj $01, $90, BATTLEANIMFRAMESET_14, BATTLEANIMFUNC_01, $06, $0a ; ANIM_OBJ_13
- battleanimobj $21, $78, BATTLEANIMFRAMESET_16, BATTLEANIMFUNC_0B, $05, $06 ; ANIM_OBJ_14
- battleanimobj $00, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_12, $04, $0b ; ANIM_OBJ_POKE_BALL
- battleanimobj $00, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_13, $04, $0b ; ANIM_OBJ_16
- battleanimobj $01, $90, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, $04, $08 ; ANIM_OBJ_17
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, $04, $08 ; ANIM_OBJ_18
- battleanimobj $01, $90, BATTLEANIMFRAMESET_1D, BATTLEANIMFUNC_06, $02, $0c ; ANIM_OBJ_19
- battleanimobj $01, $b4, BATTLEANIMFRAMESET_1F, BATTLEANIMFUNC_38, $02, $0c ; ANIM_OBJ_1A
- battleanimobj $01, $90, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, $02, $07 ; ANIM_OBJ_1B
- battleanimobj $01, $a0, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, $02, $07 ; ANIM_OBJ_1C
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_07, $07, $09 ; ANIM_OBJ_1D
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_1A, BATTLEANIMFUNC_07, $07, $09 ; ANIM_OBJ_1E
- battleanimobj $01, $b0, BATTLEANIMFRAMESET_1B, BATTLEANIMFUNC_36, $07, $09 ; ANIM_OBJ_1F
- battleanimobj $01, $b0, BATTLEANIMFRAMESET_84, BATTLEANIMFUNC_36, $06, $21 ; ANIM_OBJ_20
- battleanimobj $01, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_0C, $06, $0d ; ANIM_OBJ_21
- battleanimobj $00, $00, BATTLEANIMFRAMESET_23, BATTLEANIMFUNC_0D, $06, $0d ; ANIM_OBJ_22
- battleanimobj $01, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_0E, $02, $0e ; ANIM_OBJ_23
- battleanimobj $61, $80, BATTLEANIMFRAMESET_27, BATTLEANIMFUNC_0F, $06, $04 ; ANIM_OBJ_24
- battleanimobj $01, $b4, BATTLEANIMFRAMESET_2A, BATTLEANIMFUNC_00, $06, $04 ; ANIM_OBJ_25
- battleanimobj $01, $40, BATTLEANIMFRAMESET_2B, BATTLEANIMFUNC_11, $05, $0f ; ANIM_OBJ_26
- battleanimobj $61, $98, BATTLEANIMFRAMESET_2C, BATTLEANIMFUNC_00, $03, $10 ; ANIM_OBJ_27
- battleanimobj $61, $98, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, $03, $10 ; ANIM_OBJ_28
- battleanimobj $01, $b8, BATTLEANIMFRAMESET_2E, BATTLEANIMFUNC_00, $06, $0a ; ANIM_OBJ_29
- battleanimobj $01, $b8, BATTLEANIMFRAMESET_2F, BATTLEANIMFUNC_00, $06, $0a ; ANIM_OBJ_FROZEN
- battleanimobj $01, $b8, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_14, $07, $11 ; ANIM_OBJ_2B
- battleanimobj $01, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_14, $03, $0d ; ANIM_OBJ_2C
- battleanimobj $21, $b0, BATTLEANIMFRAMESET_31, BATTLEANIMFUNC_00, $03, $05 ; ANIM_OBJ_2D
- battleanimobj $21, $b0, BATTLEANIMFRAMESET_32, BATTLEANIMFUNC_00, $03, $05 ; ANIM_OBJ_2E
- battleanimobj $21, $b0, BATTLEANIMFRAMESET_33, BATTLEANIMFUNC_00, $03, $05 ; ANIM_OBJ_2F
- battleanimobj $21, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_15, $03, $05 ; ANIM_OBJ_30
- battleanimobj $21, $90, BATTLEANIMFRAMESET_36, BATTLEANIMFUNC_00, $03, $05 ; ANIM_OBJ_31
- battleanimobj $21, $90, BATTLEANIMFRAMESET_37, BATTLEANIMFUNC_03, $02, $08 ; ANIM_OBJ_32
- battleanimobj $21, $90, BATTLEANIMFRAMESET_38, BATTLEANIMFUNC_00, $03, $05 ; ANIM_OBJ_33
- battleanimobj $21, $90, BATTLEANIMFRAMESET_39, BATTLEANIMFUNC_03, $02, $08 ; ANIM_OBJ_34
- battleanimobj $21, $90, BATTLEANIMFRAMESET_3A, BATTLEANIMFUNC_16, $02, $02 ; ANIM_OBJ_35
- battleanimobj $01, $90, BATTLEANIMFRAMESET_3C, BATTLEANIMFUNC_17, $02, $02 ; ANIM_OBJ_36
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_3E, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_37
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_3F, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_38
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_40, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_39
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_41, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_3A
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_42, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_3B
- battleanimobj $01, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_18, $05, $12 ; ANIM_OBJ_3C
- battleanimobj $01, $88, BATTLEANIMFRAMESET_44, BATTLEANIMFUNC_00, $05, $12 ; ANIM_OBJ_3D
- battleanimobj $21, $b8, BATTLEANIMFRAMESET_45, BATTLEANIMFUNC_19, $02, $13 ; ANIM_OBJ_GUST
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_46, BATTLEANIMFUNC_00, $02, $14 ; ANIM_OBJ_3F
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_47, BATTLEANIMFUNC_00, $02, $14 ; ANIM_OBJ_40
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_48, BATTLEANIMFUNC_1A, $02, $14 ; ANIM_OBJ_41
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_49, BATTLEANIMFUNC_1A, $02, $14 ; ANIM_OBJ_42
- battleanimobj $21, $98, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_01, $02, $14 ; ANIM_OBJ_43
- battleanimobj $21, $80, BATTLEANIMFRAMESET_4B, BATTLEANIMFUNC_00, $03, $11 ; ANIM_OBJ_44
- battleanimobj $01, $88, BATTLEANIMFRAMESET_4C, BATTLEANIMFUNC_1C, $05, $12 ; ANIM_OBJ_45
- battleanimobj $21, $b0, BATTLEANIMFRAMESET_4D, BATTLEANIMFUNC_1D, $02, $15 ; ANIM_OBJ_46
- battleanimobj $01, $b0, BATTLEANIMFRAMESET_51, BATTLEANIMFUNC_1E, $03, $11 ; ANIM_OBJ_47
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_52, BATTLEANIMFUNC_1F, $05, $16 ; ANIM_OBJ_48
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_54, BATTLEANIMFUNC_1F, $05, $16 ; ANIM_OBJ_49
- battleanimobj $21, $68, BATTLEANIMFRAMESET_56, BATTLEANIMFUNC_20, $05, $06 ; ANIM_OBJ_4A
- battleanimobj $21, $90, BATTLEANIMFRAMESET_59, BATTLEANIMFUNC_21, $02, $0e ; ANIM_OBJ_4B
- battleanimobj $21, $90, BATTLEANIMFRAMESET_5C, BATTLEANIMFUNC_02, $02, $17 ; ANIM_OBJ_4C
- battleanimobj $01, $90, BATTLEANIMFRAMESET_5D, BATTLEANIMFUNC_22, $03, $11 ; ANIM_OBJ_4D
- battleanimobj $61, $88, BATTLEANIMFRAMESET_5F, BATTLEANIMFUNC_00, $03, $10 ; ANIM_OBJ_4E
- battleanimobj $61, $88, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, $03, $10 ; ANIM_OBJ_4F
- battleanimobj $21, $88, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, $03, $18 ; ANIM_OBJ_50
- battleanimobj $21, $80, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, $02, $18 ; ANIM_OBJ_51
- battleanimobj $21, $50, BATTLEANIMFRAMESET_61, BATTLEANIMFUNC_23, $03, $19 ; ANIM_OBJ_CHICK
- battleanimobj $01, $80, BATTLEANIMFRAMESET_63, BATTLEANIMFUNC_24, $02, $19 ; ANIM_OBJ_53
- battleanimobj $01, $80, BATTLEANIMFRAMESET_66, BATTLEANIMFUNC_25, $02, $19 ; ANIM_OBJ_54
- battleanimobj $01, $50, BATTLEANIMFRAMESET_1C, BATTLEANIMFUNC_00, $02, $0c ; ANIM_OBJ_SKULL
- battleanimobj $21, $a8, BATTLEANIMFRAMESET_67, BATTLEANIMFUNC_26, $07, $1a ; ANIM_OBJ_56
- battleanimobj $21, $a8, BATTLEANIMFRAMESET_68, BATTLEANIMFUNC_00, $07, $1a ; ANIM_OBJ_57
- battleanimobj $21, $90, BATTLEANIMFRAMESET_69, BATTLEANIMFUNC_01, $02, $1a ; ANIM_OBJ_58
- battleanimobj $21, $90, BATTLEANIMFRAMESET_6D, BATTLEANIMFUNC_28, $03, $19 ; ANIM_OBJ_PARALYZED
- battleanimobj $21, $90, BATTLEANIMFRAMESET_6A, BATTLEANIMFUNC_27, $02, $1b ; ANIM_OBJ_5A
- battleanimobj $00, $00, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_29, $02, $1c ; ANIM_OBJ_5B
- battleanimobj $21, $48, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_29, $02, $1c ; ANIM_OBJ_5C
- battleanimobj $21, $48, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_29, $02, $1c ; ANIM_OBJ_5D
- battleanimobj $21, $78, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_2A, $02, $1c ; ANIM_OBJ_5E
- battleanimobj $61, $90, BATTLEANIMFRAMESET_71, BATTLEANIMFUNC_2B, $02, $1d ; ANIM_OBJ_5F
- battleanimobj $61, $90, BATTLEANIMFRAMESET_72, BATTLEANIMFUNC_2C, $02, $1d ; ANIM_OBJ_60
- battleanimobj $01, $48, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_2D, $04, $1e ; ANIM_OBJ_61
- battleanimobj $01, $90, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_06, $02, $15 ; ANIM_OBJ_62
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_75, BATTLEANIMFUNC_2E, $07, $19 ; ANIM_OBJ_63
- battleanimobj $21, $90, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_02, $02, $14 ; ANIM_OBJ_64
- battleanimobj $01, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_2F, $02, $11 ; ANIM_OBJ_65
- battleanimobj $01, $78, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_2A, $04, $23 ; ANIM_OBJ_66
- battleanimobj $01, $80, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_30, $02, $1f ; ANIM_OBJ_67
- battleanimobj $01, $90, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_02, $02, $1f ; ANIM_OBJ_68
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_00, $02, $1f ; ANIM_OBJ_69
- battleanimobj $01, $80, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_08, $03, $23 ; ANIM_OBJ_6A
- battleanimobj $21, $90, BATTLEANIMFRAMESET_79, BATTLEANIMFUNC_00, $02, $1f ; ANIM_OBJ_6B
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, $03, $11 ; ANIM_OBJ_6C
- battleanimobj $01, $88, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, $03, $11 ; ANIM_OBJ_6D
- battleanimobj $21, $88, BATTLEANIMFRAMESET_7B, BATTLEANIMFUNC_32, $02, $20 ; ANIM_OBJ_6E
- battleanimobj $21, $98, BATTLEANIMFRAMESET_7C, BATTLEANIMFUNC_00, $02, $04 ; ANIM_OBJ_6F
- battleanimobj $21, $80, BATTLEANIMFRAMESET_7D, BATTLEANIMFUNC_00, $02, $18 ; ANIM_OBJ_70
- battleanimobj $01, $80, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_2F, $06, $0d ; ANIM_OBJ_71
- battleanimobj $01, $b0, BATTLEANIMFRAMESET_7E, BATTLEANIMFUNC_33, $03, $12 ; ANIM_OBJ_72
- battleanimobj $01, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_2F, $02, $08 ; ANIM_OBJ_73
- battleanimobj $21, $a0, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_34, $02, $1c ; ANIM_OBJ_74
- battleanimobj $21, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_35, $02, $15 ; ANIM_OBJ_75
- battleanimobj $21, $b0, BATTLEANIMFRAMESET_80, BATTLEANIMFUNC_33, $02, $14 ; ANIM_OBJ_76
- battleanimobj $01, $88, BATTLEANIMFRAMESET_81, BATTLEANIMFUNC_37, $02, $11 ; ANIM_OBJ_77
- battleanimobj $01, $88, BATTLEANIMFRAMESET_85, BATTLEANIMFUNC_00, $02, $22 ; ANIM_OBJ_78
- battleanimobj $01, $88, BATTLEANIMFRAMESET_86, BATTLEANIMFUNC_00, $02, $22 ; ANIM_OBJ_79
- battleanimobj $01, $90, BATTLEANIMFRAMESET_87, BATTLEANIMFUNC_39, $02, $1f ; ANIM_OBJ_7A
- battleanimobj $01, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_3A, $03, $11 ; ANIM_OBJ_7B
- battleanimobj $21, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_00, $03, $05 ; ANIM_OBJ_7C
- battleanimobj $a1, $88, BATTLEANIMFRAMESET_88, BATTLEANIMFUNC_3B, $06, $13 ; ANIM_OBJ_7D
- battleanimobj $01, $80, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_25, $04, $23 ; ANIM_OBJ_HEART
- battleanimobj $01, $98, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_34, $04, $03 ; ANIM_OBJ_7F
- battleanimobj $01, $a8, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_3C, $04, $03 ; ANIM_OBJ_80
- battleanimobj $21, $68, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_29, $02, $1f ; ANIM_OBJ_81
- battleanimobj $21, $b0, BATTLEANIMFRAMESET_8A, BATTLEANIMFUNC_00, $02, $1f ; ANIM_OBJ_82
- battleanimobj $21, $80, BATTLEANIMFRAMESET_8C, BATTLEANIMFUNC_00, $02, $1f ; ANIM_OBJ_83
- battleanimobj $21, $50, BATTLEANIMFRAMESET_8D, BATTLEANIMFUNC_00, $03, $1f ; ANIM_OBJ_84
- battleanimobj $01, $40, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_40, $02, $0e ; ANIM_OBJ_85
- battleanimobj $21, $a8, BATTLEANIMFRAMESET_8E, BATTLEANIMFUNC_41, $04, $1f ; ANIM_OBJ_86
- battleanimobj $21, $88, BATTLEANIMFRAMESET_8F, BATTLEANIMFUNC_3E, $02, $1f ; ANIM_OBJ_87
- battleanimobj $21, $88, BATTLEANIMFRAMESET_93, BATTLEANIMFUNC_3E, $02, $1f ; ANIM_OBJ_88
- battleanimobj $21, $90, BATTLEANIMFRAMESET_97, BATTLEANIMFUNC_3D, $02, $1f ; ANIM_OBJ_89
- battleanimobj $21, $90, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_3D, $03, $23 ; ANIM_OBJ_8A
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_2E, $02, $19 ; ANIM_OBJ_8B
- battleanimobj $21, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_02, $02, $15 ; ANIM_OBJ_8C
- battleanimobj $21, $a0, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_35, $04, $19 ; ANIM_OBJ_8D
- battleanimobj $21, $70, BATTLEANIMFRAMESET_8B, BATTLEANIMFUNC_3F, $02, $1f ; ANIM_OBJ_8E
- battleanimobj $01, $90, BATTLEANIMFRAMESET_15, BATTLEANIMFUNC_08, $02, $0a ; ANIM_OBJ_8F
- battleanimobj $01, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_02, $04, $03 ; ANIM_OBJ_90
- battleanimobj $01, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_42, $02, $08 ; ANIM_OBJ_91
- battleanimobj $01, $90, BATTLEANIMFRAMESET_9A, BATTLEANIMFUNC_00, $02, $1b ; ANIM_OBJ_92
- battleanimobj $21, $a0, BATTLEANIMFRAMESET_9B, BATTLEANIMFUNC_35, $04, $23 ; ANIM_OBJ_93
- battleanimobj $21, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_23, $02, $25 ; ANIM_OBJ_94
- battleanimobj $21, $80, BATTLEANIMFRAMESET_9D, BATTLEANIMFUNC_25, $02, $25 ; ANIM_OBJ_95
- battleanimobj $21, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_00, $02, $25 ; ANIM_OBJ_96
- battleanimobj $21, $80, BATTLEANIMFRAMESET_9E, BATTLEANIMFUNC_00, $06, $25 ; ANIM_OBJ_97
- battleanimobj $61, $80, BATTLEANIMFRAMESET_9F, BATTLEANIMFUNC_3A, $05, $23 ; ANIM_OBJ_98
- battleanimobj $21, $80, BATTLEANIMFRAMESET_A0, BATTLEANIMFUNC_16, $02, $23 ; ANIM_OBJ_99
- battleanimobj $21, $70, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_43, $03, $23 ; ANIM_OBJ_9A
- battleanimobj $21, $c0, BATTLEANIMFRAMESET_A2, BATTLEANIMFUNC_01, $02, $25 ; ANIM_OBJ_9B
- battleanimobj $21, $40, BATTLEANIMFRAMESET_A3, BATTLEANIMFUNC_44, $03, $24 ; ANIM_OBJ_9C
- battleanimobj $01, $80, BATTLEANIMFRAMESET_A4, BATTLEANIMFUNC_00, $02, $24 ; ANIM_OBJ_9D
- battleanimobj $01, $80, BATTLEANIMFRAMESET_A5, BATTLEANIMFUNC_00, $03, $24 ; ANIM_OBJ_9E
- battleanimobj $01, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_45, $04, $12 ; ANIM_OBJ_9F
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_A6, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_A0
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_A7, BATTLEANIMFUNC_00, $02, $02 ; ANIM_OBJ_A1
- battleanimobj $21, $00, BATTLEANIMFRAMESET_B4, BATTLEANIMFUNC_4A, $07, $0f ; ANIM_OBJ_A2
- battleanimobj $21, $90, BATTLEANIMFRAMESET_A8, BATTLEANIMFUNC_02, $03, $05 ; ANIM_OBJ_A3
- battleanimobj $21, $40, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_11, $02, $25 ; ANIM_OBJ_A4
- battleanimobj $61, $90, BATTLEANIMFRAMESET_A9, BATTLEANIMFUNC_46, $02, $23 ; ANIM_OBJ_A5
- battleanimobj $00, $00, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_47, $02, $0e ; ANIM_OBJ_A6
- battleanimobj $01, $80, BATTLEANIMFRAMESET_AA, BATTLEANIMFUNC_00, $02, $24 ; ANIM_OBJ_A7
- battleanimobj $21, $b8, BATTLEANIMFRAMESET_AB, BATTLEANIMFUNC_48, $02, $13 ; ANIM_OBJ_A8
- battleanimobj $21, $90, BATTLEANIMFRAMESET_AC, BATTLEANIMFUNC_44, $02, $13 ; ANIM_OBJ_A9
- battleanimobj $01, $a8, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, $02, $01 ; ANIM_OBJ_AA
- battleanimobj $01, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_43, $02, $0e ; ANIM_OBJ_AB
- battleanimobj $01, $88, BATTLEANIMFRAMESET_AD, BATTLEANIMFUNC_00, $06, $17 ; ANIM_OBJ_AC
- battleanimobj $01, $a8, BATTLEANIMFRAMESET_AE, BATTLEANIMFUNC_49, $02, $01 ; ANIM_OBJ_AD
- battleanimobj $21, $90, BATTLEANIMFRAMESET_AF, BATTLEANIMFUNC_01, $03, $11 ; ANIM_OBJ_AE
- battleanimobj $21, $00, BATTLEANIMFRAMESET_B0, BATTLEANIMFUNC_4A, $02, $04 ; ANIM_OBJ_AF
- battleanimobj $00, $00, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_4B, $04, $1c ; ANIM_OBJ_B0
- battleanimobj $01, $88, BATTLEANIMFRAMESET_B1, BATTLEANIMFUNC_4C, $02, $19 ; ANIM_OBJ_B1
- battleanimobj $01, $b8, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4D, $07, $09 ; ANIM_OBJ_B2
- battleanimobj $61, $98, BATTLEANIMFRAMESET_B3, BATTLEANIMFUNC_00, $03, $27 ; ANIM_OBJ_B3
- battleanimobj $61, $98, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_04, $06, $15 ; ANIM_OBJ_B4
- battleanimobj $21, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4E, $07, $09 ; ANIM_OBJ_B5
- battleanimobj $01, $90, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_08, $04, $1e ; ANIM_OBJ_FLOWER
- battleanimobj $01, $ff, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_4F, $04, $1f ; ANIM_OBJ_COTTON
- battleanimobj $00, $00, BATTLEANIMFRAMESET_B5, BATTLEANIMFUNC_00, $00, $28 ; ANIM_OBJ_B8
- battleanimobj $00, $00, BATTLEANIMFRAMESET_B6, BATTLEANIMFUNC_00, $01, $29 ; ANIM_OBJ_B9
- battleanimobj $00, $00, BATTLEANIMFRAMESET_B7, BATTLEANIMFUNC_00, $00, $28 ; ANIM_OBJ_BA
- battleanimobj $00, $00, BATTLEANIMFRAMESET_B8, BATTLEANIMFUNC_00, $01, $29 ; ANIM_OBJ_BB
-; ccfbe
-
+INCLUDE "battle/objects/engine.asm"
+INCLUDE "battle/objects/data.asm"
INCLUDE "battle/objects/functions.asm"
-
-ReinitBattleAnimFrameset: ; ce7bf (33:67bf)
- ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
- add hl, bc
- ld [hl], a
- ld hl, BATTLEANIMSTRUCT_DURATION
- add hl, bc
- ld [hl], 0
- ld hl, BATTLEANIMSTRUCT_FRAME
- add hl, bc
- ld [hl], -1
- ret
-
-GetBattleAnimFrame: ; ce7d1
-.loop
- ld hl, BATTLEANIMSTRUCT_DURATION
- add hl, bc
- ld a, [hl]
- and a
- jr z, .next_frame
- dec [hl]
- call .GetPointer
- ld a, [hli]
- push af
- jr .okay
-
-.next_frame
- ld hl, BATTLEANIMSTRUCT_FRAME
- add hl, bc
- inc [hl]
- call .GetPointer
- ld a, [hli]
- cp -2
- jr z, .restart
- cp -1
- jr z, .repeat_last
- push af
- ld a, [hl]
- push hl
- and $3f
- ld hl, BATTLEANIMSTRUCT_DURATION
- add hl, bc
- ld [hl], a
- pop hl
-
-.okay
- ld a, [hl]
- and $c0
- srl a
- ld [wBattleAnimTemp7], a
- pop af
- ret
-
-.repeat_last
- xor a
- ld hl, BATTLEANIMSTRUCT_DURATION
- add hl, bc
- ld [hl], a
- ld hl, BATTLEANIMSTRUCT_FRAME
- add hl, bc
- dec [hl]
- dec [hl]
- jr .loop
-
-.restart
- xor a
- ld hl, BATTLEANIMSTRUCT_DURATION
- add hl, bc
- ld [hl], a
- dec a
- ld hl, BATTLEANIMSTRUCT_FRAME
- add hl, bc
- ld [hl], a
- jr .loop
-
-; ce823
-
-.GetPointer: ; ce823
- ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
- add hl, bc
- ld e, [hl]
- ld d, 0
- ld hl, BattleAnimFrameData
- add hl, de
- add hl, de
- ld e, [hl]
- inc hl
- ld d, [hl]
- ld hl, BATTLEANIMSTRUCT_FRAME
- add hl, bc
- ld l, [hl]
- ld h, $0
- add hl, hl
- add hl, de
- ret
-
-; ce83c
-
-GetBattleAnimOAMPointer: ; ce83c
- ld l, a
- ld h, 0
- ld de, BattleAnimOAMData
- add hl, hl
- add hl, hl
- add hl, de
- ret
-
-; ce846
-
-LoadBattleAnimObj: ; ce846 (33:6846)
- push hl
- ld l, a
- ld h, 0
- add hl, hl
- add hl, hl
- ld de, AnimObjGFX
- add hl, de
- ld c, [hl]
- inc hl
- ld b, [hl]
- inc hl
- ld a, [hli]
- ld h, [hl]
- ld l, a
- pop de
- push bc
- call DecompressRequest2bpp
- pop bc
- ret
-
-; ce85e (33:685e)
-
+INCLUDE "battle/objects/library.asm"
INCLUDE "battle/objects/framesets.asm"
INCLUDE "battle/objects/oam.asm"
INCLUDE "battle/objects/gfx_headers.asm"
--- a/battle/bg_effects.asm
+++ b/battle/bg_effects.asm
@@ -174,8 +174,6 @@
ld de, .inverted
jp BattleBGEffect_FlashContinue
-; c80f1 (32:40f1)
-
.inverted
db %11100100 ; 3210
db %00011011 ; 0123
@@ -185,8 +183,6 @@
ld de, .white
jp BattleBGEffect_FlashContinue
-; c80f9 (32:40f9)
-
.white
db %11100100 ; 3210
db %00000000 ; 0000
@@ -295,12 +291,8 @@
ld [wOBP0], a
ret
-; c8185 (32:4185)
-
.PalsCGB
db $e4, $90, $fe
-; c8188
-
.PalsSGB
db $f0, $c0, $fe
; c818b
@@ -318,12 +310,8 @@
ld [wOBP0], a
ret
-; c819f (32:419f)
-
.PalsCGB
db $e4, $d8, $fe
-; c81a2
-
.PalsSGB
db $f0, $cc, $fe
; c81a5
@@ -334,8 +322,6 @@
ld [wBGP], a
ret
-; c81af (32:41af)
-
.Pals
db $1b, $63, $87, $fe
; c81b3
@@ -399,13 +385,9 @@
call BattleBGEffect_RunPicResizeScript
ret
-; c820c (32:420c)
-
.PlayerData
db 0, $31, 0
db -1
-; c8210
-
.EnemyData
db 3, $00, 3
db -1
@@ -668,15 +650,11 @@
call BattleBGEffect_RunPicResizeScript
ret
-; c8394 (32:4394)
-
.PlayerData
db 2, $31, 2
db 1, $31, 1
db 0, $31, 0
db -1
-; c839e
-
.EnemyData
db 5, $00, 5
db 4, $00, 4
@@ -700,8 +678,6 @@
call BattleBGEffect_RunPicResizeScript
ret
-; c83c1 (32:43c1)
-
.PlayerData
db 0, $31, 0
db -2, $66, 0
@@ -711,8 +687,6 @@
db -2, $22, 2
db -3, $00, 0
db -1
-; c83d7
-
.EnemyData
db 3, $00, 3
db -2, $77, 3
@@ -1650,12 +1624,12 @@
BattleBGEffect_26: ; c892a (32:492a)
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc8933
- dw Functionc894a
- dw Functionc8960
+ dw .zero
+ dw .one
+ dw .two
-Functionc8933: ; c8933 (32:4933)
+.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
@@ -1668,7 +1642,7 @@
ld [hl], $0
ret
-Functionc894a: ; c894a (32:494a)
+.one
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@@ -1682,7 +1656,7 @@
ld [hl], a
ret
-Functionc8960: ; c8960 (32:4960)
+.two
call BattleAnim_ResetLCDStatCustom
ret
@@ -1689,12 +1663,12 @@
BattleBGEffect_2c: ; c8964 (32:4964)
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc896d
- dw Functionc8985
- dw Functionc89b1
+ dw .zero
+ dw .one
+ dw .two
-Functionc896d: ; c896d (32:496d)
+.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
@@ -1709,7 +1683,7 @@
ld [hl], a
ret
-Functionc8985: ; c8985 (32:4985)
+.one
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@@ -1737,7 +1711,7 @@
ld [hl], a
ret
-Functionc89b1: ; c89b1 (32:49b1)
+.two
call BattleAnim_ResetLCDStatCustom
ret
@@ -1744,12 +1718,12 @@
BattleBGEffect_28: ; c89b5 (32:49b5)
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc89be
- dw Functionc89ca
- dw Functionc89da
+ dw .zero
+ dw .one
+ dw .two
-Functionc89be: ; c89be (32:49be)
+.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
@@ -1756,7 +1730,7 @@
call Functionc8ede
ret
-Functionc89ca: ; c89ca (32:49ca)
+.one
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@@ -1768,12 +1742,12 @@
call Functionc8f2e
ret
-Functionc89da: ; c89da (32:49da)
+.two
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
and a
- jr z, .asm_c89ea
+ jr z, .reset
dec [hl]
ld d, a
ld e, 4
@@ -1780,7 +1754,7 @@
call Functionc8f2e
ret
-.asm_c89ea
+.reset
call BattleAnim_ResetLCDStatCustom
ret
@@ -1949,11 +1923,11 @@
BattleBGEffect_2b: ; c8acc (32:4acc)
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc8ad3
- dw Functionc8ae5
+ dw .zero
+ dw .one
-Functionc8ad3: ; c8ad3 (32:4ad3)
+.zero
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
@@ -1963,7 +1937,7 @@
ld [hl], $40
ret
-Functionc8ae5: ; c8ae5 (32:4ae5)
+.one
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
ld a, [hl]
@@ -1986,15 +1960,15 @@
BattleBGEffect_1c: ; c8b00 (32:4b00)
ld a, [hCGB]
and a
- jr nz, asm_c8b7a
+ jr nz, .cgb
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc8b0e
- dw Functionc8b22
- dw Functionc8b60
+ dw .zero
+ dw .one
+ dw .two
-Functionc8b0e: ; c8b0e (32:4b0e)
+.zero
call BattleBGEffects_IncrementJumptable
ld a, $e4
call BattleBGEffects_SetLYOverrides
@@ -2006,7 +1980,7 @@
ld [hLCDStatCustom + 2], a
ret
-Functionc8b22: ; c8b22 (32:4b22)
+.one
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@@ -2023,18 +1997,18 @@
ld d, $0
push bc
call BGEffect_CheckBattleTurn
- jr nz, .asm_c8b4d
- ld hl, Unknown_c8bd8
+ jr nz, .player
+ ld hl, .CGB_DMGEnemyData
add hl, de
ld a, [hli]
ld [wOBP1], a
ld d, a
ld e, [hl]
- ld bc, $2f30
- jr .asm_c8b5b
+ lb bc, $2f, $30
+ jr .okay
-.asm_c8b4d
- ld hl, Unknown_c8be0
+.player
+ ld hl, .DMG_PlayerData
add hl, de
ld d, [hl]
inc hl
@@ -2041,13 +2015,13 @@
ld a, [hl]
ld [wOBP1], a
ld e, a
- ld bc, $3728
-.asm_c8b5b
- call Functionc8b6c
+ lb bc, $37, $28
+.okay
+ call .DMG_LYOverrideLoads
pop bc
ret
-Functionc8b60: ; c8b60 (32:4b60)
+.two
call Functionc8f19
ld a, $e4
ld [wBGP], a
@@ -2054,34 +2028,30 @@
ld [wOBP1], a
ret
-Functionc8b6c: ; c8b6c (32:4b6c)
+.DMG_LYOverrideLoads
ld hl, LYOverridesBackup
-.asm_c8b6f
+.loop1
ld [hl], d
inc hl
dec b
- jr nz, .asm_c8b6f
-.asm_c8b74
+ jr nz, .loop1
+.loop2
ld [hl], e
inc hl
dec c
- jr nz, .asm_c8b74
+ jr nz, .loop2
ret
-asm_c8b7a: ; c8b7a (32:4b7a)
- ld de, Jumptable_c8b81
+.cgb
+ ld de, .Jumptable
call BatttleBGEffects_GetNamedJumptablePointer
jp [hl]
-; c8b81 (32:4b81)
-
-Jumptable_c8b81: ; c8b81
- dw Functionc8b87
- dw Functionc8b91
- dw Functionc8bca
-; c8b87
-
-Functionc8b87: ; c8b87
+.Jumptable
+ dw .cgb_zero
+ dw .cgb_one
+ dw .cgb_two
+.cgb_zero
call BattleBGEffects_IncrementJumptable
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
@@ -2088,9 +2058,7 @@
ld [hl], $0
ret
-; c8b91
-
-Functionc8b91: ; c8b91
+.cgb_one
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
@@ -2106,48 +2074,42 @@
ld e, a
ld d, 0
call BGEffect_CheckBattleTurn
- jr nz, .asm_c8bbb
- ld hl, Unknown_c8bd8
+ jr nz, .player_2
+ ld hl, .CGB_DMGEnemyData
add hl, de
ld a, [hli]
push hl
- call Functionc8e7f
+ call BGEffects_LoadBGPal1_OBPal0
pop hl
ld a, [hl]
- call Functionc8e52
+ call BGEffects_LoadBGPal0_OBPal1
ret
-.asm_c8bbb
- ld hl, Unknown_c8bd8
+.player_2
+ ld hl, .CGB_DMGEnemyData
add hl, de
ld a, [hli]
push hl
- call Functionc8e52
+ call BGEffects_LoadBGPal0_OBPal1
pop hl
ld a, [hl]
- call Functionc8e7f
+ call BGEffects_LoadBGPal1_OBPal0
ret
-; c8bca
-
-Functionc8bca: ; c8bca
+.cgb_two
ld a, $e4
- call Functionc8e52
+ call BGEffects_LoadBGPal0_OBPal1
ld a, $e4
- call Functionc8e7f
+ call BGEffects_LoadBGPal1_OBPal0
call EndBattleBGEffect
ret
-; c8bd8
-
-Unknown_c8bd8: ; c8bd8
+.CGB_DMGEnemyData
db $e4, $e4
db $f8, $90
db $fc, $40
db $f8, $90
-; c8be0
-
-Unknown_c8be0: ; c8be0
+.DMG_PlayerData
db $e4, $e4
db $90, $f8
db $40, $fc
@@ -2155,101 +2117,83 @@
; c8be8
BattleBGEffect_RapidFlash: ; c8be8 (32:4be8)
- ld de, Unknown_c8bef
- call Functionc8d77
+ ld de, .FlashPals
+ call BGEffect_RapidCyclePals
ret
-; c8bef (32:4bef)
-
-Unknown_c8bef: ; c8bef
+.FlashPals
db $e4, $6c, $fe
; c8bf2
BattleBGEffect_16: ; c8bf2 (32:4bf2)
- ld de, Unknown_c8bf9
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8bf9 (32:4bf9)
-
-Unknown_c8bf9: ; c8bf9
+.Pals
db $e4, $90, $40, $ff
; c8bfd
BattleBGEffect_17: ; c8bfd (32:4bfd)
- ld de, Unknown_c8c04
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c04 (32:4c04)
-
-Unknown_c8c04: ; c8c04
+.Pals
db $e4, $f8, $fc, $ff
; c8c08
BattleBGEffect_18: ; c8c08 (32:4c08)
- ld de, Unknown_c8c0f
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c0f (32:4c0f)
-
-Unknown_c8c0f: ; c8c0f
+.Pals
db $e4, $90, $40, $90, $fe
; c8c14
BattleBGEffect_19: ; c8c14 (32:4c14)
- ld de, Unknown_c8c1b
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c1b (32:4c1b)
-
-Unknown_c8c1b: ; c8c1b
+.Pals
db $e4, $f8, $fc, $f8, $fe
; c8c20
BattleBGEffect_1a: ; c8c20 (32:4c20)
- ld de, Unknown_c8c27
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c27 (32:4c27)
-
-Unknown_c8c27: ; c8c27
+.Pals
db $e4, $f8, $fc, $f8, $e4, $90, $40, $90, $fe
; c8c30
BattleBGEffect_1b: ; c8c30 (32:4c30)
- ld de, Unknown_c8c37
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c37 (32:4c37)
-
-Unknown_c8c37:
+.Pals
db $e4, $fc, $e4, $00, $fe
; c8c3c
BattleBGEffect_1d: ; c8c3c (32:4c3c)
- ld de, Unknown_c8c43
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c43 (32:4c43)
-
-Unknown_c8c43:
+.Pals
db $e4, $90, $40, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $40, $90, $e4, $ff
; c8c55
BattleBGEffect_1e: ; c8c55 (32:4c55)
- ld de, Unknown_c8c5c
- call Functionc8d77
+ ld de, .Pals
+ call BGEffect_RapidCyclePals
ret
-; c8c5c (32:4c5c)
-
-Unknown_c8c5c:
+.Pals
db $00, $40, $90, $e4, $ff
; c8c61
@@ -2256,11 +2200,11 @@
BattleBGEffect_VibrateMon: ; c8c61 (32:4c61)
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc8c68
- dw Functionc8c85
+ dw .zero
+ dw .one
-Functionc8c68: ; c8c68 (32:4c68)
+.zero: ; c8c68 (32:4c68)
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
@@ -2276,12 +2220,12 @@
ld [hl], $20
ret
-Functionc8c85: ; c8c85 (32:4c85)
+.one: ; c8c85 (32:4c85)
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
and a
- jr z, .asm_c8c9e
+ jr z, .finish
dec [hl]
and $1
ret nz
@@ -2294,7 +2238,7 @@
call Functionc900b
ret
-.asm_c8c9e
+.finish
call BattleAnim_ResetLCDStatCustom
ret
@@ -2301,12 +2245,12 @@
BattleBGEffect_WobbleMon: ; c8ca2 (32:4ca2)
call BattleBGEffects_AnonJumptable
.anon_jumptable
- dw Functionc8cab
- dw Functionc8cc3
- dw Functionc8cdd
+ dw .zero
+ dw .one
+ dw .two
-Functionc8cab: ; c8cab (32:4cab)
+.zero: ; c8cab (32:4cab)
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_ClearLYOverrides
ld a, $43
@@ -2320,12 +2264,12 @@
ld [hl], $0
ret
-Functionc8cc3: ; c8cc3 (32:4cc3)
+.one: ; c8cc3 (32:4cc3)
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
cp $40
- jr nc, Functionc8cdd
+ jr nc, .two
ld d, $6
call BattleBGEffects_Sine
call Functionc900b
@@ -2336,18 +2280,18 @@
ld [hl], a
ret
-Functionc8cdd: ; c8cdd (32:4cdd)
+.two: ; c8cdd (32:4cdd)
call BattleAnim_ResetLCDStatCustom
ret
BattleBGEffect_2e: ; c8ce1 (32:4ce1)
call Functionc8d0b
- jr c, .asm_c8cea
+ jr c, .xor_a
bit 7, a
- jr z, .asm_c8ceb
-.asm_c8cea
+ jr z, .okay
+.xor_a
xor a
-.asm_c8ceb
+.okay
push af
call DelayFrame
pop af
@@ -2354,22 +2298,22 @@
ld [hSCY], a
xor $ff
inc a
- ld [OTPartyMon3SpclAtk], a
+ ld [AnimObject01_YOffset], a
ret
BattleBGEffect_1f: ; c8cf9 (32:4cf9)
call Functionc8d0b
- jr nc, .asm_c8cff
+ jr nc, .skip
xor a
-.asm_c8cff
+.skip
ld [hSCX], a
ret
BattleBGEffect_20: ; c8d02 (32:4d02)
call Functionc8d0b
- jr nc, .asm_c8d08
+ jr nc, .skip
xor a
-.asm_c8d08
+.skip
ld [hSCY], a
ret
@@ -2378,18 +2322,18 @@
add hl, bc
ld a, [hl]
and a
- jr nz, .asm_c8d18
+ jr nz, .okay
call EndBattleBGEffect
scf
ret
-.asm_c8d18
+.okay
dec [hl]
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
ld a, [hl]
and $f
- jr z, .asm_c8d2a
+ jr z, .every_16_frames
dec [hl]
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
@@ -2397,7 +2341,7 @@
and a
ret
-.asm_c8d2a
+.every_16_frames
ld a, [hl]
swap a
or [hl]
@@ -2416,7 +2360,7 @@
add hl, bc
ld a, [hl]
cp $40
- jr nc, .asm_c8d53
+ jr nc, .finish
ld d, $6
call BattleBGEffects_Sine
ld [hSCX], a
@@ -2427,7 +2371,7 @@
ld [hl], a
ret
-.asm_c8d53
+.finish
xor a
ld [hSCX], a
ret
@@ -2437,7 +2381,7 @@
add hl, bc
ld a, [hl]
and a
- jr z, .asm_c8d69
+ jr z, .zero
dec [hl]
ld hl, BG_EFFECT_STRUCT_03
@@ -2446,7 +2390,7 @@
call Functionc8eb2
ret
-.asm_c8d69
+.zero
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
ld a, [hl]
@@ -2456,23 +2400,23 @@
call Functionc8eac
ret
-Functionc8d77: ; c8d77 (32:4d77)
+BGEffect_RapidCyclePals: ; c8d77 (32:4d77)
ld a, [hCGB]
and a
- jr nz, asm_c8dd4
+ jr nz, .cgb
push de
- ld de, Jumptable_c8d85
+ ld de, .Jumptable_DMG
call BatttleBGEffects_GetNamedJumptablePointer
pop de
jp [hl]
-Jumptable_c8d85: ; c8d85 (32:4d85)
- dw Functionc8d8b
- dw Functionc8daa
- dw Functionc8dc9
+.Jumptable_DMG
+ dw .zero_dmg
+ dw .one_dmg
+ dw .two_dmg
-Functionc8d8b: ; c8d8b (32:4d8b)
+.zero_dmg: ; c8d8b (32:4d8b)
call BattleBGEffects_IncrementJumptable
ld a, $e4
call BattleBGEffects_SetLYOverrides
@@ -2490,32 +2434,32 @@
ld [hl], a
ret
-Functionc8daa: ; c8daa (32:4daa)
+.one_dmg: ; c8daa (32:4daa)
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
ld a, [hl]
and $f
- jr z, .asm_c8db5
+ jr z, .okay_1_dmg
dec [hl]
ret
-.asm_c8db5
+.okay_1_dmg
ld a, [hl]
swap a
or [hl]
ld [hl], a
call Functionc8eac
- jr c, .asm_c8dc3
+ jr c, .okay_2_dmg
call Functionc900b
ret
-.asm_c8dc3
+.okay_2_dmg
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
dec [hl]
ret
-Functionc8dc9: ; c8dc9 (32:4dc9)
+.two_dmg: ; c8dc9 (32:4dc9)
call Functionc8f19
ld a, $e4
ld [rBGP], a
@@ -2522,27 +2466,27 @@
call EndBattleBGEffect
ret
-asm_c8dd4: ; c8dd4 (32:4dd4)
+.cgb
push de
- ld de, Jumptable_c8ddd
+ ld de, .Jumptable_CGB
call BatttleBGEffects_GetNamedJumptablePointer
pop de
jp [hl]
-Jumptable_c8ddd: ; c8ddd (32:4ddd)
- dw Functionc8de7
- dw Functionc8e02
- dw Functionc8e21
- dw Functionc8e2a
- dw Functionc8e49
+.Jumptable_CGB: ; c8ddd (32:4ddd)
+ dw .zero_cgb
+ dw .one_cgb
+ dw .two_cgb
+ dw .three_cgb
+ dw .four_cgb
-Functionc8de7: ; c8de7 (32:4de7)
+.zero_cgb: ; c8de7 (32:4de7)
call BGEffect_CheckBattleTurn
- jr nz, .asm_c8df2
+ jr nz, .player_turn_cgb
call BattleBGEffects_IncrementJumptable
call BattleBGEffects_IncrementJumptable
-.asm_c8df2
+.player_turn_cgb
call BattleBGEffects_IncrementJumptable
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
@@ -2553,69 +2497,69 @@
ld [hl], a
ret
-Functionc8e02: ; c8e02 (32:4e02)
+.one_cgb: ; c8e02 (32:4e02)
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
ld a, [hl]
and $f
- jr z, .asm_c8e0d
+ jr z, .okay_1_cgb
dec [hl]
ret
-.asm_c8e0d
+.okay_1_cgb
ld a, [hl]
swap a
or [hl]
ld [hl], a
call Functionc8eac
- jr c, .asm_c8e1b
- call Functionc8e52
+ jr c, .okay_2_cgb
+ call BGEffects_LoadBGPal0_OBPal1
ret
-.asm_c8e1b
+.okay_2_cgb
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
dec [hl]
ret
-Functionc8e21: ; c8e21 (32:4e21)
+.two_cgb: ; c8e21 (32:4e21)
ld a, $e4
- call Functionc8e52
+ call BGEffects_LoadBGPal0_OBPal1
call EndBattleBGEffect
ret
-Functionc8e2a: ; c8e2a (32:4e2a)
+.three_cgb: ; c8e2a (32:4e2a)
ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
add hl, bc
ld a, [hl]
and $f
- jr z, .asm_c8e35
+ jr z, .okay_3_cgb
dec [hl]
ret
-.asm_c8e35
+.okay_3_cgb
ld a, [hl]
swap a
or [hl]
ld [hl], a
call Functionc8eac
- jr c, .asm_c8e43
- call Functionc8e7f
+ jr c, .okay_4_cgb
+ call BGEffects_LoadBGPal1_OBPal0
ret
-.asm_c8e43
+.okay_4_cgb
ld hl, BG_EFFECT_STRUCT_03
add hl, bc
dec [hl]
ret
-Functionc8e49: ; c8e49 (32:4e49)
+.four_cgb: ; c8e49 (32:4e49)
ld a, $e4
- call Functionc8e7f
+ call BGEffects_LoadBGPal1_OBPal0
call EndBattleBGEffect
ret
-Functionc8e52: ; c8e52 (32:4e52)
+BGEffects_LoadBGPal0_OBPal1: ; c8e52 (32:4e52)
ld h, a
ld a, [rSVBK]
push af
@@ -2642,7 +2586,7 @@
ld [hCGBPalUpdate], a
ret
-Functionc8e7f: ; c8e7f (32:4e7f)
+BGEffects_LoadBGPal1_OBPal0: ; c8e7f (32:4e7f)
ld h, a
ld a, [rSVBK]
push af
--- /dev/null
+++ b/battle/objects/data.asm
@@ -1,0 +1,573 @@
+BattleAnimObjects: ; ccb56
+battleanimobj: MACRO
+
+; ??, ??, frameset, function, ??, tile offset
+ db \1, \2, \3, \4, \5, \6
+endm
+
+
+; ANIM_OBJ_00
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_01
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_02
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_03
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_00, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_04
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_01, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_05
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_02, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_06
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_03, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_07
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_04, BATTLEANIMFUNC_1B, $02, $01
+
+; ANIM_OBJ_08
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_09
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_06, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_0A
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_07, BATTLEANIMFUNC_09, $02, $01
+
+; ANIM_OBJ_0B
+ battleanimobj $01, $aa, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_10, $04, $03
+
+; ANIM_OBJ_0C
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_0E, BATTLEANIMFUNC_04, $04, $03
+
+; ANIM_OBJ_0D
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_03, $04, $03
+
+; ANIM_OBJ_0E
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_08, $04, $03
+
+; ANIM_OBJ_0F
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_0A, $04, $03
+
+; ANIM_OBJ_BURNED
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_03, $04, $03
+
+; ANIM_OBJ_11
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_12, BATTLEANIMFUNC_08, $06, $0a
+
+; ANIM_OBJ_12
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_13, BATTLEANIMFUNC_00, $06, $0a
+
+; ANIM_OBJ_13
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_14, BATTLEANIMFUNC_01, $06, $0a
+
+; ANIM_OBJ_14
+ battleanimobj $21, $78, BATTLEANIMFRAMESET_16, BATTLEANIMFUNC_0B, $05, $06
+
+; ANIM_OBJ_POKE_BALL
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_12, $04, $0b
+
+; ANIM_OBJ_16
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_09, BATTLEANIMFUNC_13, $04, $0b
+
+; ANIM_OBJ_17
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, $04, $08
+
+; ANIM_OBJ_18
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_18, BATTLEANIMFUNC_00, $04, $08
+
+; ANIM_OBJ_19
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_1D, BATTLEANIMFUNC_06, $02, $0c
+
+; ANIM_OBJ_1A
+ battleanimobj $01, $b4, BATTLEANIMFRAMESET_1F, BATTLEANIMFUNC_38, $02, $0c
+
+; ANIM_OBJ_1B
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, $02, $07
+
+; ANIM_OBJ_1C
+ battleanimobj $01, $a0, BATTLEANIMFRAMESET_08, BATTLEANIMFUNC_00, $02, $07
+
+; ANIM_OBJ_1D
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_07, $07, $09
+
+; ANIM_OBJ_1E
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_1A, BATTLEANIMFUNC_07, $07, $09
+
+; ANIM_OBJ_1F
+ battleanimobj $01, $b0, BATTLEANIMFRAMESET_1B, BATTLEANIMFUNC_36, $07, $09
+
+; ANIM_OBJ_20
+ battleanimobj $01, $b0, BATTLEANIMFRAMESET_84, BATTLEANIMFUNC_36, $06, $21
+
+; ANIM_OBJ_21
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_0C, $06, $0d
+
+; ANIM_OBJ_22
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_23, BATTLEANIMFUNC_0D, $06, $0d
+
+; ANIM_OBJ_23
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_0E, $02, $0e
+
+; ANIM_OBJ_24
+ battleanimobj $61, $80, BATTLEANIMFRAMESET_27, BATTLEANIMFUNC_0F, $06, $04
+
+; ANIM_OBJ_25
+ battleanimobj $01, $b4, BATTLEANIMFRAMESET_2A, BATTLEANIMFUNC_00, $06, $04
+
+; ANIM_OBJ_26
+ battleanimobj $01, $40, BATTLEANIMFRAMESET_2B, BATTLEANIMFUNC_11, $05, $0f
+
+; ANIM_OBJ_27
+ battleanimobj $61, $98, BATTLEANIMFRAMESET_2C, BATTLEANIMFUNC_00, $03, $10
+
+; ANIM_OBJ_28
+ battleanimobj $61, $98, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, $03, $10
+
+; ANIM_OBJ_29
+ battleanimobj $01, $b8, BATTLEANIMFRAMESET_2E, BATTLEANIMFUNC_00, $06, $0a
+
+; ANIM_OBJ_FROZEN
+ battleanimobj $01, $b8, BATTLEANIMFRAMESET_2F, BATTLEANIMFUNC_00, $06, $0a
+
+; ANIM_OBJ_2B
+ battleanimobj $01, $b8, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_14, $07, $11
+
+; ANIM_OBJ_2C
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_14, $03, $0d
+
+; ANIM_OBJ_2D
+ battleanimobj $21, $b0, BATTLEANIMFRAMESET_31, BATTLEANIMFUNC_00, $03, $05
+
+; ANIM_OBJ_2E
+ battleanimobj $21, $b0, BATTLEANIMFRAMESET_32, BATTLEANIMFUNC_00, $03, $05
+
+; ANIM_OBJ_2F
+ battleanimobj $21, $b0, BATTLEANIMFRAMESET_33, BATTLEANIMFUNC_00, $03, $05
+
+; ANIM_OBJ_30
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_15, $03, $05
+
+; ANIM_OBJ_31
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_36, BATTLEANIMFUNC_00, $03, $05
+
+; ANIM_OBJ_32
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_37, BATTLEANIMFUNC_03, $02, $08
+
+; ANIM_OBJ_33
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_38, BATTLEANIMFUNC_00, $03, $05
+
+; ANIM_OBJ_34
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_39, BATTLEANIMFUNC_03, $02, $08
+
+; ANIM_OBJ_35
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_3A, BATTLEANIMFUNC_16, $02, $02
+
+; ANIM_OBJ_36
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_3C, BATTLEANIMFUNC_17, $02, $02
+
+; ANIM_OBJ_37
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_3E, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_38
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_3F, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_39
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_40, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_3A
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_41, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_3B
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_42, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_3C
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_18, $05, $12
+
+; ANIM_OBJ_3D
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_44, BATTLEANIMFUNC_00, $05, $12
+
+; ANIM_OBJ_GUST
+ battleanimobj $21, $b8, BATTLEANIMFRAMESET_45, BATTLEANIMFUNC_19, $02, $13
+
+; ANIM_OBJ_3F
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_46, BATTLEANIMFUNC_00, $02, $14
+
+; ANIM_OBJ_40
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_47, BATTLEANIMFUNC_00, $02, $14
+
+; ANIM_OBJ_41
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_48, BATTLEANIMFUNC_1A, $02, $14
+
+; ANIM_OBJ_42
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_49, BATTLEANIMFUNC_1A, $02, $14
+
+; ANIM_OBJ_43
+ battleanimobj $21, $98, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_01, $02, $14
+
+; ANIM_OBJ_44
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_4B, BATTLEANIMFUNC_00, $03, $11
+
+; ANIM_OBJ_45
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_4C, BATTLEANIMFUNC_1C, $05, $12
+
+; ANIM_OBJ_46
+ battleanimobj $21, $b0, BATTLEANIMFRAMESET_4D, BATTLEANIMFUNC_1D, $02, $15
+
+; ANIM_OBJ_47
+ battleanimobj $01, $b0, BATTLEANIMFRAMESET_51, BATTLEANIMFUNC_1E, $03, $11
+
+; ANIM_OBJ_48
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_52, BATTLEANIMFUNC_1F, $05, $16
+
+; ANIM_OBJ_49
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_54, BATTLEANIMFUNC_1F, $05, $16
+
+; ANIM_OBJ_4A
+ battleanimobj $21, $68, BATTLEANIMFRAMESET_56, BATTLEANIMFUNC_20, $05, $06
+
+; ANIM_OBJ_4B
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_59, BATTLEANIMFUNC_21, $02, $0e
+
+; ANIM_OBJ_4C
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_5C, BATTLEANIMFUNC_02, $02, $17
+
+; ANIM_OBJ_4D
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_5D, BATTLEANIMFUNC_22, $03, $11
+
+; ANIM_OBJ_4E
+ battleanimobj $61, $88, BATTLEANIMFRAMESET_5F, BATTLEANIMFUNC_00, $03, $10
+
+; ANIM_OBJ_4F
+ battleanimobj $61, $88, BATTLEANIMFRAMESET_2D, BATTLEANIMFUNC_09, $03, $10
+
+; ANIM_OBJ_50
+ battleanimobj $21, $88, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, $03, $18
+
+; ANIM_OBJ_51
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_60, BATTLEANIMFUNC_00, $02, $18
+
+; ANIM_OBJ_CHICK
+ battleanimobj $21, $50, BATTLEANIMFRAMESET_61, BATTLEANIMFUNC_23, $03, $19
+
+; ANIM_OBJ_53
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_63, BATTLEANIMFUNC_24, $02, $19
+
+; ANIM_OBJ_54
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_66, BATTLEANIMFUNC_25, $02, $19
+
+; ANIM_OBJ_SKULL
+ battleanimobj $01, $50, BATTLEANIMFRAMESET_1C, BATTLEANIMFUNC_00, $02, $0c
+
+; ANIM_OBJ_56
+ battleanimobj $21, $a8, BATTLEANIMFRAMESET_67, BATTLEANIMFUNC_26, $07, $1a
+
+; ANIM_OBJ_57
+ battleanimobj $21, $a8, BATTLEANIMFRAMESET_68, BATTLEANIMFUNC_00, $07, $1a
+
+; ANIM_OBJ_58
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_69, BATTLEANIMFUNC_01, $02, $1a
+
+; ANIM_OBJ_PARALYZED
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_6D, BATTLEANIMFUNC_28, $03, $19
+
+; ANIM_OBJ_5A
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_6A, BATTLEANIMFUNC_27, $02, $1b
+
+; ANIM_OBJ_5B
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_29, $02, $1c
+
+; ANIM_OBJ_5C
+ battleanimobj $21, $48, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_29, $02, $1c
+
+; ANIM_OBJ_5D
+ battleanimobj $21, $48, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_29, $02, $1c
+
+; ANIM_OBJ_5E
+ battleanimobj $21, $78, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_2A, $02, $1c
+
+; ANIM_OBJ_5F
+ battleanimobj $61, $90, BATTLEANIMFRAMESET_71, BATTLEANIMFUNC_2B, $02, $1d
+
+; ANIM_OBJ_60
+ battleanimobj $61, $90, BATTLEANIMFRAMESET_72, BATTLEANIMFUNC_2C, $02, $1d
+
+; ANIM_OBJ_61
+ battleanimobj $01, $48, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_2D, $04, $1e
+
+; ANIM_OBJ_62
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_06, $02, $15
+
+; ANIM_OBJ_63
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_75, BATTLEANIMFUNC_2E, $07, $19
+
+; ANIM_OBJ_64
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_4A, BATTLEANIMFUNC_02, $02, $14
+
+; ANIM_OBJ_65
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_2F, $02, $11
+
+; ANIM_OBJ_66
+ battleanimobj $01, $78, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_2A, $04, $23
+
+; ANIM_OBJ_67
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_30, $02, $1f
+
+; ANIM_OBJ_68
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_02, $02, $1f
+
+; ANIM_OBJ_69
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_77, BATTLEANIMFUNC_00, $02, $1f
+
+; ANIM_OBJ_6A
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_08, $03, $23
+
+; ANIM_OBJ_6B
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_79, BATTLEANIMFUNC_00, $02, $1f
+
+; ANIM_OBJ_6C
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, $03, $11
+
+; ANIM_OBJ_6D
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_7A, BATTLEANIMFUNC_31, $03, $11
+
+; ANIM_OBJ_6E
+ battleanimobj $21, $88, BATTLEANIMFRAMESET_7B, BATTLEANIMFUNC_32, $02, $20
+
+; ANIM_OBJ_6F
+ battleanimobj $21, $98, BATTLEANIMFRAMESET_7C, BATTLEANIMFUNC_00, $02, $04
+
+; ANIM_OBJ_70
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_7D, BATTLEANIMFUNC_00, $02, $18
+
+; ANIM_OBJ_71
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_21, BATTLEANIMFUNC_2F, $06, $0d
+
+; ANIM_OBJ_72
+ battleanimobj $01, $b0, BATTLEANIMFRAMESET_7E, BATTLEANIMFUNC_33, $03, $12
+
+; ANIM_OBJ_73
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_2F, $02, $08
+
+; ANIM_OBJ_74
+ battleanimobj $21, $a0, BATTLEANIMFRAMESET_6F, BATTLEANIMFUNC_34, $02, $1c
+
+; ANIM_OBJ_75
+ battleanimobj $21, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_35, $02, $15
+
+; ANIM_OBJ_76
+ battleanimobj $21, $b0, BATTLEANIMFRAMESET_80, BATTLEANIMFUNC_33, $02, $14
+
+; ANIM_OBJ_77
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_81, BATTLEANIMFUNC_37, $02, $11
+
+; ANIM_OBJ_78
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_85, BATTLEANIMFUNC_00, $02, $22
+
+; ANIM_OBJ_79
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_86, BATTLEANIMFUNC_00, $02, $22
+
+; ANIM_OBJ_7A
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_87, BATTLEANIMFUNC_39, $02, $1f
+
+; ANIM_OBJ_7B
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_30, BATTLEANIMFUNC_3A, $03, $11
+
+; ANIM_OBJ_7C
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_34, BATTLEANIMFUNC_00, $03, $05
+
+; ANIM_OBJ_7D
+ battleanimobj $a1, $88, BATTLEANIMFRAMESET_88, BATTLEANIMFUNC_3B, $06, $13
+
+; ANIM_OBJ_HEART
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_76, BATTLEANIMFUNC_25, $04, $23
+
+; ANIM_OBJ_7F
+ battleanimobj $01, $98, BATTLEANIMFRAMESET_10, BATTLEANIMFUNC_34, $04, $03
+
+; ANIM_OBJ_80
+ battleanimobj $01, $a8, BATTLEANIMFRAMESET_0F, BATTLEANIMFUNC_3C, $04, $03
+
+; ANIM_OBJ_81
+ battleanimobj $21, $68, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_29, $02, $1f
+
+; ANIM_OBJ_82
+ battleanimobj $21, $b0, BATTLEANIMFRAMESET_8A, BATTLEANIMFUNC_00, $02, $1f
+
+; ANIM_OBJ_83
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_8C, BATTLEANIMFUNC_00, $02, $1f
+
+; ANIM_OBJ_84
+ battleanimobj $21, $50, BATTLEANIMFRAMESET_8D, BATTLEANIMFUNC_00, $03, $1f
+
+; ANIM_OBJ_85
+ battleanimobj $01, $40, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_40, $02, $0e
+
+; ANIM_OBJ_86
+ battleanimobj $21, $a8, BATTLEANIMFRAMESET_8E, BATTLEANIMFUNC_41, $04, $1f
+
+; ANIM_OBJ_87
+ battleanimobj $21, $88, BATTLEANIMFRAMESET_8F, BATTLEANIMFUNC_3E, $02, $1f
+
+; ANIM_OBJ_88
+ battleanimobj $21, $88, BATTLEANIMFRAMESET_93, BATTLEANIMFUNC_3E, $02, $1f
+
+; ANIM_OBJ_89
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_97, BATTLEANIMFUNC_3D, $02, $1f
+
+; ANIM_OBJ_8A
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_3D, $03, $23
+
+; ANIM_OBJ_8B
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_2E, $02, $19
+
+; ANIM_OBJ_8C
+ battleanimobj $21, $a0, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_02, $02, $15
+
+; ANIM_OBJ_8D
+ battleanimobj $21, $a0, BATTLEANIMFRAMESET_99, BATTLEANIMFUNC_35, $04, $19
+
+; ANIM_OBJ_8E
+ battleanimobj $21, $70, BATTLEANIMFRAMESET_8B, BATTLEANIMFUNC_3F, $02, $1f
+
+; ANIM_OBJ_8F
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_15, BATTLEANIMFUNC_08, $02, $0a
+
+; ANIM_OBJ_90
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_11, BATTLEANIMFUNC_02, $04, $03
+
+; ANIM_OBJ_91
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_7F, BATTLEANIMFUNC_42, $02, $08
+
+; ANIM_OBJ_92
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_9A, BATTLEANIMFUNC_00, $02, $1b
+
+; ANIM_OBJ_93
+ battleanimobj $21, $a0, BATTLEANIMFRAMESET_9B, BATTLEANIMFUNC_35, $04, $23
+
+; ANIM_OBJ_94
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_23, $02, $25
+
+; ANIM_OBJ_95
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_9D, BATTLEANIMFUNC_25, $02, $25
+
+; ANIM_OBJ_96
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_00, $02, $25
+
+; ANIM_OBJ_97
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_9E, BATTLEANIMFUNC_00, $06, $25
+
+; ANIM_OBJ_98
+ battleanimobj $61, $80, BATTLEANIMFRAMESET_9F, BATTLEANIMFUNC_3A, $05, $23
+
+; ANIM_OBJ_99
+ battleanimobj $21, $80, BATTLEANIMFRAMESET_A0, BATTLEANIMFUNC_16, $02, $23
+
+; ANIM_OBJ_9A
+ battleanimobj $21, $70, BATTLEANIMFRAMESET_78, BATTLEANIMFUNC_43, $03, $23
+
+; ANIM_OBJ_9B
+ battleanimobj $21, $c0, BATTLEANIMFRAMESET_A2, BATTLEANIMFUNC_01, $02, $25
+
+; ANIM_OBJ_9C
+ battleanimobj $21, $40, BATTLEANIMFRAMESET_A3, BATTLEANIMFUNC_44, $03, $24
+
+; ANIM_OBJ_9D
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_A4, BATTLEANIMFUNC_00, $02, $24
+
+; ANIM_OBJ_9E
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_A5, BATTLEANIMFUNC_00, $03, $24
+
+; ANIM_OBJ_9F
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_43, BATTLEANIMFUNC_45, $04, $12
+
+; ANIM_OBJ_A0
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_A6, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_A1
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_A7, BATTLEANIMFUNC_00, $02, $02
+
+; ANIM_OBJ_A2
+ battleanimobj $21, $00, BATTLEANIMFRAMESET_B4, BATTLEANIMFUNC_4A, $07, $0f
+
+; ANIM_OBJ_A3
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_A8, BATTLEANIMFUNC_02, $03, $05
+
+; ANIM_OBJ_A4
+ battleanimobj $21, $40, BATTLEANIMFRAMESET_9C, BATTLEANIMFUNC_11, $02, $25
+
+; ANIM_OBJ_A5
+ battleanimobj $61, $90, BATTLEANIMFRAMESET_A9, BATTLEANIMFUNC_46, $02, $23
+
+; ANIM_OBJ_A6
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_47, $02, $0e
+
+; ANIM_OBJ_A7
+ battleanimobj $01, $80, BATTLEANIMFRAMESET_AA, BATTLEANIMFUNC_00, $02, $24
+
+; ANIM_OBJ_A8
+ battleanimobj $21, $b8, BATTLEANIMFRAMESET_AB, BATTLEANIMFUNC_48, $02, $13
+
+; ANIM_OBJ_A9
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_AC, BATTLEANIMFUNC_44, $02, $13
+
+; ANIM_OBJ_AA
+ battleanimobj $01, $a8, BATTLEANIMFRAMESET_05, BATTLEANIMFUNC_00, $02, $01
+
+; ANIM_OBJ_AB
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_24, BATTLEANIMFUNC_43, $02, $0e
+
+; ANIM_OBJ_AC
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_AD, BATTLEANIMFUNC_00, $06, $17
+
+; ANIM_OBJ_AD
+ battleanimobj $01, $a8, BATTLEANIMFRAMESET_AE, BATTLEANIMFUNC_49, $02, $01
+
+; ANIM_OBJ_AE
+ battleanimobj $21, $90, BATTLEANIMFRAMESET_AF, BATTLEANIMFUNC_01, $03, $11
+
+; ANIM_OBJ_AF
+ battleanimobj $21, $00, BATTLEANIMFRAMESET_B0, BATTLEANIMFUNC_4A, $02, $04
+
+; ANIM_OBJ_B0
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_70, BATTLEANIMFUNC_4B, $04, $1c
+
+; ANIM_OBJ_B1
+ battleanimobj $01, $88, BATTLEANIMFRAMESET_B1, BATTLEANIMFUNC_4C, $02, $19
+
+; ANIM_OBJ_B2
+ battleanimobj $01, $b8, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4D, $07, $09
+
+; ANIM_OBJ_B3
+ battleanimobj $61, $98, BATTLEANIMFRAMESET_B3, BATTLEANIMFUNC_00, $03, $27
+
+; ANIM_OBJ_B4
+ battleanimobj $61, $98, BATTLEANIMFRAMESET_74, BATTLEANIMFUNC_04, $06, $15
+
+; ANIM_OBJ_B5
+ battleanimobj $21, $ff, BATTLEANIMFRAMESET_19, BATTLEANIMFUNC_4E, $07, $09
+
+; ANIM_OBJ_FLOWER
+ battleanimobj $01, $90, BATTLEANIMFRAMESET_73, BATTLEANIMFUNC_08, $04, $1e
+
+; ANIM_OBJ_COTTON
+ battleanimobj $01, $ff, BATTLEANIMFRAMESET_89, BATTLEANIMFUNC_4F, $04, $1f
+
+; ANIM_OBJ_B8
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_B5, BATTLEANIMFUNC_00, $00, $28
+
+; ANIM_OBJ_B9
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_B6, BATTLEANIMFUNC_00, $01, $29
+
+; ANIM_OBJ_BA
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_B7, BATTLEANIMFUNC_00, $00, $28
+
+; ANIM_OBJ_BB
+ battleanimobj $00, $00, BATTLEANIMFRAMESET_B8, BATTLEANIMFUNC_00, $01, $29
+
+; ccfbe
--- /dev/null
+++ b/battle/objects/engine.asm
@@ -1,0 +1,314 @@
+QueueBattleAnimation: ; cc9a1 (33:49a1)
+ ld hl, ActiveAnimObjects
+ ld e, 10
+.loop
+ ld a, [hl]
+ and a
+ jr z, .done
+ ld bc, BATTLEANIMSTRUCT_LENGTH
+ add hl, bc
+ dec e
+ jr nz, .loop
+ scf
+ ret
+
+.done
+ ld c, l
+ ld b, h
+ ld hl, wNumActiveBattleAnims
+ inc [hl]
+ call InitBattleAnimation
+ ret
+
+DeinitBattleAnimation: ; cc9bd
+ ld hl, BATTLEANIMSTRUCT_INDEX
+ add hl, bc
+ ld [hl], $0
+ ret
+
+; cc9c4
+
+InitBattleAnimation: ; cc9c4 (33:49c4)
+ ld a, [wBattleAnimTemp0]
+ ld e, a
+ ld d, 0
+ ld hl, BattleAnimObjects
+rept 6
+ add hl, de
+endr
+ ld e, l
+ ld d, h
+ ld hl, BATTLEANIMSTRUCT_INDEX
+ add hl, bc
+ ld a, [wNumActiveBattleAnims]
+ ld [hli], a ; Index
+ ld a, [de]
+ inc de
+ ld [hli], a ; 01
+ ld a, [de]
+ inc de
+ ld [hli], a ; 02
+ ld a, [de]
+ inc de
+ ld [hli], a ; Frameset ID
+ ld a, [de]
+ inc de
+ ld [hli], a ; Function
+ ld a, [de]
+ inc de
+ ld [hli], a ; 05
+ ld a, [de]
+ call GetBattleAnimTileOffset
+ ld [hli], a ; Tile ID
+ ld a, [wBattleAnimTemp1]
+ ld [hli], a ; X Coord
+ ld a, [wBattleAnimTemp2]
+ ld [hli], a ; Y Coord
+ xor a
+ ld [hli], a ; X Offset
+ ld [hli], a ; Y Offset
+ ld a, [wBattleAnimTemp3]
+ ld [hli], a ; 0b
+ xor a
+ ld [hli], a ; 0c
+ dec a
+ ld [hli], a ; 0d
+ xor a
+ ld [hli], a ; 0e
+ ld [hli], a ; 0f
+ ld [hl], a ; 10
+ ret
+
+BattleAnimOAMUpdate: ; cca09
+ call InitBattleAnimBuffer
+ call GetBattleAnimFrame
+ cp -3
+ jp z, .done
+ cp -4
+ jp z, .delete
+ push af
+ ld hl, wBattleAnimTempOAMFlags
+ ld a, [wBattleAnimTemp7]
+ xor [hl]
+ and $e0
+ ld [hl], a
+ pop af
+ push bc
+ call GetBattleAnimOAMPointer
+ ld a, [wBattleAnimTempTileID]
+ add [hl]
+ ld [wBattleAnimTempTileID], a
+ inc hl
+ ld a, [hli]
+ ld c, a
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ ld a, [wBattleAnimOAMPointerLo]
+ ld e, a
+ ld d, Sprites / $100
+.loop
+ ld a, [wBattleAnimTempYCoord]
+ ld b, a
+ ld a, [wBattleAnimTempYOffset]
+ add b
+ ld b, a
+ push hl
+ ld a, [hl]
+ ld hl, wBattleAnimTempOAMFlags
+ bit 6, [hl]
+ jr z, .no_yflip
+ add $8
+ xor $ff
+ inc a
+
+.no_yflip
+ pop hl
+ add b
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [wBattleAnimTempXCoord]
+ ld b, a
+ ld a, [wBattleAnimTempXOffset]
+ add b
+ ld b, a
+ push hl
+ ld a, [hl]
+ ld hl, wBattleAnimTempOAMFlags
+ bit 5, [hl]
+ jr z, .no_xflip
+ add $8
+ xor $ff
+ inc a
+
+.no_xflip
+ pop hl
+ add b
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [wBattleAnimTempTileID]
+ add $31
+ add [hl]
+ ld [de], a
+ inc hl
+ inc de
+ ld a, [wBattleAnimTempOAMFlags]
+ ld b, a
+ ld a, [hl]
+ xor b
+ and $e0
+ ld b, a
+ ld a, [hl]
+ and $10
+ or b
+ ld b, a
+ ld a, [wBattleAnimTempPalette]
+ and $f
+ or b
+ ld [de], a
+ inc hl
+ inc de
+ ld a, e
+ ld [wBattleAnimOAMPointerLo], a
+ cp $a0
+ jr nc, .exit_set_carry
+ dec c
+ jr nz, .loop
+ pop bc
+ jr .done
+
+.delete
+ call DeinitBattleAnimation
+
+.done
+ and a
+ ret
+
+.exit_set_carry
+ pop bc
+ scf
+ ret
+
+; ccaaa
+
+InitBattleAnimBuffer: ; ccaaa
+ ld hl, BATTLEANIMSTRUCT_01
+ add hl, bc
+ ld a, [hl]
+ and %10000000
+ ld [wBattleAnimTempOAMFlags], a
+ xor a
+ ld [wBattleAnimTemp7], a
+ ld hl, BATTLEANIMSTRUCT_PALETTE
+ add hl, bc
+ ld a, [hl]
+ ld [wBattleAnimTempPalette], a
+ ld hl, BATTLEANIMSTRUCT_02
+ add hl, bc
+ ld a, [hl]
+ ld [wBattleAnimTemp1], a
+ ld hl, BATTLEANIMSTRUCT_TILEID
+ add hl, bc
+ ld a, [hli]
+ ld [wBattleAnimTempTileID], a
+ ld a, [hli]
+ ld [wBattleAnimTempXCoord], a
+ ld a, [hli]
+ ld [wBattleAnimTempYCoord], a
+ ld a, [hli]
+ ld [wBattleAnimTempXOffset], a
+ ld a, [hli]
+ ld [wBattleAnimTempYOffset], a
+ ld a, [hBattleTurn]
+ and a
+ ret z
+ ld hl, BATTLEANIMSTRUCT_01
+ add hl, bc
+ ld a, [hl]
+ ld [wBattleAnimTempOAMFlags], a
+ bit 0, [hl]
+ ret z
+ ld hl, BATTLEANIMSTRUCT_XCOORD
+ add hl, bc
+ ld a, [hli]
+ ld d, a
+ ld a, (-10 * 8) + 4
+ sub d
+ ld [wBattleAnimTempXCoord], a
+ ld a, [hli]
+ ld d, a
+ ld a, [wBattleAnimTemp1]
+ cp $ff
+ jr nz, .check_kinesis_softboiled_milkdrink
+ ld a, 5 * 8
+ add d
+ jr .done
+
+.check_kinesis_softboiled_milkdrink
+ sub d
+ push af
+ ld a, [FXAnimIDHi]
+ or a
+ jr nz, .no_sub
+ ld a, [FXAnimIDLo]
+ cp KINESIS
+ jr z, .kinesis
+ cp SOFTBOILED
+ jr z, .softboiled
+ cp MILK_DRINK
+ jr nz, .no_sub
+.kinesis
+.softboiled
+.milk_drink
+ pop af
+ sub 1 * 8
+ jr .done
+
+.no_sub
+ pop af
+.done
+ ld [wBattleAnimTempYCoord], a
+ ld a, [hli]
+ xor $ff
+ inc a
+ ld [wBattleAnimTempXOffset], a
+ ret
+
+; ccb31
+
+GetBattleAnimTileOffset: ; ccb31 (33:4b31)
+ push hl
+ push bc
+ ld hl, wBattleAnimTileDict
+ ld b, a
+ ld c, 10 / 2
+.loop
+ ld a, [hli]
+ cp b
+ jr z, .load
+ inc hl
+ dec c
+ jr nz, .loop
+ xor a
+ jr .done
+
+.load
+ ld a, [hl]
+.done
+ pop bc
+ pop hl
+ ret
+
+_ExecuteBGEffects: ; ccb48
+ callab ExecuteBGEffects
+ ret
+
+; ccb4f
+
+_QueueBGEffect: ; ccb4f (33:4b4f)
+ callab QueueBGEffect
+ ret
+
+; ccb56 (33:4b56)
--- /dev/null
+++ b/battle/objects/library.asm
@@ -1,0 +1,130 @@
+ReinitBattleAnimFrameset: ; ce7bf (33:67bf)
+ ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
+ add hl, bc
+ ld [hl], a
+ ld hl, BATTLEANIMSTRUCT_DURATION
+ add hl, bc
+ ld [hl], 0
+ ld hl, BATTLEANIMSTRUCT_FRAME
+ add hl, bc
+ ld [hl], -1
+ ret
+
+GetBattleAnimFrame: ; ce7d1
+.loop
+ ld hl, BATTLEANIMSTRUCT_DURATION
+ add hl, bc
+ ld a, [hl]
+ and a
+ jr z, .next_frame
+ dec [hl]
+ call .GetPointer
+ ld a, [hli]
+ push af
+ jr .okay
+
+.next_frame
+ ld hl, BATTLEANIMSTRUCT_FRAME
+ add hl, bc
+ inc [hl]
+ call .GetPointer
+ ld a, [hli]
+ cp -2
+ jr z, .restart
+ cp -1
+ jr z, .repeat_last
+ push af
+ ld a, [hl]
+ push hl
+ and $3f
+ ld hl, BATTLEANIMSTRUCT_DURATION
+ add hl, bc
+ ld [hl], a
+ pop hl
+
+.okay
+ ld a, [hl]
+ and $c0
+ srl a
+ ld [wBattleAnimTemp7], a
+ pop af
+ ret
+
+.repeat_last
+ xor a
+ ld hl, BATTLEANIMSTRUCT_DURATION
+ add hl, bc
+ ld [hl], a
+ ld hl, BATTLEANIMSTRUCT_FRAME
+ add hl, bc
+ dec [hl]
+ dec [hl]
+ jr .loop
+
+.restart
+ xor a
+ ld hl, BATTLEANIMSTRUCT_DURATION
+ add hl, bc
+ ld [hl], a
+ dec a
+ ld hl, BATTLEANIMSTRUCT_FRAME
+ add hl, bc
+ ld [hl], a
+ jr .loop
+
+; ce823
+
+.GetPointer: ; ce823
+ ld hl, BATTLEANIMSTRUCT_FRAMESET_ID
+ add hl, bc
+ ld e, [hl]
+ ld d, 0
+ ld hl, BattleAnimFrameData
+ add hl, de
+ add hl, de
+ ld e, [hl]
+ inc hl
+ ld d, [hl]
+ ld hl, BATTLEANIMSTRUCT_FRAME
+ add hl, bc
+ ld l, [hl]
+ ld h, $0
+ add hl, hl
+ add hl, de
+ ret
+
+; ce83c
+
+GetBattleAnimOAMPointer: ; ce83c
+ ld l, a
+ ld h, 0
+ ld de, BattleAnimOAMData
+ add hl, hl
+ add hl, hl
+ add hl, de
+ ret
+
+; ce846
+
+LoadBattleAnimObj: ; ce846 (33:6846)
+ push hl
+ ld l, a
+ ld h, 0
+ add hl, hl
+ add hl, hl
+ ld de, AnimObjGFX
+ add hl, de
+ ld c, [hl]
+ inc hl
+ ld b, [hl]
+ inc hl
+ ld a, [hli]
+ ld h, [hl]
+ ld l, a
+ pop de
+ push bc
+ call DecompressRequest2bpp
+ pop bc
+ ret
+
+; ce85e (33:685e)
--- a/battle/trainer_huds.asm
+++ b/battle/trainer_huds.asm
@@ -1,9 +1,3 @@
-wPlaceBallsDirection EQU $d003
-wTrainerHUDTiles EQU $d004
-wPlaceBallsX EQU $cfc4
-wPlaceBallsY EQU $cfc5
-GLOBAL wPlaceBallsDirection, wTrainerHUDTiles, wPlaceBallsX, wPlaceBallsY
-
BattleStart_TrainerHuds: ; 2c000
ld a, $e4
ld [rOBP0], a
--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -1,9 +1,5 @@
INCLUDE "includes.asm"
-wCreditsBorderFrame EQU $cf64
-wCreditsBorderMon EQU $cf65
-wCreditsLYOverride EQU $cf66
-
SECTION "Credits", ROMX, BANK[CREDITS]
const_def
--- a/engine/pack.asm
+++ b/engine/pack.asm
@@ -1,6 +1,3 @@
-wCurrPocket EQU $cf65
-
-
Pack: ; 10000
ld hl, Options
set NO_TEXT_SCROLL, [hl]
--- a/wram.asm
+++ b/wram.asm
@@ -1532,14 +1532,18 @@
wIntroSceneFrameCounter::
wHoldingUnownPuzzlePiece::
wCardFlipCursorY::
+wCreditsBorderFrame::
wcf64:: ds 1
IF !DEF(CRYSTAL11)
wPokedexStatus::
ENDC
+wCreditsBorderMon::
wTitleScreenTimerLo::
wUnownPuzzleCursorPosition::
wCardFlipCursorX::
+wCurrPocket::
wcf65:: ds 1
+wCreditsLYOverride::
wTitleScreenTimerHi::
wUnownPuzzleHeldPiece::
wCardFlipWhichCard::
@@ -1679,8 +1683,11 @@
FXAnimIDLo:: ; cfc2
ds 1
FXAnimIDHi:: ; cfc3
- ds 3
-
+ ds 1
+wPlaceBallsX:: ; cfc4
+ ds 1
+wPlaceBallsY:: ; cfc5
+ ds 1
TileAnimationTimer:: ; cfc6
ds 1
@@ -1795,11 +1802,13 @@
PhoneCallerLo::
wNextRadioLine::
wMovementBufferPerson::
+wPlaceBallsDirection::
ds 1
wd004::
LuckyNumberDigit3Buffer::
PhoneCallerHi::
wRadioTextDelay::
+wTrainerHUDTiles::
ds 1
wd005::
LuckyNumberDigit4Buffer::