Prev: CA22 Up: Map Next: CA55
CA2B: Draw the menu
Used by the routine at MENU.
Prints the menu's eight lines from the three lists at MENU_COLOURS -- a colour, a position and a string each -- and, the first time after MENU_SHOWN was cleared, draws the border round the screen (PRINT_BORDER). Called when the menu starts and on every pass of its loop (MENU); printing the same text over itself changes nothing but the attributes, which is how the flashing lines change. Alien 8's DISPLAY_MENU and its DISPLAY_TEXT_LIST in one, since Nightshade prints no other list.
DISPLAY_MENU CA2B LD DE,MENU_COLOURS DE' = the colours
CA2E EXX
CA2F LD HL,MENU_PLACES HL = the positions, DE = the strings; eight lines
CA32 LD DE,MENU_TEXT
CA35 LD B,$08
DISPLAY_MENU_LINE CA37 LD A,(HL) L = x, H = y; HL moved on to the next pair and kept
CA38 INC HL
CA39 INC HL
CA3A PUSH HL
CA3B DEC HL
CA3C LD H,(HL)
CA3D LD L,A
CA3E EXX this line's colour into A', from DE'
CA3F LD A,(DE)
CA40 INC DE
CA41 EX AF,AF'
CA42 EXX
CA43 CALL PRINT_TEXT_SINGLE_COLOUR print it, and loop
CA46 POP HL
CA47 DJNZ DISPLAY_MENU_LINE
CA49 LD A,(MENU_SHOWN) the border has been drawn already
CA4C AND A
CA4D RET NZ
CA4E INC A the first time: say so, and draw it
CA4F LD (MENU_SHOWN),A
CA52 JP PRINT_BORDER
Prev: CA22 Up: Map Next: CA55