Prev: B9A9 Up: Map Next: B9DA
B9CB: Display Entity Moved Down
Used by the routine at DisplayEntity.
Used by DisplayEntity when the new sprite is lower than the old one. The bottom rows of the new sprite are drawn on their own first.
Input
A Old Y position minus the new Y position (negative)
DisplayEntity_NewLower B9CB EXX Switch to the registers of the new sprite.
B9CC NEG Make the difference positive.
B9CE LD C,A Copy the number of rows that stand alone to C.
B9CF LD A,($96A4) Fetch the number of rows of the new sprite from New_Sprite_Row_Count.
B9D2 CP C Compare it with the number of rows that stand alone.
B9D3 JP C,XORSpriteLoop_Done Jump to XORSpriteLoop_Done if the new sprite has no more rows than that, so that the sprites do not overlap and are each drawn in full.
B9D6 SUB C Subtract the number of rows that stand alone.
B9D7 JP XORSpriteLoop_StoreNew Jump to XORSpriteLoop_StoreNew to store the number of rows that remain and draw those rows of the new sprite on their own.
View the equivalent code in;
Prev: B9A9 Up: Map Next: B9DA