Prev: EB41 Up: Map Next: EB8C
EB67: Print Character
Print the character code in DE at attribute address HL using the character set at Pointer_CurrentCharacterSet and attribute CurrentTextAttribute.
Print_Character EB67 PUSH DE Stash DE, HL and BC on the stack.
EB68 PUSH HL
EB69 PUSH BC
EB6A LD A,($7307) Load A with the current text attribute (CurrentTextAttribute).
EB6D LD (HL),A Set the byte at HL.
EB6E LD A,H Copy H into A.
EB6F ADD A,A Multiply A by 08 to form the screen-bitmap high byte.
EB70 ADD A,A
EB71 ADD A,A
EB72 AND %01011011 A&=5B.
EB74 LD H,A Copy A into H.
EB75 PUSH HL Stash HL on the stack.
EB76 EX DE,HL Exchange DE and HL.
EB77 ADD HL,HL Multiply HL by 08 to index the character glyph.
EB78 ADD HL,HL
EB79 ADD HL,HL
EB7A LD DE,($72F9) Load DE with the current character-set pointer (Pointer_CurrentCharacterSet).
EB7E ADD HL,DE HL+=DE.
EB7F POP DE Restore DE from the stack.
EB80 LD B,$08 Load B with loop count 08.
Blit 08 pixel rows of the character glyph into the screen bitmap.
Print_CharacterLoop EB82 LD A,(HL) Fetch the next script byte.
EB83 LD (DE),A Set the byte at DE.
EB84 INC D Advance the high byte of the screen address by one.
EB85 INC HL Advance the data pointer in HL by one byte.
EB86 DJNZ Print_CharacterLoop Decrease the loop counter in B and jump to Print_CharacterLoop if more iterations remain.
EB88 POP BC Restore BC, HL and DE from the stack.
EB89 POP HL
EB8A POP DE
EB8B RET Return.
Prev: EB41 Up: Map Next: EB8C