Prev: 38961 Up: Map Next: 39016
38980: Unused routine
This routine draws a line from (C, B) to (E, D).
38980 LD (23677),DE Load contents of DE into coordinate storage (start point of line)
38984 LD A,B Subtract y-coordinate of start of line from y-coordinate of end of line...
38985 SUB D ...to get delta-y
38986 LD D,1 Set direction of vertical change to +1 (upward)
38988 JR NC,38994 If delta-y is positive (i.e. upward) then skip ahead to 38994
38990 CPL Multiply delta-y by -1 (downward) to get absolute magnitude...
38991 INC A ...
38992 LD D,255 Set direction of vertical change to -1 (downward)
38994 LD B,A Load B with magnitude of difference in y-coordinate between start and end of line
38995 LD A,C Subtract x-coordinate of start of line from y-coordinate of end of line...
38996 SUB E ...to get delta-x
38997 LD E,1 Set direction of horizontal change to +1 (rightward)
38999 JR NC,39005 If delta-x is positive (i.e. rightward) then skip ahead to 39005
39001 CPL Multiply delta-x by -1 (leftward) to get absolute magnitude...
39002 INC A ...
39003 LD E,255 Set direction of vertical change to -1 (leftward)
39005 LD C,A Load C with magnitude of difference in x-coordinate between start and end of line
39006 EXX Switch registers
39007 PUSH HL Store HL
39008 EXX Switch registers
39009 CALL 9402 Draw a line (ROM routine)
39012 EXX Switch registers
39013 POP HL Restore HL
39014 EXX Switch registers
39015 RET Return
Prev: 38961 Up: Map Next: 39016