Prev: EBF7 Up: Map Next: EC2C
EBFF: Renders a string
Used by the routines at menu_draw_strings and ED6D.
Input
HL Address of a message structure (byte: attribute byte, word: destination screen address, bytes: top bit set terminated ASCII string)
Output
HL Address of next unconsumed byte
menu_draw_string EBFF LD C,(HL) Load attribute byte
EC00 RL C Bank the top bit of the attribute byte as the C flag (this is the single height flag)
EC02 EX AF,AF'
EC03 SRL C
EC05 INC HL Advance
EC06 LD E,(HL) Load screen address into DE
EC07 INC HL
EC08 LD D,(HL)
EC09 INC HL
EC0A PUSH HL Stack screen address
Calculate the attribute address from the screen address
EC0B LD A,D H = $58 + ((D >> 3) & 3)
EC0C RRA
EC0D RRA
EC0E RRA
EC0F AND $03
EC11 ADD A,$58
EC13 LD H,A
EC14 LD L,E L = E
EC15 EXX
HL' is screen address, DE' is attribute address
EC16 EX (SP),HL Get screen address and preserve old HL
EC17 PUSH DE Preserve regs
EC18 PUSH BC
menu_draw_string_loop EC19 LD A,(HL) Mask off the terminator bit
EC1A AND $7F
EC1C PUSH HL A = Character to draw
EC1D CALL menu_draw_char Draw the character
EC20 POP HL
EC21 BIT 7,(HL) End of string?
EC23 INC HL Advance to next char irrespective
EC24 JR Z,menu_draw_string_loop Loop if not
EC26 EXX
EC27 POP BC Restore regs
EC28 POP DE
EC29 POP HL
EC2A EXX
EC2B RET Return
Prev: EBF7 Up: Map Next: EC2C