Prev: 36111 Up: Map Next: 36266
36211: Move and draw the light beam in Solar Power Generator
Used by the routine at 34574.
36211 LD HL,23575 Point HL at the cell at (0,23) in the attribute buffer at 23552 (the source of the light beam)
36214 LD DE,32 Prepare DE for addition (the beam travels vertically downwards to start with)
The beam-drawing loop begins here.
36217 LD A,(32809) Pick up the attribute byte of the floor tile for the cavern from 32809
36220 CP (HL) Does HL point at a floor tile?
36221 RET Z Return if so (the light beam stops here)
36222 LD A,(32827) Pick up the attribute byte of the wall tile for the cavern from 32827
36225 CP (HL) Does HL point at a wall tile?
36226 RET Z Return if so (the light beam stops here)
36227 LD A,39 A=39 (INK 7: PAPER 4)
36229 CP (HL) Does HL point at a tile with this attribute value?
36230 JR NZ,36248 Jump if not (the light beam is not touching Willy)
36232 EXX Switch to the shadow registers briefly (to preserve DE and HL)
36233 CALL 35388 Decrease the air supply by four units
36236 CALL 35388
36239 CALL 35388
36242 CALL 35388
36245 EXX Switch back to the normal registers (restoring DE and HL)
36246 JR 36261 Jump forward to draw the light beam over Willy
36248 LD A,(32800) Pick up the attribute byte of the background tile for the cavern from 32800
36251 CP (HL) Does HL point at a background tile?
36252 JR Z,36261 Jump if so (the light beam will not be reflected at this point)
36254 LD A,E Toggle the value in DE between 32 and -1 (and therefore the direction of the light beam between vertically downwards and horizontally to the left): the light beam has hit a guardian
36255 XOR 223
36257 LD E,A
36258 LD A,D
36259 CPL
36260 LD D,A
36261 LD (HL),119 Draw a portion of the light beam with attribute value 119 (INK 7: PAPER 6: BRIGHT 1)
36263 ADD HL,DE Point HL at the cell where the next portion of the light beam will be drawn
36264 JR 36217 Jump back to draw the next portion of the light beam
Prev: 36111 Up: Map Next: 36266