Prev: DE77 Up: Map Next: DEC4
DE9D: Show Player Number
Used by the routines at SwitchPlayer and RunGame.
Clears the screen and prints the number of the player, which is the text at PlayerNumberText, and if the player has no lives left plays the tune at GameOverTune. Then waits for a short time.
show-player-number
ShowPlayerNumber DE9D CALL ClearScreen Call ClearScreen.
DEA0 CALL ResetAttributes Call ResetAttributes.
This entry point is used by the routine at RunGame.
ShowPlayerNumber_Print DEA3 LD A,($DEDD) Read the byte at CurrentPlayer.
DEA6 INC A Advance A.
DEA7 LD ($DECF),A Write A at DECF.
DEAA LD DE,$DEC4 Point DE at PlayerNumberText.
DEAD CALL PrintText Call PrintText.
DEB0 LD DE,$DFD1 Point DE at GameOverTune.
DEB3 LD A,($DEDE) Read the byte at Lives.
DEB6 AND A See whether A is zero.
DEB7 CALL Z,PlayMusic Call PlayMusic if the zero flag is set.
DEBA LD B,$08 B is 08.
ShowPlayerNumber_Loop DEBC LD D,$00 D is 00.
DEBE CALL Delay Call Delay.
DEC1 DJNZ ShowPlayerNumber_Loop Repeat from DEBC while B still counts.
DEC3 RET Return.
Prev: DE77 Up: Map Next: DEC4