Prev: DED3 Up: Map Next: DF97
DF34: Trim a step along -V at the walls
As CLIP_PLUS_V, with the front edge at V less the half-size, the step taken as negative (B=$FF), and CUT_STEP_MINUS_V trimming it.
Input
IX The record
Output
F Carry set if a wall trimmed the step
CLIP_MINUS_V DF34 LD L,(IX+$01) DE: U less the half-size
DF37 LD H,(IX+$02)
DF3A LD C,(IX+$08)
DF3D LD B,$00
DF3F AND A
DF40 SBC HL,BC
DF42 EX DE,HL
DF43 LD L,(IX+$03) HL: V less the half-size, the front edge
DF46 LD H,(IX+$04)
DF49 LD C,(IX+$09)
DF4C AND A
DF4D SBC HL,BC
DF4F PUSH DE Test the cell under the one front corner; done if a wall
DF50 PUSH HL
DF51 CALL CUT_STEP_MINUS_V
DF54 POP DE
DF55 POP HL
DF56 RET C
DF57 PUSH HL The other corner, U plus the half-size: in the same cell?
DF58 PUSH DE
DF59 LD C,(IX+$08)
DF5C SLA C
DF5E LD B,$00
DF60 LD A,H
DF61 ADD HL,BC
DF62 CP H
DF63 JR Z,CLIP_MINUS_V_0
DF65 EX DE,HL No: test its cell too
DF66 CALL CUT_STEP_MINUS_V
DF69 POP HL
DF6A POP DE
DF6B RET C
DF6C LD C,(IX+$0B) Does the step (negative: B=$FF) take the front edge into the row of cells before? Done if not
DF6F LD B,$FF
DF71 LD A,H
DF72 ADD HL,BC
DF73 CP H
DF74 RET Z
DF75 PUSH DE Yes: test the cells the two corners go into
DF76 PUSH HL
DF77 CALL CUT_STEP_MINUS_V
DF7A POP DE
DF7B POP HL
DF7C RET C
DF7D LD C,(IX+$08)
DF80 SLA C
DF82 LD B,$00
DF84 ADD HL,BC
DF85 EX DE,HL
DF86 JP CUT_STEP_MINUS_V
CLIP_MINUS_V_0 DF89 POP HL Both corners in one cell: test only the cell the step goes into, if another
DF8A POP DE
DF8B LD C,(IX+$0B)
DF8E LD B,$FF
DF90 LD A,H
DF91 ADD HL,BC
DF92 CP H
DF93 RET Z
DF94 JP CUT_STEP_MINUS_V
Prev: DED3 Up: Map Next: DF97