Prev: 61418 Up: Map Next: 61625
61521: Room drawing: Advance HL to next display file address to be drawn to (apply-horizontal-mirror flag set)
Used when apply-horizontal-mirror flag is set
Used by the routine at 61415.
Input
HL A display file address
Output
A 1 (if returning via 61493, drawing complete), otherwise zero
F Zero flag reset (if returning via 61493, drawing complete)
61521 LD A,(23449) Increase pixel row counter...
61524 DEC A ...
61525 AND 7 ...and reset to 7 if it falls below zero...
61527 LD (23449),A ...
61530 CP 7 If new value of pixel row counter is 7 (i.e. we have rolled over to a new character block)...
61532 JR Z,61537 ...then advance HL to next character block to be drawn and return
61534 DEC H Decrease display file address by 256 bytes (i.e. move to next pixel row up)
61535 XOR A Set A to zero
61536 RET Return
This next section advances HL to next character block to be drawn
61537 LD A,(23450) Load A with apply-horizontal-mirror and apply-vertical-mirror flags
61540 AND 1 If apply-vertical-mirror flag is set...
61542 JP NZ,61598 ...then skip ahead to 61598
61545 PUSH BC Store BC
61546 LD A,(23444) Load x-coordinate of character block currently being drawn into A...
61549 INC A ...increase by one...
61550 LD B,A ...and load into B
61551 LD A,(23410) Load (x-coordinate + 1) of right of graphic being drawn into A
61554 CP B If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)...
61555 JR Z,61575 ...then jump to 61575
61557 LD A,B Store increased x-coordinate at 23444...
61558 LD (23444),A ...
61561 LD BC,(23444) Load BC with coordinates of new character block to draw
61565 CALL 63203 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL
61568 LD A,7 Advance HL down seven pixel rows to bottom of character block...
61570 ADD A,H ...
61571 LD H,A ...
61572 XOR A Set A to zero
61573 POP BC Restore BC
61574 RET Return
This next section advances HL to next character row to be drawn
61575 LD A,(23408) Load A with x-coordinate of left of graphic to draw...
61578 LD (23444),A ...and set current x-coordinate to match
61581 LD A,(23445) Load current y-coordinate into C, decreasing by one...
61584 DEC A ...
61585 LD C,A ...
61586 LD A,(23409) Load y-coordinate of top of graphic being drawn into A
61589 CP C If both y-coordinates are the same (i.e. we have moved beyond graphic's top edge)...
61590 JR Z,61489 ...then jump to 61489 (load A with 1, reset zero flag and return)
61592 LD A,C Store increased y-coordinate at 23445...
61593 LD (23445),A ...
61596 JR 61561 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL then return
This next section advances HL to next character block to be drawn where the apply-vertical-mirror flag is set
61598 PUSH BC Store BC
61599 LD A,(23444) Load x-coordinate of character block currently being drawn into A...
61602 DEC A ...decrease by one...
61603 LD B,A ...and load into B
61604 LD A,(23408) Load x-coordinate of left of graphic being drawn into A...
61607 DEC A ...and decrease by one
61608 CP B If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)...
61609 JR Z,61618 ...then jump to 61618
61611 LD A,B Store decreased x-coordinate at 23444...
61612 LD (23444),A ...
61615 JP 61561 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL then return
61618 LD A,(23410) Load x-coordinate of right of graphic being drawn into A...
61621 DEC A ...
61622 JP 61578 Move current character position down one character row and return
Prev: 61418 Up: Map Next: 61625