Prev: 56481 Up: Map Next: 56653
56632: Get Sprite ID?
Used by the routines at Handler_Bullets, 62290 and Handler_Projectiles.
Input
BC Screen co-ordinates
Output
A Sprite ID
HL Buffer address of the sprite
Creates an offset in HL using B.
GetSpriteID 56632 LD H,0 H=0.
56634 LD L,B L=B.
Creates an offset in DE using C.
56635 LD D,H D=0.
56636 LD E,C E=C.
Position Y * 32 to find the row + position X to find the column.
56637 ADD HL,HL HL*=32+DE.
56638 ADD HL,HL
56639 ADD HL,HL
56640 ADD HL,HL
56641 ADD HL,HL
56642 ADD HL,DE
The game buffer begins at 26624-27391 which is 768 screen locations (32x24).
56643 LD A,H H+=104.
56644 ADD A,104
56646 LD H,A
Fetch the sprite ID from this location.
56647 LD A,(HL) A=*HL.
Never return with 255 instead use 0.
56648 CP 255 Return if A is not equal to 255.
56650 RET NZ
56651 XOR A A=0.
56652 RET Return.
Prev: 56481 Up: Map Next: 56653