Prev: D7C4 Up: Map Next: D8AE
D899: Routine at D899
At this point, A will hold the index of a requested sound, and RAM address 6D9A will contain the index of a pending sound. If the index of the requested sound is lower than the index of the pending sound, then the pending sound's index at 6D9A will be overwritten by the index of the requested sound in A.
Sounds with lower indices therefore take priority over sounds with higher indices.
D899 OR A If index of requested sound is zero then return.
D89A RET Z
D89B PUSH DE Stash DE on the stack.
D89C LD E,A Load E with requested sound index.
D89D LD A,($6D9B) If index of pending sound is zero then skip ahead to D8A8.
D8A0 OR A
D8A1 JR Z,$D8A8
Index of pending sound is not zero.
D8A3 CP E If index of requested sound is less than or equal to index of pending sound then skip ahead to D8A8.
D8A4 JR NC,$D8A8
D8A6 POP DE Restore DE from the stack.
D8A7 RET Return.
Index of pending sound is zero.
D8A8 LD A,E Set requested sound to be new pending sound.
D8A9 LD ($6D9B),A
D8AC POP DE
D8AD RET Return.
Prev: D7C4 Up: Map Next: D8AE