Use constants
This commit is contained in:
@@ -102,7 +102,9 @@ const_value set 1
|
|||||||
const OBJECT_1E ; 1e
|
const OBJECT_1E ; 1e
|
||||||
const OBJECT_1F ; 1f
|
const OBJECT_1F ; 1f
|
||||||
const OBJECT_RANGE ; 20
|
const OBJECT_RANGE ; 20
|
||||||
; 33-39 are not used
|
; 21-27 are not used
|
||||||
|
OBJECT_STRUCT_LENGTH EQU 40
|
||||||
|
NUM_OBJECT_STRUCTS EQU 13 ; see ObjectStructs
|
||||||
|
|
||||||
; map_object struct members (see macros/wram.asm)
|
; map_object struct members (see macros/wram.asm)
|
||||||
const_def
|
const_def
|
||||||
|
@@ -16,6 +16,8 @@
|
|||||||
const SPRITEANIMSTRUCT_0D ; d
|
const SPRITEANIMSTRUCT_0D ; d
|
||||||
const SPRITEANIMSTRUCT_0E ; e
|
const SPRITEANIMSTRUCT_0E ; e
|
||||||
const SPRITEANIMSTRUCT_0F ; f
|
const SPRITEANIMSTRUCT_0F ; f
|
||||||
|
SPRITEANIMSTRUCT_LENGTH EQU const_value
|
||||||
|
NUM_SPRITE_ANIM_STRUCTS EQU 10 ; see wSpriteAnimationStructs
|
||||||
|
|
||||||
; SpriteAnimSeqData indexes (see data/sprite_anims/sequences.asm)
|
; SpriteAnimSeqData indexes (see data/sprite_anims/sequences.asm)
|
||||||
const_def
|
const_def
|
||||||
|
@@ -116,9 +116,6 @@ PLAYER_SKATE EQU 2
|
|||||||
PLAYER_SURF EQU 4
|
PLAYER_SURF EQU 4
|
||||||
PLAYER_SURF_PIKA EQU 8
|
PLAYER_SURF_PIKA EQU 8
|
||||||
|
|
||||||
OBJECT_STRUCT_LENGTH EQU 40
|
|
||||||
NUM_OBJECT_STRUCTS EQU 13
|
|
||||||
|
|
||||||
; After-Champion Spawn
|
; After-Champion Spawn
|
||||||
SPAWN_LANCE EQU 1
|
SPAWN_LANCE EQU 1
|
||||||
SPAWN_RED EQU 2
|
SPAWN_RED EQU 2
|
||||||
|
@@ -36,7 +36,7 @@ PlaySpriteAnimations: ; 8cf69
|
|||||||
|
|
||||||
DoNextFrameForAllSprites: ; 8cf7a
|
DoNextFrameForAllSprites: ; 8cf7a
|
||||||
ld hl, wSpriteAnimationStructs
|
ld hl, wSpriteAnimationStructs
|
||||||
ld e, 10 ; There are 10 structs here.
|
ld e, NUM_SPRITE_ANIM_STRUCTS
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@@ -53,7 +53,7 @@ DoNextFrameForAllSprites: ; 8cf7a
|
|||||||
jr c, .done
|
jr c, .done
|
||||||
|
|
||||||
.next
|
.next
|
||||||
ld bc, $10
|
ld bc, SPRITEANIMSTRUCT_LENGTH
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec e
|
dec e
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
@@ -76,7 +76,7 @@ DoNextFrameForAllSprites: ; 8cf7a
|
|||||||
|
|
||||||
DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
|
DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
|
||||||
ld hl, wSpriteAnimationStructs
|
ld hl, wSpriteAnimationStructs
|
||||||
ld e, 10
|
ld e, NUM_SPRITE_ANIM_STRUCTS
|
||||||
|
|
||||||
.loop
|
.loop
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
@@ -93,7 +93,7 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
|
|||||||
jr c, .done
|
jr c, .done
|
||||||
|
|
||||||
.next
|
.next
|
||||||
ld bc, $10
|
ld bc, SPRITEANIMSTRUCT_LENGTH
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec e
|
dec e
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
@@ -119,12 +119,12 @@ InitSpriteAnimStruct:: ; 8cfd6
|
|||||||
push de
|
push de
|
||||||
push af
|
push af
|
||||||
ld hl, wSpriteAnimationStructs
|
ld hl, wSpriteAnimationStructs
|
||||||
ld e, 10
|
ld e, NUM_SPRITE_ANIM_STRUCTS
|
||||||
.loop
|
.loop
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
and a
|
and a
|
||||||
jr z, .found
|
jr z, .found
|
||||||
ld bc, $10
|
ld bc, SPRITEANIMSTRUCT_LENGTH
|
||||||
add hl, bc
|
add hl, bc
|
||||||
dec e
|
dec e
|
||||||
jr nz, .loop
|
jr nz, .loop
|
||||||
@@ -222,8 +222,8 @@ DeinitializeSprite: ; 8d036
|
|||||||
DeinitializeAllSprites: ; 8d03d (23:503d)
|
DeinitializeAllSprites: ; 8d03d (23:503d)
|
||||||
; Clear the index field of every struct in the wSpriteAnimationStructs array.
|
; Clear the index field of every struct in the wSpriteAnimationStructs array.
|
||||||
ld hl, wSpriteAnimationStructs
|
ld hl, wSpriteAnimationStructs
|
||||||
ld bc, $10
|
ld bc, SPRITEANIMSTRUCT_LENGTH
|
||||||
ld e, 10
|
ld e, NUM_SPRITE_ANIM_STRUCTS
|
||||||
xor a
|
xor a
|
||||||
.loop
|
.loop
|
||||||
ld [hl], a
|
ld [hl], a
|
||||||
@@ -391,7 +391,7 @@ GetSpriteAnimVTile: ; 8d109
|
|||||||
push bc
|
push bc
|
||||||
ld hl, wSpriteAnimDict
|
ld hl, wSpriteAnimDict
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, 10
|
ld c, NUM_SPRITE_ANIM_STRUCTS
|
||||||
.loop
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
cp b
|
cp b
|
||||||
|
Reference in New Issue
Block a user