Routines

25248: Update display area


Used by routines at 28160, 62094 and 63210

A set bit in any of the 84 bytes of the screen refresh buffer (SRB) at 32512 corresponds to a character square of the screen that needs refreshing (e.g. because of movement of game characters)

25248 CDE168 CALL 26849 Update SRB so that speech bubbles are not corrupted by moving characters
25251 0654 LD B,84 21 character lines, 4 bytes (32 bits) per character line
25253 7E LD A,(HL) Pick up a byte from the screen refresh buffer
25254 A7 AND A Anything need updating in this particular 8-character-square segment?
25255 2823 JR Z,25292 Jump if not
25257 C5 PUSH BC
25258 7D LD A,L 0≤A≤83
25259 E6FC AND 252
25261 0F RRCA
25262 0F RRCA
25263 57 LD D,A 0≤D≤20 (corresponding to line of screen)
25264 7D LD A,L 0≤A≤83
25265 E603 AND 3
25267 87 ADD A,A
25268 87 ADD A,A
25269 87 ADD A,A A=0, 8, 16 or 24
25270 3D DEC A
25271 5F LD E,A
25272 1C INC E
25273 CB26 SLA (HL) Does a character square need printing?
25275 3804 JR C,25281 Jump if so
25277 20F9 JR NZ,25272 Jump back if there are still non-zero bits left in this SRB byte
25279 180A JR 25291 Jump forward to consider next SRB byte
25281 E5 PUSH HL
25282 D5 PUSH DE
25283 EB EX DE,HL
25284 CD6C60 CALL 24684 Print a character square
25287 D1 POP DE
25288 E1 POP HL
25289 18ED JR 25272 Next bit of SRB byte
25291 C1 POP BC
25292 2C INC L Point to next SRB byte
25293 10D6 DJNZ 25253 Jump back to deal with it
25295 C9 RET