Prev: 45146 Up: Map Next: 45173
45155: Next Sprite Number
Adds one to the lowest two bits of an entity's type, so a four-frame sprite moves on to the next frame. This is the handler for entity types 112 to 115, the activated terminal.
Input
IX Entity
NextSpriteNumber 45155 PUSH BC Save BC.
45156 LD A,(IX+0) Fetch the type of the entity...
45159 LD C,A ...and keep it in C.
45160 INC A Add one...
45161 AND 3 ...keep the lowest two bits, and put them in B.
45163 LD B,A
45164 LD A,C Fetch the type again...
45165 AND 252 ...replace the lowest two bits with the new ones.
45167 OR B
45168 LD (IX+0),A Store the type of the entity.
45171 POP BC Restore BC.
45172 RET Return.
View the equivalent code in;
Prev: 45146 Up: Map Next: 45173