Prev: 36987 Up: Map Next: 37244
37212: Draw New Column
When Jetman crosses a cell boundary, point HL at the new terrain cell and DE at the screen column that has scrolled into view.
Input
HL World X
DE Pixel step
Output
HL Pointer to the cell after the drawn one
DE Screen address one character row below the column
Draw the new terrain column that has scrolled into view.
DrawNewColumn 37212 LD A,E Jump to LocateTerrainCell if Jetman is moving left.
37213 AND A
37214 JP M,LocateTerrainCell
37217 LD DE,128 Add 128 to the world X.
37220 ADD HL,DE
37221 LD A,H Fetch the high byte.
37222 AND %00011111 Keep only bits 0-4.
37224 LD H,A Write it back to H.
37225 LD DE,28672 DE=TerrainData_Active.
37228 SRA H Divide the world position by 8.
37230 RR L
37232 SRA H
37234 RR L
37236 SRA H
37238 RR L
37240 ADD HL,DE HL+=DE.
37241 LD DE,20703 DE=20703.
Continue on to DrawTerrainColumn.
Prev: 36987 Up: Map Next: 37244