Prev: 55236 Up: Map Next: 55470
55449: Routine at D899
At this point, A will hold the index of a requested sound, and RAM address 28058 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 28058 will be overwritten by the index of the requested sound in A.
Sounds with lower indices therefore take priority over sounds with higher indices.
55449 OR A If index of requested sound is zero then return.
55450 RET Z
55451 PUSH DE Stash DE on the stack.
55452 LD E,A Load E with requested sound index.
55453 LD A,(28059) If index of pending sound is zero then skip ahead to 55464.
55456 OR A
55457 JR Z,55464
Index of pending sound is not zero.
55459 CP E If index of requested sound is less than or equal to index of pending sound then skip ahead to 55464.
55460 JR NC,55464
55462 POP DE Restore DE from the stack.
55463 RET Return.
Index of pending sound is zero.
55464 LD A,E Set requested sound to be new pending sound.
55465 LD (28059),A
55468 POP DE
55469 RET Return.
Prev: 55236 Up: Map Next: 55470