Prev: 55559 Up: Map Next: 55685
55651: Flash border and screen (as in cast a spell)
Used by the routines at 31122, 31280, 31312 and 31468.
55651 LD B,96 Load B with 96 (number of times to repeat routine)
55653 LD DE,576 Load DE with 576 (number of bytes to modify - i.e. bottom 18 rows)
55656 LD HL,22720 Point HL at start of 7th row in attribute file
55659 LD A,(HL) Load attribute byte into A
55660 AND 248 Clear three lowest bits (i.e. INK colour) preserving only PAPER, BRIGHT and FLASH bits
55662 LD C,A Place modified value into C
55663 LD A,(HL) Get original attribute from screen again
55664 INC A Increase by one
55665 AND 7 Clear all bits except the lowest three (i.e. INK colour)
55667 OUT (254),A Set border colour to A
55669 OR C Combine other bits back in
55670 OUT (254),A Update border / speaker state
55672 LD (HL),A Load modified value back into attribute file
55673 INC HL Move to next byte in attribute file
55674 DEC DE Reduce DE (reducing number of attribute bytes left to modify)
55675 LD A,D If DE is not zero (i.e. there are more attribute bytes to modify)...
55676 OR E ...
55677 JR NZ,55659 ...then loop back to 55659
55679 DJNZ 55653 Loop back for another pass
55681 XOR A Set A to zero
55682 OUT (254),A Reset border to black and reset speaker state
55684 RET Return
Prev: 55559 Up: Map Next: 55685