Prev: 923A Up: Map Next: 927F
925F: Check and set the attribute byte for a cell occupied by Willy's sprite
Used by the routine at 923A.
Input
C 0x0F or Willy's y-coordinate
HL Address of the cell in the attribute buffer at 5C00
925F LD A,($8020) Pick up the attribute byte of the background tile for the current cavern from 8020
9262 CP (HL) Does this cell contain a background tile?
9263 JR NZ,$9270 Jump if not
9265 LD A,C Set the zero flag if we are going to retain the INK colour in this cell; this happens only if the cell is in the bottom row and Willy's sprite is confined to the top two rows
9266 AND $0F
9268 JR Z,$9270 Jump if we are going to retain the current INK colour in this cell
926A LD A,($8020) Pick up the attribute byte of the background tile for the current cavern from 8020
926D OR $07 Set bits 0-2, making the INK white
926F LD (HL),A Set the attribute byte for this cell in the buffer at 5C00
9270 LD A,($804D) Pick up the attribute byte of the first nasty tile for the current cavern from 804D
9273 CP (HL) Has Willy hit a nasty of the first kind?
9274 JP Z,$8D05 Kill Willy if so
9277 LD A,($8056) Pick up the attribute byte of the second nasty tile for the current cavern from 8056
927A CP (HL) Has Willy hit a nasty of the second kind?
927B JP Z,$8D05 Kill Willy if so
927E RET
Prev: 923A Up: Map Next: 927F