Prev: D2DA Up: Map Next: D303
D2E1: Test Bottom Row
Used by the routine at DrawTerrain.
Tests the vertical extent of a segment of a tile in the bottom row against the vertical position in B.
Input
B Vertical position to test against
IX Address of the record of the segment
Output
F Zero if the segment reaches the position or goes beyond it
TestBottomRow D2E1 LD A,($CE37) The vertical step.
D2E4 AND A Jump to TestBottomRow_Sloped if A is not zero.
D2E5 JR NZ,TestBottomRow_Sloped
D2E7 LD A,($CE44) The segment row.
D2EA SUB $04 Subtract 04 from A.
D2EC JR TestBottomRow_Compare Jump to TestBottomRow_Compare.
TestBottomRow_Sloped D2EE LD A,($CE59) The horizontal step copy.
D2F1 AND A Jump to TestBottomRow_Direction if A is not zero.
D2F2 JR NZ,TestBottomRow_Direction
D2F4 LD A,(IX+$01) Read offset 01 of IX.
D2F7 SUB (IX+$03) Subtract the byte at offset 03 of IX from A.
D2FA JR TestBottomRow_Compare Jump to TestBottomRow_Compare.
TestBottomRow_Direction D2FC LD A,(IX+$03) Read offset 03 of IX.
TestBottomRow_Compare D2FF CP B Return if A is B or more.
D300 RET NC
D301 XOR A Clear A.
D302 RET Return.
Prev: D2DA Up: Map Next: D303