![]() |
Routines |
| Prev: D85E | Up: Map | Next: D8DA |
|
Used by the routine at after_step_drawn.
A flat run ending in cap $13 ($93 once seen) gets a lip one byte wide and four rows tall in the byte column after its last step, from floor_lip_bytes (floor) or ceiling_lip_bytes (ceiling) for the current fine horizontal position. Nothing is drawn on a byte boundary or outside the play area's columns, and the lip is cut to two rows at the play area's bottom (piece_y = $B9) or top (piece_y = $19).
|
||||
| draw_flat_end_lip | D86A | LD A,(piece_rise) | Only for a flat piece with end cap $13 that drew something. | |
| D86D | AND A | |||
| D86E | RET NZ | |||
| D86F | LD A,(piece_extra_b) | |||
| D872 | AND $7F | |||
| D874 | CP $13 | |||
| D876 | RET NZ | |||
| D877 | LD A,(piece_steps_done) | |||
| D87A | AND A | |||
| D87B | RET Z | |||
| D87C | LD HL,floor_lip_bytes | DE = the lip for this direction and fine position. | ||
| D87F | LD A,(IX+$03) | |||
| D882 | AND A | |||
| D883 | JR Z,draw_flat_end_lip_0 | |||
| D885 | LD HL,ceiling_lip_bytes | |||
| draw_flat_end_lip_0 | D888 | LD A,(origin_x) | ||
| D88B | AND $07 | |||
| D88D | RET Z | |||
| D88E | DEC A | |||
| D88F | DEC A | |||
| D890 | ADD A,A | |||
| D891 | LD E,A | |||
| D892 | LD D,$00 | |||
| D894 | ADD HL,DE | |||
| D895 | EX DE,HL | |||
| D896 | LD A,(last_step_in_border) | The column after the last step; a last step hanging into the border puts it a character row up. | ||
| D899 | AND A | |||
| D89A | LD HL,(column_address) | |||
| D89D | JR Z,draw_flat_end_lip_1 | |||
| D89F | LD (IX+$01),$00 | |||
| D8A3 | LD A,L | |||
| D8A4 | SUB $20 | |||
| D8A6 | LD L,A | |||
| D8A7 | INC L | |||
| D8A8 | INC L | |||
| D8A9 | INC L | |||
| draw_flat_end_lip_1 | D8AA | INC L | ||
| D8AB | INC L | |||
| D8AC | INC L | |||
| D8AD | LD A,L | Outside columns 1-28: nothing. | ||
| D8AE | AND $1F | |||
| D8B0 | DEC A | |||
| D8B1 | CP $1C | |||
| D8B3 | RET NC | |||
| D8B4 | LD B,$04 | At the bottom edge: two rows only, from the play area's bottom row (the cut never came up in the build's sessions). | ||
| D8B6 | LD A,(piece_y) | |||
| D8B9 | CP $B9 | |||
| D8BB | JR NZ,draw_flat_end_lip_2 | |||
| D8BD | INC DE | |||
| D8BE | INC DE | |||
| D8BF | LD H,$57 | |||
| D8C1 | LD A,L | |||
| D8C2 | AND $1F | |||
| D8C4 | OR $C0 | |||
| D8C6 | LD L,A | |||
| D8C7 | LD B,$02 | |||
| D8C9 | JR draw_flat_end_lip_3 | |||
| draw_flat_end_lip_2 | D8CB | CP $19 | At the top edge: two rows only. | |
| D8CD | JR NZ,draw_flat_end_lip_3 | |||
| D8CF | LD B,$02 | |||
| draw_flat_end_lip_3 | D8D1 | LD A,(DE) | Write the lip upwards. | |
| D8D2 | LD (HL),A | |||
| D8D3 | INC DE | |||
| D8D4 | CALL line_up_hl | |||
| D8D7 | DJNZ draw_flat_end_lip_3 | |||
| D8D9 | RET | |||
| Prev: D85E | Up: Map | Next: D8DA |