![]() |
Routines |
| Prev: 63296 | Up: Map | Next: 63759 |
|
Used by the routines at Update_Berk_State, Update_Timed_Events, Handle_Berk_Action, ScriptRoutine_AnimateTrapDoorBerk, Update_Drutt, Update_Entity_Slot, Test_ThingUpstairs_Overlap, ScriptRoutine_TaskThreeQueueSound, Update_Heater, ScriptRoutine_TaskFourTickOfferItem, ScriptRoutine_TaskFourBerkOverlap, Update_Ghosts, ScriptRoutine_VatQueueSound, ScriptRoutine_VatClearBit6AndReset, Print_EncodedMessage, GraphicLayoutRoutine_SetPendingSound, Clear_AttributeFile, Close_TrapDoor, Open_TrapDoor, ScriptRoutine_MoveRight and ScriptRoutine_MoveDown.
Queue a sound index in PendingSoundIndex for Play_QueuedSound. If bit 7 of A is set, force the queue (replace any pending sound). Otherwise keep the existing pending sound when one is already waiting Play_QueuedSound forms the parameter pointer as base 63751 plus index×8. That base address 63751 is the operand byte of the busy-check JR NZ, and it is never read as a sound parameter because indexes start at 1 (so the first block is at Table_SoundParameters).
|
||||||||
| Queue_Sound | 63737 | BIT 7,A | Is bit 7 set (force-queue)? If not, jump to Queue_Sound_UnlessBusy to queue only when idle. | |||||
| 63739 | JR Z,Queue_Sound_UnlessBusy | |||||||
| 63741 | LD (29449),A | Write the sound index to PendingSoundIndex. | ||||||
| 63744 | RET | Return. | ||||||
|
Queue the sound index into PendingSoundIndex only when the queue is idle.
|
||||||||
| Queue_Sound_UnlessBusy | 63745 | PUSH AF | Stash AF on the stack. | |||||
| 63746 | LD A,(29449) | Fetch the pending sound index from PendingSoundIndex. | ||||||
| 63749 | OR A | Is a sound already waiting? If so, jump to Queue_Sound_Busy. | ||||||
| 63750 | JR NZ,Queue_Sound_Busy | |||||||
|
Finish Queue_Sound: write the new index when the queue was idle, or discard it when busy.
|
||||||||
| Queue_Sound_CommitOrDiscard | 63752 | POP AF | Restore the new index from the stack. | |||||
| 63753 | LD (29449),A | Write it to PendingSoundIndex. | ||||||
| 63756 | RET | Return. | ||||||
|
Leave the pending sound in PendingSoundIndex unchanged when the queue is busy.
|
||||||||
| Queue_Sound_Busy | 63757 | POP AF | Restore AF from the stack (discard the new index). | |||||
| 63758 | RET | Return. | ||||||
| Prev: 63296 | Up: Map | Next: 63759 |