Prev: 6AA3 Up: Map Next: 6B5E
6B58: Calculate mirrored right edge (terrain extras mode 1)
For symmetric river sections. Right edge = 2*C - D where C is the default river width from state_terrain_element_23 low byte and D is the left edge coordinate. This mirrors the left edge around the river center.
Input
C River center position (from state_terrain_element_23 low byte).
D Left terrain edge coordinate.
Output
A Right terrain edge coordinate = 2*C - D.
calc_terrain_right_mirrored 6B58 LD A,C A = 2*C - D (mirror left around center), jump to draw_terrain_right_edge.
6B59 SUB D
6B5A ADD A,C
6B5B JP draw_terrain_right_edge
Prev: 6AA3 Up: Map Next: 6B5E