Prev: 53825 Up: Map Next: 53968
53887: Paint red areas outside accessible areas of current character's current room
Used by the routines at 34438, 34916, 36616, 53723 and 54456.
53887 CALL 53825 Copy room dimension data entry for current character's current room to temporary store location (34230)
53890 PUSH IX Store IX
53892 CALL 53635 Clear display buffers 1 & 2
53895 EXX Switch registers
53896 LD HL,61312 Point HL at display buffer 1
53899 LD DE,63424 Point DE at display buffer 2
53902 EXX Switch registers
53903 LD HL,(34231) For current character's current room, set H = room's right edge position and L = room's left edge position (chars)
53906 LD DE,(34233) For current character's current room, set D = room's bottom edge position and E = room's top edge position (chars)
53910 LD IX,22528 Point IX at first byte of attribute file
53914 LD B,0 Set initial y-coordinate (characters) to zero
53916 LD A,B Load A with current y-coordinate
53917 CP E If y-coordinate of top of room is greater than current y-coordinate...
53918 JR C,53950 ...then skip ahead to 53950
53920 LD A,D Load A with y-coordinate of bottom of room
53921 CP B If y-coordinate of bottom of room is less than current y-coordinate...
53922 JR C,53950 ...then skip ahead to 53950
53924 LD C,0 Set initial x-coordinate to zero
53926 LD A,C Load A with current x-coordinate
53927 CP L If x-coordinate of left of room is greater than current x-coordinate...
53928 JR C,53940 ...then skip ahead to 53940
53930 LD A,H Load A with x-coordinate of right of room
53931 CP C If x-coordinate of right of room is less than current x-coordinate...
53932 JR C,53940 ...then skip ahead to 53940
53934 EXX Switch registers
53935 CALL 53977 Advance pointers in display buffers and attribute file address to next character
53938 JR 53943 Skip ahead to 53943
Current x-coordinate, C, is outside range of x-coordinates spanned by room
53940 CALL 53968 Print red cell to current attribute file position (outside play area) and mark as unused in display buffers
53943 INC C Advance C by one (move right one character)
53944 BIT 5,C If bit 5 is not set (x-coordinate has not reached 32)...
53946 JR Z,53926 ...then loop back to 53926
53948 JR 53959 Skip ahead to 53959
Current y-coordinate, B, is outside range of y-coordinates spanned by room
53950 PUSH BC Store BC (B = current y-coordinate, C = current x-coordinate)
53951 LD B,32 Load counter with 32 (as there are 32 characters per row)
53953 CALL 53968 Print red cell to current attribute file position (outside play area) and mark as unused in display buffers
53956 DJNZ 53953 Loop back to 53953 for next character block
53958 POP BC Restore BC (B = current y-coordinate, C = current x-coordinate)
53959 INC B Increase current y-coordinate by one
53960 LD A,B If y-coordinate has not reached 22...
53961 CP 22 ...
53963 JR NZ,53916 ...then loop back to 53916
53965 POP IX Restore IX
53967 RET Return
Prev: 53825 Up: Map Next: 53968