Prev: 7D72 Up: Map Next: 7D9A
7D8A: Write Menu Line
Used by the routine at GameMenu.
Prints one line of text for the game selection menu. The screen address of the line is worked out in one register set and the attribute address in the other, using the attribute held in Current_MenuAttribute, and then the text is printed by PrintString_Loop.
Before After
menu-line-before menu-line-after
Input
HL The Y position (in H) and X position (in L)
DE The address of the text
MenuWriteText 7D8A PUSH HL Stash the co-ordinates of the line on the stack.
7D8B CALL ScreenAddress Call ScreenAddress to convert the co-ordinates to a screen address.
7D8E LD A,($5E22) Fetch the attribute of the line and keep it in AF'.
7D91 EX AF,AF'
7D92 EXX Switch to the shadow registers.
7D93 POP HL Restore the co-ordinates of the line from the stack.
7D94 CALL AttributeAddress Call AttributeAddress to convert the co-ordinates to an attribute address.
7D97 JP PrintString_Loop Jump to PrintString_Loop to print the menu line.
View the equivalent code in;
Prev: 7D72 Up: Map Next: 7D9A