Prev: E86E Up: Map Next: E89B
E87D: Plot the first pixel of a line
Used by the routine at MORE_ROOM_COMMANDS.
Plots the pixel at column C, row B with the room drawing's pen, and leaves HL and D at it for MORE_ROOM_COMMANDS to carry on the line from there. The pen draws on the screen, or in the clean copy (LOADING_TUNE) while a room has sent its lines there (code $E4 $00 puts $80 in IY+$6A, which is added to the screen address; $E4 $01 puts 0 back). By the mode bits (MODE) it sets the pixel (the usual), clears it (bit 0, codes $CB and $CC) or flips it (bit 1, codes $CD and $CE). A row above the top of the screen is not plotted -- a guard nothing reaches, since the points always wrap round into the screen (DO_ROOM_COMMAND).
Input
B Row, from the bottom
C Column
Output
HL The byte plotted, on the screen or in the clean copy
D The pixel's mask
PLOT_LINE_START E87D LD A,$BF above the top of the screen: nothing
E87F SUB B
E880 RET C
E881 CALL SCREEN_PIXEL the screen byte and mask; IY+$6A moves it to the clean copy
E884 LD D,A
E885 LD A,H
E886 ADD A,(IY+LINE_PAGE-V)
E889 LD H,A
E88A LD A,(HL) flip it (bit 1); or set it, and clear it again if bit 0 is on
E88B BIT 1,(IY+MODE-V)
E88F JR NZ,PLOT_LINE_START_0
E891 OR D
E892 BIT 0,(IY+MODE-V)
E896 JR Z,PLOT_LINE_START_1
PLOT_LINE_START_0 E898 XOR D write it back
PLOT_LINE_START_1 E899 LD (HL),A
E89A RET
Prev: E86E Up: Map Next: E89B