Prev: 62947 Up: Map Next: 63041
62956: Print 1UP/ 2UP Levels
Used by the routines at CreateWindow and 40810.
Sets attributes for 1UP level.
PrintPlayerLevels 62956 LD HL,2120 HL=2120.
62959 CALL ColourLevelsGreen Call ColourLevelsGreen.
Sets attributes for 2UP level.
62962 LD HL,2208 HL=2208.
62965 CALL ColourLevelsGreen Call ColourLevelsGreen.
Is this a 1 or 2 player game?
62968 LD A,(24165) If Flag_ActivePlayer is not zero, jump to Handler_PrintPlayerLevels.
62971 AND A
62972 JR NZ,Handler_PrintPlayerLevels
Handler for printing 1UP level followed by 2UP level.
62974 LD HL,2120 HL=2120.
62977 CALL Print1UPLevel Call Print1UPLevel.
62980 LD HL,2208 HL=2208.
62983 JR Print2UPLevel Jump to Print2UPLevel.
Handler for printing 2UP level followed by 1UP level.
Handler_PrintPlayerLevels 62985 LD HL,2120 HL=2120.
62988 CALL Print2UPLevel Call Print2UPLevel.
Handles the 2UP level.
62991 LD HL,2208 HL=2208.
Handles displaying "level" for 1UP.
Print1UPLevel 62994 LD A,76 A=76.
62996 CALL PrintLevelMessaging Call PrintLevelMessaging.
62999 CALL Calculate_ActivePlayer_Level Call Calculate_ActivePlayer_Level.
Prints the first digit (held in A from B).
PrintLevel 63002 PUSH BC Stash BC on the stack.
63003 ADD A,48 Add 48 to convert to an ASCII character (starting at "0" character).
63005 CALL PrintLevelMessaging Call PrintLevelMessaging.
63008 POP BC Restore BC from the stack.
Now move onto the second digit held in C.
63009 LD A,C A=C.
63010 ADD A,48 Add 48 to convert to an ASCII character (starting at "0" character).
63012 CALL PrintLevelMessaging Call PrintLevelMessaging.
63015 RET Return.
Handles displaying "level" for 2UP.
Print2UPLevel 63016 LD A,76 A=76.
63018 CALL PrintLevelMessaging Call PrintLevelMessaging.
63021 CALL Calculate_InactivePlayer_Level Call Calculate_InactivePlayer_Level.
63024 JR PrintLevel Jump to PrintLevel.
Keep HL (pixel co-ordinates) and AF (the ASCII character to print) for later.
PrintLevelMessaging 63026 PUSH HL Stash HL and AF on the stack.
63027 PUSH AF
63028 CALL ScreenAddress Call ScreenAddress.
Fetch the ASCII character we want to print from the stack.
63031 POP AF Restore AF from the stack.
63032 CALL PrintScreen Call PrintScreen.
Restore the pixel co-ordinates from the stack, and move onto the next character column.
63035 POP HL Restore HL from the stack.
63036 LD A,L L=L+8.
63037 ADD A,8
63039 LD L,A
63040 RET Return.
Prev: 62947 Up: Map Next: 63041