Prev: 75C0 Up: Map Next: 75FD
75CC: Display Entity
Erases the sprite from the position recorded by StoreEntity and draws it at the new position held by the actor. The old and the new sprite are processed together so that the screen lines which they share are updated in step.
Input
IX Actor
sprite-move-before sprite-move-after
DisplayEntity 75CC CALL PrepareActorSprite Prepare the actor sprite using PrepareActorSprite.
75CF EXX Switch to the shadow registers.
75D0 CALL PrepareOldSprite Prepare the old sprite using PrepareOldSprite.
Compare the vertical position of the old sprite with the new one.
DisplayEntity_Compare 75D3 LD A,($5F15) Fetch the vertical co-ordinate of the old sprite (OldSprite_Y).
75D6 SUB (IX+$02) Subtract the new vertical co-ordinate.
75D9 JP Z,XORSpriteLoop_Remaining Jump to XORSpriteLoop_Remaining if they are the same.
75DC JP M,DisplayEntity_NewLower Jump to DisplayEntity_NewLower if the new sprite is lower down the screen.
The old sprite is lower down. Draw the rows of it which the new sprite does not cover first.
75DF LD C,A Keep the number of rows in C.
75E0 LD A,($5F19) Fetch the sprite rows remaining.
75E3 CP C Compare with the number of rows.
75E4 JP C,XORSpriteLoop_Remaining Jump to XORSpriteLoop_Remaining if the sprites do not overlap.
75E7 SUB C Subtract the rows which are about to be drawn.
75E8 LD ($5F19),A Update the number of rows remaining for the old sprite (OldSprite_RowsRemaining).
75EB JP XORSpriteLoop Jump to XORSpriteLoop.
The new sprite is lower down. Draw the rows of it which the old sprite does not cover first.
DisplayEntity_NewLower 75EE EXX Switch to the shadow registers.
75EF NEG Make the number of rows positive.
75F1 LD C,A Keep the number of rows in C.
75F2 LD A,($5F1A) Fetch the number of rows remaining for the actor sprite (ActorSprite_RowsRemaining).
75F5 CP C Compare with the number of rows.
75F6 JP C,XORSpriteLoop_Restore Jump to XORSpriteLoop_Restore if the sprites do not overlap.
75F9 SUB C Subtract the rows which are about to be drawn.
75FA JP XORSpriteLoop_Continue Jump to XORSpriteLoop_Continue.
Prev: 75C0 Up: Map Next: 75FD