ref: 21276b79f12fa8e261e63f7ddba0cdfb2391c0f9
parent: e0b4fc781aba3c9ac184e0ab91dfcf5d11c585c5
author: PikalaxALT <[email protected]>
date: Fri Nov 13 05:48:49 EST 2015
SpriteAnim
--- a/constants/misc_constants.asm
+++ b/constants/misc_constants.asm
@@ -189,38 +189,85 @@
NUM_BADGES EQU NUM_JOHTO_BADGES + NUM_KANTO_BADGES
const_def
- const JUMPTABLE_8D24B_FUNCTION_00
- const JUMPTABLE_8D24B_FUNCTION_01
- const JUMPTABLE_8D24B_FUNCTION_02
- const JUMPTABLE_8D24B_FUNCTION_03
- const JUMPTABLE_8D24B_FUNCTION_04
- const JUMPTABLE_8D24B_FUNCTION_05
- const JUMPTABLE_8D24B_FUNCTION_06
- const JUMPTABLE_8D24B_FUNCTION_07
- const JUMPTABLE_8D24B_FUNCTION_08
- const JUMPTABLE_8D24B_FUNCTION_09
- const JUMPTABLE_8D24B_FUNCTION_0A
- const JUMPTABLE_8D24B_FUNCTION_0B
- const JUMPTABLE_8D24B_FUNCTION_0C
- const JUMPTABLE_8D24B_FUNCTION_0D
- const JUMPTABLE_8D24B_FUNCTION_0E
- const JUMPTABLE_8D24B_FUNCTION_0F
- const JUMPTABLE_8D24B_FUNCTION_10
- const JUMPTABLE_8D24B_FUNCTION_11
- const JUMPTABLE_8D24B_FUNCTION_12
- const JUMPTABLE_8D24B_FUNCTION_13
- const JUMPTABLE_8D24B_FUNCTION_14
- const JUMPTABLE_8D24B_FUNCTION_15
- const JUMPTABLE_8D24B_FUNCTION_16
- const JUMPTABLE_8D24B_FUNCTION_17
- const JUMPTABLE_8D24B_FUNCTION_18
- const JUMPTABLE_8D24B_FUNCTION_19
- const JUMPTABLE_8D24B_FUNCTION_1A
- const JUMPTABLE_8D24B_FUNCTION_1B
- const JUMPTABLE_8D24B_FUNCTION_1C
- const JUMPTABLE_8D24B_FUNCTION_1D
- const JUMPTABLE_8D24B_FUNCTION_1E
- const JUMPTABLE_8D24B_FUNCTION_1F
- const JUMPTABLE_8D24B_FUNCTION_20
- const JUMPTABLE_8D24B_FUNCTION_21
- const JUMPTABLE_8D24B_FUNCTION_22
+ const SPRITE_ANIM_SEQ_00
+ const SPRITE_ANIM_SEQ_01
+ const SPRITE_ANIM_SEQ_02
+ const SPRITE_ANIM_SEQ_03
+ const SPRITE_ANIM_SEQ_04
+ const SPRITE_ANIM_SEQ_05
+ const SPRITE_ANIM_SEQ_06
+ const SPRITE_ANIM_SEQ_07
+ const SPRITE_ANIM_SEQ_08
+ const SPRITE_ANIM_SEQ_09
+ const SPRITE_ANIM_SEQ_0A
+ const SPRITE_ANIM_SEQ_0B
+ const SPRITE_ANIM_SEQ_0C
+ const SPRITE_ANIM_SEQ_0D
+ const SPRITE_ANIM_SEQ_0E
+ const SPRITE_ANIM_SEQ_0F
+ const SPRITE_ANIM_SEQ_10
+ const SPRITE_ANIM_SEQ_11
+ const SPRITE_ANIM_SEQ_12
+ const SPRITE_ANIM_SEQ_13
+ const SPRITE_ANIM_SEQ_14
+ const SPRITE_ANIM_SEQ_15
+ const SPRITE_ANIM_SEQ_16
+ const SPRITE_ANIM_SEQ_17
+ const SPRITE_ANIM_SEQ_18
+ const SPRITE_ANIM_SEQ_19
+ const SPRITE_ANIM_SEQ_1A
+ const SPRITE_ANIM_SEQ_1B
+ const SPRITE_ANIM_SEQ_1C
+ const SPRITE_ANIM_SEQ_1D
+ const SPRITE_ANIM_SEQ_1E
+ const SPRITE_ANIM_SEQ_1F
+ const SPRITE_ANIM_SEQ_20
+ const SPRITE_ANIM_SEQ_21
+ const SPRITE_ANIM_SEQ_22
+
+ const_def
+ const SPRITE_ANIM_INDEX_00
+ const SPRITE_ANIM_INDEX_01
+ const SPRITE_ANIM_INDEX_02
+ const SPRITE_ANIM_INDEX_03
+ const SPRITE_ANIM_INDEX_04
+ const SPRITE_ANIM_INDEX_05
+ const SPRITE_ANIM_INDEX_06
+ const SPRITE_ANIM_INDEX_07
+ const SPRITE_ANIM_INDEX_08
+ const SPRITE_ANIM_INDEX_09
+ const SPRITE_ANIM_INDEX_0A
+ const SPRITE_ANIM_INDEX_0B
+ const SPRITE_ANIM_INDEX_0C
+ const SPRITE_ANIM_INDEX_0D
+ const SPRITE_ANIM_INDEX_0E
+ const SPRITE_ANIM_INDEX_0F
+ const SPRITE_ANIM_INDEX_10
+ const SPRITE_ANIM_INDEX_11
+ const SPRITE_ANIM_INDEX_12
+ const SPRITE_ANIM_INDEX_13
+ const SPRITE_ANIM_INDEX_14
+ const SPRITE_ANIM_INDEX_15
+ const SPRITE_ANIM_INDEX_16
+ const SPRITE_ANIM_INDEX_17
+ const SPRITE_ANIM_INDEX_18
+ const SPRITE_ANIM_INDEX_19
+ const SPRITE_ANIM_INDEX_1A
+ const SPRITE_ANIM_INDEX_1B
+ const SPRITE_ANIM_INDEX_1C
+ const SPRITE_ANIM_INDEX_1D
+ const SPRITE_ANIM_INDEX_1E
+ const SPRITE_ANIM_INDEX_1F
+ const SPRITE_ANIM_INDEX_20
+ const SPRITE_ANIM_INDEX_21
+ const SPRITE_ANIM_INDEX_22
+ const SPRITE_ANIM_INDEX_23
+ const SPRITE_ANIM_INDEX_24
+ const SPRITE_ANIM_INDEX_25
+ const SPRITE_ANIM_INDEX_26
+ const SPRITE_ANIM_INDEX_27
+ const SPRITE_ANIM_INDEX_28
+ const SPRITE_ANIM_INDEX_29
+ const SPRITE_ANIM_INDEX_2A
+ const SPRITE_ANIM_INDEX_2B
+ const SPRITE_ANIM_INDEX_2C
--- a/engine/breeding/egg.asm
+++ b/engine/breeding/egg.asm
@@ -792,8 +792,8 @@
add $4c
ld d, a
ld e, $58
- ld a, $19
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_19
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $0
@@ -821,8 +821,8 @@
ld b, a
push hl
push bc
- ld a, $1c
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1C
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $0
--- a/engine/dummy_game.asm
+++ b/engine/dummy_game.asm
@@ -123,7 +123,7 @@
.asm_e1f30
ld de, $341c
ld a, $c
- call Function3b2a
+ call _InitSpriteAnimStruct
ld a, $5
ld [wc702], a
ld hl, wJumptableIndex
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -321,7 +321,7 @@
push de
ld de, $4858
ld a, $13
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $b
add hl, bc
ld a, [wJumptableIndex]
--- a/engine/flypoints.asm
+++ b/engine/flypoints.asm
@@ -828,7 +828,7 @@
; Animation/palette
ld de, 0
ld a, $0
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, 3
add hl, bc
@@ -869,7 +869,7 @@
ld b, $1e ; Female
.asm_91fd3
ld a, b
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
--- a/engine/link.asm
+++ b/engine/link.asm
@@ -2388,7 +2388,7 @@
call Function2985a
pop de
ld a, $11
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $b
add hl, bc
pop bc
@@ -2395,7 +2395,7 @@
ld [hl], b
pop de
ld a, $12
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $b
add hl, bc
pop bc
@@ -3082,7 +3082,7 @@
Function2961b: ; 2961b
lb de, $54, $58
ld a, $e
- call Function3b2a
+ call _InitSpriteAnimStruct
call Function29114
ld a, $20
ld [wcf64], a
@@ -3092,7 +3092,7 @@
Function2962c: ; 2962c
lb de, $54, $58
ld a, $e
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $b
add hl, bc
ld [hl], $1
@@ -3108,7 +3108,7 @@
Function29649: ; 29649
lb de, $54, $58
ld a, $f
- call Function3b2a
+ call _InitSpriteAnimStruct
call Function29114
ld a, $10
ld [wcf64], a
@@ -3122,7 +3122,7 @@
call Functioncf8
lb de, $28, $58
ld a, $10
- call Function3b2a
+ call _InitSpriteAnimStruct
call Function29114
ld a, $40
ld [wcf64], a
--- a/engine/namingscreen.asm
+++ b/engine/namingscreen.asm
@@ -173,9 +173,9 @@
ld hl, wc300
ld [hli], a
ld [hl], a
- ld de, $2420
- ld a, $a
- call Function3b2a
+ lb de, $24, $20
+ ld a, SPRITE_ANIM_INDEX_0A
+ call _InitSpriteAnimStruct
ld hl, $1
add hl, bc
ld [hl], $0
@@ -220,7 +220,7 @@
ld [hli], a
ld [hl], a
pop de
- ld b, $a
+ ld b, SPRITE_ANIM_INDEX_0A
ld a, d
cp $7a
jr nz, .asm_11873
@@ -227,11 +227,11 @@
ld a, e
cp $40
jr nz, .asm_11873
- ld b, $1e
+ ld b, SPRITE_ANIM_INDEX_1E
.asm_11873
ld a, b
- ld de, $2420
- call Function3b2a
+ lb de, $24, $20
+ call _InitSpriteAnimStruct
ret
Function1187b: ; 1187b (4:587b)
@@ -405,8 +405,8 @@
jr nz, .asm_11985
ld d, $40
.asm_11985
- ld a, $2
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_02
+ call _InitSpriteAnimStruct
ld a, c
ld [wc6d5], a
ld a, b
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -1037,9 +1037,9 @@
call Function92fc0
push bc
push af
- ld de, $6068
- ld a, $6
- call Function3b2a
+ lb de, $60, $68
+ ld a, SPRITE_ANIM_INDEX_06
+ call _InitSpriteAnimStruct
ld hl, $e
add hl, bc
pop af
@@ -1096,9 +1096,9 @@
add hl, bc
ld [hl], $0
push bc
- ld de, $6000
- ld a, $7
- call Function3b2a
+ lb de, $60, $00
+ ld a, SPRITE_ANIM_INDEX_07
+ call _InitSpriteAnimStruct
pop bc
xor a
ld [wcf64], a
@@ -2063,9 +2063,9 @@
add hl, bc
dec [hl]
push bc
- ld de, $606c
- ld a, $8
- call Function3b2a
+ lb de, $60, $6c
+ ld a, SPRITE_ANIM_INDEX_08
+ call _InitSpriteAnimStruct
pop bc
ret
; 93316 (24:7316)
--- a/engine/sprites.asm
+++ b/engine/sprites.asm
@@ -113,7 +113,7 @@
.done
ret
-Function8cfd6:: ; 8cfd6
+InitSpriteAnimStruct:: ; 8cfd6
; Find if there's any room in the wc314 array, which is 10x16
push de
push af
@@ -235,7 +235,6 @@
Function8d04c: ; 8d04c
-; Populate Sprites with the bouncing mon icons
call Function8d0ec ; init WRAM
call Function8d132 ; read from a memory array
cp -3
@@ -539,51 +538,51 @@
; 8d1c4
Unknown_8d1c4: ; 8d1c4
- db $01, JUMPTABLE_8D24B_FUNCTION_01, $00 ; 00
- db $07, JUMPTABLE_8D24B_FUNCTION_04, $00 ; 01
- db $08, JUMPTABLE_8D24B_FUNCTION_05, $05 ; 02
- db $0a, JUMPTABLE_8D24B_FUNCTION_06, $00 ; 03
- db $0b, JUMPTABLE_8D24B_FUNCTION_07, $06 ; 04
- db $0c, JUMPTABLE_8D24B_FUNCTION_08, $06 ; 05
- db $0d, JUMPTABLE_8D24B_FUNCTION_09, $07 ; 06
- db $0e, JUMPTABLE_8D24B_FUNCTION_0A, $07 ; 07
- db $10, JUMPTABLE_8D24B_FUNCTION_0B, $07 ; 08
- db $08, JUMPTABLE_8D24B_FUNCTION_0C, $05 ; 09
- db $11, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 0a
- db $12, JUMPTABLE_8D24B_FUNCTION_0D, $08 ; 0b
- db $12, JUMPTABLE_8D24B_FUNCTION_0E, $08 ; 0c
- db $12, JUMPTABLE_8D24B_FUNCTION_0F, $08 ; 0d
- db $13, JUMPTABLE_8D24B_FUNCTION_10, $00 ; 0e
- db $15, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 0f
- db $16, JUMPTABLE_8D24B_FUNCTION_11, $00 ; 10
- db $17, JUMPTABLE_8D24B_FUNCTION_12, $00 ; 11
- db $18, JUMPTABLE_8D24B_FUNCTION_12, $00 ; 12
- db $19, JUMPTABLE_8D24B_FUNCTION_13, $00 ; 13
- db $1a, JUMPTABLE_8D24B_FUNCTION_14, $00 ; 14
- db $1b, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 15
- db $1d, JUMPTABLE_8D24B_FUNCTION_15, $00 ; 16
- db $1e, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 17
- db $1d, JUMPTABLE_8D24B_FUNCTION_17, $00 ; 18
- db $1f, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 19
- db $24, JUMPTABLE_8D24B_FUNCTION_19, $00 ; 1a
- db $25, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 1b
- db $20, JUMPTABLE_8D24B_FUNCTION_13, $00 ; 1c
- db $26, JUMPTABLE_8D24B_FUNCTION_1A, $00 ; 1d
- db $2d, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 1e
- db $2e, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 1f
- db $2f, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 20
- db $30, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 21
- db $31, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 22
- db $32, JUMPTABLE_8D24B_FUNCTION_1B, $00 ; 23
- db $33, JUMPTABLE_8D24B_FUNCTION_1C, $00 ; 24
- db $34, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 25
- db $35, JUMPTABLE_8D24B_FUNCTION_1D, $00 ; 26
- db $37, JUMPTABLE_8D24B_FUNCTION_1E, $00 ; 27
- db $38, JUMPTABLE_8D24B_FUNCTION_1E, $00 ; 28
- db $39, JUMPTABLE_8D24B_FUNCTION_20, $00 ; 29
- db $3f, JUMPTABLE_8D24B_FUNCTION_21, $00 ; 2a
- db $3e, JUMPTABLE_8D24B_FUNCTION_22, $00 ; 2b
- db $40, JUMPTABLE_8D24B_FUNCTION_00, $00 ; 2c
+ db $01, SPRITE_ANIM_SEQ_01, $00 ; 00
+ db $07, SPRITE_ANIM_SEQ_04, $00 ; 01
+ db $08, SPRITE_ANIM_SEQ_05, $05 ; 02
+ db $0a, SPRITE_ANIM_SEQ_06, $00 ; 03
+ db $0b, SPRITE_ANIM_SEQ_07, $06 ; 04
+ db $0c, SPRITE_ANIM_SEQ_08, $06 ; 05
+ db $0d, SPRITE_ANIM_SEQ_09, $07 ; 06
+ db $0e, SPRITE_ANIM_SEQ_0A, $07 ; 07
+ db $10, SPRITE_ANIM_SEQ_0B, $07 ; 08
+ db $08, SPRITE_ANIM_SEQ_0C, $05 ; 09
+ db $11, SPRITE_ANIM_SEQ_00, $00 ; 0a
+ db $12, SPRITE_ANIM_SEQ_0D, $08 ; 0b
+ db $12, SPRITE_ANIM_SEQ_0E, $08 ; 0c
+ db $12, SPRITE_ANIM_SEQ_0F, $08 ; 0d
+ db $13, SPRITE_ANIM_SEQ_10, $00 ; 0e
+ db $15, SPRITE_ANIM_SEQ_00, $00 ; 0f
+ db $16, SPRITE_ANIM_SEQ_11, $00 ; 10
+ db $17, SPRITE_ANIM_SEQ_12, $00 ; 11
+ db $18, SPRITE_ANIM_SEQ_12, $00 ; 12
+ db $19, SPRITE_ANIM_SEQ_13, $00 ; 13
+ db $1a, SPRITE_ANIM_SEQ_14, $00 ; 14
+ db $1b, SPRITE_ANIM_SEQ_00, $00 ; 15
+ db $1d, SPRITE_ANIM_SEQ_15, $00 ; 16
+ db $1e, SPRITE_ANIM_SEQ_00, $00 ; 17
+ db $1d, SPRITE_ANIM_SEQ_17, $00 ; 18
+ db $1f, SPRITE_ANIM_SEQ_00, $00 ; 19
+ db $24, SPRITE_ANIM_SEQ_19, $00 ; 1a
+ db $25, SPRITE_ANIM_SEQ_00, $00 ; 1b
+ db $20, SPRITE_ANIM_SEQ_13, $00 ; 1c
+ db $26, SPRITE_ANIM_SEQ_1A, $00 ; 1d
+ db $2d, SPRITE_ANIM_SEQ_00, $00 ; 1e
+ db $2e, SPRITE_ANIM_SEQ_00, $00 ; 1f
+ db $2f, SPRITE_ANIM_SEQ_00, $00 ; 20
+ db $30, SPRITE_ANIM_SEQ_00, $00 ; 21
+ db $31, SPRITE_ANIM_SEQ_00, $00 ; 22
+ db $32, SPRITE_ANIM_SEQ_1B, $00 ; 23
+ db $33, SPRITE_ANIM_SEQ_1C, $00 ; 24
+ db $34, SPRITE_ANIM_SEQ_00, $00 ; 25
+ db $35, SPRITE_ANIM_SEQ_1D, $00 ; 26
+ db $37, SPRITE_ANIM_SEQ_1E, $00 ; 27
+ db $38, SPRITE_ANIM_SEQ_1E, $00 ; 28
+ db $39, SPRITE_ANIM_SEQ_20, $00 ; 29
+ db $3f, SPRITE_ANIM_SEQ_21, $00 ; 2a
+ db $3e, SPRITE_ANIM_SEQ_22, $00 ; 2b
+ db $40, SPRITE_ANIM_SEQ_00, $00 ; 2c
; 8d24b
--- a/home.asm
+++ b/home.asm
@@ -2016,17 +2016,17 @@
-Function3b2a:: ; 3b2a
+_InitSpriteAnimStruct:: ; 3b2a
ld [wc3b8], a
ld a, [hROMBank]
push af
- ld a, BANK(Function8cfd6)
+ ld a, BANK(InitSpriteAnimStruct)
rst Bankswitch
ld a, [wc3b8]
- call Function8cfd6
+ call InitSpriteAnimStruct
pop af
rst Bankswitch
--- a/main.asm
+++ b/main.asm
@@ -1392,8 +1392,8 @@
ld a, [wcf65]
and $3
ret nz
- ld bc, wc3a4
- ld hl, $a
+ ld bc, SpriteAnim10
+ ld hl, SpriteAnim10FrameIndex - SpriteAnim10
add hl, bc ; over-the-top compicated way to load wc3ae into hl
ld l, [hl]
ld h, 0
@@ -1418,18 +1418,19 @@
ret z
ld e, a
ld d, [hl]
- ld a, $1
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_01
+ call _InitSpriteAnimStruct
ret
; 63ca
Data63ca: ; 63ca
- dw $505c, 0
- dw $685c, $585c
- dw $685c, $785c
- dw $885c, $785c
- dw 0, $785c
- dw 0, $585c
+; frame 0 y, x; frame 1 y, x
+ db $5c, $50, $00, $00
+ db $5c, $68, $5c, $58
+ db $5c, $68, $5c, $78
+ db $5c, $88, $5c, $78
+ db $00, $00, $5c, $78
+ db $00, $00, $5c, $58
; 63e2
Copyright: ; 63e2
@@ -10421,9 +10422,9 @@
ld hl, wc300
ld [hli], a
ld [hl], a
- ld de, $1810
- ld a, $0
- call Function3b2a
+ lb de, $18, $10
+ ld a, SPRITE_ANIM_INDEX_00
+ call _InitSpriteAnimStruct
ld hl, $2
add hl, bc
ld [hl], $0
@@ -10554,8 +10555,8 @@
Function1201b: ; 1201b (4:601b)
lb de, $48, $10
- ld a, $9
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_09
+ call _InitSpriteAnimStruct
ld a, c
ld [wc6d5], a
ld a, b
@@ -26260,9 +26261,9 @@
xor a
ld [VramState], a
call LoadCelebiGFX
- ld de, $750
- ld a, $2c
- call Function3b2a
+ lb de, $07, $50
+ ld a, SPRITE_ANIM_INDEX_2C
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $84
@@ -26362,8 +26363,8 @@
add $40
ld d, a
ld e, $0
- ld a, $18
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_18 ; fly land
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $80
@@ -39087,8 +39088,8 @@
lb bc, BANK(HeadbuttTreeGFX), 8
call Request2bpp
call Function8cad3
- ld a, $1b
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1B
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $84
@@ -39237,8 +39238,8 @@
Function8ca23: ; 8ca23 (23:4a23)
call Function8cad3
- ld a, $17
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_17 ; leaf
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $84
@@ -39287,8 +39288,8 @@
Function8ca73: ; 8ca73 (23:4a73)
push de
push af
- ld a, $16
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_16 ; fly takeoff
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $80
@@ -39375,9 +39376,9 @@
xor a
ld [VramState], a
call Function8cb9b
- ld de, $5450
- ld a, $a
- call Function3b2a
+ lb de, $54, $50
+ ld a, SPRITE_ANIM_INDEX_0A
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $84
@@ -39409,9 +39410,9 @@
xor a
ld [VramState], a
call Function8cb9b
- ld de, $fc50
- ld a, $a
- call Function3b2a
+ lb de, $fc, $50
+ ld a, SPRITE_ANIM_INDEX_0A
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $84
@@ -39507,8 +39508,8 @@
add $40
ld d, a
ld e, $0
- ld a, $18
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_18 ; fly land
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $80
@@ -39840,7 +39841,7 @@
ld d, $55
ld a, [wd194 + 1]
ld e, a
- ld b, $15
+ ld b, SPRITE_ANIM_INDEX_15
ld a, [rSVBK]
push af
ld a, $1
@@ -39848,13 +39849,13 @@
ld a, [PlayerGender]
bit 0, a
jr z, .asm_8ce31
- ld b, $1f
+ ld b, SPRITE_ANIM_INDEX_1F
.asm_8ce31
pop af
ld [rSVBK], a
ld a, b
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $0
@@ -40264,15 +40265,17 @@
ld [CurIcon], a
call Function8e9db
ld a, [hObjectStructIndexBuffer]
-; and $f \ swap a
+; y coord
rept 4
add a
endr
add $1c
ld d, a
+; x coord
ld e, $10
- ld a, $0
- call Function8cfd6
+; type is partymon icon
+ ld a, SPRITE_ANIM_INDEX_00
+ call InitSpriteAnimStruct
pop af
ld hl, $3
add hl, bc
@@ -40317,9 +40320,9 @@
ld [CurIcon], a
xor a
call GetIconGFX
- ld de, $2420
- ld a, $0
- call Function8cfd6
+ lb de, $24, $20
+ ld a, SPRITE_ANIM_INDEX_00
+ call InitSpriteAnimStruct
ld hl, $2
add hl, bc
ld [hl], $0
@@ -40333,8 +40336,8 @@
call GetIconGFX
ld d, $1a
ld e, $24
- ld a, $0
- call Function8cfd6
+ ld a, SPRITE_ANIM_INDEX_00
+ call InitSpriteAnimStruct
ld hl, $2
add hl, bc
ld [hl], $0
@@ -41468,9 +41471,9 @@
; 90d32
Function90d32: ; 90d32 (24:4d32)
- ld de, $2410
- ld a, $d
- call Function3b2a
+ lb de, $24, $10
+ ld a, SPRITE_ANIM_INDEX_0D
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $0
@@ -41990,15 +41993,15 @@
Function9106a: ; 9106a
push af
ld de, 0
- ld b, $a
+ ld b, SPRITE_ANIM_INDEX_0A
ld a, [PlayerGender]
bit 0, a
jr z, .asm_91079
- ld b, $1e
+ ld b, SPRITE_ANIM_INDEX_1E
.asm_91079
ld a, b
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $10
@@ -42019,8 +42022,8 @@
Function91098: ; 91098
push af
ld de, 0
- ld a, $d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_0D
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $4
@@ -42081,9 +42084,9 @@
Function910f9: ; 910f9 (24:50f9)
call Function90da8
- ld de, $2454
- ld a, $14
- call Function3b2a
+ lb de, $24, $54
+ ld a, SPRITE_ANIM_INDEX_14
+ call _InitSpriteAnimStruct
ld hl, $3
add hl, bc
ld [hl], $8
@@ -42660,7 +42663,7 @@
ld [wJumptableIndex], a
ld a, b
ld [wcf64], a
- call Function914ab
+ call DeleteSpriteAnimStruct2ToEnd
ret
Function91492: ; 91492
@@ -42681,13 +42684,13 @@
; 914ab
-Function914ab: ; 914ab (24:54ab)
- ld hl, wc314 + 16
- ld bc, $90
+DeleteSpriteAnimStruct2ToEnd: ; 914ab (24:54ab)
+ ld hl, SpriteAnim2
+ ld bc, wSpriteAnimationStructsEnd - SpriteAnim2
xor a
call ByteFill
- ld a, $2
- ld [wc3b4], a
+ ld a, 2
+ ld [wSpriteAnimCount], a
ret
Function914bb: ; 914bb (24:54bb)
@@ -43160,7 +43163,7 @@
INCLUDE "engine/slot_machine.asm"
-SECTION "bank28", ROMX, BANK[$28]
+SECTION "Phone Engine", ROMX, BANK[$28]
INCLUDE "engine/more_phone_scripts.asm"
INCLUDE "engine/buena_phone_scripts.asm"
@@ -43167,7 +43170,7 @@
INCLUDE "text/phone/buena.asm"
-SECTION "bank29", ROMX, BANK[$29]
+SECTION "Phone Text", ROMX, BANK[$29]
INCLUDE "text/phone/anthony_overworld.asm"
INCLUDE "text/phone/todd_overworld.asm"
@@ -45377,9 +45380,9 @@
pop af
ld [rSVBK], a
callba Function8cf53
- ld de, $5458
- ld a, $3
- call Function3b2a
+ lb de, $54, $58
+ ld a, SPRITE_ANIM_INDEX_03
+ call _InitSpriteAnimStruct
ld hl, $7
add hl, bc
ld [hl], $a0
@@ -46057,9 +46060,9 @@
ld [hWY], a
call Functione5516
callba Function8cf53
- ld de, $6cd8
- ld a, $26
- call Function3b2a
+ lb de, $6c, $d8
+ ld a, SPRITE_ANIM_INDEX_26
+ call _InitSpriteAnimStruct
ld a, $f0
ld [wc3c0], a
call Functione549e
@@ -46146,8 +46149,8 @@
.pichu
lb de, $a9, $80
- ld a, $27
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_27
+ call _InitSpriteAnimStruct
ld de, SFX_INTRO_PICHU
call PlaySFX
ret
@@ -46154,8 +46157,8 @@
.wooper
lb de, $b0, $30
- ld a, $28
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_28
+ call _InitSpriteAnimStruct
ld de, SFX_INTRO_PICHU
call PlaySFX
ret
@@ -46332,8 +46335,8 @@
ld [hWY], a
callba Function8cf53
lb de, $6c, $58
- ld a, $26
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_26
+ call _InitSpriteAnimStruct
ld de, MUSIC_CRYSTAL_OPENING
call PlayMusic
xor a
@@ -46443,11 +46446,11 @@
callba Function8cf53
call Functione549e
lb de, $40, $28
- ld a, $2a
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_2A
+ call _InitSpriteAnimStruct
lb de, $60, $00
- ld a, $2b
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_2B
+ call _InitSpriteAnimStruct
xor a
ld [wcf64], a
ld [wcf65], a
@@ -46595,8 +46598,8 @@
ld [hl], $7f
call Functione549e
lb de, $60, $00
- ld a, $2b
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_2B
+ call _InitSpriteAnimStruct
xor a
ld [wcf64], a
ld [wcf65], a
@@ -46891,8 +46894,8 @@
Functione51dc: ; e51dc (39:51dc)
push de
- ld a, $29
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_29
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld [hl], $8
@@ -46901,8 +46904,8 @@
pop de
push de
- ld a, $29
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_29
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld [hl], $18
@@ -46911,8 +46914,8 @@
pop de
push de
- ld a, $29
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_29
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld [hl], $28
@@ -46920,8 +46923,8 @@
call Function3b3c
pop de
- ld a, $29
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_29
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld [hl], $38
--- a/misc/battle_tower_47.asm
+++ b/misc/battle_tower_47.asm
@@ -495,39 +495,39 @@
Function11c2e9: ; 11c2e9 (47:42e9)
lb de, $1a, $0d
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
lb de, $42, $0d
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $1
ld [hl], a
lb de, $4a, $10
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $3
ld [hl], a
lb de, $50, $80
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $4
ld [hl], a
lb de, $50, $20
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $5
ld [hl], a
lb de, $50, $10
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $2
--- a/misc/mobile_42.asm
+++ b/misc/mobile_42.asm
@@ -493,13 +493,13 @@
call DelayFrames
call Function108bec
lb de, $54, $58
- ld a, $20
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_20
+ call _InitSpriteAnimStruct
ld de, SFX_BALL_POOF
call PlaySFX
hlcoord 0, 0
ld bc, $00f0
- ld a, $7f
+ ld a, " "
call ByteFill
ld c, $50
call Function1082cc
@@ -528,8 +528,8 @@
ld a, $90
ld [hWY], a
lb de, $54, $58
- ld a, $21
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_21
+ call _InitSpriteAnimStruct
call Function108b45
ld a, $1
call Function108b98
@@ -628,13 +628,13 @@
call DelayFrames
call Function108c2b
lb de, $54, $58
- ld a, $20
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_20
+ call _InitSpriteAnimStruct
ld de, SFX_BALL_POOF
call PlaySFX
hlcoord 0, 0
ld bc, $00f0
- ld a, $7f
+ ld a, " "
call ByteFill
ld c, $50
call Function1082cc
@@ -672,8 +672,8 @@
ld a, $90
ld [hWY], a
lb de, $54, $58
- ld a, $21
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_21
+ call _InitSpriteAnimStruct
call Function108b45
ld a, $1
call Function108b98
@@ -741,8 +741,8 @@
ld a, $90
ld [hWY], a
lb de, $54, $58
- ld a, $21
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_21
+ call _InitSpriteAnimStruct
call Function108b45
ld a, $1
call Function108b98
@@ -928,8 +928,8 @@
cp $f8
jr nz, .asm_10878a
lb de, $54, $58
- ld a, $22
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_22
+ call _InitSpriteAnimStruct
.asm_10878a
ld c, $1
@@ -954,8 +954,8 @@
.asm_1087a9
lb de, $54, $58
- ld a, $22
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_22
+ call _InitSpriteAnimStruct
xor a
call Function108ad4
jr .asm_1087c4
@@ -986,8 +986,8 @@
call Function108af4
call Function108b5a
lb de, $4a, $50
- ld a, $25
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_25
+ call _InitSpriteAnimStruct
ld de, SFX_FORESIGHT
call PlaySFX
ld c, $a
@@ -995,8 +995,8 @@
xor a
ld [wcf64], a
lb de, $4a, $50
- ld a, $23
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_23
+ call _InitSpriteAnimStruct
.asm_1087fc
ld a, [hSCY]
cp $90
@@ -1022,8 +1022,8 @@
ld c, $3c
call Function1082cc
lb de, $f2, $50
- ld a, $24
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_24
+ call _InitSpriteAnimStruct
call Function1082b7
ld de, SFX_THROW_BALL
call PlaySFX
@@ -1042,11 +1042,11 @@
; 10884c
Function10884c: ; 10884c
- ld c, $50
+ ld c, 80
call DelayFrames
lb de, $f2, $50
- ld a, $24
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_24
+ call _InitSpriteAnimStruct
call Function1082b7
ld de, SFX_THROW_BALL
call PlaySFX
@@ -1069,8 +1069,8 @@
.asm_108879
callba Function8d03d
lb de, $4a, $50
- ld a, $25
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_25
+ call _InitSpriteAnimStruct
ld de, SFX_GLASS_TING_2
call PlaySFX
call Function108af4
@@ -1106,14 +1106,14 @@
.asm_1088c5
lb de, $54, $58
- ld a, $22
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_22
+ call _InitSpriteAnimStruct
jr .asm_1088e7
.asm_1088cf
lb de, $54, $58
- ld a, $22
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_22
+ call _InitSpriteAnimStruct
xor a
call Function108ad4
jr .asm_1088e7
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -7759,7 +7759,7 @@
callba Function171ccd
lb de, $30, $18
ld a, $1d
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $6
@@ -7766,7 +7766,7 @@
ld [hl], a
lb de, $48, $20
ld a, $1d
- call Function3b2a
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $7
--- a/misc/mobile_5c.asm
+++ b/misc/mobile_5c.asm
@@ -1761,22 +1761,22 @@
Function171b4b: ; 171b4b (5c:5b4b)
lb de, $40, $10
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $8
ld [hl], a
lb de, $40, $98
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $9
ld [hl], a
lb de, $8a, $70
- ld a, $1d
- call Function3b2a
+ ld a, SPRITE_ANIM_INDEX_1D
+ call _InitSpriteAnimStruct
ld hl, $c
add hl, bc
ld a, $a
--- a/wram.asm
+++ b/wram.asm
@@ -380,23 +380,50 @@
wc311:: ds 1
wc312:: ds 1
wc313:: ds 1
-; wPartyMonMenuIconAnims::
+wSpriteAnimationStructs::
+
+sprite_anim_struct: MACRO
+\1Index:: ds 1
+ ds 1
+\1AnimSeqID:: ds 1
+\1TileID:: ds 1
+\1XCoord:: ds 1
+\1YCoord:: ds 1
+\1XOffset:: ds 1
+\1YOffset:: ds 1
+\1FrameTimer:: ds 1
+ ds 1
+\1FrameIndex:: ds 1
+ ds 5
+ENDM
+
; Field 0: Index
; Fields 1-3: Loaded from Unknown_8d1c4
-wc314:: ds 16 ; c314
-wc324:: ds 16 ; c324
-wc334:: ds 16 ; c334
-wc344:: ds 16 ; c344
-wc354:: ds 16 ; c354
-wc364:: ds 16 ; c364
-wc374:: ds 16 ; c374
-wc384:: ds 16 ; c384
-wc394:: ds 16 ; c394
-wc3a4:: ds 16 ; c3a4
-; wPartyMonMenuIconAnimsEnd::
+wc314::
+SpriteAnim1:: sprite_anim_struct SpriteAnim1
+wc324::
+SpriteAnim2:: sprite_anim_struct SpriteAnim2
+wc334::
+SpriteAnim3:: sprite_anim_struct SpriteAnim3
+wc344::
+SpriteAnim4:: sprite_anim_struct SpriteAnim4
+wc354::
+SpriteAnim5:: sprite_anim_struct SpriteAnim5
+wc364::
+SpriteAnim6:: sprite_anim_struct SpriteAnim6
+wc374::
+SpriteAnim7:: sprite_anim_struct SpriteAnim7
+wc384::
+SpriteAnim8:: sprite_anim_struct SpriteAnim8
+wc394::
+SpriteAnim9:: sprite_anim_struct SpriteAnim9
+wc3a4::
+SpriteAnim10:: sprite_anim_struct SpriteAnim10
+wSpriteAnimationStructsEnd::
ds -8
wc3ac:: ds 8 ; c3ac
-wc3b4:: ds 1 ; something to do with wc314
+wSpriteAnimCount::
+wc3b4:: ds 1
wc3b5:: ds 1
CurIcon:: ; c3b6