Prev: 48341 Up: Map Next: 48389
48360: Draw a line from (C, B) to (E, D)
Used by the routine at 40008.
Input
B y-coordinate of start of line
C x-coordinate of start of line
D y-coordinate of end of line
E x-coordinate of end of line
48360 LD (23677),DE Load contents of DE into coordinate storage (start point of line)
48364 LD A,B Subtract y-coordinate of start of line from y-coordinate of end of line...
48365 SUB D ...to get delta-y
48366 LD D,1 Set direction of vertical change to +1 (upward)
48368 JR NC,48374 If delta-y is positive (i.e. upward) then skip ahead to 48374
48370 CPL Multiply delta-y by -1 (downward) to get absolute magnitude...
48371 INC A ...
48372 LD D,255 Set direction of vertical change to -1 (downward)
48374 LD B,A Load B with magnitude of difference in y-coordinate between start and end of line
48375 LD A,C Subtract x-coordinate of start of line from y-coordinate of end of line...
48376 SUB E ...to get delta-x
48377 LD E,1 Set direction of horizontal change to +1 (rightward)
48379 JR NC,48385 If delta-x is positive (i.e. rightward) then skip ahead to 48385
48381 CPL Multiply delta-x by -1 (leftward) to get absolute magnitude...
48382 INC A ...
48383 LD E,255 Set direction of vertical change to -1 (leftward)
48385 LD C,A Load C with magnitude of difference in x-coordinate between start and end of line
48386 JP 9402 Draw the line (ROM routine) and return
Prev: 48341 Up: Map Next: 48389