Prev: 36472 Up: Map Next: 36510
36475: Print a character (e.g. letter in the current room name, or a block of a window border)
Used by the routines at 36725, 36908 and 37147.
Input
A Index of character to print
36475 PUSH HL Store HL
36476 LD DE,63732 Point to graphic (Magic Knight, frame 1, facing left)
36479 ADD A,A Load index of character into HL and multiply by 8...
36480 LD H,0 ...
36482 LD L,A ...
36483 ADD HL,HL ...
36484 ADD HL,HL ...
36485 ADD HL,DE ...and add to DE to obtain memory location of required character in the character set
36486 EX DE,HL Swap values (DE now holds memory location of character to print and HL holds 63732)
The operand of the instruction at 36487 represents the display file address to print to. This is modified by the instructions at 28272 and 36551.
36487 LD HL,0 Load HL with the display file address to print character to
36490 LD B,8 For eight bytes (i.e. full height of character)...
36492 LD A,(DE) ...get graphic data from character set...
36493 LD (HL),A ...and load into display file...
36494 INC DE ...move to next pixel row in character set...
36495 INC H ...and move to next pixel row in display file
36496 DJNZ 36492 Loop back to 36492 if there are more rows to draw
36498 CALL 36709 Load memory location 23487 (and HL) with memory location of attribute data (attribute file) for character just printed
36501 LD A,(23695) Load A with attribute stored at 23695 (71 = white INK, black PAPER, BRIGHT)
36504 LD (HL),A Apply attribute to character just printed
36505 CALL 36606 Advance display file pointer to next location (for printing room name)
36508 POP HL Restore HL
36509 RET Return
Prev: 36472 Up: Map Next: 36510