Generates a layer 3 parallax and wave HDMA table. In addition, it also updates $701FE4 which is the frame counter/"angle" for the wave effect which only gets updated if R11 is zero. During the initialisation, R1 determines whether the table starts as without or with a wave effect.
In the loop, if the mode switch value is positive then decompress the table. Otherwise, switch the mode.
It first evaluates the parallax scroll by multiplying the layer 1 X position with the scroll factor for the current lines and takes bits 8-15 of the 32-bit for the scrolling value. This value is stored into the buffer up to the scrolling reaches Y position of the effect where the next values are evaluated.
If the wave effect is activated then the offset added to the scrolling is -sin(t) * rad with t being the frame counter/"angle" and rad being the amplitude/"radius". For each new line, t is increased by the "angle" stored in the fifth byte in the table.
This procedure is repeated for so long until 210 lines are evaluated.