![]() |
Routines |
| Prev: 40030 | Up: Map | Next: 40072 |
|
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 | 40054 | LD HL,38508 | Point HL at the queue. | |||||||
| 40057 | LD B,8 | There are eight places in the queue. | ||||||||
| QueueMessage_Search | 40059 | LD A,(HL) | Fetch the message number of the entry. | |||||||
| 40060 | AND A | Jump if the entry is free. | ||||||||
| 40061 | JR Z,QueueMessage_Store | |||||||||
| 40063 | INC HL | Move on to the next entry... | ||||||||
| 40064 | INC HL | ...which is two bytes further on. | ||||||||
| 40065 | DJNZ QueueMessage_Search | Loop back until every entry has been checked. | ||||||||
| 40067 | RET | Return, as the queue is full. | ||||||||
| QueueMessage_Store | 40068 | LD (HL),E | Store the message number. | |||||||
| 40069 | INC HL | Move on to the argument. | ||||||||
| 40070 | LD (HL),D | Store the argument. | ||||||||
| 40071 | RET | Return. | ||||||||
| Prev: 40030 | Up: Map | Next: 40072 |