Prev: EBF7 Up: Map Next: EC2C
EBFF: Renders a string
Used by the routines at menu_draw_strings and define_a_key.
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 Extract top bit of attribute byte as carry flag then bank (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 attribute address from 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 Bank for when calling menu_draw_char
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 terminator bit
EC1A AND $7F
EC1C PUSH HL Draw character in A
EC1D CALL menu_draw_char
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 Unbank
EC2B RET Return
Prev: EBF7 Up: Map Next: EC2C