![]() |
Routines |
| Prev: 57934 | Up: Map | Next: 57990 |
|
Used by the routine at Update_Timed_Events.
Choose which mid-task progress message to show from the current task index (CurrentTaskIndex), then continue on to Print_EncodedMessage to print it. Task 5 branches to Print_TaskProgressIntro ("NOT TIDY YET") or Print_WagesMessage ("HERE ARE YOUR WAGES") from bit 7 of TaskStatusFlags; tasks 1–4 index the pointer pairs at Table_TaskProgressMessagePointers (flag byte + message address).
|
||||
|
Handle the wages / not-tidy task specially.
|
||||
| Select_TaskProgressMessage | 57950 | LD A,(29358) | Fetch the current task index (CurrentTaskIndex). Is it task 5? If not, use the pointer table at Select_TaskProgressMessage_FromTable. | |
| 57953 | CP 5 | |||
| 57955 | JR NZ,Select_TaskProgressMessage_FromTable | |||
| 57957 | LD A,(29364) | Fetch the task status flags (TaskStatusFlags). Has the wages bit (bit 7) been set? If not, jump to Print_TaskProgressIntro to print "NOT TIDY YET". Otherwise jump to Print_WagesMessage to print "HERE ARE YOUR WAGES". | ||
| 57960 | BIT 7,A | |||
| 57962 | JP Z,Print_TaskProgressIntro | |||
| 57965 | JP Print_WagesMessage | |||
|
Index Table_TaskProgressMessagePointers by (task−1)×4, load the mask into MessageColour and the message pointer into HL, then continue on to Print_EncodedMessage.
|
||||
| Select_TaskProgressMessage_FromTable | 57968 | DEC A | Turn (task−1) into a 0004-byte index, point HL at Table_TaskProgressMessagePointers, and keep the table offset in BC. | |
| 57969 | ADD A,A | |||
| 57970 | ADD A,A | |||
| 57971 | LD B,0 | |||
| 57973 | LD C,A | |||
| 57974 | LD HL,57934 | |||
| 57977 | ADD HL,BC | |||
| 57978 | LD C,(HL) | Fetch the flag-pointer word and advance onto the message address, then store the live flag/mask byte as the message colour/mask (MessageColour). | ||
| 57979 | INC HL | |||
| 57980 | LD B,(HL) | |||
| 57981 | INC HL | |||
| 57982 | LD A,(BC) | |||
| 57983 | LD (29419),A | |||
| 57986 | LD E,(HL) | Fetch the message address into HL. | ||
| 57987 | INC HL | |||
| 57988 | LD D,(HL) | |||
| 57989 | EX DE,HL | |||
|
Continue on to Print_EncodedMessage.
|
||||
| Prev: 57934 | Up: Map | Next: 57990 |