![]() |
Routines |
| Prev: 44860 | Up: Map | Next: 44969 |
|
Used by the routine at GameStart.
Check Task Completion for the current Thing Upstairs task.
|
||||
| Check_Task_Completion | 44927 | LD A,(29358) | Load A with the current task index (CurrentTaskIndex). | |
| 44930 | CP 5 | Is current task index equal to 5? If not, return. | ||
| 44932 | RET NZ | |||
| 44933 | LD A,(29364) | Load A with the task status flags (TaskStatusFlags). | ||
| 44936 | BIT 7,A | Is bit 7 of task status flags set? If so, return. | ||
| 44938 | RET NZ | |||
| 44939 | LD HL,36585 | Point HL at Boney's complex entity state (StateData_Boney). | ||
| 44942 | LD DE,14 | Each entity record is 0014 bytes long, then load that length into DE. | ||
|
Scan Boney's complex state for the 55 busy pattern that marks task completion.
|
||||
| Check_Task_Completion_ScanBerk | 44945 | LD A,(HL) | Fetch the next byte from Boney's complex entity state. | |
| 44946 | CP 55 | Is task status flags equal to 55? If so, jump to Check_Task_Completion_SetBusyBit7. | ||
| 44948 | JR Z,Check_Task_Completion_SetBusyBit7 | |||
| 44950 | CP 1 | Is task status flags equal to 1? If so, jump to Check_Task_Completion_NextBerkRecord. | ||
| 44952 | JR Z,Check_Task_Completion_NextBerkRecord | |||
| 44954 | BIT 7,A | Is bit 7 of task status flags set? If so, jump to Check_Task_Completion_NextBerkRecord. | ||
| 44956 | JR NZ,Check_Task_Completion_NextBerkRecord | |||
| 44958 | OR A | Is task status flags zero? If not, return. | ||
| 44959 | RET NZ | |||
|
Advance to the next Berk state record and keep scanning for completion.
|
||||
| Check_Task_Completion_NextBerkRecord | 44960 | ADD HL,DE | Add the offset in DE to the pointer in HL. | |
| 44961 | JR Check_Task_Completion_ScanBerk | Jump to Check_Task_Completion_ScanBerk to keep testing task-status combinations. | ||
|
Mark task status bit 7 so Berk's script/dialogue is busy.
|
||||
| Check_Task_Completion_SetBusyBit7 | 44963 | LD HL,29364 | Point HL at the task status flags (TaskStatusFlags). | |
| 44966 | SET 7,(HL) | Set "Berk script / dialogue busy" (bit 7 of TaskStatusFlags). | ||
| 44968 | RET | Return. | ||
| Prev: 44860 | Up: Map | Next: 44969 |