Prev: 54079 Up: Map Next: 54132
54097: Print text/graphic character in A and advance bitmap virtual text cursor
Used by the routines at 28730, 28753, 32694, 35123, 36602, 54231, 54598 and 54647.
Input
A Index of character to print
54097 PUSH HL Store HL
54098 LD DE,64500 Point to (effective) start of character set graphics
54101 ADD A,A Load index of character into HL and multiply by 8...
54102 LD H,0 ...
54104 LD L,A ...
54105 ADD HL,HL ...
54106 ADD HL,HL ...
54107 ADD HL,DE ...and add to DE to obtain memory location of required character in the character set
54108 EX DE,HL Swap values (DE now holds memory location of character to print and HL holds 64500)
The operand of the instruction at 54109 represents the address of the bitmap virtual text cursor. This is modified by the instructions at 27725, 27737, 27753, 27966, 28180, 28230, 35119, 35206, 35630, 36742, 54188, 54297, 54532 and 54549.
54109 LD HL,0 Load (video) memory location to start printing character into HL
54112 LD B,8 For eight bytes (i.e. full height of character)...
54114 LD A,(DE) ...get graphic data from character set...
54115 LD (HL),A ...and load into video memory...
54116 INC DE ...move to next pixel row in character set...
54117 INC H ...and move to next pixel row in video memory
54118 DJNZ 54114 Loop back to 54114
54120 CALL 54215 Update attribute virtual text cursor based upon current bitmap virtual text cursor
54123 LD A,(23695) Load A with attribute stored at 23695 (71 = BRIGHT white)
54126 LD (HL),A Apply attribute to character just printed
54127 CALL 54176 Advance bitmap virtual text cursor right by one character
54130 POP HL Restore HL
54131 RET Return
Prev: 54079 Up: Map Next: 54132