Prev: F5E3 Up: Map Next: F641
F5EC: Print 1UP/ 2UP Levels
Used by the routines at CreateWindow and 9F6A.
Sets attributes for 1UP level.
PrintPlayerLevels F5EC LD HL,$0848 HL=0848.
F5EF CALL ColourLevelsGreen Call ColourLevelsGreen.
Sets attributes for 2UP level.
F5F2 LD HL,$08A0 HL=08A0.
F5F5 CALL ColourLevelsGreen Call ColourLevelsGreen.
Is this a 1 or 2 player game?
F5F8 LD A,($5E65) If Flag_ActivePlayer is not zero, jump to Handler_PrintPlayerLevels.
F5FB AND A
F5FC JR NZ,Handler_PrintPlayerLevels
Handler for printing 1UP level followed by 2UP level.
F5FE LD HL,$0848 HL=0848.
F601 CALL Print1UPLevel Call Print1UPLevel.
F604 LD HL,$08A0 HL=08A0.
F607 JR Print2UPLevel Jump to Print2UPLevel.
Handler for printing 2UP level followed by 1UP level.
Handler_PrintPlayerLevels F609 LD HL,$0848 HL=0848.
F60C CALL Print2UPLevel Call Print2UPLevel.
Handles the 2UP level.
F60F LD HL,$08A0 HL=08A0.
Handles displaying "level" for 1UP.
Print1UPLevel F612 LD A,$4C A=4C.
F614 CALL PrintLevelMessaging Call PrintLevelMessaging.
F617 CALL Calculate_ActivePlayer_Level Call Calculate_ActivePlayer_Level.
Prints the first digit (held in A from B).
PrintLevel F61A PUSH BC Stash BC on the stack.
F61B ADD A,$30 Add 30 to convert to an ASCII character (starting at "0" character).
F61D CALL PrintLevelMessaging Call PrintLevelMessaging.
F620 POP BC Restore BC from the stack.
Now move onto the second digit held in C.
F621 LD A,C A=C.
F622 ADD A,$30 Add 30 to convert to an ASCII character (starting at "0" character).
F624 CALL PrintLevelMessaging Call PrintLevelMessaging.
F627 RET Return.
Handles displaying "level" for 2UP.
Print2UPLevel F628 LD A,$4C A=4C.
F62A CALL PrintLevelMessaging Call PrintLevelMessaging.
F62D CALL Calculate_InactivePlayer_Level Call Calculate_InactivePlayer_Level.
F630 JR PrintLevel Jump to PrintLevel.
Keep HL (pixel co-ordinates) and AF (the ASCII character to print) for later.
PrintLevelMessaging F632 PUSH HL Stash HL and AF on the stack.
F633 PUSH AF
F634 CALL ScreenAddress Call ScreenAddress.
Fetch the ASCII character we want to print from the stack.
F637 POP AF Restore AF from the stack.
F638 CALL PrintScreen Call PrintScreen.
Restore the pixel co-ordinates from the stack, and move onto the next character column.
F63B POP HL Restore HL from the stack.
F63C LD A,L L=L+08.
F63D ADD A,$08
F63F LD L,A
F640 RET Return.
Prev: F5E3 Up: Map Next: F641