We use a lot of flags too. degreeMode indicates that degree mode is selected, if the program is in radian mode, then degreeMode is reset. selectMode indicates which mode the cursor is currently over, and currentSel indicates whether the cursor is over the currently selected trig mode (this is for different blinking behaviour).
res textInverse, (IY+textFlags)
B_CALL ClrLCDFull
ld h,1
ld bc,0F18h ; Box
ld de,4F18h
B_CALL ILine
ld bc,0F32h
ld de,4F32h
B_CALL ILine
ld bc,0E19h
ld de,0E31h
B_CALL ILine
ld bc,5018h
ld de,5031h
B_CALL Iline