Prev: 37269 Up: Map Next: 37312
37296: Write Menu Line
Prints a string at a pixel position, giving every character the attribute that is held in Current_MenuAttribute. The last character of the string has bit 7 set.
The work is done by PrintString_Loop, which prints through HL (the screen address) while the attribute buffer address is kept in HL' and the attribute in AF'.
Before After MenuWriteText
menu-line-before menu-line-after
Input
HL Position (L is the x position, H is the y position)
DE Pointer to the string
MenuWriteText 37296 PUSH HL Stash the position on the stack.
37297 CALL ScreenAddress Convert the position into the screen address (in HL).
37300 LD A,(36584) Fetch the attribute from Current_MenuAttribute.
37303 EX AF,AF' Keep the attribute for the characters of the string.
37304 EXX Switch to the shadow registers.
37305 POP HL Restore the position into HL'.
37306 CALL AttributeAddress Convert the position into the address in the attribute buffer.
37309 JP PrintString_Loop Jump to PrintString_Loop to print the string.
Prev: 37269 Up: Map Next: 37312