![]() |
Routines |
| Prev: 9C5E | Up: Map | Next: 9C88 |
|
Used by the routines at AttackSector, SendProgramPacket, CheckBatteryLow, ReduceSectorEnergy and MoveProgramPacket.
Adds a message to the queue of messages that are shown in the message area. The queue holds eight messages, and if it is full then the message is lost.
|
||||||||||
| QueueMessage | 9C76 | LD HL,$966C | Point HL at the queue. | |||||||
| 9C79 | LD B,$08 | There are eight places in the queue. | ||||||||
| QueueMessage_Search | 9C7B | LD A,(HL) | Fetch the message number of the entry. | |||||||
| 9C7C | AND A | Jump if the entry is free. | ||||||||
| 9C7D | JR Z,QueueMessage_Store | |||||||||
| 9C7F | INC HL | Move on to the next entry... | ||||||||
| 9C80 | INC HL | ...which is two bytes further on. | ||||||||
| 9C81 | DJNZ QueueMessage_Search | Loop back until every entry has been checked. | ||||||||
| 9C83 | RET | Return, as the queue is full. | ||||||||
| QueueMessage_Store | 9C84 | LD (HL),E | Store the message number. | |||||||
| 9C85 | INC HL | Move on to the argument. | ||||||||
| 9C86 | LD (HL),D | Store the argument. | ||||||||
| 9C87 | RET | Return. | ||||||||
| Prev: 9C5E | Up: Map | Next: 9C88 |