Flag to upload graphics from the Super FX buffer. Is the value positive then 0x2000 bytes are uploaded from $705800 into $5400 (i.e. the last four rows of the sprite graphics). Is the value negative then the VRAM destination is whatever is stored in $0CF9 & 0x7FE0 and the graphics come from $706800 instead. Upload size stays the same.
Palette for the falling wall and spinning wooden platform (sprites 0x36 and 0x39). Each byte contains the individual colour i.e. only red, green or blue. These colours are then multiplied with the angle plus some constant which is then stored into the CG-RAM mirror.
Decompresses the HDMA colour gradient in ROM where the table's bank byte is in R0 and its low and high byte in R1. The resulting colour is stored into the Super FX buffer $705800.
Each gradient table is 48 bytes large resulting 24 different colours. The HDMA table is backwards i.e. the first colours are the bottom most colours and the last colours the top most colours in the final gradient.
The first 368 generated lines are smooth transitions where each tenth line is a different colour and the other generated 70 lines are a constant colour using in the compressed table last colour.
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.