Routines |
Prev: 41892 | Up: Map | Next: 42014 |
Used by the routine at DrawCurrentOpponent.
|
||||
Messaging_PrintPlayerCurrentTotal | 41923 | CALL PrintString_Loop | Call PrintString_Loop. | |
41926 | DEFB 22,19,1 | PRINT AT: 19, 1. | ||
41929 | DEFM "PLAYER" | |||
41935 | DEFB 255 | Terminator. | ||
Who is currently playing?
|
||||
41936 | LD A,(39608) | Jump to PrintPlayerTwo_CurrentTotal if *ActivePlayer is player two. | ||
41939 | AND A | |||
41940 | JR Z,PrintPlayerTwo_CurrentTotal | |||
Handle 1UP:
|
||||
41942 | CALL PrintString_Loop | Call PrintString_Loop. | ||
41945 | DEFB 22,20,3 | PRINT AT: 20, 3. | ||
41948 | DEFM "ONE" | |||
41951 | DEFB 255 | Terminator. | ||
41952 | LD HL,(39602) | HL=*1UP_Total. | ||
41955 | LD DE,44278 | DE=Current_Total. | ||
41958 | CALL 44784 | Call 44784. | ||
41961 | LD HL,44278 | HL=Current_Total. | ||
41964 | CALL PrintCurrentTotal | Call PrintCurrentTotal. | ||
41967 | CALL FlashCurrentTotal | Call FlashCurrentTotal. | ||
41970 | RET | Return. | ||
Handle 2UP:
|
||||
PrintPlayerTwo_CurrentTotal | 41971 | CALL PrintString_Loop | Call PrintString_Loop. | |
41974 | DEFB 22,20,3 | PRINT AT: 20, 3. | ||
41977 | DEFM "TWO" | |||
41980 | DEFB 255 | Terminator. | ||
41981 | LD HL,(39600) | HL=*2UP_Total. | ||
41984 | LD DE,44278 | DE=Current_Total. | ||
41987 | CALL 44784 | Call 44784. | ||
41990 | LD HL,44278 | HL=Current_Total. | ||
41993 | CALL PrintCurrentTotal | Call PrintCurrentTotal. | ||
41996 | CALL FlashCurrentTotal | Call FlashCurrentTotal. | ||
41999 | RET | Return. | ||
Convert the total to a printable string, and display it.
|
||||
PrintCurrentTotal | 42000 | LD B,3 | Set a counter in B for the 3 digits of a total value. | |
PrintCurrentTotal_Loop | 42002 | LD A,(HL) | A=*HL. | |
42003 | CP 32 | Jump to PrintCurrentTotal_Next if A is an ASCII "space" (32). | ||
42005 | JR Z,PrintCurrentTotal_Next | |||
42007 | ADD A,48 | Add 48 (ASCII "0") to A to "convert" it to ASCII. | ||
42009 | LD (HL),A | Write A to *HL. | ||
PrintCurrentTotal_Next | 42010 | INC HL | Increment HL by one. | |
42011 | DJNZ PrintCurrentTotal_Loop | Decrease counter by one and loop back to PrintCurrentTotal_Loop until counter is zero. | ||
42013 | RET | Return. |
Prev: 41892 | Up: Map | Next: 42014 |