Prev: 38647 Up: Map Next: 38696
38681: Display Entity Moved Down
Used by the routine at DisplayEntity.
Draws the bottom rows of the new sprite on their own first, because the new sprite is lower than the old one (the old sprite has moved up the screen).
Input
A Old y position minus the new y position (negative)
DisplayEntity_NewLower 38681 EXX Switch to the registers of the new sprite.
38682 NEG Make the difference positive.
38684 LD C,A Copy the number of rows that stand alone to C.
38685 LD A,(36579) Fetch the number of rows of the new sprite from New_Sprite_Row_Count.
38688 CP C Compare it with the number of rows that stand alone.
38689 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.
38692 SUB C Subtract the number of rows that stand alone.
38693 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: 38647 Up: Map Next: 38696