Prev: 52714 Up: Map Next: 52820
52717: Room drawing: Advance HL to next display file address to be drawn to (apply-horizontal-mirror flag reset)
Used when apply-horizontal-mirror flag is reset
Used by the routine at 52714.
Input
HL A display file address
Output
A 1 (if returning via 52792, drawing complete), otherwise zero
F Zero flag reset (if returning via 52792, drawing complete)
52717 LD A,(23449) Increase pixel row counter...
52720 INC A ...
52721 AND 7 ...and reset to zero if it exceeds 7...
52723 LD (23449),A ...
52726 JR Z,52731 If we have rolled over to a new character block then advance HL to next character block to be drawn and return
52728 INC H Increase display file address by 256 bytes (i.e. move to next pixel row down)
52729 XOR A Set A to zero
52730 RET Return
This next section advances HL to next character block to be drawn
52731 LD A,(23450) Load A with apply-horizontal-mirror and apply-vertical-mirror flags
52734 AND 1 If apply-vertical-mirror flag is set...
52736 JP NZ,52793 ...then skip ahead to 52793
52739 PUSH BC Store BC
52740 LD A,(23444) Load x-coordinate of character block currently being drawn into A...
52743 INC A ...increase by one...
52744 LD B,A ...and load into B
52745 LD A,(23495) Load (x-coordinate + 1) of right of graphic being drawn into A
52748 CP B If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)...
52749 JR Z,52765 ...then jump to 52765
52751 LD A,B Store increased x-coordinate at 23444...
52752 LD (23444),A ...
52755 LD BC,(23444) Load BC with coordinates of new character block to draw
52759 CALL 54132 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL
52762 XOR A Set A to zero
52763 POP BC Restore BC
52764 RET Return
This next section advances HL to next character row to be drawn
52765 LD A,(23493) Load A with x-coordinate of left of graphic to draw...
52768 LD (23444),A ...and set current x-coordinate to match
52771 LD A,(23445) Load current y-coordinate into C, increasing by one...
52774 INC A ...
52775 LD C,A ...
52776 LD A,(23496) Load (y-coordinate + 1) of bottom of graphic being drawn into A
52779 CP C If both y-coordinates are the same (i.e. we have moved beyond graphic's bottom edge)...
52780 JR Z,52788 ...then skip ahead to 52788
52782 LD A,C Store increased y-coordinate at 23445...
52783 LD (23445),A ...
52786 JR 52755 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL then return
This entry point is used by the routine at 52820.
52788 LD A,1 Load A with 1
52790 OR A Reset zero flag
52791 POP BC Restore BC
52792 RET Return
This next section advances HL to next character block to be drawn where the apply-vertical-mirror flag is set
52793 PUSH BC Store BC
52794 LD A,(23444) Load x-coordinate of character block currently being drawn into A...
52797 DEC A ...decrease by one...
52798 LD B,A ...and load into B
52799 LD A,(23493) Load x-coordinate of left of graphic being drawn into A...
52802 DEC A ...and decrease by one
52803 CP B If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)...
52804 JR Z,52813 ...then jump to 52813
52806 LD A,B Store decreased x-coordinate at 23444...
52807 LD (23444),A ...
52810 JP 52755 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL then return
52813 LD A,(23495) Load x-coordinate of right of graphic being drawn into A...
52816 DEC A ...
52817 JP 52768 Move current character position down one character row and return
Prev: 52714 Up: Map Next: 52820