Routines |
Prev: 7D13 | Up: Map | Next: 7D2F |
This adds a new message index to the pending messages queue.
Used by the routines at check_morale, picking_lock, event_another_day_dawns, event_wake_up, event_go_to_roll_call, event_go_to_breakfast_time, event_go_to_exercise_time, event_go_to_time_for_bed, event_new_red_cross_parcel, accept_bribe, is_door_locked, action_red_cross_parcel, action_wiresnips, action_lockpick, action_key, solitary, item_discovered and event_roll_call.
Commentary: The use of C on entry to this routine is puzzling. One routine (check_morale) explicitly sets it to zero before calling, but the other callers do not so we receive whatever was in C previously.
|
||||||||||
queue_message | 7D15 | LD HL,($7D11) | Fetch the message queue pointer | |||||||
7D18 | LD A,$FF | Is the currently pointed-to index message_QUEUE_END? ($FF) | ||||||||
7D1A | CP (HL) | |||||||||
7D1B | RET Z | Return if so - the queue is full | ||||||||
Is this message index already pending?
|
||||||||||
7D1C | DEC HL | Step back two bytes to the next pending entry | ||||||||
7D1D | DEC HL | |||||||||
7D1E | LD A,(HL) | If the new message index matches the pending entry then return | ||||||||
7D1F | CP B | |||||||||
7D20 | INC HL | |||||||||
7D21 | JR NZ,queue_message_0 | |||||||||
7D23 | LD A,(HL) | |||||||||
7D24 | CP C | |||||||||
7D25 | RET Z | |||||||||
Add it to the queue.
|
||||||||||
queue_message_0 | 7D26 | INC HL | Store the new message index | |||||||
7D27 | LD (HL),B | |||||||||
7D28 | INC HL | |||||||||
7D29 | LD (HL),C | |||||||||
7D2A | INC HL | |||||||||
7D2B | LD ($7D11),HL | Update the message queue pointer | ||||||||
7D2E | RET | Return |
Prev: 7D13 | Up: Map | Next: 7D2F |