Prev: 34109 Up: Map Next: 34175
34152: Fetch Sprite
Looks up the sprite pointer for the ID in 24148. SpritesTable is the default table. On an odd level MapSpriteBand may switch the index and table to Sprite_Band_Table. Nothing calls this routine; the game uses FetchActorSprite instead.
Output
DE Sprite address
FetchSprite 34152 LD BC,47808 Point the sprite table at SpritesTable.
34155 LD A,(24226) Test LevelParity.
34158 AND A
34159 LD A,(24148) Fetch the sprite ID from 24148.
34162 CALL NZ,MapSpriteBand Call MapSpriteBand if this is an odd level.
Index the sprite table and return the address.
FetchSprite_Loop 34165 DEC A Fetch the sprite address for index A-1.
34166 LD L,A
34167 LD H,0
34169 ADD HL,HL
34170 ADD HL,BC
34171 LD E,(HL)
34172 INC HL
34173 LD D,(HL)
34174 RET Return.
View the equivalent code in;
Prev: 34109 Up: Map Next: 34175