Prev: CD02 Up: Map Next: CD58
CD10: Update Logo Piece
The routine for objects of type 98 to 9D, the pieces of the title graphic that are shown during the ending. Each piece stays where it was placed. It is drawn, and its attributes are set to bright white.
The large piece (type 98) is the last piece in the object table, and waits for the ghosts before it: when the object before it has gone, the ending is over and the game starts again.
ending-logo
UpdateLogoPiece CD10 LD A,(IX-$10) Jump to UpdateLogoPiece_Finished if the object before this one has gone, which means the ending is over.
CD13 AND A
CD14 JR Z,UpdateLogoPiece_Finished
The smaller pieces start here, as they do not wait.
UpdateLogoPiece_Small CD16 LD A,$47 Use bright white ink (attribute 47).
CD18 LD ($BC00),A
This entry point is used by the routine at UpdateEndingGhost.
Draw the piece, and set its attributes.
UpdateLogoPiece_Draw CD1B LD A,(IX+$0A) Copy the X and Y position of the piece (kept where the velocities usually are) into the position of the sprite.
CD1E LD (IX+$0E),A
CD21 LD A,(IX+$0B)
CD24 LD (IX+$0F),A
CD27 CALL DrawSprite Draw the sprite.
CD2A LD L,(IX+$0E) Fetch the screen position of the sprite.
CD2D LD H,(IX+$0F)
CD30 CALL CalculateAttributeAddress Turn the position into an address in the attribute buffer.
CD33 LD A,($BBC3) Fetch the number of rows of the sprite that were drawn.
CD36 LD C,A
CD37 LD A,(IX+$0B) Add the position of the sprite within a character cell and 05, to get the height of the sprite in pixels.
CD3A AND $07
CD3C ADD A,C
CD3D ADD A,$05
CD3F RRCA Divide by eight to get the height in characters.
CD40 RRCA
CD41 RRCA
CD42 AND $1F
CD44 LD C,A
CD45 LD A,($BBC2) Fetch the width of the sprite in characters.
CD48 LD B,A
CD49 LD A,($BC00) Fetch the attribute.
CD4C JP FillAttributeRectangle Jump to FillAttributeRectangle.
The ending is over.
UpdateLogoPiece_Finished CD4F LD DE,$C81A Play the tune for completing the game, and start a new game.
CD52 CALL PlayMusic
CD55 JP StartGame_KeepSettings
Prev: CD02 Up: Map Next: CD58