mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Enforce capacity limit of sprite list in VRAM (#2); actually fix LoadSpriteGFX (#8) [bugfix to 59bda0b36b
]
This commit is contained in:
parent
74f2a55332
commit
ea4ab28652
@ -42,7 +42,10 @@ DEF SPRITEOAMSTRUCT_ATTRIBUTES rb ; 3
|
|||||||
DEF SPRITEOAMSTRUCT_LENGTH EQU _RS
|
DEF SPRITEOAMSTRUCT_LENGTH EQU _RS
|
||||||
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM
|
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM
|
||||||
|
|
||||||
DEF SPRITE_GFX_LIST_CAPACITY EQU 32 ; see wUsedSprites
|
; see wUsedSprites
|
||||||
|
DEF WALKING_SPRITE_GFX_LIST_CAPACITY EQU 9
|
||||||
|
DEF STILL_SPRITE_GFX_LIST_CAPACITY EQU 10
|
||||||
|
DEF SPRITE_GFX_LIST_CAPACITY EQU 1 + WALKING_SPRITE_GFX_LIST_CAPACITY + STILL_SPRITE_GFX_LIST_CAPACITY
|
||||||
|
|
||||||
; PokeAnims indexes (see engine/gfx/pic_animation.asm)
|
; PokeAnims indexes (see engine/gfx/pic_animation.asm)
|
||||||
const_def
|
const_def
|
||||||
|
@ -23,4 +23,5 @@ Level1GroupSprites:
|
|||||||
db SPRITE_POKE_BALL
|
db SPRITE_POKE_BALL
|
||||||
db SPRITE_FRUIT_TREE
|
db SPRITE_FRUIT_TREE
|
||||||
db SPRITE_ROCK
|
db SPRITE_ROCK
|
||||||
|
; max 3 of 10 still sprites
|
||||||
db 0 ; end
|
db 0 ; end
|
||||||
|
@ -333,9 +333,9 @@ LoadSpriteGFX:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
.LoadSprite:
|
.LoadSprite:
|
||||||
push de
|
push bc
|
||||||
call GetSprite
|
call GetSprite
|
||||||
pop de
|
pop bc
|
||||||
ld a, l
|
ld a, l
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -383,9 +383,10 @@ ArrangeUsedSprites:
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
call GetSpriteLength
|
call GetSpriteLength
|
||||||
|
|
||||||
; There are only two tables, so don't go any further than that.
|
; Don't go any further than the second row in the second table.
|
||||||
add b
|
add b
|
||||||
jr c, .quit
|
cp $a0 + 1
|
||||||
|
jr nc, .quit
|
||||||
|
|
||||||
ld [hl], b
|
ld [hl], b
|
||||||
ld b, a
|
ld b, a
|
||||||
|
Loading…
Reference in New Issue
Block a user