Prev: E24E Up: Map Next: E286
E25E: Select Task Progress Message
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 05 branches to Print_TaskProgressIntro ("NOT TIDY YET") or Print_WagesMessage ("HERE ARE YOUR WAGES") from bit 07 of TaskStatusFlags; tasks 01–04 index the pointer pairs at Table_TaskProgressMessagePointers (flag byte + message address).
Handle the wages / not-tidy task specially.
Select_TaskProgressMessage E25E LD A,($72AE) Fetch the current task index (CurrentTaskIndex). Is it task 05? If not, use the pointer table at Select_TaskProgressMessage_FromTable.
E261 CP $05
E263 JR NZ,Select_TaskProgressMessage_FromTable
E265 LD A,($72B4) Fetch the task status flags (TaskStatusFlags). Has the wages bit (bit 07) been set? If not, jump to Print_TaskProgressIntro to print "NOT TIDY YET". Otherwise jump to Print_WagesMessage to print "HERE ARE YOUR WAGES".
E268 BIT 7,A
E26A JP Z,Print_TaskProgressIntro
E26D JP Print_WagesMessage
Index Table_TaskProgressMessagePointers by (task−01)×04, load the mask into MessageColour and the message pointer into HL, then continue on to Print_EncodedMessage.
Select_TaskProgressMessage_FromTable E270 DEC A Turn (task−01) into a 0004-byte index, point HL at Table_TaskProgressMessagePointers, and keep the table offset in BC.
E271 ADD A,A
E272 ADD A,A
E273 LD B,$00
E275 LD C,A
E276 LD HL,$E24E
E279 ADD HL,BC
E27A 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).
E27B INC HL
E27C LD B,(HL)
E27D INC HL
E27E LD A,(BC)
E27F LD ($72EB),A
E282 LD E,(HL) Fetch the message address into HL.
E283 INC HL
E284 LD D,(HL)
E285 EX DE,HL
Continue on to Print_EncodedMessage.
Prev: E24E Up: Map Next: E286