Prev: 61415 Up: Map Next: 61521
61418: 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 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)
61418 LD A,(23449) Increase pixel row counter...
61421 INC A ...
61422 AND 7 ...and reset to zero if it exceeds 7...
61424 LD (23449),A ...
61427 JR Z,61432 If we have rolled over to a new character block then advance HL to next character block to be drawn and return
61429 INC H Increase display file address by 256 bytes (i.e. move to next pixel row down)
61430 XOR A Set A to zero
61431 RET Return
This next section advances HL to next character block to be drawn
61432 LD A,(23450) Load A with apply-horizontal-mirror and apply-vertical-mirror flags
61435 AND 1 If apply-vertical-mirror flag is set...
61437 JP NZ,61494 ...then skip ahead to 61494
61440 PUSH BC Store BC
61441 LD A,(23444) Load x-coordinate of character block currently being drawn into A...
61444 INC A ...increase by one...
61445 LD B,A ...and load into B
61446 LD A,(23410) Load (x-coordinate + 1) of right of graphic being drawn into A
61449 CP B If both x-coordinates are the same (i.e. we have moved beyond graphic's right edge)...
61450 JR Z,61466 ...then jump to 61466
61452 LD A,B Store increased x-coordinate at 23444...
61453 LD (23444),A ...
61456 LD BC,(23444) Load BC with coordinates of new character block to draw
61460 CALL 63203 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL
61463 XOR A Set A to zero
61464 POP BC Restore BC
61465 RET Return
This next section advances HL to next character row to be drawn
61466 LD A,(23408) Load A with x-coordinate of left of graphic to draw...
61469 LD (23444),A ...and set current x-coordinate to match
61472 LD A,(23445) Load current y-coordinate into C, increasing by one...
61475 INC A ...
61476 LD C,A ...
61477 LD A,(23411) Load (y-coordinate + 1) of bottom of graphic being drawn into A
61480 CP C If both y-coordinates are the same (i.e. we have moved beyond graphic's bottom edge)...
61481 JR Z,61489 ...then skip ahead to 61489
61483 LD A,C Store increased y-coordinate at 23445...
61484 LD (23445),A ...
61487 JR 61456 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 61521.
61489 LD A,1 Load A with 1
61491 OR A Reset zero flag
61492 POP BC Restore BC
61493 RET Return
This next section advances HL to next character block to be drawn where the apply-vertical-mirror flag is set
61494 PUSH BC Store BC
61495 LD A,(23444) Load x-coordinate of character block currently being drawn into A...
61498 DEC A ...decrease by one...
61499 LD B,A ...and load into B
61500 LD A,(23408) Load x-coordinate of left of graphic being drawn into A...
61503 DEC A ...and decrease by one
61504 CP B If both x-coordinates are the same (i.e. we have moved beyond graphic's left edge)...
61505 JR Z,61514 ...then jump to 61514
61507 LD A,B Store decreased x-coordinate at 23444...
61508 LD (23444),A ...
61511 JP 61456 Move virtual cursor (bitmap) to display file address for coordinates x=C, y=B and load address into HL then return
61514 LD A,(23410) Load x-coordinate of right of graphic being drawn into A...
61517 DEC A ...
61518 JP 61469 Move current character position down one character row and return
Prev: 61415 Up: Map Next: 61521