Prev: 64886 Up: Map Next: 64942
64921: Build Music Delay Count
Used by the routine at Continue_MenuMusicTick.
Build a delay count from the shared phase at 64655.
Build_MusicDelayCount 64921 PUSH AF Stash AF on the stack.
64922 LD A,(64655) Load 64655, complement it, and copy the result into B and C.
64925 CPL
64926 LD B,A
64927 LD C,A
64928 ADD A,1 Add 1 so a zero phase still yields a positive count.
64930 SRA A Divide A by 4 with two arithmetic shifts right.
64932 SRA A
64934 LD E,A Copy the scaled count into E.
64935 CP 0 If the scaled count is zero, force E to 1.
64937 JR NZ,Build_MusicDelayCount_Return
64939 INC E
Restore AF and return the delay count.
Build_MusicDelayCount_Return 64940 POP AF Restore AF from the stack and return.
64941 RET
Prev: 64886 Up: Map Next: 64942