Prev: D578 Up: Map Next: D59A
D57B: Copy and clear a row, then step to the display line above
update_screen_byte D57B LD A,(HL) copy a byte and clear it behind
D57C LD (DE),A
D57D LD (HL),$00
D57F INC HL
D580 INC E
D581 DJNZ update_screen_byte
D583 POP HL the next buffer row is 32 bytes on
D584 LD BC,$0020
D587 ADD HL,BC
D588 POP DE
D589 DEC D up a display line: DEC D is enough unless the low three bits of D have wrapped round to 7, which means the line crossed into the character row above
D58A LD A,D
D58B CPL
D58C AND $07
D58E JR NZ,update_screen_next_row
D590 LD A,E crossing a character row: back 32 in E; if that borrows the line is the bottom of the third above, which is where DEC D left it; if not, D goes back up by 8 to stay in this third
D591 SUB $20
D593 LD E,A
D594 JR C,update_screen_next_row
D596 LD A,D
D597 ADD A,$08
D599 LD D,A
Prev: D578 Up: Map Next: D59A